Skip to content

JeSuisSurGithub/HMA

Repository files navigation

HI3-Manhua-Archiver

HMA is a C program to download manhuas from the official HI3 COMIC, chinese site (https://comic.bh3.com/) and international site (https://manga.honkaiimpact3.com/).

How to get it

Just go there or build it yourself.

Build

To build you'll git xmake and curl development package.
Then run these commands:
    git clone https://github.com/JeSuisSurGithub/HMA
    cd HMA
    xmake f -m release --toolchain=gcc"
    xmake -w -j $(nproc)
    sudo xmake install (optional)
    sudo xmake uninstall (to uninstall)

Usage

Usage : hma-cli [OPTIONS]
    NO ARGS Launches guided mode
    -h, --help Prints out this help
    -s, --server[int] 1 = MAINLAND CHINA, 2 = GLOBAL
    -b, --book[int] The 4-digit integer on the HI3 COMIC Official site when you read a specific book i.e: http://....com/book/[BookID]
    -f, --first[int] First chapter to download, optional
    -l, --last[int] Last chapter to download, optional
    -n, --quiet No output messages, optional
    -o, --onedirectory All pages in one directory, optional

Explanation

The url of a page uses the following format:
[CDN_BASE_URL]/comic/book/[BOOK_ID]/[CHAPTER]/[PAGE].jpg
Where:

  • CDN_BASE_URL is the CDN's base url(duh), it can be either
    https://act-webstatic.hoyoverse.com/manga/static (global)
    or
    https://act-webstatic.mihoyo.com/new_static_v2 (china)
  • BOOK_ID is an 4 digit integer starting from 1001(and growing up)
  • CHAPTER is a non zero padded integer starting at 1
  • PAGE is zero padded 4 digit integer starting at 0001

Each page downloaded is saved using one of the following path format depending on options passed in the command line:
hmaoutput/[SERVER_NAME]/[BOOK_ID]/[CHAPTER]/[CHAPTER+PAGE].jpg
or
hmaoutput/[SERVER_NAME]_[BOOK_ID]_[CHAPTER+PAGE].jpg