From 6ccea1e7199bc05a12da7802aaf6fa3d06b9e6cf Mon Sep 17 00:00:00 2001 From: Sogolumbo <33571916+Sogolumbo@users.noreply.github.com> Date: Mon, 5 Oct 2020 04:38:00 +0200 Subject: [PATCH] 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. --- spotify-backup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/spotify-backup.py b/spotify-backup.py index 1a1fc70..9866105 100755 --- a/spotify-backup.py +++ b/spotify-backup.py @@ -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: