aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-02-06 22:23:06 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-02-06 22:23:06 +0100
commitb3a286d69d2bf28ba32a77b0fe66932eb6d1bc65 (patch)
tree324c6495e2feb8feb6b742876bd2fd32ab7ef6ca
parent467d3c9a0c364fe4e24c6efd1d20317a80eee547 (diff)
downloadyoutube-dl-b3a286d69d2bf28ba32a77b0fe66932eb6d1bc65.tar.xz
[YoutubeDL] _calc_cookies: add get_header method to _PseudoRequest (#4861)
-rwxr-xr-xyoutube_dl/YoutubeDL.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py
index 9605f8f99..633e3d8a1 100755
--- a/youtube_dl/YoutubeDL.py
+++ b/youtube_dl/YoutubeDL.py
@@ -938,6 +938,9 @@ class YoutubeDL(object):
def has_header(self, h):
return h in self.headers
+ def get_header(self, h, default=None):
+ return self.headers.get(h, default)
+
pr = _PseudoRequest(info_dict['url'])
self.cookiejar.add_cookie_header(pr)
return pr.headers.get('Cookie')