08-28-2008, 05:55 PM | #1 |
Jack O' Apes
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
|
Perl only access to imp file info
I have been curious for the past few days if it were possible to get information out of imp format files without using the eBook Publisher software from eti. The api that they provide seems to be full featured and has let nick do some wonderful things managing the imp files. The down side of that, for me at least, is that you need windows for most of it to work.
So being curious I pulled out my Camel book and decided to wade around and see if I could get some of the information out of an imp file. The attached short script is the beginning of what I've been able to extract from unencrypted books so far. There is more but this is pertinent for sorting and searching through a collection of imp ebooks that might have gotten just thrown into a directory with none too descriptive names. Location of the information in the file came from http://www.chromakinetics.com/REB1200/imp_format.htm |
08-28-2008, 06:12 PM | #2 | |
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
I've been working on 'imp_dump.pl' (see here) for the past few months to allow me to dissect an .imp into it's component parts - text/images/links/styles. Once this is finished the process of re-building the html with images and links and styles can begin. I 've managed to get most of the .RES filetypes decoded, but still hung up on a few. More on this as I finish... |
|
Advert | |
|
08-28-2008, 07:56 PM | #3 |
Addict
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
|
I too have some unfinished code, but now that I can use impmake on Linux I don't think I'll be ever able to work up the enthusiasm to complete it.
|
08-29-2008, 09:20 AM | #4 |
Jack O' Apes
Posts: 227
Karma: 1939
Join Date: Dec 2007
Location: Oklahoma
Device: Ebookwise 1150, Nokia N810, EZ-Reader, HTC Droid Incredible, Archos 70
|
Wasn't really going to try for a perl only solution to building imp files. Something more along the lines of being able to catalog the imp files without having to resort to running apps in wine. Actual creation of the imp files that way isn't a problem.
I do want to be able to use something like impfind --author Ringo and have it spew out a list of titles and paths to all of the files. I'm thinking it would be uesful to search on all the fields execpt the id. Shouldn't be too hard for me to do now that I can extract the info from the files. All that is left is just moving through the directory tree and generating the list on the right key. |
08-29-2008, 09:29 AM | #5 | ||
GuteBook/Mobi2IMP Creator
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
|
Quote:
Quote:
|
||
Advert | |
|
08-29-2008, 11:38 AM | #6 | |
Addict
Posts: 350
Karma: 705
Join Date: Dec 2006
Location: Mumbai, India
Device: Kindle 1/REB 1200
|
Quote:
Code:
def get_ebook_info(name):
""" get the details of the IMP book as a tuple """
if not isfile(name):
return None
info = [name, getsize(name), getmtime(name)]
f = open(name, 'rb')
if f.read(10) != '\x00\x02BOOKDOUG':
return None
def cString(skip=0):
result = ''
while 1:
data = f.read(1)
if data == '\x00':
if not skip: return result
skip -= 1
result, data = '', ''
result += data
f.read(38)
info += [cString(), cString(), cString(1), cString(2)]
f.close()
return tuple(info)
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Is there a kindle.info file on Kindles updated to 2.5.X? | KevinH | Kindle Developer's Corner | 7 | 09-09-2010 03:15 PM |
K2 system file access | dwallbaum | Amazon Kindle | 2 | 09-08-2010 05:32 PM |
Using perl scripts to produce .IMP ebooks and more... | nrapallo | IMP | 43 | 04-22-2009 01:05 AM |
Easist way to modify IMP books internal header info? | askyn | IMP | 23 | 04-09-2009 11:20 AM |
author info on plain txt file | jakeluck | Sony Reader | 6 | 11-23-2006 07:59 PM |