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{t as r}from"./description-Daa0_wwD.mjs";import{load as i}from"cheerio";const a=async a=>{let{filter:o}=a.req.param(),s=Number.parseInt(a.req.query(`limit`)??`30`,10),c=`https://kpopping.com`,l=new URL(`kpics${o?`/${o}`:``}`,c).href,u=i(await e(l)),d=u(`html`).attr(`lang`)??`en`,f=u(`div.pics div.matrix div.cell`).slice(0,s).toArray().map(e=>{let t=u(e),n=t.find(`figcaption section`).text(),i=r({images:t.find(`a.picture img`).attr(`src`)?[{src:t.find(`a.picture img`).attr(`src`),alt:n}]:void 0}),a=t.find(`a`).first().attr(`href`),o=t.find(`figcaption section a`).contents().last().text(),s=t.find(`a.picture img`).attr(`src`);return{title:n,description:i,link:a?new URL(a,c).href:void 0,author:o,content:{html:i,text:i},image:s,banner:s,language:d}});return f=(await Promise.all(f.map(a=>a.link?t.tryGet(a.link,async()=>{let t=i(await e(a.link)),o=t(`h1`).contents().first().text(),s=r({description:t(`div.pics`).first().html()}),l=t(`meta[property="article:published_time"]`).attr(`content`),u=t(`div.buttons a`).toArray(),f=[...new Set(u.map(e=>t(e).text()).filter(Boolean))],p=t(`div.content-snippet aside:not(.like)`).toArray().map(e=>{let n=t(e),r=n.find(`a`).last();return{name:r.text(),url:new URL(r.attr(`href`),c).href,avatar:n.find(`img`).attr(`src`)}}),m=t(`meta[name="twitter:image"]`).attr(`content`),h=t(`meta[property="article:modified_time"]`).attr(`content`),g={title:o,description:s,pubDate:l?n(l):a.pubDate,category:f,author:p,content:{html:s,text:s},image:m,banner:m,updated:h?n(h):a.updated,language:d},_=t(`div.pics`).first().find(`img`).toArray(),v={},y=1;for(let e of _){let n=t(e),r=n.attr(`src`)?new URL(n.attr(`src`),c).href:void 0;if(!r)continue;let i=`image`,a=`${i}${y++}`;v[a]={url:r,medium:i,title:n.attr(`alt`)||o,description:n.attr(`alt`)||o,thumbnail:r}}return Object.keys(v).length>0&&(g={...g,media:v}),{...a,...g}}):a))).filter(e=>!0),{title:u(`title`).text(),description:u(`meta[property="og:description"]`).attr(`content`),link:l,item:f,allowEmpty:!0,image:u(`meta[property="og:image"]`).attr(`content`),author:u(`meta[property="og:site_name"]`).attr(`content`),language:d,id:l}},o={path:`/kpics/:filter{.+}?`,name:`Pics`,url:`kpopping.com`,maintainers:[`nczitzk`],handler:a,example:`/kpopping/kpics/gender-male/category-all/idol-any/group-any/order`,parameters:{filter:`Filter`},description:"::: tip\nIf you subscribe to [All male photo albums](https://kpopping.com/kpics/gender-male/category-all/idol-any/group-any/order)，where the URL is `https://kpopping.com/kpics/gender-male/category-all/idol-any/group-any/order`, extract the part `https://kpopping.com/kpics/` to the end, which is `gender-male/category-all/idol-any/group-any/order`, and use it as the parameter to fill in. Therefore, the route will be [`/kpopping/kpics/gender-male/category-all/idol-any/group-any/order`](https://rsshub.app/kpopping/kpics/gender-male/category-all/idol-any/group-any/order).\n:::",categories:[`picture`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`kpopping.com/kpics/:filter`],target:e=>{let t=e.filter;return`/kpopping/kpics${t?`/${t}`:``}`}}],view:0,zh:{path:`/kpics/:filter{.+}?`,name:`Pics`,url:`kpopping.com`,maintainers:[`nczitzk`],handler:a,example:`/kpopping/kpics/gender-male/category-all/idol-any/group-any/order`,parameters:{filter:`筛选，可在对应分类页 URL 中找到`},description:"::: tip\n若订阅 [All male photo albums](https://kpopping.com/kpics/gender-male/category-all/idol-any/group-any/order)，网址为 `https://kpopping.com/kpics/gender-male/category-all/idol-any/group-any/order`，请截取 `https://kpopping.com/kpics/` 到末尾的部分 `gender-male/category-all/idol-any/group-any/order` 作为 `filter` 参数填入，此时目标路由为 [`/kpopping/kpics/gender-male/category-all/idol-any/group-any/order`](https://rsshub.app/kpopping/kpics/gender-male/category-all/idol-any/group-any/order)。\n:::\n"}};export{a as handler,o as route};