[youtube] use url_encoded_fmt_stream_map from video page, fix #1502

This commit is contained in:
Mort Yao 2016-11-09 17:13:02 +01:00
parent d04997ec9b
commit 51dd7ad8e6
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -155,6 +155,8 @@ class YouTube(VideoExtractor):
try:
ytplayer_config = json.loads(re.search('ytplayer.config\s*=\s*([^\n]+?});', video_page).group(1))
self.html5player = 'https:' + ytplayer_config['assets']['js']
# Workaround: get_video_info returns bad s. Why?
stream_list = ytplayer_config['args']['url_encoded_fmt_stream_map'].split(',')
except:
self.html5player = None