mirror of
https://github.com/l1ving/youtube-dl
synced 2025-02-19 18:22:59 +08:00
converted --list-extractors and --extractor-descriptions to docopt
This commit is contained in:
parent
6184f65c06
commit
d2cc1a15d5
@ -343,12 +343,12 @@ def parseOpts(overrideArguments=None):
|
|||||||
#general.add_option('--referer',
|
#general.add_option('--referer',
|
||||||
# dest='referer', help='specify a custom referer, use if the video access is restricted to one domain',
|
# dest='referer', help='specify a custom referer, use if the video access is restricted to one domain',
|
||||||
metavar='REF', default=None)
|
metavar='REF', default=None)
|
||||||
general.add_option('--list-extractors',
|
#general.add_option('--list-extractors',
|
||||||
action='store_true', dest='list_extractors',
|
# action='store_true', dest='list_extractors',
|
||||||
help='List all supported extractors and the URLs they would handle', default=False)
|
# help='List all supported extractors and the URLs they would handle', default=False)
|
||||||
general.add_option('--extractor-descriptions',
|
#general.add_option('--extractor-descriptions',
|
||||||
action='store_true', dest='list_extractor_descriptions',
|
# action='store_true', dest='list_extractor_descriptions',
|
||||||
help='Output descriptions of all supported extractors', default=False)
|
# help='Output descriptions of all supported extractors', default=False)
|
||||||
#general.add_option('--proxy', dest='proxy', default=None, help='Use the specified HTTP/HTTPS proxy', metavar='URL')
|
#general.add_option('--proxy', dest='proxy', default=None, help='Use the specified HTTP/HTTPS proxy', metavar='URL')
|
||||||
#general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.')
|
#general.add_option('--no-check-certificate', action='store_true', dest='no_check_certificate', default=False, help='Suppress HTTPS certificate validation.')
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ def _real_main(argv=None):
|
|||||||
|
|
||||||
extractors = gen_extractors()
|
extractors = gen_extractors()
|
||||||
|
|
||||||
if opts.list_extractors:
|
if opts['--list-extractors']:
|
||||||
for ie in sorted(extractors, key=lambda ie: ie.IE_NAME.lower()):
|
for ie in sorted(extractors, key=lambda ie: ie.IE_NAME.lower()):
|
||||||
compat_print(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie._WORKING else ''))
|
compat_print(ie.IE_NAME + (' (CURRENTLY BROKEN)' if not ie._WORKING else ''))
|
||||||
matchedUrls = [url for url in all_urls if ie.suitable(url)]
|
matchedUrls = [url for url in all_urls if ie.suitable(url)]
|
||||||
@ -643,7 +643,7 @@ def _real_main(argv=None):
|
|||||||
for mu in matchedUrls:
|
for mu in matchedUrls:
|
||||||
compat_print(u' ' + mu)
|
compat_print(u' ' + mu)
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
if opts.list_extractor_descriptions:
|
if opts['--extractor-descriptions']:
|
||||||
for ie in sorted(extractors, key=lambda ie: ie.IE_NAME.lower()):
|
for ie in sorted(extractors, key=lambda ie: ie.IE_NAME.lower()):
|
||||||
if not ie._WORKING:
|
if not ie._WORKING:
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user