-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Use Kodi's proxy #884
Comments
Can you describe what the intended purpose of the proxy is? As mentioned in the original issue you opened, implementing something like this in the plugin would only be of use for the plugin listings and nothing else i.e. playback would be unaffected. The use case in #841 is the opposite of this i.e. the Kodi proxy settings are used for playback. |
The purposes include getting around geo-blocking or allowing Youtube access when the TV itself is quarantined from the internet. I'll do more testing as I am not sure if the plugin is indeed using the Kodi proxy settings currently |
Using a proxy in the plugin won't really work for this. The playback would/should use the Kodi proxy settings. If it doesn't, that is an issue that needs to be raised with InputStream.Adaptive or Kodi itself.
This would work I suppose, but only for the listings of this plugin. Would still need to set the Kodi proxy settings for everything else.
Note as well that even if it isn't, the ability to actually set a proxy within the plugin may not actually work so well, due to issues with how Python requests handles system proxies in sessions, compared to individual requests. I have no way to test this either. |
I have a more weird case. Proxy works well with all the youtube videos except for live streams. |
Please refer to the comment directly above your own. Not planning on doing anything about this for the reasons previously identified. AFAIK there is only one potential scenario where something like could be useful, but it is not clear from anyone asking for this whether it is even actually required. If you think there is a need for this, providing a full debug log with cURL component logging enabled would be the first step. |
I can confirm that the YouTube add-on does not “fully follow” the Kodi proxy settings, hereafter referred to as YT add-on. What are the benefits of YT add-ons following the Kodi proxy settings exactly? I hope the developers will take the time to investigate and improve the proxy support for YT Add-ons and I can help with testing. |
In the latest v7.1.0 Beta 1, the YT add-on footprint still won't use the Kodi proxy settings. Kodi Logs |
Unfortunately you are probably the wrong person to be able to provide the necessary logs. What I was trying to say is that even if proxy support was added to the plugin, video playback would be unaffected, which makes adding proxy support a somewhat useless endeavour. Need a log of someone who uses a proxy, and who can reach the Google/YouTube servers normally, to also get a debug log, with cURL component logging enabled, of the video playback. Let's see if someone else can help out here. |
It's not a big deal, I can access Google\YouTube normally via VPN on a router device, which is transparent to the client so this doesn't affect the client, and then configure the HTTP\Socks proxy on the Kodi to capture the add-on logs. This is the log captured as you requested @extremeonline says he's blocking internet traffic to the TV (except for the local LAN), so to me that equates to no access to Google\YouTube. So the video playback part is not controlled by the YT addon? Their proxy support needs to be fed to the corresponding addon maintainer right, I don't know much about Kodi addon development. But after my testing, the video\live streams in YT add-ons are using Kodi proxy settings. Anyway, I refer to the code change @hak0 mentioned jdf76/plugin.video.youtube#795 (comment) https://forum.kodi.tv/showthread.php?tid=369592 |
Because if the playback can't use the configured proxy then what is the point? And it is not even certain whether plugin specific settings are needed. In xbmc/xbmc#17729 the OP produced a log showing that the Kodi proxy settings are not being used for listings. In https://forum.kodi.tv/showthread.php?tid=369592 the OP is asking how to bypass the proxy settings, presumably because they do work for the listings. Other people commenting on this issue have also indicated the same while others indicate the proxy is not being used, but no one has provided a log until now, and I simply don't have enough information or time to spend on something that may prove to be useless. Perhaps Kodi on different platforms behaves differently with respect to using the Kodi or system proxy? Your log indicates that cURL is using the proxy, but that the initial manifest request from InputStream.Adaptive is not going via the proxy. For VOD using MPEG-DASH this is not a problem since the manifest is begin served from a local server created by the plugin. For live streams and non-adaptive VOD this may be a problem, and possibly why @pnperehod was saying live streams didn't work.
Can you also get a log showing playback of a live stream? Can you also describe the proxy setup you are using and how have you configured the Kodi proxy settings? |
But the add-on controls logging in and getting YouTube playlists, so it's part of the overall proxy support. And if I understand correctly, it's controlled by the add-on until the video actually starts playing. As I mentioned with @extremelyonline, if there is no direct access to Google\YouTube (via the Kodi proxy access Google\YouTube), then the add-on won't work at all.
I think that's correct, although that was the old Kodi and add-ons version. But his test results are the same as what we are observing now.
I don't know if @toml272 actually observed that YouTube add-ons have use proxies. Perhaps he's just confused YouTube add-ons with cURL. Based on my testing, the current Kodi version of cURL does use the Kodi proxy. So it wouldn't be wrong to say that YouTube traffic goes through the proxy. I tested it on both Android and Microsoft UWP platforms. There are differences in Kodi functionality between platforms, but I did not observe a difference in agent behavior.
I don't really understand what non-adaptive VOD stands for exactly. But for now, I modified the requests.py and it looks like all traffic goes through the proxy. no problems with VOD or live streaming. Anyway, here's the log of the add-on playing live. The proxy protocol is SOCKS5 with remote DNS resolving and the server is on the LAN. No other special settings. By the way, if I turn Use InputStream.Adaptive off in the add-on's advanced settings, or set Use for live streams to HLS\Multi-stream HLS, it reports an error when playing the live stream. Does this mean its deprecated? Setting Adaptive HLS seems to work well to get the highest bitrate. And MPEG-DASH has a slightly lower bitrate compared to that, but you get a 360p VP9 format. But I get very low resolution with MPEG-DASH on the UWP platform. For example 144p and 240p, could this be a limitation or bug unique to the UWP platform? |
As mentioned previously the plugin doesn't control proxy use for playback. What is the point of listing a video that can't be played?
Might need to stick with that for now until some additional logs are provided to better understand what is actually happening on various platforms.
No, it means that Kodi is loading the manifest rather than InputStream.Adaptive. As mentioned there is too much contradictory information to spend time working on something like this. |
Current tests show that YouTube video streams will be loaded through the Kodi proxy, so if the Kodi proxy is configured. It will be possible to play the video normally. All in all, thank you and all the maintainers of this add-on. I very much understand the limited time to meet high priorities first. Adding proxies to the add-on itself may be a relatively niche need. |
To be clear I will try to add this in when I can, as your logs identify that doing so won't be waste of time. However there is behaviour that you yourself have observed that, and that other people have commented on, that indicates this may not work properly across a range of different installations or for different videos, which is why I'm trying to get logs. There appear to be certain circumstances where ISA or Kodi don't use the system proxy or Kodi proxy settings, and I'm trying to understand why this happens.
Can you get a log of this? |
Can you share this changes? |
@MoojMidge @pnperehod
|
To my surprise, live streams began to work again through the proxy with 7.1.0-beta2! |
@Liqianyu - do you have access to any logs on your proxy server to identify what connections are made through it? It seems like the manifests requests use the proxy via curl but the actual MPEG-TS segments are being loaded using ffmpeg directly and is not using your proxy. If you can check what the proxy server is doing then it would be good to confirm this. @pnperehod - if you want anything to happen with this then you need to provide debug logs of it working or not working. Any change that you may have seen is unrelated to any change in the plugin because no such changes have been made. |
@MoojMidge @pnperehod |
Can you confirm that the first two attempts to play also went through your proxy completely? As mentioned before the Kodi logs seems to indicate that they actual MPEG-TS segments are not using the proxy settings which is why it fails. You would see a number of Playback through InputStream.Adaptive seems to work though, and that is the preferred method for playback so this should work for most types of streams. |
@MoojMidge |
Strange, will chalk it up to some issue with how ffmpeg is handling the https traffic compared to curl.
This is likely because the list is created using the settings that have already been set. When changing the settings, the list needs to be re-created to use the new settings.
Which is better depends on what YouTube provides, what this plugin can extract, and what InputStream.Adaptive supports. Currently the available MPEG-DASH live streams are very low quality, however older versions of InputStream.Adaptive don't fully support the HLS streams. Where possible using InputStream.Adaptive will provide the best experience, and currently the HLS streams offer the best quality, so |
@Liqianyu - can you test if the following test version allows both Kodi and custom proxy settings to work? https://github.com/MoojMidge/plugin.video.youtube/archive/refs/heads/master.zip Options available in |
@MoojMidge It's worth noting that if you use a custom proxy. Neither the video nor the manifest will be proxied, which is expected right? |
So when using HLS with Multistream HLS, it won't be used even if the InputStream.Adaptive option is on, right? |
@Liqianyu - As I mentioned before, any proxy settings in this plugin will only be of use for browsing within the plugin. It will have no effect on downloading or playing anything, either for manifests or video segments. That is all handled by Kodi itself. If you need to use a proxy to watch the videos, then this will need to be set in the Kodi proxy settings. Why that sometimes appears to work, and sometimes doesn't, can only be determined by people providing logs of both scenarios, but at this point I don't intend to look into this any further as there wasn't much input aside from yourself, even if it doesn't really impact you. It is outside the scope of this plugin anyway.
Yes, this is a problem that I will need to look into further. Will need to trigger the PySocks installation manually if a socks proxy is used.
Yes, that is a reasonable summary. |
Prompt for pysocks installation added in https://github.com/MoojMidge/plugin.video.youtube/archive/refs/heads/master.zip |
What Problem Does This Solve?
I am sorry for re-posting this issue, which is related to #883. Upon further testing, it seems that Kodi's proxy is not being used:
#841(comment) indicate that the proxy settings works. However, the user is running a local SOCKS server on the same machine to bypass DPI.
Would someone please test whether the proxy settings work when using the Youtube app?
Suggest a Solution (optional)
It would be great if the addon would be able to follow Kodi's system-wide proxy settings (#32). A menu to set a proxy for the addon only is another method.
This may be of help: YouTube addon don't use Kodi's proxy #795
The text was updated successfully, but these errors were encountered: