]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - youtube_dl/downloader/http.py
[utils] YoutubeDLHandler: don't use 'Youtubedl-user-agent' for overriding the default...
[youtube-dl.git] / youtube_dl / downloader / http.py
index 224962e86827956b2145378b7a6cf920a02029e6..90a2e4c53935f60ed01f4dbae08e1732c04beeca 100644 (file)
@@ -4,11 +4,12 @@ import os
 import time
 
 from .common import FileDownloader
-from ..utils import (
+from ..compat import (
     compat_urllib_request,
     compat_urllib_error,
+)
+from ..utils import (
     ContentTooShortError,
-
     encodeFilename,
     sanitize_open,
     format_bytes,
@@ -24,7 +25,7 @@ class HttpFD(FileDownloader):
         # Do not include the Accept-Encoding header
         headers = {'Youtubedl-no-compression': 'True'}
         if 'user_agent' in info_dict:
-            headers['Youtubedl-user-agent'] = info_dict['user_agent']
+            headers['User-agent'] = info_dict['user_agent']
         if 'http_referer' in info_dict:
             headers['Referer'] = info_dict['http_referer']
         add_headers = info_dict.get('http_headers')