-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcliargs.py
45 lines (37 loc) · 1.15 KB
/
cliargs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import argparse
def cli_init():
parser = argparse.ArgumentParser(description='Lets you download Spotify tracks from youtube',
allow_abbrev=False)
parser.add_argument('--type',
help='Specify what to download album/playlist. Playlist by default',
choices=['album', 'playlist'],
type=str,
action='store',
default='playlist',
nargs='?'
)
parser.add_argument('link',
help='Main link parameter, can be either link or id',
type=str,
action='store',
default=''
)
parser.add_argument('--path',
help='Download directory path, by default will create local directory \'Downloads\'',
action='store',
default='Downloads',
nargs='?'
)
parser.add_argument('--precise',
help='Precise search, might be considerably slower, False by default',
type=bool,
action=argparse.BooleanOptionalAction,
#nargs='?'
)
parser.add_argument('--workers',
help='Amount of threads to be launched for download, 5 by default',
type=int,
default=5,
nargs='?'
)
return parser