import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./ehapi-B0uXgz90.mjs";const n={path:`/search/:params?/:page?/:routeParams?`,categories:[`picture`],example:`/ehentai/search/f_cats=1021/0/bittorrent=true&embed_thumb=false`,parameters:{params:"Search parameters. You can copy the content after `https://e-hentai.org/?`",page:`Page number, set 0 to get latest`,routeParams:`Additional parameters, see the table above`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!0,supportBT:!0,supportPodcast:!1,supportScihub:!1,nsfw:!0},name:`Search`,maintainers:[`yindaheng98`,`syrinka`],handler:r};async function r(n){let r=n.req.param(`page`),i=n.req.param(`params`),a=new URLSearchParams(n.req.param(`routeParams`)),o=a.get(`bittorrent`)||!1,s=a.get(`embed_thumb`)||!1,c;r?(i=i.replace(/&*next=[^&]$/,``).replace(/next=[^&]&/,``),c=await t.getSearchItems(e,i,r,o,s)):c=await t.getSearchItems(e,i,void 0,o,s);let l=i,u=/f_search=([^&]+)/.exec(l);return u!==null&&(l=u[1]),t.from_ex?{title:l+` - ExHentai Search `,link:`https://exhentai.org/?${i}`,item:c}:{title:l+` - E-Hentai Search `,link:`https://e-hentai.org/?${i}`,item:c}}export{n as route};