import{t as e}from"./config-BYRrjYC5.mjs";import{t}from"./invalid-parameter-DLv2wPKB.mjs";import{t as n}from"./config-not-found-B9AOp828.mjs";import{r,t as i}from"./parse-article--6wBj-4o.mjs";const a={path:`/list/:user/:catalogId`,categories:[`blog`],example:`/medium/list/imsingee/f2d8d48096a9`,parameters:{user:`Username`,catalogId:`List ID`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`List`,maintainers:[`ImSingee`],handler:o,description:"The List ID is the last part of the URL after `-`, for example, the username in [https://medium.com/@imsingee/list/collection-7e67004f23f9](https://medium.com/@imsingee/list/collection-7e67004f23f9) is `imsingee`, and the ID is `7e67004f23f9`.\n\n::: warning\n  To access private lists, only self-hosting is supported.\n:::"};async function o(a){let o=a.req.param(`user`),s=a.req.param(`catalogId`),c=e.medium.cookies[o],l=await r(o,s,c);if(a.set(`json`,l),l&&l.__typename===`Forbidden`)throw new n(`无权访问 id 为 ${s} 的 List（可能是未设置 Cookie 或 Cookie 已过期）`);if(!l||!l.itemsConnection)throw new t(`id 为 ${s} 的 List 不存在`);let u=l.name,d=l.itemsConnection.items.map(e=>e.entity.mediumUrl),f=await Promise.all(d.map(e=>i(a,e)));return{title:`List: ${u}`,link:`https://medium.com/@${o}/list/${s}`,item:f}}export{a as route};