From 3f4db4199c9d45f3c8f5137feea38d40654d0356 Mon Sep 17 00:00:00 2001 From: James Taylor Date: Tue, 15 Feb 2022 12:51:48 -0800 Subject: Fix error during exit blockage detection when Set-Cookie missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jesús --- youtube/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'youtube') diff --git a/youtube/util.py b/youtube/util.py index 05f78b9..be600bf 100644 --- a/youtube/util.py +++ b/youtube/util.py @@ -344,7 +344,7 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None, ip = ip.group(1).decode('ascii') if ip else None if not ip: ip = re.search(r'IP=((?:\d+\.)+\d+)', - response.getheader('Set-Cookie')) + response.getheader('Set-Cookie') or '') ip = ip.group(1) if ip else None # don't get new identity if we're not using Tor -- cgit v1.2.3