1 from __future__ import unicode_literals
4 from .lazy_extractors import *
5 from .lazy_extractors import _ALL_CLASSES
9 from .extractors import *
13 for name, klass in globals().items()
14 if name.endswith('IE') and name != 'GenericIE'
16 _ALL_CLASSES.append(GenericIE)
19 def gen_extractor_classes():
20 """ Return a list of supported extractors.
21 The order does matter; the first extractor matched is the one handling the URL.
27 """ Return a list of an instance of every supported extractor.
28 The order does matter; the first extractor matched is the one handling the URL.
30 return [klass() for klass in gen_extractor_classes()]
33 def list_extractors(age_limit):
35 Return a list of extractors that are suitable for the given age,
36 sorted by extractor ID.
40 filter(lambda ie: ie.is_suitable(age_limit), gen_extractors()),
41 key=lambda ie: ie.IE_NAME.lower())
44 def get_info_extractor(ie_name):
45 """Returns the info extractor class with the given ie_name"""
46 return globals()[ie_name + 'IE']