diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-06-20 21:29:16 -0700 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-06-23 14:45:52 -0500 |
commit | 0df406697f7c9791b8f61874c25dd4b879f5db1e (patch) | |
tree | 92ee7c1e102ebafd43a96405159905420612671b | |
parent | 7f79269cf3811971b76834640c96af8069a61725 (diff) | |
download | yt-local-0df406697f7c9791b8f61874c25dd4b879f5db1e.tar.lz yt-local-0df406697f7c9791b8f61874c25dd4b879f5db1e.tar.xz yt-local-0df406697f7c9791b8f61874c25dd4b879f5db1e.zip |
Workaround for age restriction bypass
Signed-off-by: Jesús <heckyel@hyperbola.info>
-rw-r--r-- | youtube/watch.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/youtube/watch.py b/youtube/watch.py index 6ff0735..ec161df 100644 --- a/youtube/watch.py +++ b/youtube/watch.py @@ -247,12 +247,16 @@ def extract_info(video_id, use_invidious, playlist_id=None, index=None): data = { 'video_id': video_id, 'eurl': 'https://youtube.googleapis.com/v/' + video_id, + 'html5': '1', + # See https://github.com/ytdl-org/youtube-dl/issues/29333#issuecomment-864049544 + 'c': 'TVHTML5', + 'cver': '6.20180913', } - url = 'https://www.youtube.com/get_video_info?html5=1&' + url = 'https://www.youtube.com/get_video_info?' url += urllib.parse.urlencode(data) try: video_info_page = util.fetch_url( - url, headers=watch_headers, debug_name='get_video_info', + url, headers=util.mobile_ua, debug_name='get_video_info', report_text='Fetched get_video_info page').decode('utf-8') except util.FetchError as e: if e.code == '404': |