From a687226b48f71b874fa18b0165ec528d591f53fb Mon Sep 17 00:00:00 2001 From: sepro <4618135+seproDev@users.noreply.github.com> Date: Thu, 1 Feb 2024 19:38:42 +0100 Subject: [PATCH] [cleanup, ie] Match both `http` and `https` in `_VALID_URL` (#8968) Except for Vimeo, since that causes matching collisions. Authored by: seproDev --- yt_dlp/extractor/beatbump.py | 4 ++-- yt_dlp/extractor/cableav.py | 2 +- yt_dlp/extractor/camfm.py | 4 ++-- yt_dlp/extractor/cineverse.py | 2 +- yt_dlp/extractor/cybrary.py | 2 +- yt_dlp/extractor/duoplay.py | 2 +- yt_dlp/extractor/egghead.py | 4 ++-- yt_dlp/extractor/itprotv.py | 2 +- yt_dlp/extractor/kommunetv.py | 2 +- yt_dlp/extractor/lecturio.py | 4 ++-- yt_dlp/extractor/megaphone.py | 2 +- yt_dlp/extractor/monstercat.py | 2 +- yt_dlp/extractor/newspicks.py | 2 +- yt_dlp/extractor/novaplay.py | 2 +- yt_dlp/extractor/nzonscreen.py | 2 +- yt_dlp/extractor/parler.py | 2 +- yt_dlp/extractor/rbgtum.py | 6 +++--- yt_dlp/extractor/rcti.py | 6 +++--- yt_dlp/extractor/telequebec.py | 2 +- yt_dlp/extractor/vice.py | 2 +- 20 files changed, 28 insertions(+), 28 deletions(-) diff --git a/yt_dlp/extractor/beatbump.py b/yt_dlp/extractor/beatbump.py index f48566b2d..777a1b326 100644 --- a/yt_dlp/extractor/beatbump.py +++ b/yt_dlp/extractor/beatbump.py @@ -3,7 +3,7 @@ from .youtube import YoutubeIE, YoutubeTabIE class BeatBumpVideoIE(InfoExtractor): - _VALID_URL = r'https://beatbump\.(?:ml|io)/listen\?id=(?P[\w-]+)' + _VALID_URL = r'https?://beatbump\.(?:ml|io)/listen\?id=(?P[\w-]+)' _TESTS = [{ 'url': 'https://beatbump.ml/listen?id=MgNrAu2pzNs', 'md5': '5ff3fff41d3935b9810a9731e485fe66', @@ -48,7 +48,7 @@ class BeatBumpVideoIE(InfoExtractor): class BeatBumpPlaylistIE(InfoExtractor): - _VALID_URL = r'https://beatbump\.(?:ml|io)/(?:release\?id=|artist/|playlist/)(?P[\w-]+)' + _VALID_URL = r'https?://beatbump\.(?:ml|io)/(?:release\?id=|artist/|playlist/)(?P[\w-]+)' _TESTS = [{ 'url': 'https://beatbump.ml/release?id=MPREb_gTAcphH99wE', 'playlist_count': 50, diff --git a/yt_dlp/extractor/cableav.py b/yt_dlp/extractor/cableav.py index 2e374e5eb..4a221414e 100644 --- a/yt_dlp/extractor/cableav.py +++ b/yt_dlp/extractor/cableav.py @@ -2,7 +2,7 @@ from .common import InfoExtractor class CableAVIE(InfoExtractor): - _VALID_URL = r'https://cableav\.tv/(?P[a-zA-Z0-9]+)' + _VALID_URL = r'https?://cableav\.tv/(?P[a-zA-Z0-9]+)' _TESTS = [{ 'url': 'https://cableav.tv/lS4iR9lWjN8/', 'md5': '7e3fe5e49d61c4233b7f5b0f69b15e18', diff --git a/yt_dlp/extractor/camfm.py b/yt_dlp/extractor/camfm.py index a9850f46e..11dafa4a2 100644 --- a/yt_dlp/extractor/camfm.py +++ b/yt_dlp/extractor/camfm.py @@ -13,7 +13,7 @@ from ..utils import ( class CamFMShowIE(InfoExtractor): - _VALID_URL = r'https://(?:www\.)?camfm\.co\.uk/shows/(?P[^/]+)' + _VALID_URL = r'https?://(?:www\.)?camfm\.co\.uk/shows/(?P[^/]+)' _TESTS = [{ 'playlist_mincount': 5, 'url': 'https://camfm.co.uk/shows/soul-mining/', @@ -42,7 +42,7 @@ class CamFMShowIE(InfoExtractor): class CamFMEpisodeIE(InfoExtractor): - _VALID_URL = r'https://(?:www\.)?camfm\.co\.uk/player/(?P[^/]+)' + _VALID_URL = r'https?://(?:www\.)?camfm\.co\.uk/player/(?P[^/]+)' _TESTS = [{ 'url': 'https://camfm.co.uk/player/43336', 'skip': 'Episode will expire - don\'t actually know when, but it will go eventually', diff --git a/yt_dlp/extractor/cineverse.py b/yt_dlp/extractor/cineverse.py index 032c4334b..4405297c6 100644 --- a/yt_dlp/extractor/cineverse.py +++ b/yt_dlp/extractor/cineverse.py @@ -13,7 +13,7 @@ from ..utils import ( class CineverseBaseIE(InfoExtractor): - _VALID_URL_BASE = r'https://www\.(?P%s)' % '|'.join(map(re.escape, ( + _VALID_URL_BASE = r'https?://www\.(?P%s)' % '|'.join(map(re.escape, ( 'cineverse.com', 'asiancrush.com', 'dovechannel.com', diff --git a/yt_dlp/extractor/cybrary.py b/yt_dlp/extractor/cybrary.py index 614d0cd9e..c6995b25b 100644 --- a/yt_dlp/extractor/cybrary.py +++ b/yt_dlp/extractor/cybrary.py @@ -110,7 +110,7 @@ class CybraryIE(CybraryBaseIE): class CybraryCourseIE(CybraryBaseIE): - _VALID_URL = r'https://app\.cybrary\.it/browse/course/(?P[\w-]+)/?(?:$|[#?])' + _VALID_URL = r'https?://app\.cybrary\.it/browse/course/(?P[\w-]+)/?(?:$|[#?])' _TESTS = [{ 'url': 'https://app.cybrary.it/browse/course/az-500-microsoft-azure-security-technologies', 'info_dict': { diff --git a/yt_dlp/extractor/duoplay.py b/yt_dlp/extractor/duoplay.py index ebce0b5f2..18642fea3 100644 --- a/yt_dlp/extractor/duoplay.py +++ b/yt_dlp/extractor/duoplay.py @@ -13,7 +13,7 @@ from ..utils.traversal import traverse_obj class DuoplayIE(InfoExtractor): - _VALID_URL = r'https://duoplay\.ee/(?P\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P\d+))?' + _VALID_URL = r'https?://duoplay\.ee/(?P\d+)/[\w-]+/?(?:\?(?:[^#]+&)?ep=(?P\d+))?' _TESTS = [{ 'note': 'Siberi võmm S02E12', 'url': 'https://duoplay.ee/4312/siberi-vomm?ep=24', diff --git a/yt_dlp/extractor/egghead.py b/yt_dlp/extractor/egghead.py index a4b2a12f6..c94f3f81f 100644 --- a/yt_dlp/extractor/egghead.py +++ b/yt_dlp/extractor/egghead.py @@ -19,7 +19,7 @@ class EggheadBaseIE(InfoExtractor): class EggheadCourseIE(EggheadBaseIE): IE_DESC = 'egghead.io course' IE_NAME = 'egghead:course' - _VALID_URL = r'https://(?:app\.)?egghead\.io/(?:course|playlist)s/(?P[^/?#&]+)' + _VALID_URL = r'https?://(?:app\.)?egghead\.io/(?:course|playlist)s/(?P[^/?#&]+)' _TESTS = [{ 'url': 'https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript', 'playlist_count': 29, @@ -65,7 +65,7 @@ class EggheadCourseIE(EggheadBaseIE): class EggheadLessonIE(EggheadBaseIE): IE_DESC = 'egghead.io lesson' IE_NAME = 'egghead:lesson' - _VALID_URL = r'https://(?:app\.)?egghead\.io/(?:api/v1/)?lessons/(?P[^/?#&]+)' + _VALID_URL = r'https?://(?:app\.)?egghead\.io/(?:api/v1/)?lessons/(?P[^/?#&]+)' _TESTS = [{ 'url': 'https://egghead.io/lessons/javascript-linear-data-flow-with-container-style-types-box', 'info_dict': { diff --git a/yt_dlp/extractor/itprotv.py b/yt_dlp/extractor/itprotv.py index b9d5c196d..713fd4ec5 100644 --- a/yt_dlp/extractor/itprotv.py +++ b/yt_dlp/extractor/itprotv.py @@ -31,7 +31,7 @@ class ITProTVBaseIE(InfoExtractor): class ITProTVIE(ITProTVBaseIE): - _VALID_URL = r'https://app\.itpro\.tv/course/(?P[\w-]+)/(?P[\w-]+)' + _VALID_URL = r'https?://app\.itpro\.tv/course/(?P[\w-]+)/(?P[\w-]+)' _TESTS = [{ 'url': 'https://app.itpro.tv/course/guided-tour/introductionitprotv', 'md5': 'bca4a28c2667fd1a63052e71a94bb88c', diff --git a/yt_dlp/extractor/kommunetv.py b/yt_dlp/extractor/kommunetv.py index a30905b57..432816cd8 100644 --- a/yt_dlp/extractor/kommunetv.py +++ b/yt_dlp/extractor/kommunetv.py @@ -3,7 +3,7 @@ from ..utils import update_url class KommunetvIE(InfoExtractor): - _VALID_URL = r'https://\w+\.kommunetv\.no/archive/(?P\w+)' + _VALID_URL = r'https?://\w+\.kommunetv\.no/archive/(?P\w+)' _TEST = { 'url': 'https://oslo.kommunetv.no/archive/921', 'md5': '5f102be308ee759be1e12b63d5da4bbc', diff --git a/yt_dlp/extractor/lecturio.py b/yt_dlp/extractor/lecturio.py index 795012541..629d208fc 100644 --- a/yt_dlp/extractor/lecturio.py +++ b/yt_dlp/extractor/lecturio.py @@ -172,7 +172,7 @@ class LecturioIE(LecturioBaseIE): class LecturioCourseIE(LecturioBaseIE): - _VALID_URL = r'https://app\.lecturio\.com/(?:[^/]+/(?P[^/?#&]+)\.course|(?:#/)?course/c/(?P\d+))' + _VALID_URL = r'https?://app\.lecturio\.com/(?:[^/]+/(?P[^/?#&]+)\.course|(?:#/)?course/c/(?P\d+))' _TESTS = [{ 'url': 'https://app.lecturio.com/medical-courses/microbiology-introduction.course#/', 'info_dict': { @@ -209,7 +209,7 @@ class LecturioCourseIE(LecturioBaseIE): class LecturioDeCourseIE(LecturioBaseIE): - _VALID_URL = r'https://(?:www\.)?lecturio\.de/[^/]+/(?P[^/?#&]+)\.kurs' + _VALID_URL = r'https?://(?:www\.)?lecturio\.de/[^/]+/(?P[^/?#&]+)\.kurs' _TEST = { 'url': 'https://www.lecturio.de/jura/grundrechte.kurs', 'only_matching': True, diff --git a/yt_dlp/extractor/megaphone.py b/yt_dlp/extractor/megaphone.py index eb790e691..d249a8492 100644 --- a/yt_dlp/extractor/megaphone.py +++ b/yt_dlp/extractor/megaphone.py @@ -5,7 +5,7 @@ from ..utils import js_to_json class MegaphoneIE(InfoExtractor): IE_NAME = 'megaphone.fm' IE_DESC = 'megaphone.fm embedded players' - _VALID_URL = r'https://player\.megaphone\.fm/(?P[A-Z0-9]+)' + _VALID_URL = r'https?://player\.megaphone\.fm/(?P[A-Z0-9]+)' _EMBED_REGEX = [rf']*?\ssrc=["\'](?P{_VALID_URL})'] _TEST = { 'url': 'https://player.megaphone.fm/GLT9749789991', diff --git a/yt_dlp/extractor/monstercat.py b/yt_dlp/extractor/monstercat.py index cf5e09969..a69a12e18 100644 --- a/yt_dlp/extractor/monstercat.py +++ b/yt_dlp/extractor/monstercat.py @@ -16,7 +16,7 @@ from ..utils import ( class MonstercatIE(InfoExtractor): - _VALID_URL = r'https://www\.monstercat\.com/release/(?P\d+)' + _VALID_URL = r'https?://www\.monstercat\.com/release/(?P\d+)' _TESTS = [{ 'url': 'https://www.monstercat.com/release/742779548009', 'playlist_count': 20, diff --git a/yt_dlp/extractor/newspicks.py b/yt_dlp/extractor/newspicks.py index b6334dcba..4a1cb0a73 100644 --- a/yt_dlp/extractor/newspicks.py +++ b/yt_dlp/extractor/newspicks.py @@ -5,7 +5,7 @@ from ..utils import ExtractorError class NewsPicksIE(InfoExtractor): - _VALID_URL = r'https://newspicks\.com/movie-series/(?P\d+)\?movieId=(?P\d+)' + _VALID_URL = r'https?://newspicks\.com/movie-series/(?P\d+)\?movieId=(?P\d+)' _TESTS = [{ 'url': 'https://newspicks.com/movie-series/11?movieId=1813', diff --git a/yt_dlp/extractor/novaplay.py b/yt_dlp/extractor/novaplay.py index 77ae03fd0..adab33f59 100644 --- a/yt_dlp/extractor/novaplay.py +++ b/yt_dlp/extractor/novaplay.py @@ -3,7 +3,7 @@ from ..utils import int_or_none, parse_duration, parse_iso8601 class NovaPlayIE(InfoExtractor): - _VALID_URL = r'https://play\.nova\.bg/video/[^?#]+/(?P\d+)' + _VALID_URL = r'https?://play\.nova\.bg/video/[^?#]+/(?P\d+)' _TESTS = [ { 'url': 'https://play.nova.bg/video/ochakvaite/season-0/ochakvaite-2022-07-22-sybudi-se-sat/606627', diff --git a/yt_dlp/extractor/nzonscreen.py b/yt_dlp/extractor/nzonscreen.py index 6926bc5b2..bf2dbca59 100644 --- a/yt_dlp/extractor/nzonscreen.py +++ b/yt_dlp/extractor/nzonscreen.py @@ -10,7 +10,7 @@ from ..utils import ( class NZOnScreenIE(InfoExtractor): - _VALID_URL = r'^https://www\.nzonscreen\.com/title/(?P[^/?#]+)' + _VALID_URL = r'^https?://www\.nzonscreen\.com/title/(?P[^/?#]+)' _TESTS = [{ 'url': 'https://www.nzonscreen.com/title/shoop-shoop-diddy-wop-cumma-cumma-wang-dang-1982', 'info_dict': { diff --git a/yt_dlp/extractor/parler.py b/yt_dlp/extractor/parler.py index 2af805e7f..563012f35 100644 --- a/yt_dlp/extractor/parler.py +++ b/yt_dlp/extractor/parler.py @@ -14,7 +14,7 @@ from ..utils import ( class ParlerIE(InfoExtractor): IE_DESC = 'Posts on parler.com' - _VALID_URL = r'https://parler\.com/feed/(?P[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})' + _VALID_URL = r'https?://parler\.com/feed/(?P[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12})' _TESTS = [ { 'url': 'https://parler.com/feed/df79fdba-07cc-48fe-b085-3293897520d7', diff --git a/yt_dlp/extractor/rbgtum.py b/yt_dlp/extractor/rbgtum.py index c8a331f3e..54f194cbd 100644 --- a/yt_dlp/extractor/rbgtum.py +++ b/yt_dlp/extractor/rbgtum.py @@ -5,7 +5,7 @@ from ..utils import parse_qs, remove_start, traverse_obj, ExtractorError class RbgTumIE(InfoExtractor): - _VALID_URL = r'https://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P[^?#]+)' + _VALID_URL = r'https?://(?:live\.rbg\.tum\.de|tum\.live)/w/(?P[^?#]+)' _TESTS = [{ # Combined view 'url': 'https://live.rbg.tum.de/w/cpp/22128', @@ -60,7 +60,7 @@ class RbgTumIE(InfoExtractor): class RbgTumCourseIE(InfoExtractor): - _VALID_URL = r'https://(?P(?:live\.rbg\.tum\.de|tum\.live))/old/course/(?P(?P\d+)/(?P\w+)/(?P[^/?#]+))' + _VALID_URL = r'https?://(?P(?:live\.rbg\.tum\.de|tum\.live))/old/course/(?P(?P\d+)/(?P\w+)/(?P[^/?#]+))' _TESTS = [{ 'url': 'https://live.rbg.tum.de/old/course/2022/S/fpv', 'info_dict': { @@ -105,7 +105,7 @@ class RbgTumCourseIE(InfoExtractor): class RbgTumNewCourseIE(InfoExtractor): - _VALID_URL = r'https://(?P(?:live\.rbg\.tum\.de|tum\.live))/\?' + _VALID_URL = r'https?://(?P(?:live\.rbg\.tum\.de|tum\.live))/\?' _TESTS = [{ 'url': 'https://live.rbg.tum.de/?year=2022&term=S&slug=fpv&view=3', 'info_dict': { diff --git a/yt_dlp/extractor/rcti.py b/yt_dlp/extractor/rcti.py index 2f50efeda..6a7c7f399 100644 --- a/yt_dlp/extractor/rcti.py +++ b/yt_dlp/extractor/rcti.py @@ -28,7 +28,7 @@ class RCTIPlusBaseIE(InfoExtractor): class RCTIPlusIE(RCTIPlusBaseIE): - _VALID_URL = r'https://www\.rctiplus\.com/(?:programs/\d+?/.*?/)?(?Pepisode|clip|extra|live-event|missed-event)/(?P\d+)/(?P[^/?#&]+)' + _VALID_URL = r'https?://www\.rctiplus\.com/(?:programs/\d+?/.*?/)?(?Pepisode|clip|extra|live-event|missed-event)/(?P\d+)/(?P[^/?#&]+)' _TESTS = [{ 'url': 'https://www.rctiplus.com/programs/1259/kiko-untuk-lola/episode/22124/untuk-lola', 'md5': '56ed45affad45fa18d5592a1bc199997', @@ -218,7 +218,7 @@ class RCTIPlusIE(RCTIPlusBaseIE): class RCTIPlusSeriesIE(RCTIPlusBaseIE): - _VALID_URL = r'https://www\.rctiplus\.com/programs/(?P\d+)/(?P[^/?#&]+)(?:/(?Pepisodes|extras|clips))?' + _VALID_URL = r'https?://www\.rctiplus\.com/programs/(?P\d+)/(?P[^/?#&]+)(?:/(?Pepisodes|extras|clips))?' _TESTS = [{ 'url': 'https://www.rctiplus.com/programs/829/putri-untuk-pangeran', 'playlist_mincount': 1019, @@ -336,7 +336,7 @@ class RCTIPlusSeriesIE(RCTIPlusBaseIE): class RCTIPlusTVIE(RCTIPlusBaseIE): - _VALID_URL = r'https://www\.rctiplus\.com/((tv/(?P\w+))|(?Plive-event|missed-event))' + _VALID_URL = r'https?://www\.rctiplus\.com/((tv/(?P\w+))|(?Plive-event|missed-event))' _TESTS = [{ 'url': 'https://www.rctiplus.com/tv/rcti', 'info_dict': { diff --git a/yt_dlp/extractor/telequebec.py b/yt_dlp/extractor/telequebec.py index e89137269..08a083714 100644 --- a/yt_dlp/extractor/telequebec.py +++ b/yt_dlp/extractor/telequebec.py @@ -83,7 +83,7 @@ class TeleQuebecIE(TeleQuebecBaseIE): class TeleQuebecSquatIE(InfoExtractor): - _VALID_URL = r'https://squat\.telequebec\.tv/videos/(?P\d+)' + _VALID_URL = r'https?://squat\.telequebec\.tv/videos/(?P\d+)' _TESTS = [{ 'url': 'https://squat.telequebec.tv/videos/9314', 'info_dict': { diff --git a/yt_dlp/extractor/vice.py b/yt_dlp/extractor/vice.py index 1a2d667e7..d31908fb1 100644 --- a/yt_dlp/extractor/vice.py +++ b/yt_dlp/extractor/vice.py @@ -224,7 +224,7 @@ class ViceShowIE(ViceBaseIE): class ViceArticleIE(ViceBaseIE): IE_NAME = 'vice:article' - _VALID_URL = r'https://(?:www\.)?vice\.com/(?P[^/]+)/article/(?:[0-9a-z]{6}/)?(?P[^?#]+)' + _VALID_URL = r'https?://(?:www\.)?vice\.com/(?P[^/]+)/article/(?:[0-9a-z]{6}/)?(?P[^?#]+)' _TESTS = [{ 'url': 'https://www.vice.com/en_us/article/on-set-with-the-woman-making-mormon-porn-in-utah',