Merge pull request #1499 from xxyzz/kfx

encode serialnum before returning it, close #1479
pull/1529/head
Apprentice Harper 3 years ago committed by GitHub
commit 52e83922c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -174,14 +174,14 @@ def pidFromSerial(s, l):
# Parse the EXTH header records and use the Kindle serial number to calculate the book pid.
def getKindlePids(rec209, token, serialnum):
if isinstance(serialnum,str):
serialnum = serialnum.encode('utf-8')
if rec209 is None:
return [serialnum]
pids=[]
if isinstance(serialnum,str):
serialnum = serialnum.encode('utf-8')
# Compute book PID
pidHash = SHA1(serialnum+rec209+token)
bookPID = encodePID(pidHash)

Loading…
Cancel
Save