From afc5de1952b1f119971cdd87ed33844bf8d65cd0 Mon Sep 17 00:00:00 2001 From: Oneboy1979 Date: Sat, 16 Feb 2019 14:43:50 +0100 Subject: [PATCH 1/3] [servus] fix for new url format --- youtube_dl/extractor/servus.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/servus.py b/youtube_dl/extractor/servus.py index 264e1dd8b..4671404bf 100644 --- a/youtube_dl/extractor/servus.py +++ b/youtube_dl/extractor/servus.py @@ -5,26 +5,25 @@ from .common import InfoExtractor class ServusIE(InfoExtractor): - _VALID_URL = r'https?://(?:www\.)?servus\.com/(?:at|de)/p/[^/]+/(?PAA-\w+|\d+-\d+)' + _VALID_URL = r'https?://(?:www\.)?servus\.com/tv/videos/(?Paa-\w+|\d+-\d+)' _TESTS = [{ - 'url': 'https://www.servus.com/de/p/Die-Gr%C3%BCnen-aus-Sicht-des-Volkes/AA-1T6VBU5PW1W12/', + 'url': 'https://www.servus.com/tv/videos/aa-1t6vbu5pw1w12/', 'md5': '046dee641cda1c4cabe13baef3be2c1c', 'info_dict': { - 'id': 'AA-1T6VBU5PW1W12', + 'id': 'aa-1t6vbu5pw1w12', 'ext': 'mp4', 'title': 'Die Grünen aus Volkssicht', 'description': 'md5:052b5da1cb2cd7d562ef1f19be5a5cba', 'thumbnail': r're:^https?://.*\.jpg$', } - }, { - 'url': 'https://www.servus.com/at/p/Wie-das-Leben-beginnt/1309984137314-381415152/', - 'only_matching': True, }] def _real_extract(self, url): video_id = self._match_id(url) - webpage = self._download_webpage(url, video_id) + video_id = video_id.upper() + webpage = self._download_webpage(url, video_id) + title = self._og_search_title(webpage) description = self._og_search_description(webpage) thumbnail = self._og_search_thumbnail(webpage) From 1165fe261669ef7ec229714d2bc4d8597b218dca Mon Sep 17 00:00:00 2001 From: Oneboy1979 Date: Sat, 16 Feb 2019 15:02:01 +0100 Subject: [PATCH 2/3] [servus] clean up code --- youtube_dl/extractor/servus.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/youtube_dl/extractor/servus.py b/youtube_dl/extractor/servus.py index 4671404bf..7a6d20c93 100644 --- a/youtube_dl/extractor/servus.py +++ b/youtube_dl/extractor/servus.py @@ -19,8 +19,7 @@ class ServusIE(InfoExtractor): }] def _real_extract(self, url): - video_id = self._match_id(url) - video_id = video_id.upper() + video_id = self._match_id(url).upper() webpage = self._download_webpage(url, video_id) From b0da63e30abc5c2f9f5306153ead982ab1ef0c16 Mon Sep 17 00:00:00 2001 From: Oneboy1979 Date: Sun, 24 Feb 2019 16:37:24 +0100 Subject: [PATCH 3/3] [servus] fix tests --- youtube_dl/extractor/servus.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/youtube_dl/extractor/servus.py b/youtube_dl/extractor/servus.py index 7a6d20c93..00c1a5abf 100644 --- a/youtube_dl/extractor/servus.py +++ b/youtube_dl/extractor/servus.py @@ -6,17 +6,17 @@ from .common import InfoExtractor class ServusIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?servus\.com/tv/videos/(?Paa-\w+|\d+-\d+)' - _TESTS = [{ + _TEST = { 'url': 'https://www.servus.com/tv/videos/aa-1t6vbu5pw1w12/', - 'md5': '046dee641cda1c4cabe13baef3be2c1c', + 'md5': '3e1dd16775aa8d5cbef23628cfffc1f4', 'info_dict': { - 'id': 'aa-1t6vbu5pw1w12', + 'id': 'AA-1T6VBU5PW1W12', 'ext': 'mp4', - 'title': 'Die Grünen aus Volkssicht', - 'description': 'md5:052b5da1cb2cd7d562ef1f19be5a5cba', - 'thumbnail': r're:^https?://.*\.jpg$', + 'title': 'Die Grünen aus Sicht des Volkes - Servus TV', + 'description': 'md5:1247204d85783afe3682644398ff2ec4', + 'thumbnail': r're:^https?://.*1080$', } - }] + } def _real_extract(self, url): video_id = self._match_id(url).upper()