From 09531ab29ef334772f666aa8cd3ec2693a6417ef Mon Sep 17 00:00:00 2001 From: Oneboy1979 Date: Fri, 10 Apr 2020 10:14:16 +0200 Subject: [PATCH] playerglobewien - beautify code and remove text in title --- youtube_dl/extractor/playerglobewien.py | 43 ++++++++++++++----------- 1 file changed, 24 insertions(+), 19 deletions(-) mode change 100644 => 100755 youtube_dl/extractor/playerglobewien.py diff --git a/youtube_dl/extractor/playerglobewien.py b/youtube_dl/extractor/playerglobewien.py old mode 100644 new mode 100755 index fa41d4303..bb49a989b --- a/youtube_dl/extractor/playerglobewien.py +++ b/youtube_dl/extractor/playerglobewien.py @@ -1,32 +1,36 @@ # coding: utf-8 from __future__ import unicode_literals +import re from .common import InfoExtractor class PlayerGlobeWienIE(InfoExtractor): _VALID_URL = r'https?://player.globe.wien/globe-wien/(?P.*)' - _TESTS = [{ - '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', + _TESTS = [ + { + 'url': 'https://player.globe.wien/globe-wien/corona-podcast-teil-4', + 'info_dict': { + 'id': 'corona-podcast-teil-4', + 'ext': 'mp4', + 'title': 'Eckel & Niavarani & Sarsam - Im Endspurt versagt', + }, + 'params': { + 'format': 'bestvideo', + } }, - 'params': { - 'format': 'bestvideo', + { + 'url': 'https://player.globe.wien/globe-wien/corona-podcast-teil-4', + 'info_dict': { + 'id': 'corona-podcast-teil-4', + 'ext': 'mp4', + 'title': 'Eckel & Niavarani & Sarsam - Im Endspurt versagt', + }, + 'params': { + 'format': 'bestaudio', + } } - }, { - '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', - }, - 'params': { - 'format': 'bestaudio', - } - }] + ] def _real_extract(self, url): video_id = self._match_id(url) @@ -34,6 +38,7 @@ class PlayerGlobeWienIE(InfoExtractor): webpage = self._download_webpage(url, video_id) formats = [] title = self._html_search_regex(r'(.+?)', webpage, 'title') + title = re.sub(r'^Globe Wien VOD -\s*','',title) stream_url = self._download_webpage("https://player.globe.wien/api/playout?vodId=" + video_id, video_id)