12-20-2007, 03:53 PM | #1 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Mobiperl - Perl tools for handling MobiPocket files
Mobiperl is a collection of tools I am writing in Perl for handling MobiPocket files. Since it works OK and I am interested in suggestions for more functionality I start a new thread for it.
The latest version is 0.0.43 and it can be found here: http://www.ida.liu.se/~tompe/mobiperl/downloads/ (updated July 2013) *original text* I have not yet tested mobiperl in Windows yet but if nobody else beat me to it I will try to test it during and write down how to use the programs under Windows. As I understand it ActivePerl is very common and it contains PPM that can be used to install packages. Currently Mobiperl consists of:
I am also planning to write a mobi2opf program that explodes a MobiPocket file and tries to create an OPF structure. Last edited by DaleDe; 07-10-2013 at 10:52 AM. Reason: fix the links and update the version number. |
12-20-2007, 03:59 PM | #2 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Mobiperl: mobi2mobi
Since a lot of people have mentioned that it would be useful to be able to manipulate meta data and to add cover image to a prc or mobi file I wrote mobi2mobi. Here is the description of the program:
A program to manipulate MobiPocket files. Author and title can be set and a cover image (thumb nail image for Gen3) can be added. There are two kind of prc files used for electronic books. One is a PalmDOC file which does not have a MOBI header but can contain HTML code marked up with MobiPocket specific markup and it can be read by a MobiPocket reader. For this format you cannot store meta information in the header. The other format is MobiPocket and it has a MOBI header and some additional data where you can store meta information and an extended title. This program can change the extended title for a MobiPocket file. It can also automatically convert a PalmDOC file to a MobiPocket file and set the title. It can also add author information to a PalmDOC file by converting it to a MobiPocket file and set the author meta information. You can also add a prefix to a title in a MobiPocket file. This does not work for PalmDOC files. It is possible to add an image to the file. If there are no other images in the file then the added image will be used as cover image and thumb nail image for Gen3. Just running the program on a mobifile without any flags will print some information about the file. Since there is no specification available for the MOBI header this program might generate books that are not entirely correct. So keep the original file... |
Advert | |
|
12-20-2007, 04:44 PM | #3 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
I would love to try it but I have no clue how to run it on Windows XP. I downloaded ActivePerl but don't know what to do next.
|
12-20-2007, 05:41 PM | #4 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
For mobi2mobi you will need to install the Perl packages:
There should be something called PPM to install packages. To check the documentation do "perldoc mobi2mobi". To change a title do 'perl mobi2mobi --title "New Title" --outfile newfile.mobi originalfile.mobi". I assume you have to use a dosbox or cygwin or some shell with ActivePerl to do this. But I am really not a Windows user so I might be mistaken. |
|
12-20-2007, 05:52 PM | #5 | |
Wizard
Posts: 2,999
Karma: 300001
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Hello!
Quote:
PLEASE!!! Derek |
|
Advert | |
|
12-20-2007, 06:51 PM | #6 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
If it is possible to create an executable than this might be an option. The disadvantage is that I have to boot to Windows to create a new version.
I have uploaded version 0.0.7. The bug I fixed was that the title change did not work for DRM:ed books. Now it works for my dictionary at least. |
12-21-2007, 05:41 PM | #7 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
How to install ActivePerl on Windows for mobi2mobi and html2mobi
This is what you need to do to run the Mobiperl program on Windows.
Install ActivePerl 5.8.8 (easily found by google). maybe 5.10 also works but I did not test that version. Start the "Perl Package Manager" (from the program menu) and install packages. A package can also be installed from a cmd prompt with "ppm install packagename". For mobi2mobi install the packages:
For html2mobi you have to add the repository http://theoryx5.uwinnipeg.ca/ppms/package.lst to the package manager (in preferences). Then install the packages:
Documentation for mobi2mobi and html2mobi can be found here: |
12-21-2007, 05:47 PM | #8 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
For it to work on Windows with ActivePerl you need to get version 0.0.8 of Mobiperl.
I tested html2mobi on Windows with an HTML file and it worked. There was some problem with an opf file but I will look at that. I will also fix so that lit2mobi works properly on Windows. It should be possible to package a Perl program in one Windows binary using PAR::Packer but I could not get it to work in Windows with ActivePerl (it did work in Linux). If I get this to work I will distribute the programs that way also. But the solution to the problem might be to wait for a better binary distribution of PAR::Packer and then it can take some time... |
12-21-2007, 06:51 PM | #9 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
12-21-2007, 07:34 PM | #10 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
|
12-21-2007, 07:37 PM | #11 |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
The uwinnipeg repository is need for the GD package. I also had to include the Palm:oc module in the mobiperl distribution since the package containing this module had an old version that did not work for MOBI files.
|
12-21-2007, 10:42 PM | #12 | |
Wizard
Posts: 2,999
Karma: 300001
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Quote:
So, as nice as your mobitools appear to be, I won't be using them until they are turned into true executable apps. Derek |
|
12-21-2007, 10:44 PM | #13 | |
Wizard
Posts: 2,999
Karma: 300001
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
|
Quote:
If scripting tools are so wonderful, why do I need so many of them? Ruby, Python, Perl, Javascript, VBscript... Then there's the MS .Net - GAWD! |
|
12-22-2007, 06:24 AM | #14 | |
Grand Sorcerer
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
|
Quote:
http://www.activestate.com/store/pro...5-08d58c2648ca to a page where you can choose ActivePerl which is free. But I totally undestand that having executables is much better and will try to fix that. But if you want to be able to do extensions yourself or help to find bugs you need the development environment. On the other hand you install or have a lot of programs on your computer that works on non executable code so it should not be an issue. Why do you have a program to read books? Why is not each book an executable? |
|
12-22-2007, 08:03 AM | #15 |
Gadget Force®
Posts: 705
Karma: 2733
Join Date: Jun 2006
Location: The Netherlands
Device: Sony PRS-300 + Cybook with funny screen :P
|
I successfully changed the title of my book with mobi2mobi on my Windows XP. Thanks for the program Tommy! A small question though, when I imported it in MobiPocket Reader and then trying to send it to the Cybook, he asked me for the Login data of Fictionwise where I have bought the book. Could it be that mobi2mobi does something with the PID inside or sort?
EDIT: If the book already has a cover image, should it show the new cover image set by mobi2mobi? I tried it and it keeps showing the original. Last edited by diabloNL; 12-22-2007 at 09:28 AM. |
Tags |
mobi2mobi, mobils |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mobi2Mobi Mobi2Mobi v0.13 - GUI for Mobiperl tools | Jad | Kindle Formats | 476 | 03-15-2015 06:51 PM |
Tools for Editing Kindle .mobi Files? | GJN | Kindle Formats | 33 | 12-26-2013 03:05 PM |
Handy Perl Script to convert HTML0 files to smartquotes | maggotb0y | Sony Reader | 0 | 04-12-2007 12:49 PM |
PRS-500 Perl tools to generate Reader content | TadW | Sony Reader Dev Corner | 0 | 01-08-2007 06:55 AM |
gmail copy (gmcp) - Perl script to copy files to/from Gmail | Colin Dunstan | Lounge | 0 | 09-04-2004 02:24 PM |