Improve usage help

This commit is contained in:
ritiek
2018-04-08 16:17:15 +05:30
parent fc226442fe
commit 1e1a74f7f4
2 changed files with 62 additions and 46 deletions

View File

@@ -81,7 +81,7 @@ def override_config(config_file, parser, raw_args=None):
def get_arguments(raw_args=None, to_group=True, to_merge=True):
parser = argparse.ArgumentParser(
description='Download and convert songs from Spotify, Youtube etc.',
description='Download and convert tracks from Spotify, Youtube etc.',
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
if to_merge:
@@ -94,66 +94,74 @@ def get_arguments(raw_args=None, to_group=True, to_merge=True):
group = parser.add_mutually_exclusive_group(required=True)
group.add_argument(
'-s', '--song', help='download song by spotify link or name')
'-s', '--song',
help='download track by spotify link or name')
group.add_argument(
'-l', '--list', help='download songs from a file')
'-l', '--list',
help='download tracks from a file')
group.add_argument(
'-p', '--playlist', help='load songs from playlist URL into <playlist_name>.txt')
'-p', '--playlist',
help='load tracks from playlist URL into <playlist_name>.txt')
group.add_argument(
'-b', '--album', help='load songs from album URL into <album_name>.txt')
'-b', '--album',
help='load tracks from album URL into <album_name>.txt')
group.add_argument(
'-u', '--username',
help="load songs from user's playlist into <playlist_name>.txt")
help="load tracks from user's playlist into <playlist_name>.txt")
parser.add_argument(
'-m', '--manual', default=config['manual'],
help='choose the song to download manually', action='store_true')
help='choose the track to download manually from a list '
'of matching tracks',
action='store_true')
parser.add_argument(
'-nm', '--no-metadata', default=config['no-metadata'],
help='do not embed metadata in songs', action='store_true')
help='do not embed metadata in tracks', action='store_true')
parser.add_argument(
'-a', '--avconv', default=config['avconv'],
help='Use avconv for conversion otherwise set defaults to ffmpeg',
help='use avconv for conversion (otherwise defaults to ffmpeg)',
action='store_true')
parser.add_argument(
'-f', '--folder', default=os.path.relpath(config['folder'], os.getcwd()),
help='path to folder where files will be stored in')
help='path to folder where downloaded tracks will be stored in')
parser.add_argument(
'--overwrite', default=config['overwrite'],
help='change the overwrite policy',
choices={'prompt', 'force', 'skip'})
parser.add_argument(
'-i', '--input-ext', default=config['input-ext'],
help='prefered input format .m4a or .webm (Opus)',
help='preferred input format .m4a or .webm (Opus)',
choices={'.m4a', '.webm'})
parser.add_argument(
'-o', '--output-ext', default=config['output-ext'],
help='prefered output format .mp3, .m4a (AAC), .flac, etc.')
help='preferred output format .mp3, .m4a (AAC), .flac, etc.')
parser.add_argument(
'-ff', '--file-format', default=config['file-format'],
help='File format to save the downloaded song with, each tag '
help='file format to save the downloaded track with, each tag '
'is surrounded by curly braces. Possible formats: '
'{}'.format([internals.formats[x] for x in internals.formats]))
parser.add_argument(
'-sf', '--search-format', default=config['search-format'],
help='Search format to search for on YouTube, each tag '
help='search format to search for on YouTube, each tag '
'is surrounded by curly braces. Possible formats: '
'{}'.format([internals.formats[x] for x in internals.formats]))
parser.add_argument(
'-dm', '--download-only-metadata', default=config['download-only-metadata'],
help='download songs for which metadata is found',
help='download tracks only whose metadata is found',
action='store_true')
parser.add_argument(
'-d', '--dry-run', default=config['dry-run'],
help='Show only track title and YouTube URL',
help='show only track title and YouTube URL, and then skip '
'to the next track (if any)',
action='store_true')
parser.add_argument(
'-mo', '--music-videos-only', default=config['music-videos-only'],
help='Search only for music on Youtube',
help='search only for music videos on Youtube (works only '
'when YouTube API key is set',
action='store_true')
parser.add_argument(
'-ns', '--no-spaces', default=config['no-spaces'],
help='Replace spaces with underscores in file names',
help='replace spaces with underscores in file names',
action='store_true')
parser.add_argument(
'-ll', '--log-level', default=config['log-level'],
@@ -165,7 +173,8 @@ def get_arguments(raw_args=None, to_group=True, to_merge=True):
help=argparse.SUPPRESS)
parser.add_argument(
'-c', '--config', default=None,
help='Replace with custom config.yml file')
help='path to config.yml file (otherwise load it from same '
'directory as spotdl.py)')
parsed = parser.parse_args(raw_args)