mirror of
https://github.com/apprenticeharper/DeDRM_tools
synced 2024-12-27 09:58:59 +01:00
Merge pull request #1499 from xxyzz/kfx
encode serialnum before returning it, close #1479
This commit is contained in:
commit
52e83922c0
1 changed files with 3 additions and 3 deletions
|
@ -174,14 +174,14 @@ def pidFromSerial(s, l):
|
||||||
|
|
||||||
# Parse the EXTH header records and use the Kindle serial number to calculate the book pid.
|
# Parse the EXTH header records and use the Kindle serial number to calculate the book pid.
|
||||||
def getKindlePids(rec209, token, serialnum):
|
def getKindlePids(rec209, token, serialnum):
|
||||||
|
if isinstance(serialnum,str):
|
||||||
|
serialnum = serialnum.encode('utf-8')
|
||||||
|
|
||||||
if rec209 is None:
|
if rec209 is None:
|
||||||
return [serialnum]
|
return [serialnum]
|
||||||
|
|
||||||
pids=[]
|
pids=[]
|
||||||
|
|
||||||
if isinstance(serialnum,str):
|
|
||||||
serialnum = serialnum.encode('utf-8')
|
|
||||||
|
|
||||||
# Compute book PID
|
# Compute book PID
|
||||||
pidHash = SHA1(serialnum+rec209+token)
|
pidHash = SHA1(serialnum+rec209+token)
|
||||||
bookPID = encodePID(pidHash)
|
bookPID = encodePID(pidHash)
|
||||||
|
|
Loading…
Reference in a new issue