Closed Jemeni11 closed 5 months ago
Ah there's a problem with this The png format is huge so in a story with many images, you can end up with a massive epub file. So maybe some image compression is needed as well? And conversion to jpg/jpeg which is a lot smaller?
EDIT: No really, I accidentally downloaded a story that was 1.5 GB in size so be careful :laughing:
Turns out on fiction.live, you can have an empty image tag. Just <img />
no src. Crazy!
I tested this out on the Wandering Inn (https://wanderinginn.com/table-of-contents/), which has images in, for example, the Cover page, title page, and chapter 1.02, but it fails to detect all but one of the images. I imagine this has to do with how images are embedded in the HTML on this Wordpress site, but I'm still parsing it out.
Edit: Ah, the issue was I was my json filter selector was preventing them from being read. All of the pictures are detected now, but most fail to load for some reason. It may be an issue with my ebook viewer, however (Calibre).
Edit2: Confirmed the images show up on my Kindle, so it's a Calibre issue that they are broken in their e-book viewer. Thank you and @IdanDor for your work on adding this feature!
There's this weird image-hosting site called filepicker.io that's causing problems when you try to download from it. This new commit should fix it. The fix: https://github.com/JimmXinu/FanFicFare/issues/933#issuecomment-1483848726
These new updates work for me but I only tested them on one site (fiction.live)
This code doesn't download images in xenforo spoilers yet. This will be fixed soon.
EDIT: These xenforo spoiler images are weird. The images get downloaded twice for some reason.
EDIT: Fix for Issue #2 Here's a snippet of the new README
Images support
Leech creates EPUB 2.01 files, which means that Leech can only save images in the following format:
See the Open Publication Structure (OPS) 2.0.1 for more information.
Leech can not save images in SVG because it is not supported by Pillow.
Leech uses Pillow for image manipulation and conversion. If you want to use a different image format, you can install the required dependencies for Pillow and you will probably have to tinker with Leech. See the Pillow documentation for more information.
By default, Leech will try and save all non-animated images as JPEG. The only animated images that Leech will save are GIFs.
To configure image support, you will need to create a file called
leech.json
. See the section below for more information.Configuration
A very small amount of configuration is possible by creating a file called
leech.json
in the project directory. Currently you can define login information for sites that support it, and some options for book covers.Example:
Old:
Partial Fix for Issue #2
Thanks to @IdanDor for this pull request.
This doesn't work for other sites (like fiction.live) so I did this:
It builds up on @IdanDor code as well since it adds all the images it can find to the
chapter.images
list:I only tested this with stories from fiction.live but they've all worked fine. I also ran the epubs made through epubcheck and there were no fatals only minor errors.
I would not even know where to start with making images an option which is why I called this a partial fix