From 6cbd8de42007532cca3167c6034ff1c243e38408 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 9 Apr 2020 16:42:08 +0200 Subject: [PATCH] download works, tests fail with error AssertionError: None is not true : Missing mandatory field url --- youtube_dl/extractor/extractors.py | 1 + youtube_dl/extractor/playerglobewien.py | 42 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 youtube_dl/extractor/playerglobewien.py diff --git a/youtube_dl/extractor/extractors.py b/youtube_dl/extractor/extractors.py index e407ab3d9..23c983a4c 100644 --- a/youtube_dl/extractor/extractors.py +++ b/youtube_dl/extractor/extractors.py @@ -837,6 +837,7 @@ from .platzi import ( PlatziIE, PlatziCourseIE, ) +from .playerglobewien import PlayerGlobeWienIE from .playfm import PlayFMIE from .playplustv import PlayPlusTVIE from .plays import PlaysTVIE diff --git a/youtube_dl/extractor/playerglobewien.py b/youtube_dl/extractor/playerglobewien.py new file mode 100644 index 000000000..b5c76e953 --- /dev/null +++ b/youtube_dl/extractor/playerglobewien.py @@ -0,0 +1,42 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class PlayerGlobeWienIE(InfoExtractor): + _VALID_URL = r'https?://player.globe.wien/globe-wien/(?P.*)' + _TEST = { + 'url': 'https://player.globe.wien/globe-wien/corona-podcast-teil-4', + 'info_dict': { + 'id': 'corona-podcast-teil-4', + 'ext': 'mp4', + 'title': 'Globe Wien VOD - Eckel & Niavarani & Sarsam - Im Endspurt versagt', + 'url': 'https://player.globe.wien/globe-wien/corona-podcast-teil-4', + }, + 'params': { + 'format': 'bestvideo+bestaudio/best', + } + } + + def _real_extract(self, url): + video_id = self._match_id(url) + print(video_id) + webpage = self._download_webpage(url, video_id) + formats = [] + title = self._html_search_regex(r'(.+?)', webpage, 'title') + + stream_url = self._download_webpage("https://player.globe.wien/api/playout?vodId="+video_id, video_id) + + hls_url = self._parse_json(stream_url, video_id)['streamUrl']['hls'] + + formats.extend(self._extract_m3u8_formats( + hls_url, video_id, 'mp4', entry_protocol='m3u8_native', m3u8_id='hls')) + + self._sort_formats(formats) + return { + 'id': video_id, + 'title': title, + 'formats': formats, + } +