From c9265f6d609d3805e5c67ac615637a203ece80fc Mon Sep 17 00:00:00 2001 From: deepspy Date: Mon, 24 Jun 2024 16:46:29 +0300 Subject: [PATCH] Fixed a series title location bug. --- youtube_dl/extractor/kankids.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/youtube_dl/extractor/kankids.py b/youtube_dl/extractor/kankids.py index 19c9baf37..03051817c 100644 --- a/youtube_dl/extractor/kankids.py +++ b/youtube_dl/extractor/kankids.py @@ -35,7 +35,12 @@ class KanKidsIE(InfoExtractor): webpage = self._download_webpage(url, series_id) - series_title = self._html_search_regex(r'(?P<title>.+) \|', webpage, 'title') + title_pattern = r'<title>(?P<title>.+) \|' + series_title = re.search(title_pattern, webpage) + if not series_title: + series_title = re.search(title_pattern[:-1] + r'-', webpage) + if series_title: + series_title = series_title.group('title') season = playlist_season if playlist_season else r'(?P<season>\w+)' content_dir = CONTENT_DIR + category + r'-main/' @@ -47,7 +52,6 @@ class KanKidsIE(InfoExtractor): r'.+title="(?P<title>.+)"' # Title , webpage)) # , 'Episode list') - print('playlist:', playlist) entries = [] content_dir = r'https://www.' + DOMAIN + content_dir