aboutsummaryrefslogtreecommitdiffstats
path: root/youtube/util.py
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2022-02-15 12:51:48 -0800
committerJesús <heckyel@hyperbola.info>2022-02-15 21:32:00 -0500
commit3f4db4199c9d45f3c8f5137feea38d40654d0356 (patch)
tree69e9d4a3d911a36abec7fad35cbe4a44e157f26d /youtube/util.py
parent5260716d14dea32f67ac805ca187e97723c3d6ce (diff)
downloadyt-local-3f4db4199c9d45f3c8f5137feea38d40654d0356.tar.lz
yt-local-3f4db4199c9d45f3c8f5137feea38d40654d0356.tar.xz
yt-local-3f4db4199c9d45f3c8f5137feea38d40654d0356.zip
Fix error during exit blockage detection when Set-Cookie missing
Signed-off-by: Jesús <heckyel@hyperbola.info>
Diffstat (limited to 'youtube/util.py')
-rw-r--r--youtube/util.py2
1 files changed, 1 insertions, 1 deletions
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