npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

runtu-pixiv-sdk

v2.0.0-beta.2

Published

An SDK that can easily get Pixiv illustration data

Downloads

161

Readme

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

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

Maintainers

@Runtus

License

MIT © 2022 Runtus