From 1d0e49e1c7a0c7490df508eb1a2d764cd3cb1a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Tue, 25 Mar 2014 21:22:27 +0700 Subject: [PATCH] Use explicitly set Referer header for downloading --- youtube_dl/downloader/http.py | 2 ++ 1 file changed, 2 insertions(+) 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 @@ def real_download(self, filename, info_dict): 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)