@vince-gamer/sumire
v0.1.2
Published
Picture sources collection.
Downloads
17
Readme
Supported Websites
and more soon.
Installation
npm i @vince-gamer/sumireFeatures
- Proxy support.
- Use
ugoira.comto extract gif/mp4 from pixiv animations - lolicon-api integrated.
Usage
Here are some of examples:
Examples
Every main function like yandere(), pixivIllust() uses sumire config.
Sumire universal config type:
export interface SumireConfig {
proxy?: {
protocol: string;
host: string;
port: number;
};
yandere?: {
auth?: {
username?: string;
password?: string;
};
r18?: boolean;
};
pixiv?: {
mode?: "r18" | "safe" | "all";
phpSessId?: string;
mirror?: string; // mirror of i.pximg.net, which will be blocked by referer policy.
};
}yande.re
Types:
interface Params {
tags?: string; // search keywords
limit?: number; // number of pictures per search
login?: string; // don't pass this value, it will be auto filled if config.auth exists.
password_hash?: string; // don't pass this value, it will be auto filled if config.auth exists.
api_version?: number; // api_version, default 2
}Function:
import { yandere } from "@vince-gamer/sumire";
const a = await yandere(
{
tags: "persona",
},
{
proxy: {
protocol: "http",
host: "127.0.0.1",
port: 7890,
},
yandere: {
r18: true,
},
},
);
console.log(a);Pixiv
[!IMPORTANT] If you get 404 on request, please login your pixiv account, then add phpSessId from cookie to
config.pixiv
Official API
Types:
interface Params {
tags?: string;
mode?: string;
limit?: number;
}Function:
import {
pixivDiscovery,
pixivIllust,
pixivUserProfile,
} from "@vince-gamer/sumire";
// Search illusts with tags and mode
const a = await pixivDiscovery(
{
tags: "persona",
limit: 5,
},
{
proxy: {
protocol: "http",
host: "127.0.0.1",
port: 7890,
},
pixiv: {
mode: "r18",
phpSessId: "xxxx", // pass your phpSessId in cookie if you encounter authentication issue.
},
},
);
// get the original picture(full resolution) with illust id
const b = await pixivIllust("129887775", {
proxy: {
protocol: "http",
host: "127.0.0.1",
port: 7890,
},
pixiv: {
phpSessId: "xxxx", // pass your phpSessId in cookie if you encounter authentication issue.
},
});
// get user profile
const c = await pixivUserProfile("120227846", {
proxy: {
protocol: "http",
host: "127.0.0.1",
port: 7890,
},
pixiv: {
phpSessId: "xxxx", // pass your phpSessId in cookie if you encounter authentication issue.
},
});
// get user's following authors, requires authentication
const d = await pixivFollowingSource(
{
userId: "114104704",
offset: 0,
limit: 3,
rest: "show",
},
{
proxy: {
protocol: "http",
host: "127.0.0.1",
port: 7890,
},
pixiv: {
phpSessId: "xxx",
},
},
);Third-party API
Lolicon API:
Types:
interface LoliconParams {
r18?: number; // 0: not R18, 1: R18, 2: mixed, default 0
num?: number; // result count, range 1 to 20, default 1
uid?: number[]; // returns artwork with specified user id(s), max length is 20
keyword?: string; // search condition, like title, author, tags, etc. Fuzzy matching. Not recommended. Better use tag.
tag?: string[] | string[][]; // returns artwork with specified tags. https://docs.api.lolicon.app/#/setu?id=tag
size?: string[]; // returns specified size of pictures. Options: "original", "regular", "small", "thumb", "mini". Default ["original"]
proxy?: string; // reverse proxy address of i.pximg.net, default i.pixiv.re
dateAfter?: number; // returns artwork which upload time after this value. Timestamp, unit: ms.
dateBefore?: number; // returns artwork which upload time before this value. Timestamp, unit: ms.
dsc?: boolean; // disable auto replacement between keyword(shorthand) and tag, default false. https://docs.api.lolicon.app/#/setu?id=dsc
excludeAI?: boolean; // default false
aspectRatio?: string; // https://docs.api.lolicon.app/#/setu?id=aspectratio
}Function:
import { lolicon } from "@vince-gamer/sumire";
const aa = await lolicon({
r18: 1,
num: 5,
tag: [["萝莉", "少女"]],
});Ugoira
Use ugoira function to download pixiv animations.
import { ugoira } from "@vince-gamer/sumire";
const resp = await ugoira("https://www.pixiv.net/artworks/134478609", {
proxy: {
protocol: "http",
host: "127.0.0.1",
port: 7890,
},
});License
MIT License © 2025-PRESENT Vincent-the-gamer
