From a8a3c3225c330778da06a9a323424d78e83a27a8 Mon Sep 17 00:00:00 2001 From: Jan Chren Date: Tue, 4 Apr 2017 20:27:13 +0200 Subject: [PATCH] [ceskatelevize] Fix initial url replace()s Fixes: https://github.com/rg3/youtube-dl/issues/7411 Test cases: ``` From: http://www.ceskatelevize.cz/porady/1126666764-toulava-kamera/217562221500004 To: http://www.ceskatelevize.cz/ivysilani/1126666764-toulava-kamera/217562221500004 From: http://www.ceskatelevize.cz/porady/1126666764-toulava-kamera/217562221500004/video/519429 To: http://www.ceskatelevize.cz/ivysilani/1126666764-toulava-kamera/217562221500004/obsah/519429 From: http://www.ceskatelevize.cz/ivysilani/1126666764-toulava-kamera/217562221500004/obsah/519429-na-bezkach-po-ceskem-raji To: http://www.ceskatelevize.cz/ivysilani/1126666764-toulava-kamera/217562221500004/obsah/519429-na-bezkach-po-ceskem-raji ``` --- youtube_dl/extractor/ceskatelevize.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/ceskatelevize.py b/youtube_dl/extractor/ceskatelevize.py index dd2529a6d..6940b7dcc 100644 --- a/youtube_dl/extractor/ceskatelevize.py +++ b/youtube_dl/extractor/ceskatelevize.py @@ -92,10 +92,11 @@ class CeskaTelevizeIE(InfoExtractor): }] def _real_extract(self, url): - url = url.replace('/porady/', '/ivysilani/').replace('/video/', '') - mobj = re.match(self._VALID_URL, url) playlist_id = mobj.group('id') + + url = url.replace('/porady/', '/ivysilani/', 1) + url = url.replace('/video/', '/obsah/', 1) webpage = self._download_webpage(url, playlist_id)