MCPcopy Index your code
hub / github.com/bookstairs/bookhunter

github.com/bookstairs/bookhunter @v1.14.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.14.1 ↗ · + Follow
295 symbols 769 edges 56 files 108 documented · 37%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

⏬ bookhunter

LICENSE Language Go Report Card Release

Downloading books from talebook, SoBooks 中小学教材 and Telegram Channels. This is a totally rewritten fork compared to its original version.

🚧 Development

  1. Go Releaser is used for releasing and local building
  2. golangci-lint is used for code style.
  3. pre-commit is used for checking code before committing.

💾 Install

🍎 Homebrew (for macOS, Linux)

brew tap bookstairs/tap
brew install bookhunter

💻 Scope (for Windows)

scoop bucket add bookstairs https://github.com/bookstairs/scoop-bucket.git
scoop install bookstairs/bookhunter

🛠 Manually

Download the latest release in release page. Choose related tarball by your running environment.

📚 Usage

Website Address Direct Download Aliyun Lanzou Telecom
智慧教育平台 https://basic.smartedu.cn/tchMaterial
Talebook https://github.com/talebook/talebook
SoBooks https://sobooks.net
Telegram https://t.me
Hsu Life https://book.hsu.life

Login Aliyundrive to get the refreshToken

We would show a QR code at the first time. And cache the refreshToken after successfully login.

bookhunter aliyun

Download textbooks for Kids

Usage:
  bookhunter k12 [flags]

Flags:
  -d, --download string   The book directory you want to use (default ".")
  -h, --help              help for k12
      --ratelimit int     The allowed requests per minutes for every thread (default 30)
  -t, --thread int        The number of download thead (default 1)

Global Flags:
  -c, --config string       The config path for bookhunter
      --proxy string        The request proxy
  -a, --user-agent string   The request user-agent (default "Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/13.0 Firefox/13.0")
      --verbose             Print all the logs for debugging

Register account in Talebook

Usage:
  bookhunter talebook register [flags]

Flags:
  -e, --email string      The talebook email
  -h, --help              help for register
  -p, --password string   The talebook password
  -u, --username string   The talebook username
  -w, --website string    The talebook link

Global Flags:
  -c, --config string       The config path for bookhunter
      --proxy string        The request proxy
  -a, --user-agent string   The request user-agent (default "Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/13.0 Firefox/13.0")
      --verbose             Print all the logs for debugging

Download books from Talebook

Usage:
  bookhunter talebook download [flags]

Flags:
  -d, --download string   The book directory you want to use (default ".")
  -f, --format strings    The file formats you want to download (default [epub,azw3,mobi,pdf,zip])
  -h, --help              help for download
  -i, --initial int       The book id you want to start download (default 1)
  -p, --password string   The talebook password
      --ratelimit int     The allowed requests per minutes for every thread (default 30)
  -r, --rename            Rename the book file by book id
  -t, --thread int        The number of download thead (default 1)
  -u, --username string   The talebook username
  -w, --website string    The talebook link

Global Flags:
  -c, --config string       The config path for bookhunter
      --proxy string        The request proxy
  -a, --user-agent string   The request user-agent (default "Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/13.0 Firefox/13.0")
      --verbose             Print all the logs for debugging

Download books from SoBooks

Usage:
  bookhunter sobooks [flags]

Flags:
      --code string       The secret code for SoBooks (default "844283")
  -d, --download string   The book directory you want to use (default ".")
  -e, --extract           Extract the archive file for filtering
  -f, --format strings    The file formats you want to download (default [epub,azw3,mobi,pdf,zip])
  -h, --help              help for sobooks
  -i, --initial int       The book id you want to start download (default 1)
      --ratelimit int     The allowed requests per minutes for every thread (default 30)
  -r, --rename            Rename the book file by book id
  -t, --thread int        The number of download thead (default 1)

Global Flags:
  -c, --config string       The config path for bookhunter
      --proxy string        The request proxy
  -a, --user-agent string   The request user-agent (default "Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/13.0 Firefox/13.0")
      --verbose             Print all the logs for debugging

Download books from Telegram groups

Example command: bookhunter telegram --appID ****** --appHash ****** -k https://t.me/MothLib

Please refer Creating your Telegram Application to obtain your appID and appHash.

Usage:
  bookhunter telegram [flags]

Flags:
      --appHash string     The app hash for telegram
      --appID int          The app id for telegram
      --channelID string   The channel id for telegram
  -d, --download string    The book directory you want to use (default ".")
  -e, --extract            Extract the archive file for filtering
  -f, --format strings     The file formats you want to download (default [epub,azw3,mobi,pdf,zip])
  -h, --help               help for telegram
  -i, --initial int        The book id you want to start download (default 1)
      --mobile string      The mobile number, we will add +86 as default zone code
      --ratelimit int      The allowed requests per minutes for every thread (default 30)
      --refresh            Refresh the login session
  -r, --rename             Rename the book file by book id
  -t, --thread int         The number of download thead (default 1)

Global Flags:
  -c, --config string       The config path for bookhunter
      --proxy string        The request proxy
  -a, --user-agent string   The request user-agent (default "Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/13.0 Firefox/13.0")
      --verbose             Print all the logs for debugging

Download books from Hsu Life

Example command: bookhunter hsu --username ****** --password ******

Usage:
  bookhunter hsu [flags]

Flags:
  -d, --download string   The book directory you want to use (default "/Users/Yufan/Developer/bookstairs/bookhunter")
  -f, --format strings    The file formats you want to download (default [epub,azw3,mobi,pdf,zip])
  -h, --help              help for hsu
  -i, --initial int       The book id you want to start download (default 1)
  -p, --password string   The hsu.life password
      --ratelimit int     The allowed requests per minutes for every thread (default 30)
  -r, --rename            Rename the book file by book id
  -t, --thread int        The number of download thead (default 1)
  -u, --username string   The hsu.life username

Global Flags:
  -c, --config string     The config path for bookhunter
  -k, --keyword strings   The keywords for books
      --proxy string      The request proxy
      --retry int         The retry times for a failed download (default 3)
  -s, --skip-error        Continue to download the next book if the current book download failed (default true)
      --verbose           Print all the logs for debugging

Extension points exported contracts — how you extend this code

Fetcher (Interface)
Fetcher exposes the download method to the command line. [4 implementers]
internal/fetcher/fetcher.go
Driver (Interface)
Driver is used to resolve the links from a Source. [3 implementers]
internal/driver/common.go
Progress (Interface)
(no doc) [1 implementers]
internal/progress/progress.go
Printer (Interface)
(no doc) [1 implementers]
internal/log/printer.go
Creator (Interface)
(no doc) [1 implementers]
internal/file/writer.go
Writer (Interface)
(no doc) [1 implementers]
internal/file/writer.go

Core symbols most depended-on inside this repo

Row
called by 65
internal/log/printer.go
Close
called by 18
internal/file/writer.go
Exit
called by 17
internal/log/console.go
Info
called by 13
internal/log/console.go
extractRegex
called by 12
internal/driver/lanzou/share.go
Debugf
called by 11
internal/log/console.go
Property
called by 10
internal/fetcher/common.go
Print
called by 10
internal/log/printer.go

Shape

Method 132
Function 81
Struct 70
Interface 7
TypeAlias 5

Languages

Go100%

Modules by API surface

internal/driver/aliyun/response.go17 symbols
internal/log/printer.go16 symbols
internal/progress/progress.go15 symbols
internal/driver/lanzou/share.go14 symbols
internal/file/writer.go13 symbols
internal/log/console.go11 symbols
internal/driver/aliyun/auth.go11 symbols
internal/client/client.go11 symbols
internal/driver/telecom/response.go10 symbols
internal/fetcher/hsu.go9 symbols
internal/fetcher/fetcher.go9 symbols
internal/telegram/proxy.go8 symbols

For agents

$ claude mcp add bookhunter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page