[downloader/external] Use the 'http_headers' field
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 24 Jan 2015 17:25:09 +0000 (18:25 +0100)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Sat, 24 Jan 2015 17:25:09 +0000 (18:25 +0100)
youtube_dl/downloader/external.py

index 7ebe400969cf3c66b7ece2046526d7085cbac43a..5bf24ccbb75fde93514a294f8cb1afd3aff9e943 100644 (file)
@@ -49,9 +49,9 @@ class ExternalFD(FileDownloader):
     def _calc_headers(self, info_dict):
         res = std_headers.copy()
 
-        ua = info_dict.get('user_agent')
-        if ua is not None:
-            res['User-Agent'] = ua
+        add_headers = info_dict.get('http_headers')
+        if add_headers:
+            res.update(add_headers)
 
         cookies = self._calc_cookies(info_dict)
         if cookies: