Files
2026-05-12 01:30:35 +10:00

2.0 KiB

hitomi-downloader

A small Go command-line downloader for hitomi.moe galleries.

The tool fetches gallery metadata from https://hitomi.moe/reader/info/<id>, writes it to info.json, and downloads all gallery images with concurrent workers.

Requirements

  • Go 1.26 or newer
  • Network access to hitomi.moe

Build

go build -o hitomi-downloader .

Usage

Download by gallery URL:

go run . -url https://hitomi.moe/g/123456

Download by gallery ID:

go run . -url 123456

The gallery identifier can also be provided as a positional argument:

go run . 123456

After building:

./hitomi-downloader -url 123456 -out downloads

Options

-url string
    Hitomi gallery URL or ID.

-out string
    Output directory. Defaults to "downloads".

-workers int
    Number of concurrent download workers. Defaults to a value based on CPU
    count, with a minimum of 2 and a maximum of 8.

-timeout int
    Per-request timeout in seconds. Defaults to 30.

-skip-existing bool
    Skip existing non-empty files. Defaults to true.
    Use -skip-existing=false to force re-downloads.

-metadata-only bool
    Fetch metadata and write info.json without downloading images.

Output

Files are written under:

<out>/<gallery-id>_<sanitized-title>/

Each gallery directory contains:

info.json
001.<ext>
002.<ext>
003.<ext>
...

Images are first downloaded to a temporary .part file and then renamed into place when the download completes successfully.

Examples

Fetch metadata only:

go run . -url 123456 -metadata-only

Use more workers and a longer timeout:

go run . -url 123456 -workers 12 -timeout 60

Force re-downloading existing files:

go run . -url 123456 -skip-existing=false

Notes

Use this tool responsibly and follow the terms and rules of the site you are accessing. Very high worker counts can increase load on the remote server and may make downloads less reliable.