Skip to content

Olivi-9/DojinGo

Repository files navigation

DojinGo

中文 | English

Bot that downloads ehentai / exhentai / nhentai / pixiv galleries locally and republishes them to Telegraph.

Features

  • Supports direct connections and outbound proxy for all traffic.
  • Cache is local only: in-memory or filesystem-backed.

Supported Sources

  • e-hentai
  • exhentai
  • nhentai
  • pixiv

Commands

  • /start
  • /help
  • /sync <url>
  • /id
  • /version
  • /cancel
  • /delete <cache-key> for admins

Messages or captions that contain a supported gallery URL are also synchronized automatically

Quick Start

  1. Copy config_example.yaml to config.yaml.
  2. Fill in your Telegram bot token and at least one Telegraph token.
  3. If you need exhentai or pixiv, add the required cookies under their respective sections in collectors.

Using the binary

  1. You can download the precompiled binary from the releases page.

  2. Run with your config.yaml:

./DojinGo -c config.yaml

when no -c argument is provided, it will default to reading config.yaml in the current directory.

Start with Docker:

docker compose up -d --build

Or build locally:

go build -o build/Dojingo ./cmd/Dojingo

Run:

./build/Dojingo -c config.yaml

Systemd (systemctl)

Example unit file: systemd/dojingo.service

Place your config at /etc/dojingo/config.yaml to match the unit file. Ensure storage.path in the config points to a writable directory, for example /var/lib/dojingo/cache.

Edit service and enable it:

copy dojingo.service to /etc/systemd/system/ and edit paths

sudo systemctl daemon-reload
sudo systemctl enable --now dojingo
sudo systemctl status dojingo

Logs:

sudo journalctl -u dojingo -f

Configuration

Example:

bot:
  token: "YOUR_BOT_TOKEN"
  admins: [123456789]

telegraph:
  tokens: ["YOUR_TELEGRAPH_TOKEN"]
  author_name: "Author"
  author_url: "https://example.com"

ipv6:
  prefix: ""

storage:
  type: "memory"
  path: "./cache"
  ttl: 3888000
  max_entries: 1024

proxy:
  upstream:
    http: ""
    socks5: ""

collectors:
  exhentai:
    ipb_pass_hash: ""
    ipb_member_id: ""
    igneous: ""
  pixiv:
    session: ""

whitelist:
  enabled: false
  ids: [123456789]

Notes:

  • storage.type supports memory and file.
  • storage.path is only used by file storage.
  • ipv6.prefix can be a larger IPv6 CIDR such as 2001:db8::/64 for rotating local source addresses.
  • proxy.upstream configures outbound requests and supports http(s):// or socks5:// (scheme optional for host:port).
  • When proxy.upstream is set, all outbound traffic (Telegram API, collectors, uploads) uses it.

IPv6 Rotation

If you own a routed IPv6 prefix and want per-connection source rotation:

  1. Bind the prefix locally.
  2. Enable net.ipv6.ip_nonlocal_bind=1.
  3. Set ipv6.prefix in the config.

This is optional. Leaving ipv6.prefix empty uses normal local networking.

Development

Requirements:

  • Go 1.26

Useful commands:

go test ./...
go build -o build/Dojingo ./cmd/Dojingo

Deployment Notes

  • The container reads CONFIG_FILE, defaulting to config.yaml.
  • File-backed cache needs a writable directory.

Project Origin and Changes

This project is a reimplementation of eh2telegraph using Go. It adjusts the proxy configuration and storage mechanisms while retaining the core functionality.

About

Telegram 本子下载 bot:支持 ehentai & exhentai & nhentai & pixiv / Telegram Bot for automatic doujinshi downloading. Supports ehentai & exhentai & nhenta & pixiv

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages