[YoutubeDL] _calc_cookies: add get_header method to _PseudoRequest (#4861)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 6 Feb 2015 21:23:06 +0000 (22:23 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 6 Feb 2015 21:23:06 +0000 (22:23 +0100)
youtube_dl/YoutubeDL.py

index 9605f8f99ac04bf72032b1cc8a64635bb6c2a8b8..633e3d8a141e2cd249a69da2137709f2f1858040 100755 (executable)
@@ -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')