• Stars
    star
    1,375
  • Rank 34,198 (Top 0.7 %)
  • Language
    Go
  • License
    MIT License
  • Created over 2 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Mangal 4 โ˜„๏ธ

Linux macOS Windows Termux

The most advanced CLI manga downloader in the entire universe!

Mangal 4 TUI

Try it!

curl -sSL mangal.metafates.one/run | sh

Note This script does not install anything, it just downloads, verifies and runs Mangal. Not available on Windows.

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
  • 4 Built-in sources - Mangadex, Manganelo, Manganato & Mangapill
  • Download & Read Manga - I mean, it would be strange if you couldn't, right?
  • Caching - Mangal will cache as much data as possible, so you don't have to wait for it to download the same data over and over again.
  • 4 Different export formats - PDF, CBZ, ZIP and plain images
  • TUI โœจ - You already know how to use it! (๏พ‰>ฯ‰<)๏พ‰ :๏ฝก๏ฝฅ::๏ฝฅ๏พŸโ€™โ˜…,๏ฝก๏ฝฅ:๏ฝฅ๏พŸโ€™โ˜†
  • Scriptable - You can use Mangal in your scripts, it's just a CLI app after all. Examples
  • History - Resume your reading from where you left off!
  • Fast? - YES.
  • Monolith - ZERO runtime dependencies. Even Lua is built in. Easy to install and use.
  • Cross-Platform - Linux, macOS, Windows, Termux, even your toaster. (ยฌโ€ฟยฌ )
  • Anilist integration - Mangal will collect additional data from Anilist and use it to improve your reading experience. It can also sync your progress!

Installation

Script (Linux, MacOS, Termux)

Install using this shell script

curl -sSL mangal.metafates.one/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...

Arch Linux

AUR package (maintained by @balajsra, thank you)

MacOS

Install using Homebrew

brew tap metafates/mangal
brew install mangal

Windows

Install using Scoop (thanks to @SonaliBendre for adding it to the official bucket)

scoop bucket add extras
scoop install mangal

Termux

Thanks to @T-Dynamos for adding it to the termux-packages

pkg install mangal

Gentoo

Install using third-party overlay raiagent. Thanks to @leycec for maintaining it.

eselect repository enable raiagent
emerge --sync raiagent
emerge mangal

Nix

Install using Nix. Thanks to @bertof for adding it to the nixpkgs

# NixOS
nix-env -iA nixos.mangal

# Non NixOS
nix-env -iA nixpkgs.mangal

Docker

