mirror of
https://github.com/ciromattia/kcc
synced 2025-12-20 13:11:47 +00:00
No longer modify header field 504
This commit is contained in:
@@ -143,14 +143,12 @@ class DualMobiMetaFix:
|
|||||||
self.datain_rec0 = readsection(self.datain, 0)
|
self.datain_rec0 = readsection(self.datain, 0)
|
||||||
|
|
||||||
# in the first mobi header
|
# in the first mobi header
|
||||||
# add 501 to "EBOK", add 113 as asin, add 504 as asin
|
# add 501 to "EBOK", add 113 as asin
|
||||||
rec0 = self.datain_rec0
|
rec0 = self.datain_rec0
|
||||||
rec0 = del_exth(rec0, 501)
|
rec0 = del_exth(rec0, 501)
|
||||||
rec0 = del_exth(rec0, 113)
|
rec0 = del_exth(rec0, 113)
|
||||||
rec0 = del_exth(rec0, 504)
|
|
||||||
rec0 = add_exth(rec0, 501, b'EBOK')
|
rec0 = add_exth(rec0, 501, b'EBOK')
|
||||||
rec0 = add_exth(rec0, 113, asin)
|
rec0 = add_exth(rec0, 113, asin)
|
||||||
rec0 = add_exth(rec0, 504, asin)
|
|
||||||
replacesection(self.datain, 0, rec0)
|
replacesection(self.datain, 0, rec0)
|
||||||
|
|
||||||
ver = getint(self.datain_rec0, mobi_version)
|
ver = getint(self.datain_rec0, mobi_version)
|
||||||
@@ -172,14 +170,12 @@ class DualMobiMetaFix:
|
|||||||
self.datain_kfrec0 = readsection(self.datain, datain_kf8)
|
self.datain_kfrec0 = readsection(self.datain, datain_kf8)
|
||||||
|
|
||||||
# in the second header
|
# in the second header
|
||||||
# add 501 to "EBOK", add 113 as asin, add 504 as asin
|
# add 501 to "EBOK", add 113 as asin
|
||||||
rec0 = self.datain_kfrec0
|
rec0 = self.datain_kfrec0
|
||||||
rec0 = del_exth(rec0, 501)
|
rec0 = del_exth(rec0, 501)
|
||||||
rec0 = del_exth(rec0, 113)
|
rec0 = del_exth(rec0, 113)
|
||||||
rec0 = del_exth(rec0, 504)
|
|
||||||
rec0 = add_exth(rec0, 501, b'EBOK')
|
rec0 = add_exth(rec0, 501, b'EBOK')
|
||||||
rec0 = add_exth(rec0, 113, asin)
|
rec0 = add_exth(rec0, 113, asin)
|
||||||
rec0 = add_exth(rec0, 504, asin)
|
|
||||||
replacesection(self.datain, datain_kf8, rec0)
|
replacesection(self.datain, datain_kf8, rec0)
|
||||||
|
|
||||||
self.datain.flush()
|
self.datain.flush()
|
||||||
|
|||||||
Reference in New Issue
Block a user