import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{t as r}from"./invalid-parameter-DLv2wPKB.mjs";import{t as i}from"./valid-host-CeDzTNj_.mjs";import{n as a,t as o}from"./utils-DQygUH812.mjs";import{load as s}from"cheerio";const c={path:`/user/:uid`,categories:[`design`],view:2,example:`/zcool/user/baiyong`,parameters:{uid:`个性域名前缀或者用户ID`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`www.zcool.com.cn/u/:id`],target:`/user/:id`}],name:`用户作品`,description:"  例如:\n\n    站酷的个人主页 `https://baiyong.zcool.com.cn` 对应 rss 路径 `/zcool/user/baiyong`\n\n    站酷的个人主页 `https://www.zcool.com.cn/u/568339` 对应 rss 路径 `/zcool/user/568339`",maintainers:[`junbaor`],handler:l};async function l(c){let l=c.req.param(`uid`),u=`https://www.zcool.com.cn/u/${l}`;if(Number.isNaN(l)){if(!i(l))throw new r(`Invalid uid`);u=`https://${l}.zcool.com.cn`}let{data:d}=await n(u),f=s(d),p=JSON.parse(f(`script#__NEXT_DATA__`).text()),m=p.props.pageProps.workList.map(e=>({title:e.title,link:e.pageUrl,pubDate:t(e.publishTime,`x`),category:[e.objectTypeStr,e.cateStr,e.subCateStr,...e.tags]})),h=await Promise.all(m.map(t=>e.tryGet(t.link,async()=>{let{data:e}=await n(t.link),r=s(e),i=JSON.parse(r(`script#__NEXT_DATA__`).text());return t.link.startsWith(`https://www.zcool.com.cn/article/`)?t.description=o(i):t.link.startsWith(`https://www.zcool.com.cn/work/`)&&(t.description=a(i)),t})));return{title:p.props.pageProps.seo.title,description:p.props.pageProps.seo.description,image:p.props.pageProps.userInfo.avatar.includes(`?x-oss-process`)?p.props.pageProps.userInfo.avatar.split(`?`)[0]:p.props.pageProps.userInfo.avatar,link:u,item:h}}export{c as route};