From c11eec95550bbaf5e2ce7c1ce3f481d56951afd0 Mon Sep 17 00:00:00 2001 From: pluja Date: Mon, 12 Oct 2020 08:52:20 +0200 Subject: [PATCH] Fix problem with url var --- youtube/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youtube/util.py b/youtube/util.py index 760d40f..5049aba 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -99,7 +99,7 @@ def decode_content(content, encoding_header): return content -def bypass_captcha(session, response): +def bypass_captcha(session, response, url): print("vvv COOKIES DICT vvv") cookies = session.cookies.get_dict() print(cookies) @@ -199,7 +199,7 @@ def fetch_url_response(url, headers=(), timeout=15, data=None, string_en = "To continue with your YouTube experience, please fill out the form below." # If there's a captcha, bypass it. if string_de in response.text or string_en in response.text: - bypass_captcha(session, response) + bypass_captcha(session, response, url) if max_redirects: retries = urllib3.Retry(3 + max_redirects, redirect=max_redirects)