From 32766d525a49fe020154e22c953da158fcd3c12e Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu@web.de> Date: Sun, 12 Apr 2020 01:40:13 +0200 Subject: [PATCH] [tele5] Prefer m3u8 download in extraction (closes #24674) --- youtube_dl/extractor/tele5.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/youtube_dl/extractor/tele5.py b/youtube_dl/extractor/tele5.py index 364556a1f..9f4e29234 100644 --- a/youtube_dl/extractor/tele5.py +++ b/youtube_dl/extractor/tele5.py @@ -91,6 +91,19 @@ class Tele5IE(InfoExtractor): media = self._download_json( 'https://cdn.jwplayer.com/v2/media/' + jwplatform_id, display_id) + + m3u8_url = try_get( + media, lambda x: x['playlist'][0]['sources'][0]['file'], compat_str) + + if m3u8_url: + formats = self._extract_m3u8_formats(m3u8_url, jwplatform_id, 'mp4', fatal=False) + return { + 'id': '%s' % jwplatform_id, + 'title': try_get(media, lambda x: x['title'], compat_str), + # TODO: description, thumbnail, duration + 'formats': formats + } + nexx_id = try_get( media, lambda x: x['playlist'][0]['nexx_id'], compat_str)