2.0.0-beta.2 • Published 7 months ago

runtu-pixiv-sdk v2.0.0-beta.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

pixiv-server-SDK

standard-readme compliant

🌟 一个能够轻松获取Pixiv的插画数据的SDK

🌟 An SDK that can easily get Pixiv illustration data."

Table of Contents

Install

# npm
npm install runtu-pixiv-sdk
# yarn
yarn add runtu-pixiv-sdk

Usage

RPixiv 类

  • SDK以RPixiv类的形式出现,你需要从包中导出类。
  • 同时该类可以传递一个AxiosProxy参数以便于你使用代理进行Pixiv请求。
  • "The SDK appears in the form of the RPixiv class, and you need to export the class from the package."
  • Additionally, RPixiv can receive an param called AxiosProxy, allowing you to use a proxy for Pixiv requests.
import { RPixiv } from 'runtu-pixiv-sdk'

// 初始化
// init
const pixiv = new RPixiv(proxy)

// token请求, 你必须请求这一步,否则后续会导致一些其他问题
// request token, You must do this step, or this code could not run successfully.
await pixiv.token();

/**
proxy: {
	host: string,
	port: number
}
*/

API

getDayRanks(range ?: string)

  • 获取Pixiv每日的插画排行榜数据。
  • Get Pixiv daily monthly illustration ranking data
await pixiv.getDayRanks("2022-11-11")

getWeekRanks(range ?: string)

  • 获取Pixiv每周的插画排行榜数据。
  • Get Pixiv weekly illustration ranking data
await pixiv.getWeekRanks("2022-11-14")

getMonthRanks(range ?: string)

  • 获取Pixiv每月的插画排行榜数据。
  • Get Pixiv weekly monthly ranking data
await pixiv.getMonthRanks("2022-11-14")

后续接口还在移植中

getAuthorIllusts(id: string, iType: 'illust' | 'manga')

  • 获取Pixiv指定作者的作品,id是作者id号,iType用于指定是漫画作品还是插画作品,默认为漫画作品。
  • Get Pixiv author's works, the id is the author's id, and you can set the iType to specify the illust or mange, default is the illust.
await pixiv.getAuthorIllusts("114514", "manga")

getAuthorInfo(id: string)

  • 获取pixiv指定作者的信息。
  • Get Pixiv author's infomation
await pixiv.getAuthorInfo("1919810")

getPixivStream(url: string, rType: AxiosRequestConfig'responseType')

  • 获取pixiv图片的数据流,rType用于制定图片流的类型,是Axios中的responseType类型,具体可参考axios-config
await pixiv.getPixivStream("https://114514.pixiv.com", "arraybuffer")

TODO

  • 增加获取图片流的接口
  • 对各个图片搜索接口实现翻页功能

Maintainers

@Runtus

License

MIT © 2022 Runtus

2.0.0-beta.2

7 months ago

2.0.0-beta.1

7 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago