From 0272961435563065a8c994208a660aacabafc9a2 Mon Sep 17 00:00:00 2001 From: ShivamB25 <104637569+ShivamB25@users.noreply.github.com> Date: Wed, 10 Jan 2024 23:55:45 +0530 Subject: [PATCH 1/2] Create github.yaml --- .github/workflows/github.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/github.yaml diff --git a/.github/workflows/github.yaml b/.github/workflows/github.yaml new file mode 100644 index 0000000..939dc2b --- /dev/null +++ b/.github/workflows/github.yaml @@ -0,0 +1,25 @@ +name: Deploy Images to GHCR + +on: + push: + branches: + - main + workflow_dispatch: + +jobs: + push-store-image: + runs-on: ubuntu-latest + steps: + - name: 'Checkout GitHub Action' + uses: actions/checkout@main + + - name: 'Login to GitHub Container Registry' + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{github.actor}} + password: ${{secrets.GITHUB_TOKEN}} + - name: 'Build Inventory Image' + run: | + docker build . ghcr.io/zachstultz/komga-cover-extractor:latest + docker push ghcr.io/zachstultz/komga-cover-extractor:latest From 820ad07d169402024bb23ba0eafc7b5f1ca7042b Mon Sep 17 00:00:00 2001 From: shivam Date: Thu, 11 Jan 2024 00:34:00 +0530 Subject: [PATCH 2/2] 1. Add a table of contents for easy navigation. 2. Include a brief introduction section that explains what Komga is and how the Komga Cover Extractor enhances the user experience. 3. Expand the "Installation" section to include more detailed steps and clarify the requirements. 4. Refine the "Usage" section to make it more user-friendly, including a brief explanation of each argument. 5. Provide a more detailed "Examples" section with explanations of each example. 6. Update the "Future Goals" section to be more concise and clear. 7. Add a "Contributing" section to encourage community involvement. 8. Include a "License" section to inform users about the terms of use. 9. Add a "Support and Contact" section for users to know where to seek help or report issues. 10. Enhance the overall formatting for better readability, such as using bold text for section titles and bullet points for lists. --- LICENSE.md | 21 ++++++++++ README.md | 110 +++++++++++++++++++++++++++++------------------------ 2 files changed, 81 insertions(+), 50 deletions(-) create mode 100644 LICENSE.md diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..9535ae1 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 [fullname] + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 6d66edb..e1b34d1 100644 --- a/README.md +++ b/README.md @@ -1,73 +1,83 @@ -# Komga Cover Extractor -A python automation script that detects and extracts the cover from your zip, cbz, and epub files for each individual 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-based releases**. - -**There is no compression of the cover by default, see usage at the bottom for compressing the covers.** +## Table of Contents +1. [Introduction](#introduction) +2. [Installation](#installation) +3. [Usage](#usage) +4. [Examples](#examples) +5. [Future Goals](#future-goals) +6. [Contributing](#contributing) +7. [License](#license) +8. [Support and Contact](#support-and-contact) + +### 2. Introduction + +```markdown +The Komga Cover Extractor is a Python automation script designed to enhance the user experience of Komga, a manga and light novel manager. This script automates the detection and extraction of covers from zip, cbz, and epub files, providing users with high-resolution local covers within Komga. +``` -## Cover Detection -Detection is based on various scene releases, if none are detected, it will default to the first image. Which, unless you have scans from the internet, it will almost always be the cover. +### 3. Installation -## Finished Result Example: -![image](https://user-images.githubusercontent.com/8385256/152403016-90660098-0b04-4178-babd-87e56ff1b390.png) +To use the Komga Cover Extractor, follow one of the options below: -## Installation -To use the Komga Cover Extractor, you have several options: +### Docker (Recommended) +You can use the [Docker image available here](https://hub.docker.com/r/zachstultz/komga-cover-extractor), which simplifies the setup process. -1. **Docker (Recommended):** You can use the [Docker image available here](https://hub.docker.com/r/zachstultz/komga-cover-extractor), which simplifies the setup process. +### Manual Installation +If you prefer manual installation, follow these steps: +1. Clone the repository: `git clone https://github.com/zachstultz/komga-cover-extractor.git` +2. Install required Python packages: `pip3 install -r requirements.txt` +3. (OPTIONAL) If you intend to use advanced RAR features, you may need to install unrar: + - Linux: `sudo apt-get install unrar` + - MacOS: `brew install rar` (requires [brew](https://brew.sh/)) (untested) + - Windows: Install UnRAR.dll from [rarlab.com](https://www.rarlab.com/rar_add.htm) (untested) -2. **Manual Installation:** If you prefer manual installation, follow these steps: - 1. Clone the repository: `git clone https://github.com/zachstultz/komga-cover-extractor.git` - 2. Install required Python packages: `pip3 install -r requirements.txt` - 3. (OPTIONAL) If you intend to use advanced RAR features, you may need to install unrar: - - Linux: `sudo apt-get install unrar` - - MacOS: `brew install rar` (requires [brew](https://brew.sh/)) (untested) - - Windows: Install UnRAR.dll from [rarlab.com](https://www.rarlab.com/rar_add.htm) (untested) +### 4. Usage +#### The Komga Cover Extractor provides several options for cover extraction. Here's how to use it: -## Usage -The Komga Cover Extractor provides several options for cover extraction. Here's how to use it: +```bash +python3 komga_cover_extractor.py [-h] [-p [PATHS [PATHS ...]]] -wh WEBHOOK1,WEBHOOK2,upto N [-c COMPRESS] [-cq COMPRESS_QUALITY] ``` -usage: komga_cover_extractor.py [-h] [-p [PATHS [PATHS ...]]] [-wh [WEBHOOK [WEBHOOK ...]]] [-c COMPRESS] [-cq COMPRESS_QUALITY] - -Scans for covers in the zip, 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. -``` -## Examples -Here are a couple of usage examples: +- `-p` or `--paths`: The path/paths to be scanned for cover extraction. +- `-wh` or `--webhook`: The optional Discord webhook URL for notifications about changes and errors. +- `-c` or `--compress`: Whether or not to compress the extracted cover images. +- `-cq` or `--compress_quality`: The quality of the compressed cover images. + +### 5. Examples - **With Compression:** - ``` + ```bash python3 komga_cover_extractor.py -p "/path/to/manga" -p "/path/to/novels" -c "True" -cq "60" ``` - + - **Without Compression:** - ``` + ```bash python3 komga_cover_extractor.py -p "/path/to/manga" -p "/path/to/novels" ``` +### 6. Future Goals -## Future Goals -Our development team has ambitious plans for the Komga Cover Extractor, which include: +```markdown +Our development team has ambitious plans for the Komga Cover Extractor, including: -1. Transforming the script into a comprehensive manga/light novel manager with a wide range of features that include cover extraction but are not limited to it (in-progress). +1. Transforming the script into a comprehensive manga/light novel manager with a wide range of features (in-progress). 2. Modularizing volume/chapter keyword regexes across the script (in-progress). 3. Improving documentation to make the tool even more user-friendly (in-progress). +``` -For more information and updates, please refer to the [project's GitHub repository](https://github.com/zachstultz/komga-cover-extractor). +### 7. Contributing + +```markdown +We welcome contributions! If you'd like to contribute to the Komga Cover Extractor, please follow our [Contribution Guidelines](CONTRIBUTING.md). +``` + +### 8. License + +```markdown +This project is licensed under the [MIT License](LICENSE). +``` -Feel free to choose the installation method that suits your needs, and enjoy the benefits of using the Komga Cover Extractor! +### 9. Support and Contact +```markdown +If you need help or want to report issues, please [create an issue](https://github.com/zachstultz/komga-cover-extractor/issues) on GitHub. +``` \ No newline at end of file