From: Jaime Marquínez Ferrándiz Date: Fri, 6 Feb 2015 21:23:06 +0000 (+0100) Subject: [YoutubeDL] _calc_cookies: add get_header method to _PseudoRequest (#4861) X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=b3a286d69d2bf28ba32a77b0fe66932eb6d1bc65;p=youtube-dl.git [YoutubeDL] _calc_cookies: add get_header method to _PseudoRequest (#4861) --- 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')