通过画师 id 下载图片到本地

pixiv 图片下载服务

(仅使用画师id进行下载)

一、简介

该项目由 RainChain 提供的接口进行进一步封装
提供了将对应画师id的前30张图片下载本地的服务
源API接口作者接口文档地址 https://api.hcyacg.com

二、接口信息

接口地址 接口参数 参数类型 参数描述
http://localhost:3000/down uid GET 传入画师uid, 在后台下载, 并返回存储地址
http://localhost:3000/get/list uid(typeonce下使用) & type GET 传入type=once时, 传入画师uid, 并返回存在的图片列表; 传入type=all时, 获得所有已下载的画师作品
http://localhost:3000/get/show uid & pid GET uid即画师id, pid即画师作品id(通过get/list接口获得)

三、使用

1、克隆该仓库到本地

1
git clone https://github.com/Sakura1943/PixivImagesDownload.git

若下载较慢, 可以尝试使用github的反向代理进行克隆

1
git clone https://proxy.sakunia.tk/https://github.com/Sakura1943/PixivImagesDownload.git

2、编辑config.ini配置文件

项目配置文件在项目目录下的config/config.ini

1
2
3
4
5
6
7
8
9
10
; 服务地址
[app]
; 服务端口,默认 3000
PORT=3000
; 主机地址, 默认 localhost
HOST=localhost
; 存储位置
[img]
; 默认, 于项目根目录的 images 文件夹
IMAGE_DIR_PATH=images

3、安装node项目依赖

1
npm install

4、运行

1
npm run dev

5、调用接口

下载

1
curl http://localhost:3000/down?uid=xxxx

下载完就会提示保存的路径了

查看列表

1
2
3
curl http://localhost:3000/get/list?type=once&uid=xxx
或者
curl http://localhost:3000/get/list?type=all

查看图片

1
浏览器输入地址: http://localhost:3000/get/show?uid=xxx&pid=xxx

四、开源协议

GNU GPLv3


本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!