Skip to content

Instantly share code, notes, and snippets.

@pjetr
Created April 27, 2016 14:21
Show Gist options
  • Save pjetr/ba066b2caca043aa10d85a43bb457117 to your computer and use it in GitHub Desktop.
Save pjetr/ba066b2caca043aa10d85a43bb457117 to your computer and use it in GitHub Desktop.

e-pub fixer

When purchasing an e-book from bol.com you get an epub file that isn't valid. Because it isn't valid you can't upload it to play books. Luckily this is easily fixed.

howto

note
this is done on a mac, but would just as easily be done an linux. The steps for windows are a bit different, but it is basically the same principle.
I've done it before on windows by simply opening the epub in winrar, and modifying the contents without even extracting the file.

Open a new terminal window and cd into the folder containing you epub.

unzip book.epub -d book
cd book

In the fresh folder you'll find the contents of the e-book. Most notably a .html file with a random name. This file is the culprit of your file being invalid.

rm 4fcd6ad2b741.html
nano Ops/content.opf

Or you know, open the folder in finder, remove the HTML file and open Ops/content.opf in your favorite texteditor. Find the two lines that reference the .html and remove them. Back to terminal for the final step.

zip -rX book.epub mimetype Ops/ META-INF/

This will give you a brand new book.epub in the folder book. Check online to see if your file is now valid. And upload it to play books.

Now you can share the book on all your google-devices / browser windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment