-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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] Age-gate bypass does not work because of get_video_info returning 404 #29086
[youtube] Age-gate bypass does not work because of get_video_info returning 404 #29086
Comments
Noticing this too. This seems like similar behavior of what happened when the old API endpoint used to get continuation pages was being turned off. So I think the This also affects PR #28778. |
@colethedj Sorry for the double post but this is the first issue a came by when i googled so: I dont know if this helps but if you want to let get_video_info link to work for now you can add : &html5=1 to the link. |
I guess that this error probably has the same Reason:
|
Yes, it seems I was relying exclusively on it (with MotionBox) and I'm now transitionning to a |
Also with &html5=1 in the link? |
Workaround for #319, ytdl-org/youtube-dl#29086 Authored by: colethedj
Oh you're right it works with the following Still wanted to ditch get_video_info because I couldn't find higher resolutions int it (2k 4k). |
I am new to this, what is youtube.com/watch` based implementation? Does it work with age-restricted videos? Can you link to more info? adding html5=1& solved the get_video_info issue for now/ |
Yep adding html5 solved. What I was talking about was off topic since it's related to another program I'm working on. |
3unjee, no problem if it is off topic, , I'd like to know if there is any other way to get info from age-restricted videos , like this youtube.com/watch method? Is there an youtube.com/watch URL that takes video ID and returns data, like get_video_info method? |
On my side, for age restricted I'm using |
3unjee , for me it works even without embedded flag, but html5=1 is a must. The reason I am asking about alternatives (like the youtube.com/watch you mentioned) is because I think it is just a matter of time google kills html5=1 workaround too. So how will you transition to youtube.com/watch or what will you use if get_video_info with html5=1 workaround gets killed? |
I also recently had problems with the age-ghetto wall. It was precisely that error: "WARNING: unable to download video info webpage: HTTP Error 404: Not Found" Google really wants to be annoying... |
For me it did not work. :( E. g. an URL such as https://www.youtube.com/get_video_info?html5=1&video_id=pawkdEOyvIk&el=embedded And I got: [youtube:tab] get_video_info: Downloading webpage ERROR: Unable to extract yt initial data; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output. Hmm. If a solution was found, perhaps the commandline could display |
There is the player endpoint of the newer innertube API ( As for the age-gate bypass, this endpoint will return an error if the video is age-restricted if you do not supply auth. So I'm not sure if there is anyway to workaround that. |
This request is done internally in the YouTube extractor, you can't pass it directly to youtube-dl. |
colethedj , by supply auth do you mean gmail/youtube credentials or youtubr API3 credentials? Because google screwed many with their api credentials too, reducing the number of request to very low or even 0 for so many developers. So which auih credentials do you need/are you talking about? Considering that you need only google account to see age-restricted videos is it this what is needed? |
This is the internal API Youtube uses ("Innertube") - it is separate from the official dev api.Youtube-dl uses this API is used for playlist continuation pages, if you want to have a look. The auth for it isn't actually implemented in youtube-dl yet (hence #28362). I described the auth required in that issue, but essentially it's your cookies.txt exported from Youtube plus a few headers (SAPISIDHASH etc.) You can already access age-restricted videos if you pass cookies to youtube-dl - as that is just a normal request to the watch html page (API requests is done internally YouTube's side in this case). |
colethedj, I am trying the -cookies way and it does not work. Using a video example from first post (I just want to get video URL, not download it), this is what I use: youtube-dl -g --cookies cookies.txt https://www.youtube.com/watch?v=Tq92D6wQ1mg WARNING: unable to download video info webpage: HTTP Error 404: Not Found I updated to latest version 2021.05.16 Apologies for question, I am new to youtube-dl, but is youtube-dl utilizing get_video_info method for downloading/getting youtube video info? Because right now I am using a different plugin that calls get_video_info, but if youtube-dl uses the same thing for age-restricted vidos then if get_video_info dies then youtube-dl will sadly also not help. I just received updated YT terms and it says : "YouTube’s right to monetize: YouTube has the right to monetize all content on the platform and ads may appear on videos from channels not in the YouTube Partner Program" . I am really disliking google, they keep closing door after door for developers. and they ae rally getting greedier with every move. |
It is only using get_video_info if the initial watch page gives an age gate error.
Cookies method will only work if you can play the video in the browser with your account.
…-------- Original Message --------
On 21 May 2021, 19:18, MikeTester21 wrote:
colethedj, I am trying the -cookies way and it does not work. Using a video example from first post (I just want to get video URL, not download it), this is what I use:
youtube-dl -g --cookies cookies.txt https://www.youtube.com/watch?v=Tq92D6wQ1mg
WARNING: unable to download video info webpage: HTTP Error 404: Not Found
I updated to latest version 2021.05.16
Apologies for question, I am new to youtube-dl, but is youtube-dl utilizing get_video_info method for downloading/getting youtube video info? Because right now I am using a different plugin that calls get_video_info, but if youtube-dl uses the same thing for age-restricted vidos then if get_video_info dies then youtube-dl will sadly also not help.
I just received updated YT terms and it says : "YouTube’s right to monetize: YouTube has the right to monetize all content on the platform and ads may appear on videos from channels not in the YouTube Partner Program" . I am really disliking google, they keep closing door after door for developers. and they ae rally getting greedier with every move.
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#29086 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AGUWOBVLYMQBH4R6J3WJNKLTOYCMJANCNFSM45GHGUTA).
|
get_video_info now returns 404 error. Adding html5=1 fixes it (for now). See ytdl-org/youtube-dl#29086 (comment) Also handles 404 error if it arises so it will be non-fatal
i feel like the get_video_info with html5 is broken ;( |
@StanNieuwmans What makes you say that? Tested with |
Did you use this tool? because if you did this tool already did an transition to the innertube api, if i am correct. Then there are no issue's. To the people who do use the html5 "hack", I think it doesn't work anymore. Also I think google is shutting down the www.youtube.com/get_video_info?video_id={videoID} link. |
I rewrote the code to use innertube instead, and age-gate bypassing worked for embeddedable videos. It'll fail if the video can't be embedded, since it's mimicking embedded client. |
Age restricted videos haven't been able to be embedded since about last September, as they'll display an error saying that they're age restricted and only viewable on YouTube's website. It's possible that this is different to the "playback on other websites has been disabled by the video owner" error, though. |
@rjdg14 Not all age-gated videos are non-embeddable. See yt-dlp/yt-dlp#328 (comment) Also, see #29333 (comment) for another workaround |
Co-authored-by: colethedj, pukkandan Closes #427 Workarounds for ytdl-org/youtube-dl#29326, #319, ytdl-org/youtube-dl#29086
Youtube-dl doesn't download age restricted youtube videos anymore like this one "https://www.youtube.com/watch?v=xcRUPMf6scs" (NSFW). Is there a way to get it to download those videos without signing in? Thanks. |
works in yt-dlp. @IoanPaleru |
Thanks, but how do I get it to work in youtube-dl though? Isn't this the page for that? Also, I don't know how or where to download a pre-compiled version of yt-dlp from that works in windows 7 & 10, without having to install anything extra to get it to work. If there isn't a pre-compiled version, I don't know how to compile programs for windows from source code. Are the command options in yt-dlp be the same as youtube-dl? I'm just an average user how knows how to use some simple command line commands with the help of a help guide. Is there some kind of program that will just download those kinds of youtube videos properly without having to configure anything other than just doing regular updates? Youtube-dl used to work properly but it doesn't anymore, so why doesn't it just work properly after updating it? Why does it keep having problems downloading youtube videos properly? |
@IoanPaleru The problem is that youtube keeps changing its undocumented API. #29333 (comment) fixes it, but you'll need to wait for it to be merged and released. |
It seems like the (tier 2) age-gate workaround has been fixed here (03ab027), however there hasn't been a release in over a month, so the latest doesn't include it... |
Yes, if you use cookies and you can play the video with such account then you should be able to access the video regardless. |
😕 Same thing? Yes, this applies to API requests too (the html watch page basically does the API requests on Youtube's side and mashes all the player&next response data into ytinitialdata if I'm not mistaken). Though as you found there are some extra headers required when using cookies with the API. |
It appears to be fixed in youtube dlp, i just tried it and while standart youtube dl didn't work, the info was fetched correctly and the video downloadble using youtube dlp |
This seems to be their issue where they patched it, looks like it has two different methods to get the data, if one doesn't work they try the other. Of course, when they close those endpoints there will be no way unless a workaround with the new APIs is found. |
In summary: The current known age-gate bypasses ( This is assuming you're not in the EU, which if you are the above probably does not apply and you require cookies from an account that is age-verified regardless (correct me if I'm wrong - not in the EU myself!). Both youtube-dl and yt-dlp have working support for tier 2 bypass. However, the tier 2 bypass in youtube-dl current release is broken. It is fixed in master, but for whatever reason there hasn't been a release with it :/ Also good to note |
@colethedj I'm in the EU, I can access tier 1 & 2 videos with yt-dlp just fine. Tier 3 doesn't work here either. I however can indeed not access any of those videos on the YouTube website itself without verifying my age. |
I'd create a new issue regarding these findings, since it's not particularly relevant to the age-gate. for anyone reading: it's an alternative method to providing cookies, not an age-gate workaround. |
…lp#329) Workaround for yt-dlp#319, ytdl-org/youtube-dl#29086 Authored by: colethedj
…p#328) Co-authored-by: colethedj, pukkandan Closes yt-dlp#427 Workarounds for ytdl-org/youtube-dl#29326, yt-dlp#319, ytdl-org/youtube-dl#29086
Checklist
Verbose log
Description
Given an age-restricted video like this one, youtube-dl used to workaround it by using
get_video_info
call. But it seems it's not available anymore.This is not lethal because when I provided
--cookies
option then it works normally.The text was updated successfully, but these errors were encountered: