1 from __future__ import unicode_literals
4 from .lazy_extractors import *
5 from .lazy_extractors import _ALL_CLASSES
7 from .extractors import *
11 for name, klass in globals().items()
12 if name.endswith('IE') and name != 'GenericIE'
14 _ALL_CLASSES.append(GenericIE)
17 def gen_extractor_classes():
18 """ Return a list of supported extractors.
19 The order does matter; the first extractor matched is the one handling the URL.
25 """ Return a list of an instance of every supported extractor.
26 The order does matter; the first extractor matched is the one handling the URL.
28 return [klass() for klass in gen_extractor_classes()]
31 def list_extractors(age_limit):
33 Return a list of extractors that are suitable for the given age,
34 sorted by extractor ID.
38 filter(lambda ie: ie.is_suitable(age_limit), gen_extractors()),
39 key=lambda ie: ie.IE_NAME.lower())
42 def get_info_extractor(ie_name):
43 """Returns the info extractor class with the given ie_name"""
44 return globals()[ie_name + 'IE']