import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{t as r}from"./timezone-keeL11Io.mjs";import{n as i,t as a}from"./utils-D1fXcjiv.mjs";import{load as o}from"cheerio";const s={path:`/news/:category?`,categories:[`game`],example:`/yxdown/news`,parameters:{category:`分类，见下表，默认为资讯首页`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`资讯`,maintainers:[`nczitzk`],handler:c,description:`| 资讯首页 | 业界动态 | 视频预告 | 新作发布 | 游戏资讯 | 游戏评测 | 网络游戏 | 手机游戏 |
| -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- |
|          | dongtai  | yugao    | xinzuo   | zixun    | pingce   | wangluo  | shouyou  |`};async function c(s){let c=`${i}/news/${s.req.param(`category`)?`${s.req.param(`category`)}/`:``}`,l=await a(),u=o((await n(c,{headers:{cookie:l}})).data),d=u(`.div_zixun h2 a`).toArray().map(e=>(e=u(e),{title:e.text(),link:`${i}${e.attr(`href`)}`})),f=await Promise.all(d.map(i=>e.tryGet(i.link,async()=>{let e=o((await n(i.link,{headers:{cookie:l}})).data);return e(`h1, .intro`).remove(),i.description=e(`.news`).html(),i.pubDate=r(t(e(`meta[property="og:release_date"]`).attr(`content`)),8),i})));return{title:`${u(`.now`).text()} - 游讯网`,link:c,item:f}}export{s as route};