A python automation script that detects and extracts the cover from your cbz and epub files for each individal volume. Then takes the cover from the first volume and copies that as a cover file for your overall collection.
Allowing the user to use local high-resolution covers within Komga instead of the compressed versions that Komga generates.
Primary usage is with https://github.com/gotson/komga, with volume releases.
There is no compression of the cover by default, see usage at the bottom for compressing the covers.
Detection is based on various scene releases, if none are detected, it will default to the first image. Which, unless you have scans from online, will almost always be the cover.
- Run
git clone https://github.com/zachstultz/komga-cover-extractor.git
or download the repository up above. - Run
pip3 install -r requirements.txt
- (OPTIONAL) (IGNORE IF ALL YOU INTEND TO USE IS COVER EXTRACTION) (ONLY REQUIRED FOR OPT RAR FEATURES)
- Install unrar
- Linux:
sudo apt-get install unrar
- MacOS:
brew install unrar
- Windows: Install UnRAR.dll from https://www.rarlab.com/rar_add.htm
- Linux:
- Install unrar
- Read usage below and enjoy!
usage: komga_cover_extractor.py [-h] [-p [PATHS [PATHS ...]]] [-wh [WEBHOOK [WEBHOOK ...]]] [-c COMPRESS] [-cq COMPRESS_QUALITY]
Scans for covers in the cbz and epub files.
optional arguments:
-h, --help show this help message and exit
-p [PATHS [PATHS ...]], --paths [PATHS [PATHS ...]]
The path/paths to be scanned for cover extraction.
-wh [WEBHOOK [WEBHOOK ...]], --webhook [WEBHOOK [WEBHOOK ...]]
The optional discord webhook url for notifications about changes and errors.
-c COMPRESS, --compress COMPRESS
Whether or not to compress the extracted cover images.
-cq COMPRESS_QUALITY, --compress_quality COMPRESS_QUALITY
The quality of the compressed cover images.
with compression example:
python3 komga_cover_extractor.py -p "/path/to/manga" -p "/path/to/novels" -c "True" -cq "60"
without compression example:
python3 komga_cover_extractor.py -p "/path/to/manga" -p "/path/to/novels"
- Transform script into manga/light novel manager with many features that includes cover extraction, but is not exclusive to it. (in-progress)
- Modularize volume keyword regexes across the script. (in-progress)
- Better documentation.