View Single Post
Old 04-20-2010, 01:52 PM   #151
epstewart
Connoisseur
epstewart will become famous soon enoughepstewart will become famous soon enoughepstewart will become famous soon enoughepstewart will become famous soon enoughepstewart will become famous soon enoughepstewart will become famous soon enough
 
Posts: 54
Karma: 558
Join Date: Oct 2009
Device: iPhone 3G 16GB, B&N nook
Quote:
Originally Posted by EatingPie View Post
I found an alternate solution to this problem.

- DOES NOT require unzip/rezip. (The Good News!)
- DOES require the command line. (The Bad News, unless you're me. )

It also eliminates the do not use unzip on the command line warning. An unzip will work fine afterward, though it won't be necessary, since the archive is repaired directly.
Good deal!

Quote:
Originally Posted by EatingPie View Post
Here goes...

The zip file has a corrupted file name in the archive, as mentioned above. The command line version of zip on Mac OS X actually has the ability to repair zip files. Since this is a pretty simple repair, it works fine.

Note that the zip command alters the file in place, so you probably want to work on a copy.

Code:
% cp your-epub.epub new-epub.epub
% zip -F new-epub.epub
The -F option means to fix the file.

Quote:
Originally Posted by EatingPie View Post
To test the archive, you can use the unzip command:

Code:
% unzip -qt new-epub.epub
The 't' part of '-qt' means to test the file for correctness. The 'q' part of '-qt' means to do so quietly.

Quote:
Originally Posted by EatingPie View Post
If the fix worked, you shouldn't see anything. Just a clean run, all clear and back to the prompt. This also doesn't actually unzip anything, it's just a test run.

Okay!!

Now you can run ineptepub.pyw on the fixed file (it has a command-line/no GUI mode when you pass it parameters).

Code:
% python ineptepub.pyw  adeptkey.der new-epub.epub decrypted.epub
For me the command brought up the GUI version of ineptepub, which is fine.
epstewart is offline   Reply With Quote