1
0
Fork 0
mirror of https://github.com/blackjack4494/yt-dlc.git synced 2024-12-26 09:48:11 +00:00

[youtube] Always request webpage in English (Fixes #3844)

This commit is contained in:
Philipp Hagemeister 2014-09-29 01:39:26 +02:00
parent 1770ed9e86
commit e2dce53781

View file

@ -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)