From: Sergey M․ Date: Tue, 25 Mar 2014 14:22:27 +0000 (+0700) Subject: Use explicitly set Referer header for downloading X-Git-Url: http://git.bitcoin.ninja/index.cgi?p=youtube-dl;a=commitdiff_plain;h=1d0e49e1c7a0c7490df508eb1a2d764cd3cb1a6b Use explicitly set Referer header for downloading --- diff --git a/youtube_dl/downloader/http.py b/youtube_dl/downloader/http.py index 348097dab..16a2dce3f 100644 --- a/youtube_dl/downloader/http.py +++ b/youtube_dl/downloader/http.py @@ -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)