UNPKG

rsshub

Version:
64 lines (62 loc) 1.89 kB
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/zjxwlb.ts init_esm_shims(); const renderDesc = (item) => art(path.join(__dirname, "templates/zjxwlb-e1ebec38.art"), item); const route = { path: "/zjxwlb", categories: ["traditional-media"], example: "/cztv/zjxwlb", 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); return { title: "浙江新闻联播", link: url, item: $("#videolistss li").toArray().map((item) => { item = $(item); const title = item.find("span.t1").text(); const link = item.find("input[name=data-url]").attr("value"); const videoUrl = item.find("input[name=video]").attr("value"); const posterUrl = item.find("input[name=videoimage]").attr("value"); return { title, link, pubDate: timezone(parseDate(item.find("span.t2").text() + " 16:30", "YYYY-MM-DD hh:mm"), 8), description: renderDesc({ title, videoUrl, posterUrl }) }; }) }; } //#endregion export { route };