Install using Docker. (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

From source

Visit this link to install Go.

Clone the repo

git clone --depth 1 https://github.com/metafates/mangal.git
cd mangal

GNU Make (Recommended)

make install # if you want to compile and install mangal to path
make build # if you want to just build the binary
If you don't have GNU Make use this
# To build
go build -ldflags "-X 'github.com/metafates/mangal/constant.BuiltAt=$(date -u)' -X 'github.com/metafates/mangal/constant.BuiltBy=$(whoami)' -X 'github.com/metafates/mangal/constant.Revision=$(git rev-parse --short HEAD)' -s -w"

# To install
go install -ldflags "-X 'github.com/metafates/mangal/constant.BuiltAt=$(date -u)' -X 'github.com/metafates/mangal/constant.BuiltBy=$(whoami)' -X 'github.com/metafates/mangal/constant.Revision=$(git rev-parse --short HEAD)' -s -w"

If you want to build mangal for other architecture, say ARM, you'll have to set env variables GOOS and GOARCH

GOOS=linux GOARCH=arm64 make build

Available GOOS and GOARCH combinations

Pre-compiled

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

Usage

TUI

Just run mangal and you're ready to go.

Keybinds
Bind Description
? Show help
โ†‘/j โ†“/k โ†’/l โ†/h Navigate
g Go to first
G Go to last
/ Filter
esc Back
space Select one
tab Select all
v Select volume
backspace Unselect all
enter Confirm
o Open URL
r Read
q Quit
ctrl+c Force quit
a Select Anilist manga (chapters list)
d Delete single history entry

TUI

If you wonder what those icons mean - D stands for "downloaded", * shows that chapter is marked to be downloaded. You can choose different icons, e.g. nerd font ones - just run mangal with --icons nerd. Available options are nerd, emoji, kaomoji and squares

Mini

Mini mode tries to mimic ani-cli

To run: mangal mini

mini

Inline

Inline mode is intended for use with other scripts.

Type mangal help inline for more information.

See Wiki for more examples.

Mangal 4 Inline

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.

Command Description
mangal config get Get config value for specific key
mangal config set Set config value for specific key
mangal config reset Reset config value for specific key
mangal config info List all config fields with description for each
mangal config write Write current config to a file

Custom scrapers

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

mangal sources 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 scrapers examples, check the mangal-scrapers repository

Creating a custom scraper

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

mangal sources 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.

Besides fetching metadata for each manga when downloading, mangal can also mark chapters as read on your Anilsit profile when you read them inside mangal.

For more information see wiki

Honorable mentions

Projects using mangal

  • kaizoku - Self-hosted manga downloader with mangal as its core ๐Ÿš€

Similar Projects

  • mangadesk - Terminal client for MangaDex
  • ani-cli - A cli tool to browse and play anime
  • manga-py - Universal manga downloader
  • animdl - A highly efficient, fast, powerful and light-weight anime downloader and streamer
  • tachiyomi - Free and open source manga reader for Android

Libraries

  • bubbletea, bubbles & lipgloss - Made mangal shine! The best TUI libraries ever โœจ
  • gopher-lua - Made it possible to write custom scrapers with Lua โค๏ธ
  • cobra and viper - Responsible for the awesome CLI & config experience ๐Ÿ› 
  • pdfcpu - Fast pdf processor in pure go ๐Ÿ“„
  • And many others!

Contributors

And of course, thanks to all contributors! You are awesome!

Contributors


If you find this project useful or want to say thank you, please consider starring it, that would mean a lot to me โญ

Star History

More Repositories

1

mangal-scrapers

๐ŸŒ™ A collection of custom scrapers for mangal
Lua
43
star
2

ChromiumPywal

๐Ÿค– Generates color theme for chromium by using pywal colors
Shell
36
star
3

marky

๐Ÿญ Convert Markdown documents into themed HTML pages with support for code syntax highlighting, LaTeX and Mermaid diagrams.
Rust
27
star
4

Wallpapers

๐ŸŒ‡ My collection of wallpapers
HTML
23
star
5

go-template

โ˜„๏ธ Powerful template for Go CLI projects with advanced config management
Go
21
star
6

buffer-language-server

๐Ÿ’ฌ LSP that can autocomplete words found in the opened buffer
Rust
15
star
7

gign

โš™๏ธ A cute .gitignore generator
Rust
12
star
8

geminite

๐Ÿ’Ž Article reader for your terminal
Go
12
star
9

wezterm-config

My wezterm config
Lua
11
star
10

pat

๐Ÿ $PATH manager for bash, zsh & fish. Featuring shining TUI!
Go
8
star
11

Workflow

๐Ÿฆ‹ An opinionated list of programs I use everyday
HTML
7
star
12

Neovim

๐Ÿ“ My Neovim Config
Lua
6
star
13

Wallery

๐Ÿช… Frontend client for my wallpapers
Vue
6
star
14

pictura

Rust
4
star
15

Paletter

๐ŸŽจ Convert color scheme of image into a fancy background
Python
4
star
16

medusa

๐Ÿชผ My nix systems configurations
Nix
4
star
17

brewer

๐Ÿบ An extremely fast homebrew CLI wrapper with extra features.
Rust
4
star
18

soda

๐Ÿฅค Bubbletea TUI Framework
Go
4
star
19

nvim

๐Ÿค“ My neovim config. All the things I need, none I don't
Lua
2
star
20

lips

๐Ÿ’‹ LISP-like toy language
Java
2
star
21

BentoPywal

Generates pywal theme for Bento startpage
Shell
2
star
22

vivi

Here be dragons :)
Rust
1
star
23

AlfredPywal

Generates pywal theme for Alfred 4
Shell
1
star
24

nt

๐Ÿ““ Simple cli snippet manager
Rust
1
star
25

MyFiles

Repo for hosting files on github
1
star
26

Faces-Generator

Generates random svg images from assets
JavaScript
1
star
27

JapanMap

๐Ÿ—พ Interactive Japan Map (RU)
Vue
1
star