rsshub
Version:
Make RSS Great Again!
66 lines (64 loc) • 2.19 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 { n as parseRelativeDate } from "./parse-date-BrP7mxXf.mjs";
import "./helpers-DxBp0Pty.mjs";
import "./got-KxxWdaxq.mjs";
import { t as invalid_parameter_default } from "./invalid-parameter-rr4AgGpp.mjs";
import { n as genSize, t as doGot } from "./util-Duh7o5Ja.mjs";
//#region lib/routes/bt0/tlist.ts
const categoryDict = {
1: "电影",
2: "电视剧",
3: "近日热门",
4: "本周热门",
5: "本月热门"
};
const route = {
path: "/tlist/:sc/:domain?",
categories: ["multimedia"],
example: "/bt0/tlist/1",
parameters: {
sc: "分类(1-5), 1:电影, 2:电视剧, 3:近日热门, 4:本周热门, 5:本月热门",
domain: "数字1-9, 比如1表示请求域名为 1bt0.com, 默认为 2"
},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: true,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["2bt0.com/tlist/"] }],
name: "最新资源列表",
maintainers: ["miemieYaho"],
handler
};
async function handler(ctx) {
const domain = ctx.req.param("domain") ?? "2";
const sc = ctx.req.param("sc");
if (!/^[1-9]$/.test(domain)) throw new invalid_parameter_default("Invalid domain");
if (!/^[1-5]$/.test(sc)) throw new invalid_parameter_default("Invalid sc");
const host = `https://www.${domain}bt0.com`;
const items = (await doGot(0, host, `${host}/prod/core/system/getTList?sc=${sc}`)).data.list.map((item) => ({
title: item.zname,
guid: item.zname,
description: `《${item.title}》 导演: ${item.daoyan}<br>编剧: ${item.bianji}<br>演员: ${item.yanyuan}<br>简介: ${item.conta.trim()}`,
link: host + item.aurl,
pubDate: item.eztime.endsWith("前") ? parseRelativeDate(item.eztime) : item.eztime,
enclosure_type: "application/x-bittorrent",
enclosure_url: item.zlink,
enclosure_length: genSize(item.zsize),
itunes_item_image: item.epic
}));
return {
title: `不太灵-最新资源列表-${categoryDict[sc]}`,
link: `${host}/tlist/${sc}_1.html`,
item: items
};
}
//#endregion
export { route };