https://github.com/magicdawn/node-huaban
花瓣(http://huaban.com) 画板下载器
https://github.com/magicdawn/node-huaban
Last synced: about 1 year ago
JSON representation
花瓣(http://huaban.com) 画板下载器
- Host: GitHub
- URL: https://github.com/magicdawn/node-huaban
- Owner: magicdawn
- Created: 2015-03-03T11:39:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-04-07T16:22:00.000Z (about 8 years ago)
- Last Synced: 2025-05-05T04:03:08.492Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 43 KB
- Stars: 24
- Watchers: 5
- Forks: 12
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# node-huaban
花瓣(http://huaban.com) 画板下载器
[](#)
[](#)
[](#)
## 安装
```
$ npm i node-huaban -g
```
## 使用
```
$ huaban
huaban board downloader v0.0.1
Usage:
huaban [options]
Options:
-h,--help 输出此帮助信息
-c,--concurrency 同时最大下载数量,默认10
-t, --timeout 超时, 单位分, 默认1分钟 = 60 * 1000毫秒
--max-times 重试次数, 默认5
Example:
huaban http://huaban.com/boards/17324249/ -c 10
```
## API
```js
const HuabanBoard = require('node-huaban');
```
### constructor
```js
const board = new HuabanBoard(url) // url 是画板地址
```
### init
```js
board.init() // return a Promise, when all pins & title are ready
// normally, use with async/await
await board.init()
```
运行 `init` 之后, board会包含以下字段:
- board.title board的名称
- board.pins 图片, 包含地址src & 文件类型 ext
### downloadBoard
下载所有图片
```js
await board.downloadBoard(concurrency, timeout, maxTimes)
```
## Changelog
[CHANGELOG.md](CHANGELOG.md)
## License
the MIT License http://magicdawn.mit-license.org