Add files via upload
This commit is contained in:
36
main.py
Normal file
36
main.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from setup.login_account import loginAndGetKey
|
||||
from setup.fulfill import downloadFile
|
||||
|
||||
from decrypt.decodePDF import decryptPDF
|
||||
from decrypt.decodeEPUB import decryptEPUB
|
||||
|
||||
# setting up the account and keys
|
||||
loginAndGetKey()
|
||||
|
||||
# acsm file
|
||||
acsmFile = input("Enter ACSM file (press enter if the file name is URLLink.acsm): ")
|
||||
if acsmFile == "":
|
||||
from os.path import exists
|
||||
if exists("URLLink.acsm"):
|
||||
acsmFile = "URLLink.acsm"
|
||||
else:
|
||||
print("URLLink.acsm file does not exists")
|
||||
print()
|
||||
exit(1)
|
||||
|
||||
# downlaod
|
||||
enrcyptedFile = downloadFile(acsmFile)
|
||||
print(enrcyptedFile)
|
||||
print()
|
||||
|
||||
# decrypt
|
||||
if enrcyptedFile.endswith(".pdf"):
|
||||
decryptedFile = decryptPDF(enrcyptedFile)
|
||||
elif enrcyptedFile.endswith(".epub"):
|
||||
decryptedFile = decryptEPUB(enrcyptedFile)
|
||||
else:
|
||||
print("Not in supported file formats")
|
||||
print()
|
||||
exit(1)
|
||||
print(decryptedFile)
|
||||
print()
|
||||
Reference in New Issue
Block a user