Chris Pomeroy
2021-04-15 4625f53d76b155fcfe49a054a7b6a8fd22de5d48
Updated for python3
2 files modified
48 ■■■■ changed files
aaxConvert.py 40 ●●●● patch | view | raw | blame | history
querysubsonic.py 8 ●●●● patch | view | raw | blame | history
aaxConvert.py
@@ -138,23 +138,23 @@
            act_byte = getcorrectkey(rfile)
            if act_byte == 1:
                print("The checkkey function is unavaliable")
            ddir = "%s/%s/%s" % (path, artist, title)
            single_file_path = "%s/%s.mp3" % (ddir, title)
            if not os.path.exists(ddir):
                os.makedirs(ddir)
            print(ddir)
            reencode(rfile, single_file_path)``
            if mode == 'chapter':
                chapter = 0
                numchapters = getchaptercount()
                while (numchapters > 0 ):
                    cstart = getchaptermetadata(chapter, 'start_time')
                    cend = getchaptermetadata(chapter, 'end_time')
                    chapter += 1
                    numchapters -= 1
                    schap = str(chapter).zfill(2)
                    movetochapters(single_file_path, ddir, schap, title, cstart,cend)
                os.remove(single_file_path)
            getcoverart(rfile, ddir)
            updatelibrary('testuser','testpass')
            else :
                ddir = "%s/%s/%s" % (path, artist, title)
                single_file_path = "%s/%s.mp3" % (ddir, title)
                if not os.path.exists(ddir):
                    os.makedirs(ddir)
                print(ddir)
                reencode(rfile, single_file_path)``
                if mode == 'chapter':
                    chapter = 0
                    numchapters = getchaptercount()
                    while (numchapters > 0 ):
                        cstart = getchaptermetadata(chapter, 'start_time')
                        cend = getchaptermetadata(chapter, 'end_time')
                        chapter += 1
                        numchapters -= 1
                        schap = str(chapter).zfill(2)
                        movetochapters(single_file_path, ddir, schap, title, cstart,cend)
                    os.remove(single_file_path)
                getcoverart(rfile, ddir)
                updatelibrary('testuser','testpass')
querysubsonic.py
old mode 100644 new mode 100755
@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/local/bin/python
##  Eaxmple url
## https://subsonic.darkurthe.net/audiobooks/rest/getMusicFolders.view?u=testuser&t=0733b8e9889d7a9986d82764cee9db1c&s=O5kgRb6X5jFFbPSW&v=1.15.0&c=myapp&f=json
@@ -21,7 +21,7 @@
def gentoken(passwd,salt):
    m = md5()
    m.update(passwd + salt)
    m.update(passwd.encode('utf8') + salt.encode('utf-8'))
    return m.hexdigest()
@@ -29,7 +29,7 @@
    s = gensalt()
    t = gentoken(passwd,s)
    payload = {'u': user, 't': t, 's': s, 'c': 'audible', 'v': '1.15.0', 'f': 'json', 'type': 'alphabeticalByName', 'size': '500'}
    r = requests.get('http://zombietc01.darkurthe.net:8080/audiobooks/rest/getAlbumList.view', payload, verify=False)
    r = requests.get('https://subsonic.darkurthe.net/audiobooks/rest/getAlbumList.view', payload)
    if r.status_code == 200:
        jr = r.json()
        return jr
@@ -50,7 +50,7 @@
    s = gensalt()
    t = gentoken(passwd,s)
    payload = {'u': user, 't': t, 's': s, 'c': 'audible', 'v': '1.15.0'}
    r = requests.get('http://zombietc01.darkurthe.net:8080/audiobooks/rest/startScan.view', payload, verify=False)
    r = requests.get('https://subsonic.darkurthe.net/audiobooks/rest/audiobooks/rest/startScan.view', payload)
    if r.status_code == 200:
        return True
    else: