aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-09-29 01:39:26 +0200
committerPhilipp Hagemeister <phihag@phihag.de>2014-09-29 01:39:26 +0200
commite2dce5378191e315ad86785aac7e786c86a1a121 (patch)
treeeb890efc11cae829312508ac4515a446a810e8bc /youtube_dl/extractor
parent1770ed9e86a147eceb86210dec0aefcf0d94ab52 (diff)
[youtube] Always request webpage in English (Fixes #3844)
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/youtube.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py
index 045507bc7..61228817e 100644
--- a/youtube_dl/extractor/youtube.py
+++ b/youtube_dl/extractor/youtube.py
@@ -655,7 +655,9 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
# Get video webpage
url = proto + '://www.youtube.com/watch?v=%s&gl=US&hl=en&has_verified=1' % video_id
- video_webpage = self._download_webpage(url, video_id)
+ req = compat_urllib_request.Request(url)
+ req.add_header('Cookie', 'PREF=hl=en')
+ video_webpage = self._download_webpage(req, video_id)
# Attempt to extract SWF player URL
mobj = re.search(r'swfConfig.*?"(https?:\\/\\/.*?watch.*?-.*?\.swf)"', video_webpage)