import{t as e}from"./parse-date-BdYTmLpo.mjs";import{t}from"./got-BBDj7u1e.mjs";import{t as n}from"./timezone-keeL11Io.mjs";import{load as r}from"cheerio";const i={path:`/video/:category?`,categories:[`finance`],example:`/cs/video/今日聚焦`,parameters:{category:`分类，见下表，默认为今日聚焦`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`中证视频`,description:`| 今日聚焦 | 传闻求证 | 高端访谈 | 投教课堂 | 直播汇 |
| -------- | -------- | -------- | -------- | ------ |`,maintainers:[`nczitzk`],handler:a};async function a(i){let{category:a=`今日聚焦`}=i.req.param(),o=i.req.query(`limit`)?Number.parseInt(i.req.query(`limit`),10):50,s=`https://video.cs.com.cn`,c=new URL(`web/api/getCategory`,s).href,l=new URL(`web/api/toSecondPage`,s).href,{data:{data:u}}=await t.post(c),d=u.map(e=>({id:e.id,title:e.categoryTitle,image:e.categoryImg,sortType:e.categorySortType})).find(e=>e.title===a||e.id===a),f=new URL(`list.html?title=${d.title}&id=${d.id}`,s).href,{data:{records:p}}=await t.post(l,{json:{categorySortType:d.sortType,id:d.id,pageNum:1,pageSize:o}}),m=p.slice(0,o).map(t=>({title:t.contentTitle,link:new URL(t.contentUrl,s).href,description:t.contentDetails,author:t.contentSource,pubDate:n(e(t.contentDatetime),8),updated:n(e(t.updateDate),8)})),{data:h}=await t(f),g=r(h),_=g(`title`).text(),v=d.image,y=new URL(g(`link[rel="icon"]`).prop(`href`),s).href;return{item:m,title:`${_} | ${d.title}`,link:f,description:g(`meta[name="Description"]`).prop(`content`),language:g(`html`).prop(`lang`),image:v,icon:y,logo:y,subtitle:g(`meta[name="Keywords"]`).prop(`content`),author:_.split(`-`).pop().trim(),allowEmpty:!0}}export{i as route};