mangal

command module
v1.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 25, 2022 License: MIT Imports: 37 Imported by: 0

README

Mangal

logo

Manga Browser & Downloader

https://user-images.githubusercontent.com/62389790/174501320-119474c3-c745-4f95-8e7d-fbf5bd40920b.mov

Table of Contents

About

Mangal is feature rich, configurable manga browser & downloader written in Go with support for different formats

⚙️ One of the most important features of Mangal is that it supports user defined scrapers that can be added with just a few lines of config file (see config & limitations)

🦎 Works in both modes - TUI & Inline. Use it as a standalone app or integrate with scripts

🍿 This app is inspired by awesome ani-cli. Check it out!

Currently, Mangal supports these formats

  • PDF
  • Epub
  • CBZ
  • Zip
  • Plain (just images)

Type mangal formats for more info

Examples

TUI usage example

https://user-images.githubusercontent.com/62389790/174574562-011f9c30-db6f-45a9-9ce2-03973564ace0.mov

Inline mode usage example

For more information about inline mode type mangal inline --help

# Search manga. Returns a list of found manga
mangal inline --query "death note"

# Search manga. Returns a JSON list of found manga
mangal inline --query "death note" --json

# Get chapters of the first manga in the list
mangal inline --query "death note" --manga 1

# Download first chapter of the first manga in the list
mangal inline --query "death note" --manga 1 --chapter 1

Config

TLDR: Use mangal config where to show where config should be located and mangal config init to create default config

Config is located at the OS default config directory.
  • Unix - $XDG_CONFIG_HOME/mangal/config.toml if $XDG_CONFIG_HOME exists, else $HOME/.config/mangal/config.toml
  • Darwin (macOS) - $HOME/Library/Application\ Support/mangal/config.toml
  • Windows - %AppData%\mangal\config.toml

You can load config from custom path by using --config flag

mangal --config /user/configs/config.toml

By default, Mangal uses manganelo as a source

Click here to show config example
# Which sources to use. You can use several sources, it won't affect perfomance'
use = ['manganelo']

# Available options: ` + strings.Join(Map(AvailableFormats, func(f FormatType) string { return string(f) }), ", ") + `
# Type "mangal formats" to show more information about formats
format = "pdf"

# If false, then OS default pdf reader will be used
use_custom_reader = false
custom_reader = "zathura"

# Custom download path, can be either relative (to the current directory) or absolute
download_path = '.'

# Add images to cache
# If set to true mangal could crash when trying to redownload something really quickly
# Usually happens on slow machines
cache_images = false

[ui]
# Fullscreen mode
fullscreen = true

# Input prompt icon
prompt = ">"

# Input placeholder
placeholder = "What shall we look for?"

# Selected chapter mark
mark = "▼"

# Search window title
title = "` + Mangal + `"

[sources]
[sources.manganelo]
# Base url
base = 'https://m.manganelo.com'

# Chapters Base url
chapters_base = 'https://chap.manganelo.com/'

# Search endpoint. Put %s where the query should be
search = 'https://m.manganelo.com/search/story/%s'

# Selector of entry anchor (<a></a>) on search page
manga_anchor = '.search-story-item a.item-title'

# Selector of entry title on search page
manga_title = '.search-story-item a.item-title'

# Manga chapters anchors selector
chapter_anchor = 'li.a-h a.chapter-name'

# Manga chapters titles selector
chapter_title = 'li.a-h a.chapter-name'

# Reader page images selector
reader_page = '.container-chapter-reader img'

# Random delay between requests
random_delay_ms = 500 # ms

# Are chapters listed in reversed order on that source?
# reversed order -> from newest chapter to oldest
reversed_chapters_order = true

# With what character should the whitespace in query be replaced?
whitespace_escape = "_"

Commands

Usage:
  mangal [flags]
  mangal [command]

Available Commands:
  check-update Check if new version is available
  cleanup      Remove cached and temp files
  completion   Generate the autocompletion script for the specified shell
  config       Config actions
  formats      Information about available formats
  help         Help about any command
  inline       Search & Download manga in inline mode
  version      Show version

Flags:
  -c, --config string   use config from path
  -f, --format string   use custom format
  -h, --help            help for mangal

Use "mangal [command] --help" for more information about a command.

Install

Go

You will need Go installed

go install -ldflags="-s -w" github.com/metafates/mangal@latest
Update / Uninstall
Update
go install -ldflags="-s -w" github.com/metafates/mangal@latest
Uninstall

To uninstall just delete the binary file

  • Bash / zsh - rm $(which mangal)
  • Fish - rm (which mangal)
  • Powershell - rm $(where.exe mangal)

MacOS

Install using Homebrew

brew tap metafates/mangal
brew install mangal
Update & Uninstall
Update
brew upgrade mangal
Uninstall
brew uninstall mangal

Windows

Install using Scoop

scoop install https://raw.githubusercontent.com/metafates/scoop-mangal/main/mangal.json
Update & Uninstall
Update
scoop update mangal
Uninstall
scoop uninstall mangal

Debian

To install download the latest .deb file from GitHub Release page

Then run

sudo dpkg -i [FILE YOU DOWNLOADED].deb
Update & Uninstall
Update

To update you will need to uninstall and install from the new .deb file in the GitHub Release page

Uninstall
sudo dpkg -r mangal

Build

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

You can also cross build for windows, linux & macos by running cross-compile.py (you will need Python 3)

Built binaries and generated packages will be stored in the bin folder

Limitations

Even though many manga sites will work, there exist some (serious) limitations to which sites could be added

  • Navigation layout should follow this model
    • Each manga have a separate page
    • Manga page should have some form of chapters list (not lazy loaded)
    • Each chapter should have a separate reader page with all the images

Some sites that work well

I'm planning to make a more advanced scraper creation system to overcome this roadblocks somewhere in the future


Logo taken from here

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL