From 48cacb7af0d0b5a894570420bf7e78a53dc42e26 Mon Sep 17 00:00:00 2001 From: pluja Date: Sat, 17 Oct 2020 13:22:15 +0200 Subject: [PATCH] print cookie --- youtube/util.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/youtube/util.py b/youtube/util.py index 3796f64..b709aa5 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -151,12 +151,13 @@ def bypass_captcha(session, response, url, cookies): inputs['g-recaptcha-response'] = response['solution']['gRecaptchaResponse'] print(response) # Print POST request headers - print(requests.post("https://youtube.com/das_captcha", data=inputs, - headers={"Content-Type": "application/x-www-form-urlencoded", - "Accept-Language": "en-US,en;q=0.5", - "User-Agent":'Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0', - "Referer": "https://www.youtube.com/das_captcha", - "Origin": "https://www.youtube.com"}, cookies=session.cookies).headers) + yt_rq = requests.post("https://youtube.com/das_captcha", data=inputs, + headers={"Content-Type": "application/x-www-form-urlencoded", + "Accept-Language": "en-US,en;q=0.5", + "User-Agent":'Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Firefox/78.0', + "Referer": "https://www.youtube.com/das_captcha", + "Origin": "https://www.youtube.com"}, cookies=session.cookies).headers + print(yt_rq['Cookie']) def fetch_url_response(url, headers=(), timeout=15, data=None,