Autodetect json file name

Detect if file name ends on '.json'. If this is the case and the name was entered manually the json dump will be saved.
This commit is contained in:
Sogolumbo
2020-10-05 04:38:00 +02:00
parent 2c23bc0604
commit 6ccea1e719

View File

@@ -130,6 +130,7 @@ def main():
# If they didn't give a filename, then just prompt them. (They probably just double-clicked.)
while not args.file:
args.file = input('Enter a file name (e.g. playlists.txt): ')
args.format = args.file.split('.')[-1]
# Log into the Spotify API.
if args.token: