How to get ISBN number from .mobi file with python

半腔热情 提交于 2019-12-03 21:24:52

Yes.

Basically, you just need to parse the PalmDB file format. The ISBN is stored in the EXTH header field of type 104.

The Python PalmDB module I have linked above was somewhat immature when I wrote my Kindle collections manager, so I ended up implementing the relevant parts myself, see kiehinen source code for details.

If it is OK for you to use my code (It has non-contagious MIT License, should not be a problem, right?) you can just do:

>>> from kiehinen.ebook import Book
>>> b = Book("hobbit.mobi")
>>> b.exth['isbn'][0]
'9780618260300'

If not, please see the code linked above.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!