[ie/wistia] Support password-protected videos (#11100)
[yt-dlp3.git] / yt_dlp / extractor / __init__.py
blob6bfa4bd7bbedbb69c8120e1e0d3d2f5586df09f3
1 from ..compat.compat_utils import passthrough_module
3 passthrough_module(__name__, '.extractors')
4 del passthrough_module
7 def gen_extractor_classes():
8 """ Return a list of supported extractors.
9 The order does matter; the first extractor matched is the one handling the URL.
10 """
11 from .extractors import _ALL_CLASSES
13 return _ALL_CLASSES
16 def gen_extractors():
17 """ Return a list of an instance of every supported extractor.
18 The order does matter; the first extractor matched is the one handling the URL.
19 """
20 return [klass() for klass in gen_extractor_classes()]
23 def list_extractor_classes(age_limit=None):
24 """Return a list of extractors that are suitable for the given age, sorted by extractor name"""
25 from .generic import GenericIE
27 yield from sorted(filter(
28 lambda ie: ie.is_suitable(age_limit) and ie != GenericIE,
29 gen_extractor_classes()), key=lambda ie: ie.IE_NAME.lower())
30 yield GenericIE
33 def list_extractors(age_limit=None):
34 """Return a list of extractor instances that are suitable for the given age, sorted by extractor name"""
35 return [ie() for ie in list_extractor_classes(age_limit)]
38 def get_info_extractor(ie_name):
39 """Returns the info extractor class with the given ie_name"""
40 from . import extractors
42 return getattr(extractors, f'{ie_name}IE')