소스 검색

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

Jaime Marquínez Ferrándiz 10 년 전
부모
커밋
b3a286d69d
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      youtube_dl/YoutubeDL.py

+ 3 - 0
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')