]> git.bitcoin.ninja Git - youtube-dl/blobdiff - youtube_dl/extractor/youtube.py
[youtube] Fix protocol-independent URLs (Fixes #1768)
[youtube-dl] / youtube_dl / extractor / youtube.py
index f745b8b1450a6a39ad281ab72b7c1a1b60ba755d..ed82e4fc02878b1cac9019ca1439ac7d31ca8cd7 100644 (file)
@@ -1019,6 +1019,8 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
         """Turn the encrypted s field into a working signature"""
 
         if player_url is not None:
+            if player_url.startswith(u'//'):
+                player_url = u'https:' + player_url
             try:
                 player_id = (player_url, len(s))
                 if player_id not in self._player_cache:
@@ -1082,7 +1084,7 @@ class YoutubeIE(YoutubeBaseInfoExtractor, SubtitlesInfoExtractor):
         else:
             raise ExtractorError(u'Unable to decrypt signature, key length %d not supported; retrying might work' % (len(s)))
 
-    def _get_available_subtitles(self, video_id):
+    def _get_available_subtitles(self, video_id, webpage):
         try:
             sub_list = self._download_webpage(
                 'http://video.google.com/timedtext?hl=en&type=list&v=%s' % video_id,