aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/jwplatform.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-05-21 13:50:38 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-05-21 13:50:38 +0800
commit115c65793af4c56c8f1986d2640105fc7e760c13 (patch)
tree7a0296333b05ebfb89162325681150e238928bcd /youtube_dl/extractor/jwplatform.py
parent661d46b28f6de2772fc642c36b505a3c7b9a3b10 (diff)
[jwplatform] Don't fail with RTMP URLs without mp4:, mp3: or flv:
Diffstat (limited to 'youtube_dl/extractor/jwplatform.py')
-rw-r--r--youtube_dl/extractor/jwplatform.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/youtube_dl/extractor/jwplatform.py b/youtube_dl/extractor/jwplatform.py
index 0aa6fc750..fa6f335e1 100644
--- a/youtube_dl/extractor/jwplatform.py
+++ b/youtube_dl/extractor/jwplatform.py
@@ -34,15 +34,18 @@ class JWPlatformBaseIE(InfoExtractor):
'height': int_or_none(source.get('height')),
}
if source_url.startswith('rtmp'):
+ a_format['ext'] = 'flv',
+
# See com/longtailvideo/jwplayer/media/RTMPMediaProvider.as
# of jwplayer.flash.swf
- rtmp_url, prefix, play_path = re.split(
+ rtmp_url_parts = re.split(
r'((?:mp4|mp3|flv):)', source_url, 1)
- a_format.update({
- 'url': rtmp_url,
- 'ext': 'flv',
- 'play_path': prefix + play_path,
- })
+ if len(rtmp_url_parts) == 3:
+ rtmp_url, prefix, play_path = rtmp_url_parts
+ a_format.update({
+ 'url': rtmp_url,
+ 'play_path': prefix + play_path,
+ })
if rtmp_params:
a_format.update(rtmp_params)
formats.append(a_format)