mirror of
https://github.com/soimort/you-get.git
synced 2025-02-02 16:24:00 +03:00
[common] option -d is short for --debug
This commit is contained in:
parent
406a5962e4
commit
9875939d18
@ -987,32 +987,35 @@ def download_main(download, download_playlist, urls, playlist, **kwargs):
|
|||||||
|
|
||||||
def script_main(script_name, download, download_playlist, **kwargs):
|
def script_main(script_name, download, download_playlist, **kwargs):
|
||||||
def version():
|
def version():
|
||||||
log.i('version %s' % get_version(kwargs['repo_path']
|
log.i('version %s, a tiny downloader that scrapes the web.'
|
||||||
|
% get_version(kwargs['repo_path']
|
||||||
if 'repo_path' in kwargs else __version__))
|
if 'repo_path' in kwargs else __version__))
|
||||||
|
|
||||||
help = 'Usage: %s [OPTION]... [URL]...\n' % script_name
|
help = 'Usage: %s [OPTION]... [URL]...\n\n' % script_name
|
||||||
help += '''\nStartup options:
|
help += '''Startup options:
|
||||||
-V | --version Display the version and exit.
|
-V | --version Print version and exit.
|
||||||
-h | --help Print this help and exit.
|
-h | --help Print help and exit.
|
||||||
'''
|
\n'''
|
||||||
help += '''\nDownload options (use with URLs):
|
help += '''Dry-run options: (no actual downloading)
|
||||||
-f | --force Force overwriting existed files.
|
-i | --info Print extracted information.
|
||||||
-i | --info Display the information of videos without downloading.
|
-u | --url Print extracted information with URLs.
|
||||||
-u | --url Display the real URLs of videos without downloading.
|
--json Print extracted URLs in JSON format.
|
||||||
-c | --cookies Load cookies.txt or cookies.sqlite.
|
\n'''
|
||||||
-n | --no-merge Don't merge video parts.
|
help += '''Download options:
|
||||||
-F | --format <STREAM_ID> Video format code.
|
-n | --no-merge Do not merge video parts.
|
||||||
-O | --output-filename <FILE> Set the output filename.
|
-f | --force Force overwriting existed files.
|
||||||
-o | --output-dir <PATH> Set the output directory for downloaded videos.
|
-F | --format <STREAM_ID> Set video format to STREAM_ID.
|
||||||
-p | --player <PLAYER [options]> Directly play the video with PLAYER like vlc/smplayer.
|
-O | --output-filename <FILE> Set output filename.
|
||||||
-x | --http-proxy <HOST:PORT> Use specific HTTP proxy for downloading.
|
-o | --output-dir <PATH> Set output directory.
|
||||||
-y | --extractor-proxy <HOST:PORT> Use specific HTTP proxy for extracting stream data.
|
-p | --player <PLAYER [OPTIONS]> Stream extracted URL to a PLAYER.
|
||||||
--no-proxy Don't use any proxy. (ignore $http_proxy)
|
-c | --cookies <COOKIES_FILE> Load cookies.txt or cookies.sqlite.
|
||||||
--debug Show traceback on KeyboardInterrupt.
|
-x | --http-proxy <HOST:PORT> Use an HTTP proxy for downloading.
|
||||||
--json Output the information of videos in json text without downloading.
|
-y | --extractor-proxy <HOST:PORT> Use an HTTP proxy for extracting only.
|
||||||
|
--no-proxy Never use a proxy.
|
||||||
|
-d | --debug Show traceback for debugging.
|
||||||
'''
|
'''
|
||||||
|
|
||||||
short_opts = 'Vhfiuc:nF:O:o:p:x:y:'
|
short_opts = 'Vhfiuc:ndF:O:o:p:x:y:'
|
||||||
opts = ['version', 'help', 'force', 'info', 'url', 'cookies', 'no-merge', 'no-proxy', 'debug', 'json', 'format=', 'stream=', 'itag=', 'output-filename=', 'output-dir=', 'player=', 'http-proxy=', 'extractor-proxy=', 'lang=']
|
opts = ['version', 'help', 'force', 'info', 'url', 'cookies', 'no-merge', 'no-proxy', 'debug', 'json', 'format=', 'stream=', 'itag=', 'output-filename=', 'output-dir=', 'player=', 'http-proxy=', 'extractor-proxy=', 'lang=']
|
||||||
if download_playlist:
|
if download_playlist:
|
||||||
short_opts = 'l' + short_opts
|
short_opts = 'l' + short_opts
|
||||||
@ -1094,7 +1097,7 @@ def script_main(script_name, download, download_playlist, **kwargs):
|
|||||||
merge = False
|
merge = False
|
||||||
elif o in ('--no-proxy',):
|
elif o in ('--no-proxy',):
|
||||||
proxy = ''
|
proxy = ''
|
||||||
elif o in ('--debug',):
|
elif o in ('-d', '--debug'):
|
||||||
traceback = True
|
traceback = True
|
||||||
elif o in ('-F', '--format', '--stream', '--itag'):
|
elif o in ('-F', '--format', '--stream', '--itag'):
|
||||||
stream_id = a
|
stream_id = a
|
||||||
|
Loading…
Reference in New Issue
Block a user