1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-12-31 02:33:21 +08:00

[YoutubeDL] _calc_cookies: add get_header method to _PseudoRequest (#4861)

This commit is contained in:
Jaime Marquínez Ferrándiz 2015-02-06 22:23:06 +01:00
parent 467d3c9a0c
commit b3a286d69d

View File

@ -938,6 +938,9 @@ class YoutubeDL(object):
def has_header(self, h): def has_header(self, h):
return h in self.headers return h in self.headers
def get_header(self, h, default=None):
return self.headers.get(h, default)
pr = _PseudoRequest(info_dict['url']) pr = _PseudoRequest(info_dict['url'])
self.cookiejar.add_cookie_header(pr) self.cookiejar.add_cookie_header(pr)
return pr.headers.get('Cookie') return pr.headers.get('Cookie')