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{load as i}from"cheerio";const a={path:`/hot/:bsn`,categories:[`anime`],view:0,example:`/gamer/hot/47157`,parameters:{bsn:`板塊 id，在 URL 可以找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`本板推薦`,maintainers:[`nczitzk`,`TonyRL`,`kennyfong19931`],handler:o};async function o(a){let o=`https://forum.gamer.com.tw/B.php?bsn=${a.req.param(`bsn`)}`,s=i((await n({url:o,headers:{Referer:`https://forum.gamer.com.tw`}})).data),c=s(`div.popular__card-list div.popular__card-img a`).toArray().map(e=>(e=s(e),{link:e.attr(`href`)})),l=await Promise.all(c.map(a=>e.tryGet(a.link,async()=>{let e=i((await n({url:a.link,headers:{Referer:o}})).data);return e(`div.c-post__body__buttonbar`).remove(),a.title=e(`.c-post__header__title`).text(),a.description=e(`div.c-post__body`).html(),a.author=`${e(`a.username`).eq(0).text()} (${e(`a.userid`).eq(0).text()})`,a.pubDate=r(t(e(`a.edittime`).eq(0).attr(`data-mtime`),8)),a}))),u={title:s(`title`).text(),link:o,item:l};return a.set(`json`,u),u}export{a as route};