-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
[youtube:tab] Fallback to API when webpage fails to download #1122
Conversation
Had to fix and improve the visitorData handling since the home/recommended was broken. Some info on visitorData for the sake of documentation:When YT gives If YouTube doesn't provide We've seen it been used to keep track of what comment section version to use (ensure consistency) when YT was switching from the old to new API a while back. Along with the recommend feed and the playlists in the above issue, maybe this suggests it is some sort of token that identifies a session state? After this PR I do need to go through YoutubeIE and clean up it's Note: probably not a good idea to share visitorData across different clients. |
Co-authored-by: pukkandan <[email protected]>
Some things we'll move to a future cleanup PR(s):
|
Some changes:
Issue: channel search (e.g. https://www.youtube.com/user/theCodyReeder/search?query=chicken):
|
…1122) and add some extractor_args to force this mode Authored by: coletdjnz
Ok |
Please follow the guide below
x
into all the boxes [ ] relevant to your pull request (like that [x])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 one of the following options:
What is the purpose of your pull request?
Description of your pull request and other information
This supersedes #682. (I'm making a new PR to keep things on topic - the other PR is a bit messy due to be experimental).
This PR adds support for falling back to the Innertube API when the webpage fails to download for whatever reason (429, network error, initial data extraction failure, etc.)
It is also possible to manually skip the webpage download by using
--extractor-args youtubetab:skip=webpage
Also added a quick fix for the resolve MP to OLAK playlist handling, since that was broken.
At least at the time of writing, yt-dlp should now have a complete* workaround for the common** YouTube HTTP 429 error reported, for both video and tab extraction.
*except private content accessible only through a secondary or greater account/channel
**common referring to the webpage request getting 429nd only, but the API still works.
resolves #926, resolves ytdl-org/youtube-dl#23638 (and most of the other 429 reports upstream)
Known issues:
When using cookies, the webpage is required to extract the required variables. Without this, the API requests will be for the first channel of the first account.
In the case of the user passing cookies, and the webpage failing to download, the tab extractor will raise an error. This is to stop unwanted behavior in variety of situations (e.g. an automated script to download a secondary channel liked playlist, but the webpage fails and starts downloading the first channel liked playlist).
Currently, the user can skip this check by passing
--extractor-args youtubetab:skip=authcheck
channel search does not work (returns 0 results)
TODO:
(and probably fixup)testsFix unavailable video messages showing - test: https://www.youtube.com/playlist?list=UUTYLiWFZy8xtPwxFwX9rV7Qfor another PR