makemek / hitomijs

Download gallery from hitomi.la in parallel without zipping or throttling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HitomiJS

CLI utility for downloading gallery images from hitomi.la (NSFW).

Comparison between download option in hitomi.la and hitomijs

hitomi.la hitomijs
1 image at a time Multiple images concurrently with auto retries
All images are webp format Convert webp back close to original automatically using sharp or keep them as-is
Throttled 1 second for each image No throttling
Zipped compression No zipped compression

Installation

Clone this repository and run

npm install
npm run build

Entry file locates in bin/hitomijs.js. Try running ./hitomijs inside bin, it should list all available command and options.

Usage

hitomijs download <galleryid> [destination] [options]

For example,

hitomijs download 2173473 "Nekopara Chronicle"

To get galleryid, locate number in url

https://hitomi.la/gamecg/nekopara-chronicle-2173473.html

galleryid is the number after - at the end of the title.

Command options

-c, --concurrency <number>

Required: false

Default: 3

Specify number of concurrent image download. Please note that setting this number too high will result in http 503 response from hitomi's cdn server endpoint.

-s, --skip <number>

Required: false

Default: 0

Skip n images from start. Useful for resuming download.

--convert

Required: false

Default: true

All images from hitomi.la are in webp format. This option tells hitomijs to convert webp back to its original format. It uses sharp library internally to do the conversion. Resulted image quality should be close to the original.

To keep file format as-is, please pass --no-convert to a command.

-attempt, --retry-attempt <number>

Required: false

Default: 30

Set maximum number of retry attempt if request fails

-delay, --retry-delay <number>

Required: false

Default: 2

retry delay for <number> seconds

Known Issues

If there were changes to common.js, download.js, or gg.js, the cli might not be working properly. Some functionality are modified or copy-pasted from these source codes to get them working. To check for changes, run npm test hitomi-endpoint. It will check for modified changes comparing with current snapshots.

Techstacks

About

Download gallery from hitomi.la in parallel without zipping or throttling


Languages

Language:TypeScript 98.7%Language:Shell 0.8%Language:JavaScript 0.5%