Glax c94c55300c
Some checks failed
Docker Image CI / build (push) Has been cancelled
https://github.com/C9Glax/tranga/issues/361 Chromium Close Pages that errored.
2025-03-27 20:30:51 +01:00
2025-03-08 19:02:14 +01:00
2024-12-16 18:29:57 +01:00
2024-12-16 18:29:57 +01:00
2023-05-20 15:34:32 +02:00
2025-03-13 15:34:29 +01:00
2024-12-16 17:47:12 +01:00
2023-10-27 13:47:37 +02:00

Tranga v2

Automatic Manga and Metadata downloader

GitHub License

GitHub branch check runs Last Run
GitHub branch check runs Last Run
GitHub branch check runs Last Run

About The Project

Tranga can download Chapters and Metadata from "Scanlation" sites such as

and trigger a library-scan with Komga and Kavita.
Notifications can be sent to your devices using Gotify, LunaSea or Ntfy, or any other service that can use REST Webhooks.

What this program does and does not do

Tranga (the program in this repository) is a REST-API and worker in one. Meaning it will open a network-port to listen for requests, and then work through these. Requests include searches for Manga, starting "Jobs" such as downloading available chapters, creating a monitoring job (that will periodically do the aforementioned), update metadata, and more.

This repository does not include a frontend. A frontend can take many forms, such as a website:

tranga-website

When downloading a chapter (meaning the images that make-up the manga) from a Scanlation-Website, Tranga will additionally try and scrape Metadata from the same website or enhance it from third-party sources (tbd https://github.com/C9Glax/tranga/issues/280). Downloaded images can be jpeg-compressed and/or made black and white to save on diskspace (measured at least a 50% reduction in size, without a significant loss of quality).

Tranga will then package the contents of each chapter in a .cbz-archive and place it in a common folder per Manga. If specified, Tranga will then notify library-Managers such as Komga and Kavita to trigger a scan for new chapters. Tranga can also send notifications to your devices via third-party services such as Gotify, LunaSea or Ntfy.

Screenshots

This repository has no frontend, however checkout tranga-website for a default!

Inspiration:

Because Kaizoku was relying on mangal and mangal hasn't received bugfixes for its issues with Titles not showing up, or throwing errors because of illegal characters, there were no alternatives for automatic downloads. However, Kaizoku certainly had a great Web-UI.

That is why I wanted to create my own project, in a language I understand, and that I am able to maintain myself.

(back to top)

Endpoint Documentation

Endpoints are documented in Swagger. Just spin up an instance, and go to http://<url>/swagger.

Built With

(back to top)

Star History

Star History Chart

Getting Started

Docker

An example docker-compose.yaml is provided. Mount /Manga to wherever you want your chapters (.cbz-Archives) downloaded (where Komga/Kavita can access them for example).
The file also includes tranga-website as frontend. For its configuration refer to the Tranga-Website Repository README.

For compatibility do not execute the compose as root (which you should not do anyways...) but as user that can access the folder. Permission conflicts with Komga and Kavita should thus be limited.

Bare-Metal

While not supported/currently built, Tranga will also run Bare-Metal without issue.

Configuration-Files will be stored per OS:

  • Linux /usr/share/tranga-api
  • Windows %appdata%/tranga-api

Downloads (default) are stored in - but this can be configured in settings.json:

  • Linux /Manga
  • Windows %currentDirectory%/Downloads

Prerequisits

.NET-Core 9.0

Contributing

If you want to contribute, please feel free to fork and create a Pull-Request!

General rules:

  • Strongly-type your variables. This improves readability.
var xyz = Object.GetSomething(); //Do not do this. What type is xyz?
Manga[] zyx = Object.GetAnotherThing(); //I can now easily see that zyx is an Array.

A broad overview of where is what:

  • Program.cs Configuration for ASP.NET, Swagger (also in NamedSwaggerGenOptions.cs, Npgsql
  • Tranga.cs Job(worker)-Logic
  • Schema/ Entity-Framework
    • Schema/Jobs/ + Logic for Jobs
    • Schema/**/ + Logic for **
    • Schema/PgsqlContext.cs EF configuration
  • MangaDownloadClients/ Networking-Clients for Scraping
  • Controllers/ ASP.NET Controllers (Endpoints)
  • APIEndpointRecords/ Records for API-Requests with specific Request-Types (Body)

If you want to add a new Scanlationsite-Connector:

  1. Copy one of the existing connectors, or start from scratch and inherit from API.Schema.MangaConnectors.MangaConnector.
  2. Add the new Connector as Object-Instance in Program.cs to the MangaConnector-Array connectors.
  3. In Schema/PgsqlContext.cs add the Discriminator for the Connector (the value is the name of the connector, as defined in the constructor).

License

Distributed under the GNU GPLv3 License. See LICENSE.txt for more information.

(back to top)

Acknowledgments

(back to top)

Description
Languages
C# 99.4%
Dockerfile 0.6%