diff options
-rwxr-xr-x | jamos | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -75,6 +75,16 @@ def get_command_line_options(): args = parser.parse_args() + if args.retryFile and args.url: + print("Cannot have url and retry flag!\n") + parser.print_help() + raise Exception() + + if not args.retryFile and not args.url: + print("Must pass either a url or a retry file!\n") + parser.print_help() + raise Exception() + return args @@ -218,11 +228,10 @@ def save_urls_from_playlist_to_file(filename, urls): if __name__ == "__main__": - args = get_command_line_options() - - if args.retryFile and args.url: - print("Cannot have url and retry flag!") - sys.exit(1) + try: + args = get_command_line_options() + except Exception as ex: + sys.exit() music_directory = args.output or os.path.join(os.path.expanduser("~"), "Music") |