rsshub
Version:
Make RSS Great Again!
52 lines (50 loc) • 1.59 kB
JavaScript
import "./esm-shims-CzJ_djXG.mjs";
import "./config-C37vj7VH.mjs";
import "./dist-BInvbO1W.mjs";
import "./logger-Czu8UMNd.mjs";
import "./ofetch-BIyrKU3Y.mjs";
import "./helpers-DxBp0Pty.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
//#region lib/routes/bilibili/mall-ip.ts
const route = {
path: "/mall/ip/:id",
categories: ["social-media"],
example: "/bilibili/mall/ip/0_3000294",
parameters: { id: "作品 id, 可在作品列表页 URL 中找到" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "会员购作品",
maintainers: ["DIYgod"],
handler
};
async function handler(ctx) {
const id = ctx.req.param("id");
const detail = await got_default({
method: "get",
url: `https://mall.bilibili.com/mall-c-search/ipright/detail?type=ip&id=${id}`,
headers: { Referer: `https://mall.bilibili.com/ip.html?noTitleBar=1&ip=${id}&from=detail` }
});
const data = (await got_default({
method: "get",
url: `https://mall.bilibili.com/mall-c-search/ipright/newitems?type=ip&id=${id}`,
headers: { Referer: `https://mall.bilibili.com/ip.html?noTitleBar=1&ip=${id}&from=detail` }
})).data.data;
return {
title: `${detail.data.data.name} - 会员购`,
description: detail.data.data.intro,
link: `https://mall.bilibili.com/list.html?ip=${id}`,
item: data.map((item) => ({
title: item.name,
description: `${item.name}<br>¥${item.price}<br><img src="${item.itemsImg}">`,
link: item.jumpUrlH5
}))
};
}
//#endregion
export { route };