kevinxiong/epub2txt — pull request #2 by cacol89 (2013-07-08 10:09:35+00:00)
Title: Fixed two bugs: url unquoting and better analysis of root dir

Hi,

I found two bugs in your code and fixed them:

1) Your code fails if there are special characters in the URL of toc contents (for example spaces), so the solution is to simply unquote the URLs.
2) Your code fails when the directory with the ePUB's information is not the standard OEBPS folder: some epubs don't even have it or may have a more complex directory structure. The solution is simply to make a better analysis of the root directory of the "content.opf" file.

I found the bugs when using your code to transform around 4,000 ePUBs to text and around a third of them were giving problems; after fixing those two errors I could parse all of them with no problem.