aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/extractor/__init__.py')
-rw-r--r--yt_dlp/extractor/__init__.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/yt_dlp/extractor/__init__.py b/yt_dlp/extractor/__init__.py
index 506ffe87c..afd3d05ac 100644
--- a/yt_dlp/extractor/__init__.py
+++ b/yt_dlp/extractor/__init__.py
@@ -37,11 +37,17 @@ def gen_extractors():
return [klass() for klass in gen_extractor_classes()]
-def list_extractors(age_limit):
+def list_extractor_classes(age_limit=None):
"""Return a list of extractors that are suitable for the given age, sorted by extractor name"""
- return sorted(filter(
- lambda ie: ie.is_suitable(age_limit),
- gen_extractors()), key=lambda ie: ie.IE_NAME.lower())
+ yield from sorted(filter(
+ lambda ie: ie.is_suitable(age_limit) and ie != GenericIE, # noqa: F405
+ gen_extractor_classes()), key=lambda ie: ie.IE_NAME.lower())
+ yield GenericIE # noqa: F405
+
+
+def list_extractors(age_limit=None):
+ """Return a list of extractor instances that are suitable for the given age, sorted by extractor name"""
+ return [ie() for ie in list_extractor_classes(age_limit)]
def get_info_extractor(ie_name):