import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{Fragment as r,jsx as i,jsxs as a}from"hono/jsx/jsx-runtime";import{load as o}from"cheerio";import{renderToString as s}from"hono/jsx/dom/server";import{raw as c}from"hono/html";const l=({category:e,catalogue:t,title:n,size:o,date:l,images:u})=>s(a(r,{children:[e||t||n||o||l?i(`table`,{children:a(`tbody`,{children:[e?a(`tr`,{children:[i(`th`,{children:`Category`}),i(`td`,{children:c(e)})]}):null,t?a(`tr`,{children:[i(`th`,{children:`Catalogue`}),i(`td`,{children:c(t)})]}):null,n?a(`tr`,{children:[i(`th`,{children:`Title`}),i(`td`,{children:c(n)})]}):null,o?a(`tr`,{children:[i(`th`,{children:`Size`}),i(`td`,{children:c(o)})]}):null,l?a(`tr`,{children:[i(`th`,{children:`Date`}),i(`td`,{children:c(l)})]}):null]})}):null,u?.map(e=>e?.src?i(`figure`,{children:i(`img`,{src:e.src,alt:e.alt??void 0})}):null)]})),u=async r=>{let{filter:i}=r.req.param(),a=Number.parseInt(r.req.query(`limit`)??`100`,10),s=`https://0xxx.ws`,c=new URL(i?`?${i}`:``,s).href,u=o(await e(c)),d=u(`html`).attr(`lang`)??`en`,f=u(`table#home-table tr:not(.gore)`).slice(0,a).toArray().map(e=>{let t=u(e),r=t.find(`td.category`),i=t.find(`td.catalogue`),a=t.find(`td.date`),o=t.find(`td.title`).text(),c=t.find(`a.screenshot`).attr(`rel`),f=l({images:c?[{src:c,alt:o}]:void 0,category:r.html(),catalogue:i.html(),title:o,size:t.find(`td.size`).text(),date:a.html()}),p=a.text(),m=t.find(`td.title a`).attr(`href`),h=[...new Set([r.text()?.trim(),i.text()?.trim(),a.text()])].filter(e=>!!(e&&e!==`-`)),g=p;return{title:o,description:f,pubDate:p?n(p,`DD.MM.YYYY`):void 0,link:m?new URL(m,s).href:void 0,category:h,content:{html:f,text:f},image:c,banner:c,updated:g?n(g,`DD.MM.YYYY`):void 0,language:d}});f=await Promise.all(f.map(n=>n.link?t.tryGet(n.link,async()=>{let t=o(await e(n.link)),r=l({images:t(`div.thumbs img`).toArray().map(e=>{let r=t(e);return{src:r.attr(`src`),alt:r.attr(`alt`)??n.title}})})+(n.description??``);return{...n,description:r}}):n));let p=u(`title`).text()?.split(/\|/).pop();return{title:p?`${p} - ${i}`:i,description:u(`meta[name="description"]`).attr(`content`),link:c,item:f,allowEmpty:!0,image:u(`div.logo img`).attr(`src`)?new URL(u(`div.logo img`).attr(`src`),s).href:void 0,author:u(`meta[property="og:site_name"]`).attr(`content`),language:d,id:c}},d={path:`/:filter?`,name:`Source`,url:`0xxx.ws`,maintainers:[`nczitzk`],handler:u,example:`/0xxx/category=Movie-HD-1080p`,parameters:{filter:{description:`Filter`}},description:":::tip\nTo subscribe to [Movie HD 1080p](https://0xxx.ws?category=Movie-HD-1080p), where the source URL is `https://0xxx.ws?category=Movie-HD-1080p`, extract the certain parts from this URL to be used as parameters, resulting in the route as [`/0xxx/category=Movie-HD-1080p`](https://rsshub.app/0xxx/category=Movie-HD-1080p).\n:::\n",categories:[`multimedia`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1,nfsw:!0},radar:[{source:[`0xxx.ws`],target:(e,t)=>{let n=new URL(t);n.searchParams.delete(`next`);let r=n.searchParams.toString();return`/0xxx${r?`/${r}`:``}`}}],view:0};export{u as handler,d as route};