diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2015-01-07 07:30:57 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2015-01-07 07:30:57 +0100 |
commit | e4a8eae701f22395dae607ed000d39f7a57e80a0 (patch) | |
tree | ff33173e1320f25a6af60140c3cd4ff98346d2c3 /youtube_dl/extractor/__init__.py | |
parent | 75e51819d010b38d9a3464f8749688c8d53fc123 (diff) | |
parent | 8ee341500dea885c79316fb8f12adde2028c55a5 (diff) |
Merge commit '8ee3415'
Diffstat (limited to 'youtube_dl/extractor/__init__.py')
-rw-r--r-- | youtube_dl/extractor/__init__.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/youtube_dl/extractor/__init__.py b/youtube_dl/extractor/__init__.py index b523e9644..0145e350d 100644 --- a/youtube_dl/extractor/__init__.py +++ b/youtube_dl/extractor/__init__.py @@ -560,6 +560,8 @@ from .zingmp3 import ( ZingMp3AlbumIE, ) +from ..utils import age_restricted + _ALL_CLASSES = [ klass for name, klass in globals().items() @@ -575,6 +577,17 @@ def gen_extractors(): return [klass() for klass in _ALL_CLASSES] +def list_extractors(age_limit): + """ + Return a list of extractors that are suitable for the given age, + sorted by extractor ID. + """ + + return sorted( + filter(lambda ie: ie.is_suitable(age_limit), gen_extractors()), + key=lambda ie: ie.IE_NAME.lower()) + + def get_info_extractor(ie_name): """Returns the info extractor class with the given ie_name""" return globals()[ie_name + 'IE'] |