mirror of
https://github.com/apprenticeharper/DeDRM_tools
synced 2024-11-12 19:10:48 +00:00
tools v6.0.7
This commit is contained in:
parent
5a502dbce3
commit
74a4c894cb
@ -24,19 +24,19 @@
|
|||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>droplet</string>
|
<string>droplet</string>
|
||||||
<key>CFBundleGetInfoString</key>
|
<key>CFBundleGetInfoString</key>
|
||||||
<string>DeDRM AppleScript 6.0.5. Written 2010–2013 by Apprentice Alf and others.</string>
|
<string>DeDRM AppleScript 6.0.7. Written 2010–2013 by Apprentice Alf and others.</string>
|
||||||
<key>CFBundleIconFile</key>
|
<key>CFBundleIconFile</key>
|
||||||
<string>DeDRM</string>
|
<string>DeDRM</string>
|
||||||
<key>CFBundleIdentifier</key>
|
<key>CFBundleIdentifier</key>
|
||||||
<string>com.apple.ScriptEditor.id.707CCCD5-0C6C-4BEB-B67C-B6E866ADE85A</string>
|
<string>com.apple.ScriptEditor.id.707CCCD5-0C6C-4BEB-B67C-B6E866ADE85A</string>
|
||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0.7</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>DeDRM</string>
|
<string>DeDRM</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>6.0.5</string>
|
<string>6.0.7</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>dplt</string>
|
<string>dplt</string>
|
||||||
<key>LSRequiresCarbon</key>
|
<key>LSRequiresCarbon</key>
|
||||||
|
@ -27,14 +27,18 @@ __docformat__ = 'restructuredtext en'
|
|||||||
# Revision history:
|
# Revision history:
|
||||||
# 6.0.0 - Initial release
|
# 6.0.0 - Initial release
|
||||||
# 6.0.1 - Bug Fixes for Windows App, Kindle for Mac and Windows Adobe Digital Editions
|
# 6.0.1 - Bug Fixes for Windows App, Kindle for Mac and Windows Adobe Digital Editions
|
||||||
# 6.0.2 - Restored call to Wine to get Kindle for PC keys
|
# 6.0.2 - Restored call to Wine to get Kindle for PC keys, added for ADE
|
||||||
|
# 6.0.3 - Fixes for Kindle for Mac and Windows non-ascii user names
|
||||||
|
# 6.0.4 - Fixes for stand-alone scripts and applications
|
||||||
|
# and pdb files in plugin and initial conversion of prefs.
|
||||||
|
# 6.0.6 - Fix up an incorrect function call
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Decrypt DRMed ebooks.
|
Decrypt DRMed ebooks.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PLUGIN_NAME = u"DeDRM"
|
PLUGIN_NAME = u"DeDRM"
|
||||||
PLUGIN_VERSION_TUPLE = (6, 0, 5)
|
PLUGIN_VERSION_TUPLE = (6, 0, 7)
|
||||||
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
||||||
# Include an html helpfile in the plugin's zipfile with the following name.
|
# Include an html helpfile in the plugin's zipfile with the following name.
|
||||||
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
||||||
@ -213,10 +217,10 @@ class DeDRM(FileTypePlugin):
|
|||||||
else: # linux
|
else: # linux
|
||||||
from wineutils import WineGetKeys
|
from wineutils import WineGetKeys
|
||||||
|
|
||||||
scriptpath = os.join(self.alfdir,u"adobekey.py")
|
scriptpath = os.path.join(self.alfdir,u"adobekey.py")
|
||||||
defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
||||||
|
|
||||||
self.default_key = default_keys[0]
|
self.default_key = defaultkeys[0]
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self.default_key = u""
|
self.default_key = u""
|
||||||
@ -308,7 +312,7 @@ class DeDRM(FileTypePlugin):
|
|||||||
try:
|
try:
|
||||||
from wineutils import WineGetKeys
|
from wineutils import WineGetKeys
|
||||||
|
|
||||||
scriptpath = os.join(self.alfdir,u"adobekey.py")
|
scriptpath = os.path.join(self.alfdir,u"adobekey.py")
|
||||||
defaultkeys = self.WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
defaultkeys = self.WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -386,7 +390,7 @@ class DeDRM(FileTypePlugin):
|
|||||||
else: # linux
|
else: # linux
|
||||||
from wineutils import WineGetKeys
|
from wineutils import WineGetKeys
|
||||||
|
|
||||||
scriptpath = os.join(self.alfdir,u"kindlekey.py")
|
scriptpath = os.path.join(self.alfdir,u"kindlekey.py")
|
||||||
defaultkeys = self.WineGetKeys(scriptpath, u".k4i",dedrmprefs['kindlewineprefix'])
|
defaultkeys = self.WineGetKeys(scriptpath, u".k4i",dedrmprefs['kindlewineprefix'])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -426,7 +430,7 @@ class DeDRM(FileTypePlugin):
|
|||||||
import calibre_plugins.dedrm.prefs as prefs
|
import calibre_plugins.dedrm.prefs as prefs
|
||||||
import calibre_plugins.dedrm.erdr2pml
|
import calibre_plugins.dedrm.erdr2pml
|
||||||
|
|
||||||
dedrmrefs = prefs.DeDRM_Prefs()
|
dedrmprefs = prefs.DeDRM_Prefs()
|
||||||
# Attempt to decrypt epub with each encryption key (generated or provided).
|
# Attempt to decrypt epub with each encryption key (generated or provided).
|
||||||
for keyname, userkey in dedrmprefs['ereaderkeys'].items():
|
for keyname, userkey in dedrmprefs['ereaderkeys'].items():
|
||||||
keyname_masked = u"".join((u'X' if (x.isdigit()) else x) for x in keyname)
|
keyname_masked = u"".join((u'X' if (x.isdigit()) else x) for x in keyname)
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
# ineptepub.pyw, version 5.9
|
# ineptepub.pyw, version 6.1
|
||||||
# Copyright © 2009-2010 by i♥cabbages
|
# Copyright © 2009-2010 by i♥cabbages
|
||||||
|
|
||||||
# Released under the terms of the GNU General Public Licence, version 3
|
# Released under the terms of the GNU General Public Licence, version 3
|
||||||
|
@ -52,13 +52,14 @@ from __future__ import with_statement
|
|||||||
# 7.13 - Fixed erroneous mentions of ineptepub
|
# 7.13 - Fixed erroneous mentions of ineptepub
|
||||||
# 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility
|
# 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility
|
||||||
# 8.0 - Work if TkInter is missing
|
# 8.0 - Work if TkInter is missing
|
||||||
|
# 8.0.1 - Broken Metadata fix.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Decrypts Adobe ADEPT-encrypted PDF files.
|
Decrypts Adobe ADEPT-encrypted PDF files.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__version__ = "8.0"
|
__version__ = "8.0.1"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@ -949,8 +950,11 @@ class PSStackParser(PSBaseParser):
|
|||||||
try:
|
try:
|
||||||
(pos, objs) = self.end_type('d')
|
(pos, objs) = self.end_type('d')
|
||||||
if len(objs) % 2 != 0:
|
if len(objs) % 2 != 0:
|
||||||
raise PSSyntaxError(
|
print "Incomplete dictionary construct"
|
||||||
'Invalid dictionary construct: %r' % objs)
|
objs.append("") # this isn't necessary.
|
||||||
|
# temporary fix. is this due to rental books?
|
||||||
|
# raise PSSyntaxError(
|
||||||
|
# 'Invalid dictionary construct: %r' % objs)
|
||||||
d = dict((literal_name(k), v) \
|
d = dict((literal_name(k), v) \
|
||||||
for (k,v) in choplist(2, objs))
|
for (k,v) in choplist(2, objs))
|
||||||
self.push((pos, d))
|
self.push((pos, d))
|
||||||
|
@ -188,7 +188,7 @@ def unescape(text):
|
|||||||
def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()):
|
def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()):
|
||||||
# handle the obvious cases at the beginning
|
# handle the obvious cases at the beginning
|
||||||
if not os.path.isfile(infile):
|
if not os.path.isfile(infile):
|
||||||
raise DRMException (u"Input file does not exist.")
|
raise DrmException(u"Input file does not exist.")
|
||||||
|
|
||||||
mobi = True
|
mobi = True
|
||||||
magic3 = open(infile,'rb').read(3)
|
magic3 = open(infile,'rb').read(3)
|
||||||
|
@ -114,7 +114,7 @@ def convertprefs(always = False):
|
|||||||
# Generate eReader user key from name and credit card number.
|
# Generate eReader user key from name and credit card number.
|
||||||
keyname = u"{0}_{1}".format(name.strip(),cc.strip()[-4:])
|
keyname = u"{0}_{1}".format(name.strip(),cc.strip()[-4:])
|
||||||
keyvalue = getuser_key(name,cc).encode('hex')
|
keyvalue = getuser_key(name,cc).encode('hex')
|
||||||
userkeysappend([keyname,keyvalue])
|
userkeys.append([keyname,keyvalue])
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
print e.args[0]
|
print e.args[0]
|
||||||
@ -231,21 +231,20 @@ def convertprefs(always = False):
|
|||||||
dedrmprefs.addnamedvaluetoprefs('bandnkeys', name, value)
|
dedrmprefs.addnamedvaluetoprefs('bandnkeys', name, value)
|
||||||
addedkeycount = len(dedrmprefs['bandnkeys'])-priorkeycount
|
addedkeycount = len(dedrmprefs['bandnkeys'])-priorkeycount
|
||||||
if addedkeycount > 0:
|
if addedkeycount > 0:
|
||||||
print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ignoblecount, u"key file" if ignoblecount==1 else u"key files")
|
print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"key file" if addedkeycount==1 else u"key files")
|
||||||
# Make the json write all the prefs to disk
|
# Make the json write all the prefs to disk
|
||||||
dedrmprefs.writeprefs(False)
|
dedrmprefs.writeprefs(False)
|
||||||
|
|
||||||
# get any .der files in the config dir
|
# get any .der files in the config dir
|
||||||
priorkeycount = len(dedrmprefs['adeptkeys'])
|
priorkeycount = len(dedrmprefs['adeptkeys'])
|
||||||
adeptfilekeys = getConfigFiles('.der','hex')
|
adeptfilekeys = getConfigFiles('.der','hex')
|
||||||
ineptcount = addConfigFiles('.der', 'adeptkeys')
|
|
||||||
for keypair in adeptfilekeys:
|
for keypair in adeptfilekeys:
|
||||||
name = keypair[0]
|
name = keypair[0]
|
||||||
value = keypair[1]
|
value = keypair[1]
|
||||||
dedrmprefs.addnamedvaluetoprefs('adeptkeys', name, value)
|
dedrmprefs.addnamedvaluetoprefs('adeptkeys', name, value)
|
||||||
addedkeycount = len(dedrmprefs['adeptkeys'])-priorkeycount
|
addedkeycount = len(dedrmprefs['adeptkeys'])-priorkeycount
|
||||||
if addedkeycount > 0:
|
if addedkeycount > 0:
|
||||||
print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ineptcount, u"keyfile" if ineptcount==1 else u"keyfiles")
|
print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"keyfile" if addedkeycount==1 else u"keyfiles")
|
||||||
# Make the json write all the prefs to disk
|
# Make the json write all the prefs to disk
|
||||||
dedrmprefs.writeprefs(False)
|
dedrmprefs.writeprefs(False)
|
||||||
|
|
||||||
@ -280,7 +279,7 @@ def convertprefs(always = False):
|
|||||||
if addedserialcount > 0:
|
if addedserialcount > 0:
|
||||||
print u"{0} v{1}: {2:d} {3} imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, addedserialcount, u"serial number" if addedserialcount==1 else u"serial numbers")
|
print u"{0} v{1}: {2:d} {3} imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, addedserialcount, u"serial number" if addedserialcount==1 else u"serial numbers")
|
||||||
try:
|
try:
|
||||||
if kindleprefs['wineprefix'] != "":
|
if 'wineprefix' in kindleprefs and kindleprefs['wineprefix'] != "":
|
||||||
dedrmprefs.set('adobewineprefix',kindleprefs['wineprefix'])
|
dedrmprefs.set('adobewineprefix',kindleprefs['wineprefix'])
|
||||||
dedrmprefs.set('kindlewineprefix',kindleprefs['wineprefix'])
|
dedrmprefs.set('kindlewineprefix',kindleprefs['wineprefix'])
|
||||||
print u"{0} v{1}: WINEPREFIX ‘(2)’ imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, kindleprefs['wineprefix'])
|
print u"{0} v{1}: WINEPREFIX ‘(2)’ imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, kindleprefs['wineprefix'])
|
||||||
|
@ -24,7 +24,7 @@ def WineGetKeys(scriptpath, extension, wineprefix=""):
|
|||||||
|
|
||||||
outdirpath = os.path.join(basepath, u"winekeysdir")
|
outdirpath = os.path.join(basepath, u"winekeysdir")
|
||||||
if not os.path.exists(outdirpath):
|
if not os.path.exists(outdirpath):
|
||||||
os.mkdir(outdirpath)
|
os.makedirs(outdirpath)
|
||||||
|
|
||||||
if wineprefix != "" and os.path.exists(wineprefix):
|
if wineprefix != "" and os.path.exists(wineprefix):
|
||||||
cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)
|
cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
# 6.0.4 - Fix for other potential unicode problems
|
# 6.0.4 - Fix for other potential unicode problems
|
||||||
# 6.0.5 - Fix typo
|
# 6.0.5 - Fix typo
|
||||||
|
|
||||||
__version__ = '6.0.5'
|
__version__ = '6.0.7'
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os, os.path
|
import os, os.path
|
||||||
|
@ -31,13 +31,14 @@ __docformat__ = 'restructuredtext en'
|
|||||||
# 6.0.3 - Fixes for Kindle for Mac and Windows non-ascii user names
|
# 6.0.3 - Fixes for Kindle for Mac and Windows non-ascii user names
|
||||||
# 6.0.4 - Fixes for stand-alone scripts and applications
|
# 6.0.4 - Fixes for stand-alone scripts and applications
|
||||||
# and pdb files in plugin and initial conversion of prefs.
|
# and pdb files in plugin and initial conversion of prefs.
|
||||||
|
# 6.0.6 - Fix up an incorrect function call
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Decrypt DRMed ebooks.
|
Decrypt DRMed ebooks.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PLUGIN_NAME = u"DeDRM"
|
PLUGIN_NAME = u"DeDRM"
|
||||||
PLUGIN_VERSION_TUPLE = (6, 0, 5)
|
PLUGIN_VERSION_TUPLE = (6, 0, 7)
|
||||||
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
||||||
# Include an html helpfile in the plugin's zipfile with the following name.
|
# Include an html helpfile in the plugin's zipfile with the following name.
|
||||||
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
||||||
@ -216,10 +217,10 @@ class DeDRM(FileTypePlugin):
|
|||||||
else: # linux
|
else: # linux
|
||||||
from wineutils import WineGetKeys
|
from wineutils import WineGetKeys
|
||||||
|
|
||||||
scriptpath = os.join(self.alfdir,u"adobekey.py")
|
scriptpath = os.path.join(self.alfdir,u"adobekey.py")
|
||||||
defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
||||||
|
|
||||||
self.default_key = default_keys[0]
|
self.default_key = defaultkeys[0]
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self.default_key = u""
|
self.default_key = u""
|
||||||
@ -311,7 +312,7 @@ class DeDRM(FileTypePlugin):
|
|||||||
try:
|
try:
|
||||||
from wineutils import WineGetKeys
|
from wineutils import WineGetKeys
|
||||||
|
|
||||||
scriptpath = os.join(self.alfdir,u"adobekey.py")
|
scriptpath = os.path.join(self.alfdir,u"adobekey.py")
|
||||||
defaultkeys = self.WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
defaultkeys = self.WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
@ -389,7 +390,7 @@ class DeDRM(FileTypePlugin):
|
|||||||
else: # linux
|
else: # linux
|
||||||
from wineutils import WineGetKeys
|
from wineutils import WineGetKeys
|
||||||
|
|
||||||
scriptpath = os.join(self.alfdir,u"kindlekey.py")
|
scriptpath = os.path.join(self.alfdir,u"kindlekey.py")
|
||||||
defaultkeys = self.WineGetKeys(scriptpath, u".k4i",dedrmprefs['kindlewineprefix'])
|
defaultkeys = self.WineGetKeys(scriptpath, u".k4i",dedrmprefs['kindlewineprefix'])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
# ineptepub.pyw, version 5.9
|
# ineptepub.pyw, version 6.1
|
||||||
# Copyright © 2009-2010 by i♥cabbages
|
# Copyright © 2009-2010 by i♥cabbages
|
||||||
|
|
||||||
# Released under the terms of the GNU General Public Licence, version 3
|
# Released under the terms of the GNU General Public Licence, version 3
|
||||||
|
@ -52,13 +52,14 @@ from __future__ import with_statement
|
|||||||
# 7.13 - Fixed erroneous mentions of ineptepub
|
# 7.13 - Fixed erroneous mentions of ineptepub
|
||||||
# 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility
|
# 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility
|
||||||
# 8.0 - Work if TkInter is missing
|
# 8.0 - Work if TkInter is missing
|
||||||
|
# 8.0.1 - Broken Metadata fix.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Decrypts Adobe ADEPT-encrypted PDF files.
|
Decrypts Adobe ADEPT-encrypted PDF files.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__version__ = "8.0"
|
__version__ = "8.0.1"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@ -949,8 +950,11 @@ class PSStackParser(PSBaseParser):
|
|||||||
try:
|
try:
|
||||||
(pos, objs) = self.end_type('d')
|
(pos, objs) = self.end_type('d')
|
||||||
if len(objs) % 2 != 0:
|
if len(objs) % 2 != 0:
|
||||||
raise PSSyntaxError(
|
print "Incomplete dictionary construct"
|
||||||
'Invalid dictionary construct: %r' % objs)
|
objs.append("") # this isn't necessary.
|
||||||
|
# temporary fix. is this due to rental books?
|
||||||
|
# raise PSSyntaxError(
|
||||||
|
# 'Invalid dictionary construct: %r' % objs)
|
||||||
d = dict((literal_name(k), v) \
|
d = dict((literal_name(k), v) \
|
||||||
for (k,v) in choplist(2, objs))
|
for (k,v) in choplist(2, objs))
|
||||||
self.push((pos, d))
|
self.push((pos, d))
|
||||||
|
@ -188,7 +188,7 @@ def unescape(text):
|
|||||||
def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()):
|
def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()):
|
||||||
# handle the obvious cases at the beginning
|
# handle the obvious cases at the beginning
|
||||||
if not os.path.isfile(infile):
|
if not os.path.isfile(infile):
|
||||||
raise DRMException (u"Input file does not exist.")
|
raise DrmException(u"Input file does not exist.")
|
||||||
|
|
||||||
mobi = True
|
mobi = True
|
||||||
magic3 = open(infile,'rb').read(3)
|
magic3 = open(infile,'rb').read(3)
|
||||||
|
@ -114,7 +114,7 @@ def convertprefs(always = False):
|
|||||||
# Generate eReader user key from name and credit card number.
|
# Generate eReader user key from name and credit card number.
|
||||||
keyname = u"{0}_{1}".format(name.strip(),cc.strip()[-4:])
|
keyname = u"{0}_{1}".format(name.strip(),cc.strip()[-4:])
|
||||||
keyvalue = getuser_key(name,cc).encode('hex')
|
keyvalue = getuser_key(name,cc).encode('hex')
|
||||||
userkeysappend([keyname,keyvalue])
|
userkeys.append([keyname,keyvalue])
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
print e.args[0]
|
print e.args[0]
|
||||||
@ -231,21 +231,20 @@ def convertprefs(always = False):
|
|||||||
dedrmprefs.addnamedvaluetoprefs('bandnkeys', name, value)
|
dedrmprefs.addnamedvaluetoprefs('bandnkeys', name, value)
|
||||||
addedkeycount = len(dedrmprefs['bandnkeys'])-priorkeycount
|
addedkeycount = len(dedrmprefs['bandnkeys'])-priorkeycount
|
||||||
if addedkeycount > 0:
|
if addedkeycount > 0:
|
||||||
print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ignoblecount, u"key file" if ignoblecount==1 else u"key files")
|
print u"{0} v{1}: {2:d} Barnes and Noble {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"key file" if addedkeycount==1 else u"key files")
|
||||||
# Make the json write all the prefs to disk
|
# Make the json write all the prefs to disk
|
||||||
dedrmprefs.writeprefs(False)
|
dedrmprefs.writeprefs(False)
|
||||||
|
|
||||||
# get any .der files in the config dir
|
# get any .der files in the config dir
|
||||||
priorkeycount = len(dedrmprefs['adeptkeys'])
|
priorkeycount = len(dedrmprefs['adeptkeys'])
|
||||||
adeptfilekeys = getConfigFiles('.der','hex')
|
adeptfilekeys = getConfigFiles('.der','hex')
|
||||||
ineptcount = addConfigFiles('.der', 'adeptkeys')
|
|
||||||
for keypair in adeptfilekeys:
|
for keypair in adeptfilekeys:
|
||||||
name = keypair[0]
|
name = keypair[0]
|
||||||
value = keypair[1]
|
value = keypair[1]
|
||||||
dedrmprefs.addnamedvaluetoprefs('adeptkeys', name, value)
|
dedrmprefs.addnamedvaluetoprefs('adeptkeys', name, value)
|
||||||
addedkeycount = len(dedrmprefs['adeptkeys'])-priorkeycount
|
addedkeycount = len(dedrmprefs['adeptkeys'])-priorkeycount
|
||||||
if addedkeycount > 0:
|
if addedkeycount > 0:
|
||||||
print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, ineptcount, u"keyfile" if ineptcount==1 else u"keyfiles")
|
print u"{0} v{1}: {2:d} Adobe Adept {3} imported from config folder.".format(PLUGIN_NAME, PLUGIN_VERSION, addedkeycount, u"keyfile" if addedkeycount==1 else u"keyfiles")
|
||||||
# Make the json write all the prefs to disk
|
# Make the json write all the prefs to disk
|
||||||
dedrmprefs.writeprefs(False)
|
dedrmprefs.writeprefs(False)
|
||||||
|
|
||||||
@ -280,7 +279,7 @@ def convertprefs(always = False):
|
|||||||
if addedserialcount > 0:
|
if addedserialcount > 0:
|
||||||
print u"{0} v{1}: {2:d} {3} imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, addedserialcount, u"serial number" if addedserialcount==1 else u"serial numbers")
|
print u"{0} v{1}: {2:d} {3} imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, addedserialcount, u"serial number" if addedserialcount==1 else u"serial numbers")
|
||||||
try:
|
try:
|
||||||
if kindleprefs['wineprefix'] != "":
|
if 'wineprefix' in kindleprefs and kindleprefs['wineprefix'] != "":
|
||||||
dedrmprefs.set('adobewineprefix',kindleprefs['wineprefix'])
|
dedrmprefs.set('adobewineprefix',kindleprefs['wineprefix'])
|
||||||
dedrmprefs.set('kindlewineprefix',kindleprefs['wineprefix'])
|
dedrmprefs.set('kindlewineprefix',kindleprefs['wineprefix'])
|
||||||
print u"{0} v{1}: WINEPREFIX ‘(2)’ imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, kindleprefs['wineprefix'])
|
print u"{0} v{1}: WINEPREFIX ‘(2)’ imported from Kindle plugin preferences".format(PLUGIN_NAME, PLUGIN_VERSION, kindleprefs['wineprefix'])
|
||||||
|
@ -24,7 +24,7 @@ def WineGetKeys(scriptpath, extension, wineprefix=""):
|
|||||||
|
|
||||||
outdirpath = os.path.join(basepath, u"winekeysdir")
|
outdirpath = os.path.join(basepath, u"winekeysdir")
|
||||||
if not os.path.exists(outdirpath):
|
if not os.path.exists(outdirpath):
|
||||||
os.mkdir(outdirpath)
|
os.makedirs(outdirpath)
|
||||||
|
|
||||||
if wineprefix != "" and os.path.exists(wineprefix):
|
if wineprefix != "" and os.path.exists(wineprefix):
|
||||||
cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)
|
cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)
|
||||||
|
Binary file not shown.
@ -38,7 +38,7 @@ Decrypt DRMed ebooks.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
PLUGIN_NAME = u"DeDRM"
|
PLUGIN_NAME = u"DeDRM"
|
||||||
PLUGIN_VERSION_TUPLE = (6, 0, 6)
|
PLUGIN_VERSION_TUPLE = (6, 0, 7)
|
||||||
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
||||||
# Include an html helpfile in the plugin's zipfile with the following name.
|
# Include an html helpfile in the plugin's zipfile with the following name.
|
||||||
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
||||||
@ -220,7 +220,7 @@ class DeDRM(FileTypePlugin):
|
|||||||
scriptpath = os.path.join(self.alfdir,u"adobekey.py")
|
scriptpath = os.path.join(self.alfdir,u"adobekey.py")
|
||||||
defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
defaultkeys = WineGetKeys(scriptpath, u".der",dedrmprefs['adobewineprefix'])
|
||||||
|
|
||||||
self.default_key = default_keys[0]
|
self.default_key = defaultkeys[0]
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self.default_key = u""
|
self.default_key = u""
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
from __future__ import with_statement
|
from __future__ import with_statement
|
||||||
|
|
||||||
# ineptepub.pyw, version 5.9
|
# ineptepub.pyw, version 6.1
|
||||||
# Copyright © 2009-2010 by i♥cabbages
|
# Copyright © 2009-2010 by i♥cabbages
|
||||||
|
|
||||||
# Released under the terms of the GNU General Public Licence, version 3
|
# Released under the terms of the GNU General Public Licence, version 3
|
||||||
|
@ -52,13 +52,14 @@ from __future__ import with_statement
|
|||||||
# 7.13 - Fixed erroneous mentions of ineptepub
|
# 7.13 - Fixed erroneous mentions of ineptepub
|
||||||
# 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility
|
# 7.14 - moved unicode_argv call inside main for Windows DeDRM compatibility
|
||||||
# 8.0 - Work if TkInter is missing
|
# 8.0 - Work if TkInter is missing
|
||||||
|
# 8.0.1 - Broken Metadata fix.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Decrypts Adobe ADEPT-encrypted PDF files.
|
Decrypts Adobe ADEPT-encrypted PDF files.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__version__ = "8.0"
|
__version__ = "8.0.1"
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@ -949,8 +950,11 @@ class PSStackParser(PSBaseParser):
|
|||||||
try:
|
try:
|
||||||
(pos, objs) = self.end_type('d')
|
(pos, objs) = self.end_type('d')
|
||||||
if len(objs) % 2 != 0:
|
if len(objs) % 2 != 0:
|
||||||
raise PSSyntaxError(
|
print "Incomplete dictionary construct"
|
||||||
'Invalid dictionary construct: %r' % objs)
|
objs.append("") # this isn't necessary.
|
||||||
|
# temporary fix. is this due to rental books?
|
||||||
|
# raise PSSyntaxError(
|
||||||
|
# 'Invalid dictionary construct: %r' % objs)
|
||||||
d = dict((literal_name(k), v) \
|
d = dict((literal_name(k), v) \
|
||||||
for (k,v) in choplist(2, objs))
|
for (k,v) in choplist(2, objs))
|
||||||
self.push((pos, d))
|
self.push((pos, d))
|
||||||
|
@ -188,7 +188,7 @@ def unescape(text):
|
|||||||
def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()):
|
def GetDecryptedBook(infile, kDatabases, serials, pids, starttime = time.time()):
|
||||||
# handle the obvious cases at the beginning
|
# handle the obvious cases at the beginning
|
||||||
if not os.path.isfile(infile):
|
if not os.path.isfile(infile):
|
||||||
raise DRMException (u"Input file does not exist.")
|
raise DrmException(u"Input file does not exist.")
|
||||||
|
|
||||||
mobi = True
|
mobi = True
|
||||||
magic3 = open(infile,'rb').read(3)
|
magic3 = open(infile,'rb').read(3)
|
||||||
|
@ -24,7 +24,7 @@ def WineGetKeys(scriptpath, extension, wineprefix=""):
|
|||||||
|
|
||||||
outdirpath = os.path.join(basepath, u"winekeysdir")
|
outdirpath = os.path.join(basepath, u"winekeysdir")
|
||||||
if not os.path.exists(outdirpath):
|
if not os.path.exists(outdirpath):
|
||||||
os.mkdir(outdirpath)
|
os.makedirs(outdirpath)
|
||||||
|
|
||||||
if wineprefix != "" and os.path.exists(wineprefix):
|
if wineprefix != "" and os.path.exists(wineprefix):
|
||||||
cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)
|
cmdline = u"WINEPREFIX=\"{2}\" wine python.exe \"{0}\" \"{1}\"".format(scriptpath,outdirpath,wineprefix)
|
||||||
|
Loading…
Reference in New Issue
Block a user