diff options
author | Philipp Hagemeister <[email protected]> | 2015-01-07 07:20:20 +0100 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2015-01-07 07:20:20 +0100 |
commit | 059006292523264f4e7c7e03df3729612af8099c (patch) | |
tree | 8d1e12c32a966aeb373dd972838febe1d591061d /youtube_dl/__init__.py | |
parent | 76b3c61012b5cd5a539e2a1a121d11427e6c4c6d (diff) | |
download | youtube-dl-059006292523264f4e7c7e03df3729612af8099c.tar.gz youtube-dl-059006292523264f4e7c7e03df3729612af8099c.zip |
Respect age_limit when listing extractors (Fixes #4653)
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r-- | youtube_dl/__init__.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index 56f560d26..4c21188a9 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -38,7 +38,7 @@ from .update import update_self from .downloader import ( FileDownloader, ) -from .extractor import gen_extractors +from .extractor import list_extractors from .YoutubeDL import YoutubeDL @@ -95,17 +95,15 @@ def _real_main(argv=None): _enc = preferredencoding() all_urls = [url.decode(_enc, 'ignore') if isinstance(url, bytes) else url for url in all_urls] - extractors = gen_extractors() - if opts.list_extractors: - for ie in sorted(extractors, key=lambda ie: ie.IE_NAME.lower()): + for ie in list_extractors(opts.age_limit): compat_print(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie._WORKING else '')) matchedUrls = [url for url in all_urls if ie.suitable(url)] for mu in matchedUrls: compat_print(' ' + mu) sys.exit(0) if opts.list_extractor_descriptions: - for ie in sorted(extractors, key=lambda ie: ie.IE_NAME.lower()): + for ie in list_extractors(opts.age_limit): if not ie._WORKING: continue desc = getattr(ie, 'IE_DESC', ie.IE_NAME) |