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
[patreon] fix some vimeo embed downloads #9613
Conversation
Do you know why this happens? Uploader deletes vimeo video? Can the reverse scenario happen? Also, if both work, we should prioritize the video embed, correct? |
@pukkandan Not 100% sure but yeah I believe the uploader deleting just the Vimeo video could be it (or Vimeo themselves). The reverse scenario seems really unlikely to me (although I am not a creator on Patreon so I can't test that) since the removal of a Patreon embed would be done on Patreon itself, I would imagine it would be removed from the post correctly in that case. Edit: by reverse scenario I am assuming you mean, the removal of the patreon attachment itself (but still having the url for it as if it was still there) but having a working (vimeo/other) embed, right?
But yes, in that scenario prioritizing the embed would make more sense, I could change it so it would still try the embed first but if it fails try other options, I will look into that a bit later, thanks! |
We can make a HeadRequest to the Vimeo URL and fall back to m3u8 if that fails |
@pukkandan Changed the code to use this approach, is it correct? Don't have any public posts I could share that fall into this example (having both a working embed and a file attachment), but seems to be working with some private posts I have access to. I also haven't found any working vimeo embeds on Patreon to test with (just dropbox) but it worked with a hard-coded vimeo url temporarily in the code as if it was attached to the post: My original test (with a public post) also works fine python -m yt_dlp https://www.patreon.com/posts/hunter-x-hunter-34007913
[Patreon] Extracting URL: https://www.patreon.com/posts/hunter-x-hunter-34007913
[Patreon] 34007913: Downloading API JSON
[Patreon] 34007913: Downloading webpage
WARNING: [Patreon] Unable to download webpage: HTTP Error 405: Method Not Allowed
[Patreon] 34007913: Downloading webpage
WARNING: [Patreon] Unable to download webpage: HTTP Error 404: Not Found
[Patreon] 34007913: Downloading m3u8 information
[info] 34007913: Downloading 1 format(s): 4712
[hlsnative] Downloading m3u8 manifest
[hlsnative] Total fragments: 284
[download] Destination: Hunter x Hunter | Kurapika DESTROYS Uvogin!!! [34007913].mp4
[download] 10.2% of ~ 721.42MiB at 2.61MiB/s ETA 03:26 (frag 28/284) |
this means a HEAD request won't work. IMO just use GET for both |
@bashonly Yeah you're right, I missed that, only tested vimeo.com links and not player.vimeo.com, changing both to GET requests, thanks. |
Closes yt-dlp#8702 Authored by: johnvictorfs
IMPORTANT: PRs without the template will be CLOSED
Description of your pull request and other information
This change prioritizes downloading from m3u8 instead of vimeo embeds (or embeds in general), which in some cases may no longer exist and only the m3u8 video attachment does.This change adds checks to verify if external embeds of Patreon posts are still valid before trying to download them (since they may have been deleted from vimeo/dropbox/etc. but still be attached to the Patreon post), and if it is invalid then it tries other options
Example, using
python -m yt_dlp https://www.patreon.com/posts/hunter-x-hunter-34007913
(this video is public, so no need for cookies/account to test with)Possibly fixes #8702 (don't have access to the post in the example to test but seems pretty similar to my test case)
Template
Before submitting a pull request make sure you have:
In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:
What is the purpose of your pull request?