Tranga can download Chapters and Metadata from "Scanlation" sites such as
- MangaDex.org (Multilingual)
- MangaWorld (it)
- MangaPark (en)
- ❓ Open an issue
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.
DOES: Download Images from a Website.
DOES: Create Archives with those images.
how?
Tranga (this repository) is a REST-API and worker in one. Tranga provides REST-Endpoints to configure workers (Jobs).
Requests include searches for Manga, creating and starting Jobs such as downloading available chapters.
For available endpoints check http(s)://<hostedInstance>/swagger or API/openapi/API_v2.json
This repository does not include a frontend. A frontend can take many forms, such as a website:
tranga-website (Original)
tranga-yacobGUI (Third Party)
When downloading a chapter (meaning the images that make-up the manga) from a Website, Tranga will additionally try and fetch Metadata from the same website or enhance it from third-party sources. 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, Ntfy,
or any other REST Webhook.
This repository has no frontend, however checkout tranga-website for a default!
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.
Checkout openapi/API_v2.json
The container also spins up a Swagger site at http://<url>/swagger.
- ASP.NET
- EF Core
- PostgreSQL
- Ngpsql
- Swagger
- Newtonsoft.Json
- Sixlabors.ImageSharp
- Html Agility Pack (HAP)
- Soenneker.Utils.String.NeedlemanWunsch
- Jikan
- BuildInformation
- 💙 Blåhaj 🦈
Built for AMD64 (and ARM64, maybe, if it feels like it).
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.
| Environment Variable | default | Description |
|---|---|---|
| POSTGRES_HOST | tranga-pg:5432 |
host-address of postgres database |
| POSTGRES_DB | postgres |
name of database |
| POSTGRES_USER | postgres |
username used for database authentication |
| POSTGRES_PASSWORD | postgres |
password used for database authentication |
| DOWNLOAD_LOCATION | /Manga |
Target-Directory for Downloads (Container path!) |
| FLARESOLVERR_URL | URL of Flaresolverr-Instance | |
| POSTGRES_COMMAND_TIMEOUT | 60 |
Timeout of Postgres-commands |
| POSTGRES_CONNECTION_TIMEOUT | 30 |
Timeout for postgres-databaes connection |
| CHECK_CHAPTERS_BEFORE_START | true |
Whether to update database downloaded chapters column |
| MATCH_EXACT_CHAPTER_NAME | true |
Match the stored filename exactly with the filename on disk when checking if a chapter is downloaded |
| CREATE_COMICINFO_XML | true |
Whether to include ComicInfo.xml in .cbz-Archives |
| ALWAYS_INCLUDE_VOLUME_IN_FILENAME | false |
Override to always include a volume in filenames (default as Vol. 0) |
| HTTP_REQUEST_TIMEOUT | 10 |
Request timeout for Mangaconnectors |
| REQUESTS_PER_MINUTE | 90 |
Maximum requests per minute for Mangaconnectors |
| MINUTES_BETWEEN_NOTIFICATIONS | 1 |
Interval at which Tranga checks if notifications need to be sent. |
| HOURS_BETWEEN_NEW_CHAPTERS_CHECK | 3 |
Interval at which Tranga checks if there are new chapters for a manga |
While not supported/currently built, Tranga should 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 (which will be generated on first after first launch):
- Linux
/Manga - Windows
%currentDirectory%/Downloads
If you want to contribute, please feel free to fork and create a Pull-Request!
-
Strong-type your variables. This improves readability.
- DO
Manga[] zyx = Object.GetAnotherThing(); //I can see that zyx is an Array, without digging through more code
- DO NOT
var xyz = Object.GetSomething(); //What is xyz? An Array? A string? An object?
- DO
-
Indent your
ifandforblocks-
DO
if(true) return false;
-
DO NOT
if(true) return false;
Because try reading this
if (s.StartsWith("http://", StringComparison.OrdinalIgnoreCase) || s.StartsWith("https://", StringComparison.OrdinalIgnoreCase)) return s;
-
-
When using shorthand, this improves readability for longer lines (at some point just use if-else...):
bool retVal = xyz is true
? false
: true;bool retVal = xyz?
?? abc?
?? true;Tranga is using a code-first EF-Core approach. If you modify the database(context) structure you need to create a migration.
| variable | default-value |
|---|---|
| POSTGRES_HOST | tranga-pg:5432 |
| POSTGRES_DB | postgres |
| POSTGRES_USER | postgres |
| POSTGRES_PASSWORD | postgres |
Program.csConfiguration for ASP.NET, Swagger (also inNamedSwaggerGenOptions.cs)Tranga.csWorker-LogicSchema/**Entity-Framework Schema DefinitionsMangaDownloadClients/**Networking-Clients for ScrapingControllers/**ASP.NET Controllers (Endpoints)
- Copy one of the existing connectors, or start from scratch and inherit from
API.Schema.MangaConnectors.MangaConnector. - Add the new Connector as Object-Instance in
Tranga.csto the MangaConnector-Arrayconnectors.
In the Project root a docker-compose.local.yaml file will compile the code and create the container(s).
Distributed under the GNU GPLv3 License. See LICENSE.txt for more information.
