aboutsummaryrefslogtreecommitdiffstats
path: root/youtube
diff options
context:
space:
mode:
authorJames Taylor <user234683@users.noreply.github.com>2018-12-26 02:05:56 -0800
committerJames Taylor <user234683@users.noreply.github.com>2018-12-26 02:05:56 -0800
commitf8c51bdfd8d1b55e4b623ac5341284365e54d601 (patch)
tree5abd4bc86b08a3903c46082c9e3c4055531f9fdc /youtube
parentd5e2e3ee8a4db85a90683f17f93ba648f86e0df0 (diff)
downloadyt-local-f8c51bdfd8d1b55e4b623ac5341284365e54d601.tar.lz
yt-local-f8c51bdfd8d1b55e4b623ac5341284365e54d601.tar.xz
yt-local-f8c51bdfd8d1b55e4b623ac5341284365e54d601.zip
fetch_url: fix cookie sending/receiving not working
Diffstat (limited to 'youtube')
-rw-r--r--youtube/common.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube/common.py b/youtube/common.py
index 0a53c51..655f24c 100644
--- a/youtube/common.py
+++ b/youtube/common.py
@@ -169,12 +169,12 @@ def fetch_url(url, headers=(), timeout=15, report_text=None, data=None, cookie_j
start_time = time.time()
req = urllib.request.Request(url, data=data, headers=headers)
- if cookie_jar_send:
+ if cookie_jar_send is not None:
cookie_jar_send.add_cookie_header(req)
response = urllib.request.urlopen(req, timeout=timeout)
response_time = time.time()
- if cookie_jar_receive:
+ if cookie_jar_receive is not None:
cookie_jar_receive.extract_cookies(response, req)
content = response.read()