Skip to content
/ mangal Public
forked from metafates/mangal

πŸ“– The most advanced cli manga downloader in the entire universe! Lua scrapers, export formats, anilist integration, fancy TUI and more!

License

Notifications You must be signed in to change notification settings

jojoxd/mangal

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Mangal 3 πŸ“œ

Linux macOS Windows

The most advanced CLI manga downloader in the entire universe!

mangal.mov

Try it!

curl -sfL https://raw.githubusercontent.com/metafates/mangal/main/scripts/run | sh

Note This script does not install anything, it just downloads, verifies and runs Mangal. Linux MacOS only

Table of contents

Features

  • Lua Scrapers!!! You can add any source you want by creating your own (or using someone's else) scraper with __ Lua 5.1__. See mangal-scrapers repository
  • Mangadex Manganelo Built-In
  • Download & Read Manga - I mean, it would be strange if you couldn't, right?
  • 4 Different export formats - PDF, CBZ, ZIP and plain images
  • 3 Different modes - TUI, Mini and Inline
  • Fast? - YES.
  • Monolith - ZERO runtime dependencies. Even Lua is built in.
  • Fancy - (οΎ‰>Ο‰<)οΎ‰ :qο½₯::ο½₯οΎŸβ€™β˜…,qο½₯:ο½₯οΎŸβ€™β˜†
  • Cross-Platform - Linux, macOS, Windows. Sorry, *BSD users...
  • Anilist integration - Track your manga progress on Anilist when reading with Mangal.

Installation

Linux MacOS

Install using this shell script

curl -sfL https://raw.githubusercontent.com/metafates/mangal/main/scripts/install | sh

This script will automatically detect OS & Distro and use the best option available. For example, on macOS it will try to use Homebrew, on Ubuntu it will install the .deb package and so on...

😑 I hate scripts! Show me how to install it manually

Arch Linux

AUR package (by @balajsra)

Ubuntu / Debian

  1. Download the *.deb file from release page
  2. Run sudo dpkg --install ... where ... is the name of the file you downloaded

Fedora / Any other rpm based distro

  1. Download the *.rpm file from release page
  2. Run sudo rpm --install ... where ... is the name of the file you downloaded

MacOS

Install using Homebrew

brew tap metafates/mangal
brew install mangal

Pre-compiled

Download the pre-compiled binaries from the releases page and copy them to the desired location.

From source

Visit this link to install Go

git clone --depth 1 https://github.com/metafates/mangal.git
cd mangal
go install -ldflags="-s -w"

Windows

Install using Scoop

scoop bucket add metafates https://github.com/metafates/scoop-metafates
scoop install mangal

Docker

Install using... well, you know. (thanks to @ArabCoders for reference)

docker pull metafates/mangal

To run

docker run --rm -ti -e "TERM=xterm-256color" -v $(PWD)/mangal/downloads:/downloads -v $(PWD)/mangal/config:/config metafates/mangal

Usage

TUI

Just run mangal and you're ready to go.

Mini

Mini mode tries to mimic ani-cli

To run: mangal mini

Screenshot 2022-08-14 at 09 37 14

Inline

Inline mode is intended for use with other scripts.

Example of usage:

mangal inline --source Manganelo --query "death note" --manga first --chapters "@Vol.1 @"  -d

This will download the first volume of "Death Note" from Manganelo.

Type mangal help inline for more information

Other

See mangal help for more information

Configuration

Mangal uses TOML format for configuration under the mangal.toml filename. Config path depends on the OS. To find yours, use mangal where --config. For example, on Linux it would be ~/.config/mangal/mangal.toml.

Use env variable MANGAL_CONFIG_PATH to set custom config path.

See mangal env to show all available env variables.

Run mangal where to show expected config paths

Run mangal config init to generate a default config file

Default config example (click to show)
# mangal.toml

[downloader]
# Default source to use
# Will prompt to choose if empty
# Type `mangal sources` for available sources
default_source = ''
# Name template of the downloaded chapters
# Available variables:
# {index}        - index of the chapters
# {padded-index} - same as index but padded with leading zeros
# {chapter}      - name of the chapter
# {manga}        - name of the manga
chapter_name_template = '[{padded-index}] {chapter}'
# Where to download manga
# Absolute or relative.
#
# You can also use home variable 
# path = "~/..." or "$HOME/..."
path = '.'
# Use asynchronous downloader (faster)
# Do no turn it off unless you have some issues
async = true
# Create a subdirectory for each manga
create_manga_dir = true
# Stop downloading other chapters on error
stop_on_error = false




[formats]
# Default format to export chapters
# Available options are: pdf, zip, cbz, plain
use = 'pdf'
# Will skip images that can't be converted to the specified format 
# Example: if you want to export to pdf, but some images are gifs, they will be skipped
skip_unsupported_images = true



[history]
# Save chapters to history when downloaded
save_on_download = false
# Save chapters to history on read
save_on_read = true



[icons]
# Icons variant.
# Available options are: emoji, kaomoji, plain, squares, nerd (nerd-font)
variant = 'plain'



[mangadex]
# Preferred language
language = 'en'
# Show nsfw manga/chapters
nsfw = false
# Show chapters that cannot be read (because they are hosted on a different site)
show_unavailable_chapters = false



[mini]
# Limit number of search page entries
search_limit = 20



[reader]
# Name of the app to use as a reader for each format.
# Will use default OS app if empty
pdf = '' # e.g. pdf = 'zathura'
cbz = ''
zip = ''
plain = ''
# Will open chapter in the browser instead of downloading it
read_in_browser = false



[installer]
# Custom scrapers repository (github only)
repo = 'mangal-scrapers'
# Custom scrapers repository owner
user = 'metafates'
# Custom scrapers repository branch
branch = 'main'


[gen]
# Name of author for gen command.
# Will use OS username if empty
author = ''


[logs]
# write logs?
write = false
# Available options are: (from less to most verbose)
# panic, fatal, error, warn, info, debug, trace
level = "info"

Custom scrapers

TLDR; To browse and install a custom scraper from mangal-scrapers repository run

mangal install

Mangal has a Lua5.1 VM built-in some useful libraries, such as headless chrome, http client, html parser and so on...

Check the defined modules for more information.

For scraper examples, check the mangal-scrapers repository

Creating a custom scraper

This command will create example.lua file in the mangal where --sources directory.

mangal gen --name example --url https://example.com

Open the file and edit it as you wish. Take a look at the comments for more information. See mangal-scrapers repository for examples.

You can test it by running mangal run <filepath>

It should automatically appear in the list of available scrapers.

New to Lua? Quick start guide

Anilist

Mangal also supports integration with anilist.

It will mark chapters as read on Anilsit when you read them inside mangal.

For more information see wiki

Maybe I'll add more sites in the future, like myanimelist. Open for suggestions!

About

πŸ“– The most advanced cli manga downloader in the entire universe! Lua scrapers, export formats, anilist integration, fancy TUI and more!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 81.3%
  • Shell 17.5%
  • Other 1.2%