diff options
author | James Taylor <user234683@users.noreply.github.com> | 2021-07-28 13:00:25 -0700 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2021-07-28 23:48:54 -0500 |
commit | f27105fa7f92919ea2cecdc87239e62a2a3d23b7 (patch) | |
tree | 9084c9b142406e5188279171c5dc29288dec0fcc /youtube/yt_data_extract | |
parent | 54b39f13034fdbcf427a21b3be8d56020516a764 (diff) | |
download | yt-local-f27105fa7f92919ea2cecdc87239e62a2a3d23b7.tar.lz yt-local-f27105fa7f92919ea2cecdc87239e62a2a3d23b7.tar.xz yt-local-f27105fa7f92919ea2cecdc87239e62a2a3d23b7.zip |
New age restriction bypass method since get_video_info was disabled
From
https://github.com/yt-dlp/yt-dlp/issues/574#issuecomment-887171136
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/yt_data_extract')
-rw-r--r-- | youtube/yt_data_extract/watch_extraction.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/youtube/yt_data_extract/watch_extraction.py b/youtube/yt_data_extract/watch_extraction.py index 9ad3d43..04380fa 100644 --- a/youtube/yt_data_extract/watch_extraction.py +++ b/youtube/yt_data_extract/watch_extraction.py @@ -706,15 +706,10 @@ def get_caption_url(info, language, format, automatic=False, translation_languag url += '&tlang=' + translation_language return url -def update_with_age_restricted_info(info, video_info_page): - '''Inserts urls from 'player_response' in get_video_info page''' +def update_with_age_restricted_info(info, player_response): + '''Inserts urls from player_response json''' ERROR_PREFIX = 'Error getting missing player or bypassing age-restriction: ' - video_info = urllib.parse.parse_qs(video_info_page) - player_response = deep_get(video_info, 'player_response', 0) - if player_response is None: - info['playability_error'] = ERROR_PREFIX + 'Could not find player_response in video_info_page' - return try: player_response = json.loads(player_response) except json.decoder.JSONDecodeError: |