projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f67177c
)
[itv] Fix rtmp formats (#12759)
author
Sergey M․
<dstftw@gmail.com>
Sun, 16 Apr 2017 16:15:24 +0000
(23:15 +0700)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 16 Apr 2017 16:15:24 +0000
(23:15 +0700)
youtube_dl/extractor/itv.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/itv.py
b/youtube_dl/extractor/itv.py
index 5ff7e1aaa4b8c720c7861355a7d373c8718fb49d..7442c24d9adc550245d3c50b3c8ce83b7c6c8104 100644
(file)
--- a/
youtube_dl/extractor/itv.py
+++ b/
youtube_dl/extractor/itv.py
@@
-116,15
+116,25
@@
class ITVIE(InfoExtractor):
if not play_path:
continue
tbr = int_or_none(media_file.get('bitrate'), 1000)
if not play_path:
continue
tbr = int_or_none(media_file.get('bitrate'), 1000)
- f
ormats.append(
{
+ f
=
{
'format_id': 'rtmp' + ('-%d' % tbr if tbr else ''),
'format_id': 'rtmp' + ('-%d' % tbr if tbr else ''),
- 'url': rtmp_url,
'play_path': play_path,
'play_path': play_path,
+ # Providing this swfVfy allows to avoid truncated downloads
+ 'player_url': 'http://www.itv.com/mercury/Mercury_VideoPlayer.swf',
+ 'page_url': url,
'tbr': tbr,
'ext': 'flv',
'tbr': tbr,
'ext': 'flv',
- # rtmp formats are now stop downloading at ~72MiB
- 'preference': -10,
- })
+ }
+ app = self._search_regex(
+ 'rtmpe?://[^/]+/(.+)$', rtmp_url, 'app', default=None)
+ if app:
+ f.update({
+ 'url': rtmp_url.split('?', 1)[0],
+ 'app': app,
+ })
+ else:
+ f['url'] = rtmp_url
+ formats.append(f)
ios_playlist_url = params.get('data-video-playlist')
hmac = params.get('data-video-hmac')
ios_playlist_url = params.get('data-video-playlist')
hmac = params.get('data-video-hmac')