From 43f2db009d285ce02bc8c3c611b91fc0db9df4eb Mon Sep 17 00:00:00 2001 From: Amin Rezaei <45730096+aminprox@users.noreply.github.com> Date: Sun, 12 Jan 2020 14:02:15 +0330 Subject: [PATCH] Fix the 429 error (partially) This change will help to fix the 429 error. Youtube is blocking requests to youtube.com/get_video_info and not other pages(even with captcha resolving), but as I checked we don't need "youtube.com/get_video_info" mostly and the `player_response` is enough. --- youtube_dl/extractor/youtube.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index b913d07a6..ff3d27b63 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1795,7 +1795,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor): errnote='unable to download video info webpage', fatal=False, query=query) if not video_info_webpage: - continue + video_info = try_get(player_response, lambda x: x['videoDetails'], dict) or {} + break get_video_info = compat_parse_qs(video_info_webpage) if not player_response: pl_response = get_video_info.get('player_response', [None])[0]