import{t as e}from"./got-BBDj7u1e.mjs";import{load as t}from"cheerio";const n={path:`/search/:query`,categories:[`multimedia`],example:`/jable/search/みなみ羽琉`,parameters:{query:`Search keyword`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1,nsfw:!0},radar:[{source:[`jable.tv/search/:query`],target:`/search/:query`}],name:`Jable 搜索结果`,maintainers:[`eve2ptp`],handler:i};function r(e){return`<img src="${e.thumb}" alt="${e.title}" style="max-width:100%" />`.trim()}async function i(n){let{query:i}=n.req.param(),a=new URLSearchParams({mode:`async`,function:`get_block`,block_id:`list_videos_videos_list_search_result`,q:i,sort_by:`post_date`}),o=`https://jable.tv/search/${encodeURIComponent(i)}/`,s=t((await e(`${o}?${a.toString()}`)).data),c=s(`.video-img-box`).toArray().map(e=>{let t=s(e),n=t.find(`.detail h6.title a`),r=t.find(`img`);return{title:n.text().trim(),link:n.attr(`href`)??``,thumb:r.attr(`data-src`)??``,preview:r.attr(`data-preview`)??``}}).map(e=>({title:e.title,link:e.link,author:i,description:r(e),media:{content:{url:e.preview||e.link,type:`video/mp4`},thumbnail:{url:e.thumb}}}));return{title:`${i} - Search | Jable`,link:o,description:`Search results for ${i}`,item:c}}export{n as route};