[theplatform] Fallback to hardcoded releaseUrl if not available
authorYen Chi Hsuan <yan12125@gmail.com>
Thu, 13 Aug 2015 04:56:12 +0000 (12:56 +0800)
committerYen Chi Hsuan <yan12125@gmail.com>
Thu, 13 Aug 2015 04:56:12 +0000 (12:56 +0800)
Fixes #6546.

Not adding a test case as test_NBC has the same problem.

youtube_dl/extractor/theplatform.py

index 83d833e30dbeb60caa43aa272bfd4d35f4507a53..0643eccaf48c21a29718f9b0b4fbe52bf3d4ee0e 100644 (file)
@@ -108,7 +108,11 @@ class ThePlatformIE(InfoExtractor):
             config_url = config_url.replace('swf/', 'config/')
             config_url = config_url.replace('onsite/', 'onsite/config/')
             config = self._download_json(config_url, video_id, 'Downloading config')
-            smil_url = config['releaseUrl'] + '&format=SMIL&formats=MPEG4&manifest=f4m'
+            if 'releaseUrl' in config:
+                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'
         else:
             smil_url = 'http://link.theplatform.com/s/%s/meta.smil?format=smil&mbr=true' % path