import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./got-BBDj7u1e.mjs";import{n,r,t as i}from"./const-DOjQ_46O.mjs";import{load as a}from"cheerio";const o={path:`/category/:category`,categories:[`picture`],example:`/cosplaytele/category/cosplay`,parameters:{category:`Category`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1,nsfw:!0},radar:[{source:[`cosplaytele.com/category/:category`],target:`/category/:category`}],name:`Category`,maintainers:[`AiraNadih`],handler:s,url:`cosplaytele.com/`};async function s(o){let s=Number.parseInt(o.req.query(`limit`))||20,c=o.req.param(`category`),l=`${n}category/${c}/`,u=a((await t(l)).body),d=u(`#content .post-item`).slice(0,s).toArray();return{title:`${i} - Category: ${c}`,link:l,item:await Promise.all(d.map(t=>{let n=u(t).find(`h5.post-title a`).attr(`href`);return e.tryGet(n,()=>r(n))}))}}export{o as route};