From ed281c633661b51ef525d1dcf838063bd67462d3 Mon Sep 17 00:00:00 2001 From: KrumpetPirate Date: Sun, 13 Dec 2015 01:20:05 -0600 Subject: [PATCH] Initial commit for AAXtoMP3.py script for conversion. --- AAXtoMP3.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 AAXtoMP3.py diff --git a/AAXtoMP3.py b/AAXtoMP3.py new file mode 100755 index 0000000..d3a81c8 --- /dev/null +++ b/AAXtoMP3.py @@ -0,0 +1,37 @@ +#!/usr/bin/python3 +import sys +import getopt +import shutil + +def usage(): + print('Usage: '+sys.argv[0]+' -a -f ') + +def main(argv): + try: + opts, args = getopt.getopt(sys.argv[1:], 'a:f:h', ['auth=', 'file=', 'help']) + except getopt.GetoptError: + usage() + sys.exit(2) + + for opt, arg in opts: + if opt in ('-h', '--help'): + usage() + sys.exit(2) + elif opt in ('-a', '--auth'): + auth_string = arg + elif opt in ('-f', '--file'): + input_file = arg + else: + usage() + sys.exit(2) + if not auth_string: + usage() + sys.exit(2) + if not input_file: + usage() + sys.exit(2) + print(auth_string) + print(input_file) + +if __name__ == "__main__": + main(sys.argv[1:])