Use explicitly set Referer header for downloading
authorSergey M․ <dstftw@gmail.com>
Tue, 25 Mar 2014 14:22:27 +0000 (21:22 +0700)
committerSergey M․ <dstftw@gmail.com>
Tue, 25 Mar 2014 14:22:27 +0000 (21:22 +0700)
youtube_dl/downloader/http.py

index 348097dab0886954655b85917def8743975d963a..16a2dce3f6a84998523351c701196ee83a5e33e3 100644 (file)
@@ -23,6 +23,8 @@ class HttpFD(FileDownloader):
         headers = {'Youtubedl-no-compression': 'True'}
         if 'user_agent' in info_dict:
             headers['Youtubedl-user-agent'] = info_dict['user_agent']
+        if 'referer' in info_dict:
+            headers['Referer'] = info_dict['referer']
         basic_request = compat_urllib_request.Request(url, None, headers)
         request = compat_urllib_request.Request(url, None, headers)