12-07-2008, 12:44 AM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2008
Location: Richmond VA
Device: Kindle, IRex DR1000S
|
Deleting AUTHOR fields with mobi2mobi
I have a number of mobi and azw e-books from MobileReference, and they're not very consistent in their headers. In some, they've seen fit to label themselves as not only the Publisher but also as an Author. So these files have two Author headers, one for the actual author and one for MobileReference. On the Kindle, the author shows up as "MobileReference and <whoever>, with the <whoever> getting truncated by the display.
I'm trying to use mobi2mobi.exe from the command prompt to clean this up, using "--delexthtype Author", intending to then add back the real author. But the deletion step doesn't seem to work. The output from the program includes "Deleting extended header data of type: Author", so it's parsing my command line input properly. But the resulting file still has both of the two Author headers. Has anyone tried this? Or is there some other way to do this? |
12-07-2008, 01:21 AM | #2 | |
I'm Super Kindle-icious
Posts: 6,734
Karma: 2434103
Join Date: Apr 2008
Location: Long Drive, Calinadia Candafornia
Device: KDXG, KT, Oasis
|
Quote:
|
|
Advert | |
|
12-07-2008, 02:14 AM | #3 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2008
Location: Richmond VA
Device: Kindle, IRex DR1000S
|
Quote:
I haven't been able to get the GUI version operational, but it looks like it also expects a single Author header. I can see the two headers in a binary file editor, but simply deleting the bytes for the extra one doesn't work as it apparently screws up the length of the database. |
|
12-07-2008, 02:37 AM | #4 | |
I'm Super Kindle-icious
Posts: 6,734
Karma: 2434103
Join Date: Apr 2008
Location: Long Drive, Calinadia Candafornia
Device: KDXG, KT, Oasis
|
Quote:
Would you mind sharing the title of the book. I can download the sample and try to see what the issue is. |
|
12-07-2008, 10:24 AM | #5 | |
The Grand Mouse 高貴的老鼠
Posts: 72,538
Karma: 309500000
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Have you tried taking the output file and running it through mobi2mobi with the --delexthtype Author option?
If there are two Author EXTH entries, it might be that the first pass will delete one, and the next pass will delete the other. Quote:
|
|
Advert | |
|
12-07-2008, 11:35 AM | #6 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
That might work. I have to admit that when writing mobi2mobi I did not think about the possibility to have more than one author field. But I read the code now and it seems that it could work removing all author fields with just one call. But I do not think I have tested this...
|
12-07-2008, 11:51 AM | #7 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2008
Location: Richmond VA
Device: Kindle, IRex DR1000S
|
Quote:
A second pass on the output from the first pass results in a file with a single Author header, which is blank. So this actually deleted one, nulled the other. So then you have to make a third pass with --exthtype and with --exthdata to restore the proper Author. |
|
12-07-2008, 01:35 PM | #8 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
|
|
12-07-2008, 02:03 PM | #9 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Just clarify that the argument to "--delexthtype" should be "author" and not "Author". But I have now rewritten the code so it works for me and the code is nicer. I have also added a flag "--addexthtype" in addition to "--addauthor".
|
12-07-2008, 02:20 PM | #10 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2008
Location: Richmond VA
Device: Kindle, IRex DR1000S
|
Quote:
It looks like it operates on the first Author header, but it doesn't delete the header, but rather replaces the data with a null string. It might be clearer if it did delete it. But if it's the second Author header that you're trying to get rid of, then you likely have to delete both of them and then re-add the first one. Perhaps you could use --delexthtype Author --exthdata "BadAuthor" that would tell it to delete only a header with that particular data. MobileReference seems to have figured out the error of their ways, as their most recent e-books have only contained a single author header. But older ones have included the editor(s), the translator(s), "MobileReference", and "mobi" as Authors. One had 5 author headers! |
|
12-07-2008, 02:32 PM | #11 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Oct 2008
Location: Richmond VA
Device: Kindle, IRex DR1000S
|
Quote:
Is the binary Mobipocket format documented anywhere, or did you just reverse engineer it, so to speak? |
|
12-07-2008, 02:39 PM | #12 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Now I delete all of them. Maybe I should be proactive here and add a flag to specify which one to delete before somebody ask for this functionality...
|
12-07-2008, 02:42 PM | #13 | ||
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
Quote:
|
||
12-17-2008, 06:36 AM | #14 |
The Grand Mouse 高貴的老鼠
Posts: 72,538
Karma: 309500000
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
All the information that I know about the Mobipocket format has been put into the wiki at
https://wiki.mobileread.com/wiki/MOBI |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any suggestion to switch the Title and Author fields? | evertonhs | Calibre | 1 | 11-01-2009 12:04 AM |
used mobi2mobi - no longer indexable? | bxrLvr | Amazon Kindle | 5 | 04-11-2009 05:13 PM |
Title / Author Fields in txt docs | tomtt2 | Sony Reader | 5 | 03-21-2009 08:54 PM |
Bizarre problems with mobi2mobi | AlexBell | Kindle Formats | 4 | 01-05-2009 03:50 AM |
How do you use mobi2mobi? | GatorDeb | Kindle Formats | 3 | 10-11-2008 03:55 PM |