diff --git a/core/misc.py b/core/misc.py index 0dfcfe7..57fc005 100755 --- a/core/misc.py +++ b/core/misc.py @@ -127,7 +127,7 @@ def filter_path(path): def grace_quit(): print('\n\nExiting.') - sys.exit() + sys.exit(0) def get_sec(time_str): v = time_str.split(':', 3) diff --git a/spotdl.py b/spotdl.py index 7d17868..cb13063 100755 --- a/spotdl.py +++ b/spotdl.py @@ -236,10 +236,8 @@ def write_album(album): def download_song(file_name, content): """Download the audio file from YouTube.""" - if args.input_ext == '.webm': - link = content.getbestaudio(preftype='webm') - elif args.input_ext == '.m4a': - link = content.getbestaudio(preftype='m4a') + if args.input_ext in (".webm", ".m4a"): + link = content.getbestaudio(preftype=args.input_ext[1:]) else: return False