1 from __future__ import unicode_literals
3 from .extractors import *
7 for name, klass in globals().items()
8 if name.endswith('IE') and name != 'GenericIE'
10 _ALL_CLASSES.append(GenericIE)
13 def gen_extractor_classes():
14 """ Return a list of supported extractors.
15 The order does matter; the first extractor matched is the one handling the URL.
21 """ Return a list of an instance of every supported extractor.
22 The order does matter; the first extractor matched is the one handling the URL.
24 return [klass() for klass in gen_extractor_classes()]
27 def list_extractors(age_limit):
29 Return a list of extractors that are suitable for the given age,
30 sorted by extractor ID.
34 filter(lambda ie: ie.is_suitable(age_limit), gen_extractors()),
35 key=lambda ie: ie.IE_NAME.lower())
38 def get_info_extractor(ie_name):
39 """Returns the info extractor class with the given ie_name"""
40 return globals()[ie_name + 'IE']