View Single Post
Old 07-24-2011, 06:52 AM   #1
dilo_sec
Member
dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.dilo_sec ought to be getting tired of karma fortunes by now.
 
Posts: 21
Karma: 244219
Join Date: Jul 2011
Device: K3
new exthupdt.py to update title in EXTH header to the filename

I've had need for such a tool for a while now - rather than using a few existing tools to achieve the same thing, but sometimes with unexpected side effects. I wrote this in the last few days...

exthupdt.py is unashamedly based on the code in mobiunpack.py 0.26 - thanks guys, you know who you are!

exthupdt.py simply and quickly updates the title in the EXTH header to the filename (less the extension) so it displays correctly (as I want it to appear) in the Kindle. The title at the end of the EXTH header (referenced in the MOBI header) is also updated. It can also optionally remove the ASIN record in the EXTH record so collection generators, to organise books in Author folders, now work as expected.

Usage: exthupdt.py [options] mobifile

Options:
-h, --help show this help message and exit
-d, --debug to print debug information
-r, --raw to create additional raw data files
-a, --asin to remove the ASIN record from the EXTH section
-t, --title to update the title to the filename (default=True)

the output is a .mobi file, so change the input file extension (e.g. to .m)
example: exthupdt.py --asin inputfile.m

Please report any problems here.

Have fun!
Dilo.
Attached Files
File Type: zip exthupdt.zip (3.2 KB, 482 views)

Last edited by dilo_sec; 07-24-2011 at 08:29 AM. Reason: zip file update
dilo_sec is offline   Reply With Quote