Tachidesk Notifier is a Python-based application that integrates with Tachidesk to send Telegram notifications for new manga chapters. It uses a GraphQL API to fetch manga data, stores information locally, and sends notifications with thumbnails. This entire project was conceptualized and created with the assistance of Claude, an AI language model.
- Fetches manga data from Tachidesk using GraphQL
- Sends Telegram notifications for new unread chapters
- Includes manga thumbnails in notifications
- Caches thumbnails locally to reduce bandwidth usage
- Prevents notification spam for older chapters on first run
- Runs on a customizable schedule using cron (when deployed with Docker)
- Python 3.9 or higher
- Docker (for containerized deployment)
- A Tachidesk instance
- A Telegram Bot Token and Chat ID
-
Clone this repository:
git clone https://github.com/yourusername/tachidesk-notifier.git cd tachidesk-notifier
-
Copy the
.env.sample
file to.env
and fill in your details:cp .env.sample .env
-
Edit the
.env
file with your specific configuration:TACHIDESK_BASE_URL=http://your-tachidesk-base-url:4567 TELEGRAM_BOT_TOKEN=your_telegram_bot_token TELEGRAM_CHAT_ID=your_telegram_chat_id JSON_FILE_PATH=/app/data/manga_data.json THUMBNAIL_DIR=/app/thumbnails SCHEDULE="0 * * * *"
-
Install the required dependencies:
pip install poetry poetry install
-
Run the script:
poetry run python tachidesk_notifier.py
-
Build the Docker image:
docker build -t tachidesk-notifier .
-
Run the Docker container:
docker run -d --name tachidesk-notifier \ --env-file .env \ tachidesk-notifier
or
docker run -d --name tachidesk-notifier \ -e TACHIDESK_BASE_URL=http://your-tachidesk-base-url:4567 \ -e TELEGRAM_BOT_TOKEN=your_telegram_bot_token \ -e TELEGRAM_CHAT_ID=your_telegram_chat_id \ -e JSON_FILE_PATH=/app/data/manga_data.json \ -e THUMBNAIL_DIR=/app/thumbnails \ -e SCHEDULE="0 * * * *" \ -v $(pwd)/data:/app/data \ -v $(pwd)/thumbnails:/app/thumbnails \ tachidesk-notifier
To run the tests for this project:
-
Ensure you have the development dependencies installed:
poetry install
-
Run the tests using pytest:
poetry run pytest
This will run all the tests in the tests/
directory and provide a summary of the results.
TACHIDESK_BASE_URL
: The base URL of your Tachidesk instanceTELEGRAM_BOT_TOKEN
: Your Telegram Bot TokenTELEGRAM_CHAT_ID
: Your Telegram Chat IDJSON_FILE_PATH
: Path to store the manga data JSON fileTHUMBNAIL_DIR
: Directory to store downloaded thumbnailsSCHEDULE
: Cron schedule for running the script (e.g., "0 * * * *" for every hour)
- The script fetches manga data from Tachidesk using the GraphQL API.
- It compares the fetched data with locally stored data to identify new chapters.
- For new or updated manga:
- If it's a new manga, it only sends a notification if the chapter is less than 24 hours old.
- For existing manga with new chapters, it always sends a notification.
- Thumbnails are downloaded and cached locally.
- Notifications are sent via Telegram, including the manga thumbnail and chapter information.
- First Run: To prevent notification spam, only chapters uploaded within the last 24 hours will trigger notifications for newly added manga.
- Subsequent Runs: All new chapters for tracked manga will trigger notifications, regardless of upload date.
To contribute to this project:
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
- Tachidesk for the manga server
- python-telegram-bot for Telegram integration
- Poetry for dependency management