rsshub
Version:
Make RSS Great Again!
49 lines (47 loc) • 1.47 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 { t as parseDate } from "./parse-date-BrP7mxXf.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/futunn/video.ts
init_esm_shims();
const route = {
path: "/video",
categories: ["finance"],
example: "/futunn/video",
features: { supportRadar: true },
radar: [{
source: ["news.futunn.com/main/video-list", "news.futunn.com/:lang/main/video-list"],
target: "/video"
}],
name: "视频",
maintainers: ["kennyfong19931"],
handler
};
async function handler(ctx) {
const limit = ctx.req.query("limit") ? Number.parseInt(ctx.req.query("limit")) : 50;
const rootUrl = "https://news.futunn.com";
return {
title: "富途牛牛 - 视频",
link: `${rootUrl}/main/video-list`,
item: (await got_default({
method: "get",
url: `${rootUrl}/news-site-api/main/get-video-list?size=${limit}`
})).data.data.videoList.list.map((item) => ({
title: item.title,
description: art(path.join(__dirname, "templates/description-d147424f.art"), {
abs: item.abstract,
pic: item.videoImg
}),
link: item.targetUrl,
pubDate: parseDate(item.timestamp * 1e3)
}))
};
}
//#endregion
export { route };