From 9fa2b91f0bde316166413593bb8d6ef0e319587d Mon Sep 17 00:00:00 2001 From: garret Date: Mon, 8 May 2023 17:36:25 +0100 Subject: make BaseIE private prevents the plugin thing from trying to load it as an extractor error this prevents: Traceback (most recent call last): File "/home/g/Downloads/yt-dlp/test/test_download.py", line 160, in test_template res_dict = ydl.extract_info( File "/home/g/Downloads/yt-dlp/yt_dlp/YoutubeDL.py", line 1508, in extract_info if not ie.suitable(url): File "/home/g/Downloads/yt-dlp/yt_dlp/extractor/common.py", line 563, in suitable return cls._match_valid_url(url) is not None File "/home/g/Downloads/yt-dlp/yt_dlp/extractor/common.py", line 555, in _match_valid_url cls._VALID_URL_RE = re.compile(cls._VALID_URL) File "/usr/lib/python3.10/re.py", line 251, in compile return _compile(pattern, flags) File "/usr/lib/python3.10/re.py", line 302, in _compile raise TypeError("first argument must be string or compiled pattern") TypeError: first argument must be string or compiled pattern (BaseIE doesnt have _VALID_URL, so it fails. If I add one, it wants a _real_extract) --- yt_dlp_plugins/extractor/radiko.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'yt_dlp_plugins/extractor') diff --git a/yt_dlp_plugins/extractor/radiko.py b/yt_dlp_plugins/extractor/radiko.py index 103bd64..863c9aa 100755 --- a/yt_dlp_plugins/extractor/radiko.py +++ b/yt_dlp_plugins/extractor/radiko.py @@ -15,7 +15,7 @@ from yt_dlp.utils import ( ) -class RadikoBaseIE(InfoExtractor): +class _RadikoBaseIE(InfoExtractor): _FULL_KEY = base64.b64decode(''' fAu/s1ySbQBAyfugPCOniGTrMcOu5XqKcup3tmrZUAvx3MGtIIZl7wHokm07yxzL/oR9jdgWhi+e WYVoBIiAG4hDOP5H0Og3Qtd9KFnW8s0N4vNN2DzQ1Y4PqDq3HsQszf4ZaDTkyt4FFW9fPqKUtnVR @@ -541,7 +541,7 @@ class RadikoBaseIE(InfoExtractor): ) return formats -class RadikoLiveIE(RadikoBaseIE): +class RadikoLiveIE(_RadikoBaseIE): _VALID_URL = r'https?://(?:www\.)?radiko\.jp/#!/live/(?P[A-Z0-9-]+)' _TESTS = [{ # JP13 (Tokyo) @@ -607,7 +607,7 @@ class RadikoLiveIE(RadikoBaseIE): } -class RadikoTimeFreeIE(RadikoBaseIE): +class RadikoTimeFreeIE(_RadikoBaseIE): _VALID_URL = r'https?://(?:www\.)?radiko\.jp/#!/ts/(?P[A-Z0-9-]+)/(?P\d+)' _TESTS = [{ 'url': 'https://radiko.jp/#!/ts/INT/20230505230000', -- cgit v1.2.3-70-g09d2