Skip to content

Commit

Permalink
Ascii | UTF-8 Switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Pfuenzle committed Feb 25, 2022
1 parent c3e344b commit 5fd5946
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
Binary file modified __pycache__/animeloads.cpython-39.pyc
Binary file not shown.
32 changes: 23 additions & 9 deletions animeloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -1011,26 +1011,40 @@ def downloadEpisode(self, episode, release, hoster, browser, browserlocation="",
except:
raise ALLinkExtractionException("Linkdaten konnten nicht gelesen werden")

k_list = list(k)
tmp = k_list[15]
k_list[15] = k_list[16]
k_list[16] = tmp
k = "".join(k_list)
try:
k_list = list(k)
tmp = k_list[15]
k_list[15] = k_list[16]
k_list[16] = tmp
k = "".join(k_list)
except:
print("Failed to deobfuscate key")
raise ALLinkExtractionException("Linkdaten konnten nicht gelesen werden")

# print("Key wurde erfolgreich deobfuskiert")

jk = "function f(){ return \'" + k + "\';}"

if(pkgName == ""):
pkgName = anime_identifier

if(jdhost != "" and myjd_user == ""):
return utils.addToJD(jdhost, release.getPassword(), self.url, crypted, jk)
elif(jdhost == "" and myjd_user != ""):
links_decoded = utils.decodeCNL(k, crypted)
try:
links_decoded = utils.decodeCNL(k, crypted)
print("Successfully decoded links")
except:
print("Failed to decode links")
raise ALUnknownException("Failed to decode links")
links = []
linkstring = ""
for link in links_decoded:
linkstring += link.decode('ascii')
myjd_return = utils.addToMYJD(myjd_user, myjd_pw, myjd_device, linkstring, pkgName, release.getPassword())
linkstring += link.decode('utf-8')
try:
myjd_return = utils.addToMYJD(myjd_user, myjd_pw, myjd_device, linkstring, pkgName, release.getPassword())
except:
print("Failed to add Link to MyJD")
raise ALUnknownException("Failed to add Link to MyJD")
try:
pkgID = myjd_return['id']
return True
Expand Down

0 comments on commit 5fd5946

Please sign in to comment.