Skip to content

madking2099/auto_mangadex

Repository files navigation

auto_mangadex

A tool for downloading manga from MangaDex with a focus on automation and ease of use.

Setup

  1. Install Dependencies:
   pip install -r requirements.txt
  1. Environment Variables: Create a .env file in the root directory of the project with the following variables:
# Example environment variables for auto_mangadex
MAX_RETRIES=3
HTTP_TIMEOUT=10
MAX_CONCURRENT_DOWNLOADS=2
PDF_PAGE_SIZE=letter
PDF_CREATION_TIMEOUT=60
ENCRYPTION_KEY=  # This will be automatically generated if not set or if set to empty or whitespace
MANGADEX_BASE_URL=https://api.mangadex.org/
CACHE_TTL=300
MAX_RESPONSE_TIME=10.0
IMAGE_QUALITY=data
RATE_LIMIT_CALLS=2
DATABASE_TYPE=sqlite
DB_NAME=mangadex_data
DB_USER=admin
DB_PASSWORD=default_password
DB_HOST=localhost
DB_PORT=5432
OUTPUT_DIRECTORY=./downloads  # Directory where downloads will be saved
  • Note: If ENCRYPTION_KEY is not set, empty, or contains only whitespace, it will be automatically generated by the application. Ensure the directory specified by OUTPUT_DIRECTORY exists or create it before running the application.

Database Setup

  • SQLite: No additional setup is required; the database will be created automatically.
  • MySQL/PostgreSQL:
    • Ensure the database server is running.
    • Create a database named mangadex_data or change DB_NAME in .env.
    • Ensure DB_USER has the necessary permissions to create tables, insert, update, etc.

Usage

Run the CLI tool:

python cli.py

Command Line Arguments:

--test: Run in test mode without actual downloads. Example:

python cli.py --test

Troubleshooting

  • Authentication Issues: Check your MangaDex UID and Password in your .env file or ensure they are correctly entered when prompted.
  • Download Failures: Verify internet connectivity and check if MangaDex is accessible. Also, ensure your OUTPUT_DIRECTORY exists and has write permissions.
  • Database Errors: Confirm your database settings in .env match your actual setup. Check if the database server is running for non-SQLite databases.

Commands

  • Search: Search for manga by name, author, tags, etc.
  • Info: Get detailed information about a manga.
  • Download: Download chapters or an entire manga as PDF or PNG files.
  • List: Manage personal MangaDex lists.
  • Auth: Handle login, logout, and check authentication status.

Customization

  • Output Directory: You can specify where downloaded files are saved by setting OUTPUT_DIRECTORY in your .env file. By default, files will be saved in a downloads folder in the project's root directory. Make sure this directory exists before starting the download process.

Features

  • Asynchronous downloading for better performance.
  • Robust error handling and retry mechanisms.
  • Logging for tracking actions and debugging.
  • User configuration storage for persistent settings across sessions.
  • Support for multiple database backends (SQLite, MySQL, PostgreSQL).

Contributing Feel free to fork this repository and submit pull requests. Contributions are welcome!

License

This project is licensed under the MIT License.

Additional Notes:

  • I've added a section under "Environment Variables" to explain ENCRYPTION_KEY behavior.
  • Included OUTPUT_DIRECTORY in the environment variables section with a note on its usage for customization.
  • Updated the "Usage" and "Customization" sections to reflect these changes.
  • Make sure to replace [Your License here, e.g., MIT, GPL, etc.] with the actual license information for your project.
  • Added a note under ENCRYPTION_KEY to clarify that it will be automatically generated if not properly set.
  • Added a reminder about the OUTPUT_DIRECTORY under both the "Environment Variables" and "Customization" sections to ensure users know they need to create or verify the existence of this directory before running the application.

Contributors:

  • madking2099
  • Grok2
  • You

Feel free to fork this repository and submit pull requests. Contributions are welcome!

Project

This is a series of Python files that interact with each other and the public MangaDex API.

The goal of this set of files and project is to be a docker-ized web-application that can executed via CLI as well.

Each file will contain 1 or more class objects that can be imported modularly without conflicting function and class names.

The possible result may even be something that can be container-ized.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages