rsshub
Version:
Make RSS Great Again!
66 lines (64 loc) • 2.17 kB
JavaScript
import { n as init_esm_shims, t as __dirname } from "./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 art } from "./render-BQo6B4tL.mjs";
import { t as got_default } from "./got-KxxWdaxq.mjs";
import path from "node:path";
//#region lib/routes/taobao/zhongchou.ts
init_esm_shims();
const route = {
path: "/zhongchou/:type?",
categories: ["shopping"],
example: "/taobao/zhongchou/all",
parameters: { type: "类型, 默认为 `all` 全部" },
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
name: "众筹项目",
maintainers: ["xyqfer", "Fatpandac"],
handler,
description: `| 全部 | 科技 | 食品 | 动漫 | 设计 | 公益 | 娱乐 | 影音 | 书籍 | 游戏 | 其他 |
| ---- | ---- | ----------- | ---- | ------ | ---- | ---- | ----- | ---- | ---- | ----- |
| all | tech | agriculture | acg | design | love | tele | music | book | game | other |`
};
async function handler(ctx) {
const { type = "all" } = ctx.req.param();
const items = (await got_default({
method: "get",
url: `https://izhongchou.taobao.com/dream/ajax/getProjectListNew.htm?_input_charset=utf-8&type=6&pageSize=20&page=1&sort=1&status=&projectType=${encodeURIComponent({
all: "",
tech: "121288001",
agriculture: "123330001,125672021",
acg: "122018001",
design: "121292001,126176002,126202001",
love: "121280001",
tele: "121284001",
music: "121278001",
book: "121274002",
game: "122020001",
other: "125706031,125888001,125886001,123332001"
}[type])}&_=${Date.now()}&callback=`
})).data.data.map((item) => {
return {
title: item.name,
link: `https://izhongchou.taobao.com/dreamdetail.htm?id=${item.id}`,
description: art(path.join(__dirname, "templates/zhongchou-21b2cd6c.art"), { item }),
guid: item.id
};
});
return {
title: `淘宝众筹-${type}`,
link: "https://izhongchou.taobao.com/index.htm",
item: items
};
}
//#endregion
export { route };