about summary refs log tree commit diff
path: root/youtube_dl/extractor/theplatform.py
diff options
context:
space:
mode:
authorremitamine <remitamine@gmail.com>2016-03-18 09:21:21 +0100
committerremitamine <remitamine@gmail.com>2016-03-18 09:22:10 +0100
commit4c92fd2e835cde89866d3dfb1fc05d23196b19db (patch)
treed8988a9d4764f28fa222ef38a35feee2eeb103fa /youtube_dl/extractor/theplatform.py
parente3d17b3c07c6d8bc7fd45af1e45523e8fde5fb58 (diff)
downloadyoutube-dl-4c92fd2e835cde89866d3dfb1fc05d23196b19db.tar.gz
youtube-dl-4c92fd2e835cde89866d3dfb1fc05d23196b19db.tar.xz
youtube-dl-4c92fd2e835cde89866d3dfb1fc05d23196b19db.zip
[theplatform] always force theplatform to return a smil for _extract_theplatform_smil
Diffstat (limited to 'youtube_dl/extractor/theplatform.py')
-rw-r--r--youtube_dl/extractor/theplatform.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/youtube_dl/extractor/theplatform.py b/youtube_dl/extractor/theplatform.py
index ffe7c57ad..a148f78ce 100644
--- a/youtube_dl/extractor/theplatform.py
+++ b/youtube_dl/extractor/theplatform.py
@@ -22,6 +22,7 @@ from ..utils import (
     xpath_with_ns,
     mimetype2ext,
     find_xpath_attr,
+    update_url_query,
 )
 
 default_ns = 'http://www.w3.org/2005/SMIL21/Language'
@@ -30,6 +31,7 @@ _x = lambda p: xpath_with_ns(p, {'smil': default_ns})
 
 class ThePlatformBaseIE(OnceIE):
     def _extract_theplatform_smil(self, smil_url, video_id, note='Downloading SMIL data'):
+        smil_url = update_url_query(smil_url, {'format': 'SMIL'})
         meta = self._download_xml(smil_url, video_id, note=note)
         error_element = find_xpath_attr(
             meta, _x('.//smil:ref'), 'src',
@@ -213,7 +215,7 @@ class ThePlatformIE(ThePlatformBaseIE):
                 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'
+            smil_url += '?' if '?' not in smil_url else '&' + 'formats=m3u,mpeg4'
         elif mobj.group('config'):
             config_url = url + '&form=json'
             config_url = config_url.replace('swf/', 'config/')
@@ -223,9 +225,9 @@ class ThePlatformIE(ThePlatformBaseIE):
                 release_url = config['releaseUrl']
             else:
                 release_url = 'http://link.theplatform.com/s/%s?mbr=true' % path
-            smil_url = release_url + '&format=SMIL&formats=MPEG4&manifest=f4m'
+            smil_url = release_url + '&formats=MPEG4&manifest=f4m'
         else:
-            smil_url = 'http://link.theplatform.com/s/%s/meta.smil?format=smil&mbr=true' % path
+            smil_url = 'http://link.theplatform.com/s/%s?mbr=true' % path
 
         sig = smuggled_data.get('sig')
         if sig:
@@ -280,7 +282,7 @@ class ThePlatformFeedIE(ThePlatformBaseIE):
         first_video_id = None
         duration = None
         for item in entry['media$content']:
-            smil_url = item['plfile$url'] + '&format=SMIL&mbr=true'
+            smil_url = item['plfile$url'] + '&mbr=true'
             cur_video_id = ThePlatformIE._match_id(smil_url)
             if first_video_id is None:
                 first_video_id = cur_video_id