From 52ca49628fe189b44c4812178cb3a8084a878317 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Wed, 13 Jan 2021 13:12:02 -0800 Subject: fetch_url: 429: get new identity regardless of page content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New 429 captcha page doesn't have IP. This new page appears to match the 429 code plus the json of {"redirect": ...} which would be occasionally received when the pbj json endpoint was used in the past. Closes #22 Signed-off-by: Jesús --- youtube/util.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'youtube/util.py') diff --git a/youtube/util.py b/youtube/util.py index fd6ca1a..44ae1ba 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -292,9 +292,7 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None, content, response.getheader('Content-Encoding', default='identity')) - if (response.status == 429 - and content.startswith(b'