From bf7a1b2ddf8bfc720a50892f9e24efa3077fb620 Mon Sep 17 00:00:00 2001 From: qbnu <93988953+qbnu@users.noreply.github.com> Date: Sun, 31 Dec 2023 05:47:29 -0500 Subject: [PATCH 1/3] [ie/ctvnews] fix playlist ID detection --- yt_dlp/extractor/ctvnews.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/ctvnews.py b/yt_dlp/extractor/ctvnews.py index ad3f0d8e4..1bce4f568 100644 --- a/yt_dlp/extractor/ctvnews.py +++ b/yt_dlp/extractor/ctvnews.py @@ -5,7 +5,7 @@ from ..utils import orderedSet class CTVNewsIE(InfoExtractor): - _VALID_URL = r'https?://(?:.+?\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P[0-9.]+)' + _VALID_URL = r'https?://(?:.+?\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P[0-9.]+)(?:$|[^\w.-])' _TESTS = [{ 'url': 'http://www.ctvnews.ca/video?clipId=901995', 'md5': '9b8624ba66351a23e0b6e1391971f9af', @@ -31,6 +31,13 @@ class CTVNewsIE(InfoExtractor): 'id': '1.2876780', }, 'playlist_mincount': 100, + }, { + 'url': 'https://www.ctvnews.ca/it-s-been-23-years-since-toronto-called-in-the-army-after-a-major-snowstorm-1.5736957', + 'info_dict': + { + 'id': '1.5736957', + }, + 'playlist_mincount': 6, }, { 'url': 'http://www.ctvnews.ca/1.810401', 'only_matching': True, From 9805caa7421e69b689acaa127adc73d808dfb28f Mon Sep 17 00:00:00 2001 From: qbnu <93988953+qbnu@users.noreply.github.com> Date: Sun, 31 Dec 2023 06:09:42 -0500 Subject: [PATCH 2/3] [ie/ctvnews] fix failing test --- yt_dlp/extractor/ctvnews.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/yt_dlp/extractor/ctvnews.py b/yt_dlp/extractor/ctvnews.py index 1bce4f568..c6cbb3e72 100644 --- a/yt_dlp/extractor/ctvnews.py +++ b/yt_dlp/extractor/ctvnews.py @@ -8,7 +8,7 @@ class CTVNewsIE(InfoExtractor): _VALID_URL = r'https?://(?:.+?\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P[0-9.]+)(?:$|[^\w.-])' _TESTS = [{ 'url': 'http://www.ctvnews.ca/video?clipId=901995', - 'md5': '9b8624ba66351a23e0b6e1391971f9af', + 'md5': 'b608f466c7fa24b9666c6439d766ab7e', 'info_dict': { 'id': '901995', 'ext': 'flv', @@ -16,6 +16,14 @@ class CTVNewsIE(InfoExtractor): 'description': 'md5:958dd3b4f5bbbf0ed4d045c790d89285', 'timestamp': 1467286284, 'upload_date': '20160630', + 'categories': [], + 'tags': [], + 'season_id': 57981, + 'duration': 764.631, + 'series': 'CTV News National story', + 'thumbnail': r're:^https?://.*\.jpg$', + 'season': 'Season 0', + 'season_number': 0, } }, { 'url': 'http://www.ctvnews.ca/video?playlistId=1.2966224', From 719f06f4903a539ac155e55d1080cc4013a95ced Mon Sep 17 00:00:00 2001 From: qbnu <93988953+qbnu@users.noreply.github.com> Date: Sun, 31 Dec 2023 22:43:15 -0500 Subject: [PATCH 3/3] [ie/ctvnews] match regex from other examples --- yt_dlp/extractor/ctvnews.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yt_dlp/extractor/ctvnews.py b/yt_dlp/extractor/ctvnews.py index c6cbb3e72..26b1f1d3f 100644 --- a/yt_dlp/extractor/ctvnews.py +++ b/yt_dlp/extractor/ctvnews.py @@ -5,7 +5,7 @@ from ..utils import orderedSet class CTVNewsIE(InfoExtractor): - _VALID_URL = r'https?://(?:.+?\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P[0-9.]+)(?:$|[^\w.-])' + _VALID_URL = r'https?://(?:.+?\.)?ctvnews\.ca/(?:video\?(?:clip|playlist|bin)Id=|.*?)(?P[0-9.]+)(?:$|[#?])' _TESTS = [{ 'url': 'http://www.ctvnews.ca/video?clipId=901995', 'md5': 'b608f466c7fa24b9666c6439d766ab7e',