-
-
Notifications
You must be signed in to change notification settings - Fork 217
Fix youtube support and use requests for downloads. #1043
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
Conversation
|
Streaming from youtube is broken, but this does not fix it for me. I get redirected to consent.youtube.com and then get There probably needs to be some cookies set. The gPodder youtube plugin is nice, but getting into the obfuscation arms race with youtube leads to gPodder reimplementing functionality in youtube-dl, which is kind of pointless... |
|
Is that an age-gated video? Age-gated content is not supported by gpodder, you can use youtube-dl to download it but not stream. Does the following live stream episode work? |
|
The video in question was not age-restricted. I get the same response from your example. The redirection asks permission to set cookies and this is likely not done outside of EU. |
|
Ah, and the error also happens when downloading the video with manage_downloads turned off? |
|
Yes, the error message is exactly the same. |
|
Does that fix the issue? |
|
No, there is still the same redirection. |
The `get_video_info` URL no longer exists (without html5=1) and instead of throwing a 404 not found error, http_request() was returning an empty page which threw a no formats found error. The new requests code will throw the correct error if this happens in the future. The player response data is still fetched from `get_video_info` but will fallback to the `watch` URL if `get_video_info` is eventually removed. The `watch` URL will fail for anyone in Europe due to it redirecting to a GDPR cookie consent page. Error messages have been shortened by removing video ID, which could be removed from the code in the future.
4927723 to
7177834
Compare
|
It seems the old page is still reachable with a different query string. I fixed the patch to use the old page and fall back to the new page if it should fail again in the future. A fix for the cookie consent will need to be found in case the old page gets removed, I think youtube-dl uses the API. |
|
The example episode now streams, but does not download, which I suppose is how it should work. |
|
The example episode is a never ending live stream. Can you verify other non-livestream content downloads and streams with the patch and manage_downloads=False? |
|
Hi, I notices the problem yesterday and are happy to find the issue listed here. Just tried the patch and it works at the moment. :) |
|
Yeah, downloading and streaming works with this patch and without the ytdl extension. |
|
Thanks for testing. |
|
how to I add the Patch? is there instructions somewhere? |
|
Hello, I am an EU pleb and encountered this TODO: # TODO: watch URL does not work in europe due to GDPR cookie consent I have made a solution that uses the HTMLParser to parse out the form Google wants submitted on the consent page and then I use that data to create the final URL needed to simulate the user clicking the approve button. Even though the form submission is a post on that page I have seen that the only thing Google seems to do after the post is to redirect it to a GET request with the exact same data. So when I do this with the data extracted from the form everything works for me. I am totally new to open source code contributions but this should probably be useful for other EU plebs :) |
|
Looks promising, but could you submit a separate pull request? Just make a new branch with the commit, push it to github and you should see an URL which allows you to make the PR. |
The
get_video_infoURL no longer exists and instead of throwing a 404 not found error, http_request() was returning an empty page which threw a no formats found error. The new requests code will throw the correct error if this happens in the future.The player response data is now fetched from the
watchURL due to the removal ofget_video_info.Error messages have been shortened by removing video ID, which could be removed from the code in the future.
The code has been tested but I want to wait a couple days before merging to make sure nothing breaks.