aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/testurl.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/testurl.py')
-rw-r--r--yt_dlp/extractor/testurl.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/yt_dlp/extractor/testurl.py b/yt_dlp/extractor/testurl.py
index dccca1004..0da01aa53 100644
--- a/yt_dlp/extractor/testurl.py
+++ b/yt_dlp/extractor/testurl.py
@@ -23,11 +23,12 @@ class TestURLIE(InfoExtractor):
if len(matching_extractors) == 0:
raise ExtractorError(f'No extractors matching {extractor_id!r} found', expected=True)
elif len(matching_extractors) > 1:
- try: # Check for exact match
- extractor = next(
- ie for ie in matching_extractors
- if ie.IE_NAME.lower() == extractor_id.lower())
- except StopIteration:
+ extractor = next(( # Check for exact match
+ ie for ie in matching_extractors if ie.IE_NAME.lower() == extractor_id.lower()
+ ), None) or next(( # Check for exact match without plugin suffix
+ ie for ie in matching_extractors if ie.IE_NAME.split('+')[0].lower() == extractor_id.lower()
+ ), None)
+ if not extractor:
raise ExtractorError(
'Found multiple matching extractors: %s' % ' '.join(ie.IE_NAME for ie in matching_extractors),
expected=True)