question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[youtube] Age-gate bypass does not work because of get_video_info returning 404

See original GitHub issue

Checklist

  • I’m reporting a bug report
  • I’ve verified that I’m running youtube-dl version 2021.05.16
  • I’ve checked that all provided URLs are alive and playable in a browser
  • I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
  • I’ve searched the bugtracker for similar bug reports including closed ones
  • I’ve read bugs section in FAQ

Verbose log

[debug] System config: []
[debug] User config: []
[debug] Custom config: []
[debug] Command-line args: ['-sv', 'Tq92D6wQ1mg']
[debug] Encodings: locale UTF-8, fs utf-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2021.05.16
[debug]        from commit 9aad8cd18
[debug]           based on a72600998
[debug] Git HEAD: 8248d5fba
[debug] Python version 3.9.5 (CPython) - Linux-5.11.0-051100-generic-x86_64-with-glibc2.31
[debug] exe versions: ffmpeg 4.2.4, ffprobe 4.2.4, rtmpdump 2.4
[debug] Proxy map: {}
[youtube] Tq92D6wQ1mg: Downloading webpage
[youtube] [debug] Fetching webpage from https://www.youtube.com/watch?v=Tq92D6wQ1mg&bpctr=9999999999&has_verified=1
[youtube] trying regex ;ytplayer\.config\s*=\s*({.+?});ytplayer
[youtube] trying regex ;ytplayer\.config\s*=\s*({.+?});
[youtube] trying regex (?m)window\["ytInitialPlayerResponse"\]\s*=\s*({.+});$
[youtube] trying regex ytInitialPlayerResponse\s*=\s*({.+?})\s*;\s*(?:var\s+meta|</script|if\s*\(window\.ytcsi\)|\n)
[youtube] ytInitialPlayerResponse\s*=\s*({.+?})\s*;\s*(?:var\s+meta|</script|if\s*\(window\.ytcsi\)|\n) found
[youtube] Tq92D6wQ1mg: Refetching age-gated info webpage
[youtube] [debug] Fetching webpage from https://www.youtube.com/get_video_info?video_id=Tq92D6wQ1mg&eurl=https%3A%2F%2Fyoutube.googleapis.com%2Fv%2FTq92D6wQ1mg
WARNING: unable to download video info webpage: HTTP Error 404: Not Found
ERROR: Sign in to confirm your age
This video may be inappropriate for some users.
Traceback (most recent call last):
  File "/home/lesmi/youtube-dl/youtube_dl/YoutubeDL.py", line 876, in wrapper
    return func(self, *args, **kwargs)
  File "/home/lesmi/youtube-dl/youtube_dl/YoutubeDL.py", line 907, in __extract_info
    ie_result = ie.extract(url)
  File "/home/lesmi/youtube-dl/youtube_dl/extractor/common.py", line 553, in extract
    ie_result = self._real_extract(url)
  File "/home/lesmi/youtube-dl/youtube_dl/extractor/youtube.py", line 1743, in _real_extract
    raise ExtractorError(reason, expected=True)
youtube_dl.utils.ExtractorError: Sign in to confirm your age
This video may be inappropriate for some users.

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.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:18
  • Comments:48 (19 by maintainers)

github_iconTop GitHub Comments

14reactions
StanNieuwmanscommented, May 20, 2021

@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. You will get something like this: https://www.youtube.com/get_video_info?html5=1&video_id={videoID}.

3reactions
Lesmiscorecommented, Jun 18, 2021

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. https://github.com/ytdl-patched/ytdl-patched/commit/7371d30ec1040afcbe94b3d6ff1a28b137dc65b5

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to watch YouTube age restricted videos without giving ...
300 votes, 154 comments. Too many videos are now age restricted so YouTube can try and get your ID Freetube doesn't work for...
Read more >
API — pytube 12.1.2 documentation
Core developer interface for pytube. Attempt to update the vid_info by bypassing the age gate. Get a list of Caption . Interface to...
Read more >
pytube Documentation - Read the Docs
The use_oauth and allow_oauth_cache flags allow you to authorize pytube to interact with YouTube using your ac- count, and can be used to...
Read more >
Easy Ways to Bypass Youtube Age Restriction - Electronics Hub
Due to the recent and frequent changes in Youtube's terms and conditions, some of these solutions might not work for you, depending on...
Read more >
How to watch age restricted videos on youtube without signing ...
Watch Age Restricted Videos Without Google account How to watch age restricted videos on youtube without signing in - 2022.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found