projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
661d46b
)
[jwplatform] Don't fail with RTMP URLs without mp4:, mp3: or flv:
author
Yen Chi Hsuan
<yan12125@gmail.com>
Sat, 21 May 2016 05:50:38 +0000
(13:50 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Sat, 21 May 2016 05:50:38 +0000
(13:50 +0800)
youtube_dl/extractor/jwplatform.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/jwplatform.py
b/youtube_dl/extractor/jwplatform.py
index 0aa6fc7504974b93546a564d7c68b80ffa400535..fa6f335e1e25575e5b2de57859a73a7c262ed1ae 100644
(file)
--- 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'):
'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
# 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)
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)
if rtmp_params:
a_format.update(rtmp_params)
formats.append(a_format)