From 5935ef3c5d9c70c412a0c49f03feb3d0da8dedc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sun, 16 Apr 2017 21:52:07 +0700 Subject: [itv] Lower preference for rtmp formats (closes #12759) --- youtube_dl/extractor/itv.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'youtube_dl/extractor/itv.py') diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py index 021c6b278..7f24f14ce 100644 --- a/youtube_dl/extractor/itv.py +++ b/youtube_dl/extractor/itv.py @@ -122,6 +122,8 @@ class ITVIE(InfoExtractor): 'play_path': play_path, 'tbr': tbr, 'ext': 'flv', + # rtmp formats are now stop downloading at ~72MiB + 'preference': -10, }) ios_playlist_url = params.get('data-video-playlist') -- cgit v1.2.3 From f67177cae8a2e616d265bbbafe1ceabc7df8dbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sun, 16 Apr 2017 21:52:45 +0700 Subject: [itv] Use native hls --- youtube_dl/extractor/itv.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'youtube_dl/extractor/itv.py') diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py index 7f24f14ce..5ff7e1aaa 100644 --- a/youtube_dl/extractor/itv.py +++ b/youtube_dl/extractor/itv.py @@ -174,7 +174,9 @@ class ITVIE(InfoExtractor): href = ios_base_url + href ext = determine_ext(href) if ext == 'm3u8': - formats.extend(self._extract_m3u8_formats(href, video_id, 'mp4', m3u8_id='hls', fatal=False)) + formats.extend(self._extract_m3u8_formats( + href, video_id, 'mp4', entry_protocol='m3u8_native', + m3u8_id='hls', fatal=False)) else: formats.append({ 'url': href, -- cgit v1.2.3 From c2d7d76efd37c16d01100635f308f03deb9c04aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sun, 16 Apr 2017 23:15:24 +0700 Subject: [itv] Fix rtmp formats (#12759) --- youtube_dl/extractor/itv.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'youtube_dl/extractor/itv.py') diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py index 5ff7e1aaa..7442c24d9 100644 --- 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) - formats.append({ + f = { 'format_id': 'rtmp' + ('-%d' % tbr if tbr else ''), - 'url': rtmp_url, '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', - # 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') -- cgit v1.2.3 From 751c89a27d68c54375e96789cc90d4c8a3ce3dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergey=20M=E2=80=A4?= Date: Sun, 16 Apr 2017 23:19:20 +0700 Subject: [itv] Extract series metadata --- youtube_dl/extractor/itv.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'youtube_dl/extractor/itv.py') diff --git a/youtube_dl/extractor/itv.py b/youtube_dl/extractor/itv.py index 7442c24d9..f3156804d 100644 --- a/youtube_dl/extractor/itv.py +++ b/youtube_dl/extractor/itv.py @@ -203,7 +203,8 @@ class ITVIE(InfoExtractor): 'ext': 'ttml' if ext == 'xml' else ext, }) - return { + info = self._search_json_ld(webpage, video_id, default={}) + info.update({ 'id': video_id, 'title': title, 'formats': formats, @@ -212,4 +213,5 @@ class ITVIE(InfoExtractor): 'episode_number': int_or_none(xpath_text(playlist, 'EpisodeNumber')), 'series': xpath_text(playlist, 'ProgrammeTitle'), 'duartion': parse_duration(xpath_text(playlist, 'Duration')), - } + }) + return info -- cgit v1.2.3