import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./got-BBDj7u1e.mjs";import{a as n,d as r,f as i,o as a,p as o,s,u as c}from"./util-DndyIAOJ.mjs";const l={path:`/search/:keyword`,categories:[`new-media`],example:`/huxiu/search/生活`,parameters:{keyword:`关键字`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!0,supportBT:!1,supportPodcast:!0,supportScihub:!1},radar:[{source:[`huxiu.com/`]}],name:`搜索`,maintainers:[`xyqfer`,`HenryQW`,`nczitzk`],handler:u,url:`huxiu.com/`};async function u(u){let d=u.req.param(`keyword`),f=u.req.query(`limit`)?Number.parseInt(u.req.query(`limit`),10):20,p=o,m=new URL(`api/article`,n).href,h=i,{data:g}=await t.post(m,{searchParams:{platform:`www`,s:d,sort:``,page:1,pagesize:f,appid:`hx_search_202303`,...c()}}),_=await r(g.data.datalist,f,e.tryGet),v=a({title:`搜索结果-${d}`,link:h,description:p,subtitle:p,titlePrefix:s(l.name)});return u.set(`json`,g.data.datalist),{item:_,...v}}export{l as route};