rsshub
Version:
Make RSS Great Again!
61 lines (59 loc) • 1.82 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 { t as timezone } from "./timezone-D8cuwzTY.mjs";
import path from "node:path";
import { load } from "cheerio";
//#region lib/routes/cztv/daily.ts
init_esm_shims();
const renderDesc = (item) => art(path.join(__dirname, "templates/daily-0bf4291e.art"), item);
const route = {
path: "/zjxwlb/daily",
categories: ["traditional-media"],
example: "/cztv/zjxwlb/daily",
parameters: {},
features: {
requireConfig: false,
requirePuppeteer: false,
antiCrawler: false,
supportBT: false,
supportPodcast: false,
supportScihub: false
},
radar: [{ source: ["cztv.com/videos/zjxwlb", "cztv.com/"] }],
name: "浙江新闻联播 - 每日合集",
maintainers: ["yhkang"],
handler,
url: "cztv.com/videos/zjxwlb"
};
async function handler() {
const url = "http://www.cztv.com/videos/zjxwlb";
const { data: res } = await got_default(url);
const $ = load(res);
const list = $("#videolistss li").toArray().map((item) => {
item = $(item);
return {
title: item.find("span.t1").text(),
link: item.find("input[name=data-url]").attr("value"),
pubDate: timezone(parseDate(item.find("span.t2").text() + " 16:30", "YYYY-MM-DD hh:mm"), 8)
};
});
return {
title: "浙江新闻联播-每日合集",
link: url,
item: [{
title: list[0].title,
link: list[0].link,
pubDate: list[0].pubDate,
description: renderDesc({ list: list.slice(1) })
}]
};
}
//#endregion
export { route };