[theplatform] Handle explicitly specified SMIL (#7385)
authorSergey M․ <dstftw@gmail.com>
Sun, 15 Nov 2015 17:43:23 +0000 (23:43 +0600)
committerSergey M․ <dstftw@gmail.com>
Sun, 15 Nov 2015 17:43:23 +0000 (23:43 +0600)
youtube_dl/extractor/theplatform.py

index 25edc310008ef0da7b407c97db86ce5e49c78a50..114c70b7ce42eebd22766506de4de6a4359d86d2 100644 (file)
@@ -193,6 +193,15 @@ class ThePlatformIE(ThePlatformBaseIE):
 
         if smuggled_data.get('force_smil_url', False):
             smil_url = url
+        # Explicitly specified SMIL (see https://github.com/rg3/youtube-dl/issues/7385)
+        elif '/guid/' in url:
+            webpage = self._download_webpage(url, video_id)
+            smil_url = self._search_regex(
+                r'<link[^>]+href=(["\'])(?P<url>.+?)\1[^>]+type=["\']application/smil\+xml',
+                webpage, 'smil url', group='url')
+            path = self._search_regex(
+                r'link\.theplatform\.com/s/((?:[^/?#&]+/)+[^/?#&]+)', smil_url, 'path')
+            smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4&format=SMIL'
         elif mobj.group('config'):
             config_url = url + '&form=json'
             config_url = config_url.replace('swf/', 'config/')