Skip to content

Instantly share code, notes, and snippets.

@arbu
Created February 18, 2017 17:37
Show Gist options
  • Save arbu/57309bb5c8cfa1aaec1ff1ef396c9529 to your computer and use it in GitHub Desktop.
Save arbu/57309bb5c8cfa1aaec1ff1ef396c9529 to your computer and use it in GitHub Desktop.
List account informations for JDownloader2
#! /usr/bin/env python3
import os.path, json
from Crypto.Cipher import AES
ACCOUNTS_KEY = b'\x01\x06\x04\x05\x02\x07\x04\x03\x0c=\x0eK\xfe\xf9\xd4!'
def decrypt_ejs(ejs, key):
if hasattr(ejs, "read"):
ejs = ejs.read()
aes = AES.new(key, AES.MODE_CBC, key)
djs = aes.decrypt(ejs)
# remove PKCS#5 padding
djs = djs[:-djs[-1]]
return json.loads(djs)
if __name__ == "__main__":
account_ejs = '.jd2/cfg/org.jdownloader.settings.AccountSettings.accounts.ejs'
account_file = open(os.path.expanduser("~/"+account_ejs), "rb")
config = decrypt_ejs(account_file, ACCOUNTS_KEY)
for host in config.values():
for account in host:
print("%s:\t%s,\t%s" % (account["hoster"], account["user"], account["password"]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment