base on A download tools for clawing the ebooks from internets. # ⏬ bookhunter [![LICENSE](https://img.shields.io/github/license/bookstairs/bookhunter)](https://github.com/bookstairs/bookhunter/blob/main/LICENSE) [![Language](https://img.shields.io/badge/Language-Go-blue.svg)](https://golang.org/) [![Go Report Card](https://goreportcard.com/badge/github.com/bookstairs/bookhunter)](https://goreportcard.com/report/github.com/bookstairs/bookhunter) ![](https://img.shields.io/github/stars/bookstairs/bookhunter.svg) ![](https://img.shields.io/github/forks/bookstairs/bookhunter.svg) ![Release](https://github.com/bookstairs/bookhunter/workflows/release/badge.svg) Downloading books from [talebook](https://github.com/talebook/talebook), [SoBooks](https://sobooks.cc) [中小学教材](https://basic.smartedu.cn/tchMaterial) and Telegram Channels. This is a totally rewritten fork compared to its [original version](https://github.com/hellojukay/dl-talebook). ## 🚧 Development 1. [Go Releaser](https://github.com/goreleaser/goreleaser) is used for releasing and local building 2. [golangci-lint](https://github.com/golangci/golangci-lint) is used for code style. 3. [pre-commit](https://pre-commit.com/) is used for checking code before committing. ## 💾 Install ### 🍎 Homebrew (for macOS, Linux) ```shell brew tap bookstairs/tap brew install bookhunter ``` ### 💻 Scope (for Windows) ```shell scoop bucket add bookstairs https://github.com/bookstairs/scoop-bucket.git scoop install bookstairs/bookhunter ``` ### 🛠 Manually Download the latest release in [release page](https://github.com/bookstairs/bookhunter/releases). Choose related tarball by your running environment. ## 📚 Usage | Website | Address | Direct Download | [Aliyun](https://www.aliyundrive.com/) | [Lanzou](https://www.lanzou.com/) | [Telecom](https://cloud.189.cn/) | |--------------------------------------------------|----------------------------------------|-----------------|----------------------------------------|-----------------------------------|----------------------------------| | [智慧教育平台](#download-textbooks-for-kids) | <https://basic.smartedu.cn/tchMaterial> | ✅ | ❌ | ❌ | ❌ | | [Talebook](#download-books-from-talebook) | <https://github.com/talebook/talebook> | ✅ | ❌ | ❌ | ❌ | | [SoBooks](#download-books-from-sobooks) | <https://sobooks.cc> | ✅ | ❌ | ✅ | ❌ | | [Telegram](#download-books-from-telegram-groups) | <https://t.me> | ✅ | ❌ | ❌ | ❌ | | [Hsu Life](#download-books-from-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. ```shell bookhunter aliyun ``` ### Download textbooks for Kids ```text 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 -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 ``` ### Register account in Talebook ```text 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 -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 ``` ### Download books from Talebook ```text 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 -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 ``` ### Download books from SoBooks ```text Usage: bookhunter sobooks [flags] Flags: --code string The secret code for SoBooks (default "244152") -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 -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 ``` ### Download books from Telegram groups Example command: `bookhunter telegram --appID ****** --appHash ****** --thread 4 --proxy http://127.0.0.1:7890 --channelID https://t.me/sharebooks4you` Please refer [Creating your Telegram Application](https://core.telegram.org/api/obtaining_api_id) to obtain your `appID` and `appHash`. ```text 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 -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 ``` ### Download books from Hsu Life Example command: `bookhunter hsu --username ****** --password ******` ```text Usage: bookhunter hsu [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 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 ``` ", Assign "at most 3 tags" to the expected json: {"id":"5523","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"