From d973a3f65990c3c5c0ce625222edc03e74ff2f9b Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sat, 26 Mar 2022 16:42:40 -0400 Subject: [PATCH] Simplified argument parser --- bin/flac2pod | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bin/flac2pod b/bin/flac2pod index eb9c9a5..7e2df8d 100755 --- a/bin/flac2pod +++ b/bin/flac2pod @@ -45,7 +45,7 @@ def scan_destination_convert_mp3(): ("'", "\\'").replace(')', '\\)').replace('(', '\\(').replace('&', '\\&').replace\ ('`', '\\`').replace('$', '\\$') + '.mp3' print(f"\n\u001b[38;5;0;48;5;15mConverting {_file_s} to {_file_d}...\u001b[0m\n") - if argument.__contains__('-s'): + if '-s' in arguments: system(f"ffmpeg -i {_file_s} -map 0:a -ab 320k -map_metadata 0 -id3v2_version 3 {_file_d}") else: system(f"ffmpeg -i {_file_s} -c:v copy -ab 320k -map_metadata 0 -id3v2_version 3 {_file_d}") @@ -70,10 +70,7 @@ def strip_txxx_tags(_file): # program start sequence # retrieve typed argument -argument_list = argv -i, argument = 0, '' -for user_argument in argument_list: - argument += user_argument +arguments = argv source = input('Source parent directory: ') if source.endswith('/'):