1 from ..compat
.compat_utils
import passthrough_module
3 passthrough_module(__name__
, '.extractors')
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.
11 from .extractors
import _ALL_CLASSES
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.
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())
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')