Chris Pomeroy
2017-08-08 0cd3c94d0c5c47028e868206b571683e821b0678
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/python
import argparse
import os
import glob
 
# arguments
# activation_key, file name, codec(default to mp3)
parser = argparse.ArgumentParser()
parser.add_argument("--code", help="Activation Code from audible to decrypt files")
parser.add_argument("filename", help="Filename to convert")
 
args = parser.parse_args()
 
act_byte = ""
if args.code:
    act_byte = args.code
elif os.path.isfile('./.authcode'):
    act_byte = open('./.authcode').readline()
 
if act_byte == "":
    print "Please provide an activation code from audible. Either at the command line or the .authcode file"
else:
    print act_byte
 
for rfile in glob.glob(args.filename):
    if (rfile.find("aax") != -1):
        if os.path.isfile(rfile):
            print os.path.abspath(rfile)