Patrick-Hogan / wandering_inn

Download and convert The Wandering Inn to epub and mobi (kindle) format
27 stars 16 forks source link

Issue on OSX (Python 3.10) #13

Closed kleineluka closed 1 year ago

kleineluka commented 1 year ago

Issue All options generate empty epub books. I'm running OSX Ventura 13.2.1.

Might be multiple causes, starting with dependencies. I'm running Python3.10 as I only saw Python3 as a requirement, if you specifically suggest another version please let me know. When running pip install -r requirements.txt in the cloned directory, the following error is given:

ERROR: Could not install packages due to an OSError: Cannot move the non-empty directory '/opt/homebrew/lib/python3.10/site-packages/tqdm-4.64.1-py3.10.egg': Lacking write permission to '/opt/homebrew/lib/python3.10/site-packages/tqdm-4.64.1-py3.10.egg'.

Seeing as this is a permissions related error, I resolved it by running the command as sudo. It may be worth nothing that for OSX this is a necessary step. The problem still persists after this, though, and the same output is generated. Here is a sample command and the output:

Test Case #1 Input: python3.10 ./wanderinginn2epub.py Output: Chapter: 0it [00:00, ?it/s] Generating ePub file for eBook "The Wandering Inn". ePub file "./build/The Wandering Inn.epub" successfully generated.

Test Case #2 Input: python3.10 ./wanderinginn2epub.py --volume 1 --output-by-chapter Output: truncated all of the html output.. <a href="https://wanderinginn.com/2022/04/26/8-82-pt-3/">8.82 (Pt. 3)</a><br/> <a href="https://wanderinginn.com/2022/05/03/8-83/">8.83</a><br/> <a href="https://wanderinginn.com/2022/05/03/8-84/">8.84</a><br/> <a href="https://wanderinginn.com/2022/05/03/8-85/">8.85</a><br/> <a href="https://wanderinginn.com/2022/05/03/epilogue/">Epilogue</a></p> Chapter: 0it [00:00, ?it/s] Generating ePub file for eBook "The Wandering Inn".

Test case 1 generates an empty epub, while test case 2 does nothing but exits the program. I apologize if this an error on my end or during installation, as Python is not something I am very familiar with.

Patrick-Hogan commented 1 year ago

For install, I can look at adding some more details to the readme. Basically, what you ran into was:

Usually, I've considered any "how-to" for installing python/python packages as out of scope for this project, but I don't mind adding some links to other documentation to make it easier.

For the other errors: It's a result of some changes to the wandering inn website, now fixed thanks to this PR and some minor updates to handling some image file names on the latest commit on main: if you run git pull origin (or fetch and merge, or re-clone, etc.) to get the updates and apply to your work tree, it should fix the problem.

Note: you'll probably have to manually remove the ./build directory (or at least ./build/html; very bare minimum, remove any empty/malformed html files from that directory) to get the updated script to work. I try to be very lazy about downloading the html (avoid putting any more strain on the website than needed), so any malformed html files will both prevent re-fetching the content (since the file already exists) and cause errors when generating any ebook.

Let me know if you're still having problems and we can re-open this issue.