[youtube] Extract the 'sts' parameter from the webpage (fixes #3327)
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 23 Jul 2014 10:16:26 +0000 (12:16 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Wed, 23 Jul 2014 10:16:26 +0000 (12:16 +0200)
youtube_dl/extractor/youtube.py

index a346f4c960df87b4f35bda4f8e571c6405f1a316..2b346d4f8160e56bc7b8c404a010eded47154072 100644 (file)
@@ -611,7 +611,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
             data = compat_urllib_parse.urlencode({
                 'video_id': video_id,
                 'eurl': 'https://youtube.googleapis.com/v/' + video_id,
-                'sts':'16268',
+                'sts': self._search_regex(
+                    r'"sts"\s*:\s*(\d+)', video_webpage, 'sts'),
             })
             video_info_url = proto + '://www.youtube.com/get_video_info?' + data
             video_info_webpage = self._download_webpage(video_info_url, video_id,