File tree Expand file tree Collapse file tree 3 files changed +16
-9
lines changed
Expand file tree Collapse file tree 3 files changed +16
-9
lines changed Original file line number Diff line number Diff line change 2727> get your auth token here : http://flyingrub.tk/soundcloud/
2828
2929* This permitt scdl to access to your user profile data.
30- * For now scdl use it only to use ` scdl.py me [OPTIONS] ` instead of ` scdl.py -l [url] [OPTIONS] `
30+ * For now scdl use it only to use ` scdl me [OPTIONS] ` instead of ` scdl -l [url] [OPTIONS] `
3131* (soon) scdl will download an user's stream thanks to this
3232
3333## Help
3434### Usage:
3535```
36- scdl.py -l <track_url> [-a | -f | -t | -p][-c][-o <offset>][--hidewarnings][--addtofile]
37- scdl.py me (-s | -a | -f | -t | -p)[-c][-o <offset>][--hidewarnings][--addtofile]
38- scdl.py -h | --help
39- scdl.py --version
36+ scdl -l <track_url> [-a | -f | -t | -p][-c][-o <offset>][--hidewarnings][--addtofile]
37+ scdl me (-s | -a | -f | -t | -p)[-c][-o <offset>][--hidewarnings][--addtofile]
38+ scdl -h | --help
39+ scdl --version
4040```
4141
4242### Options:
5454 -o [offset] Begin with a custom offset.
5555 --hidewarnings Hide Warnings. (use with precaution)
5656 --addtofile Add the artist name to the filename if it isn't in the filename already
57+ --path Path to download directory, can be set in the config. If none of this is set, it uses the current working directory
5758```
5859
5960
Original file line number Diff line number Diff line change 4141import mutagen
4242
4343token = ''
44+ path = ''
4445offset = 0
4546filename = ''
4647scdl_client_id = '9dbef61eb005cb526480279a0cc868c4'
@@ -71,18 +72,22 @@ def main():
7172
7273 if arguments ["--hidewarnings" ]:
7374 warnings .filterwarnings ("ignore" )
74- print ("no warnings!" )
75+ # print("no warnings!") # Warn about no warnings...?
7576
7677 if arguments ["--path" ] is not None :
7778 if os .path .exists (arguments ["--path" ]):
79+ print ('Downloading to ' + arguments ["--path" ]+ '...' )
7880 os .chdir (arguments ["--path" ])
7981 else :
80- print ('Invalid path...' )
81- sys .exit ()
82+ if path is not None :
83+ print ('Downloading to ' + path + '...' )
84+ os .chdir (path )
85+ else :
86+ print ('Downloading to current directory...' )
8287
8388 print ('' )
8489 if arguments ["-l" ]:
85- parse_url (arguments ["<track_url> " ])
90+ parse_url (arguments ["-l " ])
8691 elif arguments ["me" ]:
8792 if arguments ["-a" ]:
8893 download_all_user_tracks (who_am_i ())
@@ -99,6 +104,7 @@ def get_config():
99104 read the path where to store music
100105 """
101106 global token
107+ global path
102108 config = configparser .ConfigParser ()
103109 config .read (os .path .join (os .path .expanduser ('~' ), '.config/scdl/scdl.cfg' ))
104110 try :
You can’t perform that action at this time.
0 commit comments