import{t as e}from"./header-generator-D_8tgMao.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{load as r}from"cheerio";const i={path:`/chapter/:id`,categories:[`reading`],view:5,example:`/qidian/chapter/1010400217`,parameters:{id:`小说 id, 可在对应小说页 URL 中找到`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`book.qidian.com/info/:id`]}],name:`作品章节`,maintainers:[`fuzy112`,`pseudoyu`],handler:a};async function a(i){let a=i.req.param(`id`),o=r((await n(`https://m.qidian.com/book/${a}.html`,{headerGeneratorOptions:e.MODERN_IOS})).data),s=o(`meta[property="og:title"]`).attr(`content`),c=`https:${o(`.detail__header-cover__img`).attr(`src`)}`,{data:l}=await n(`https://m.qidian.com/book/${a}/catalog/`,{headerGeneratorOptions:e.MODERN_IOS}),u=r(l),{pageContext:d}=JSON.parse(u(`#vite-plugin-ssr_pageContext`).text()),f=d.pageProps.pageData.vs.flatMap(e=>e.cs).map(e=>({title:e.cN,pubDate:t(e.uT),link:`https://vipreader.qidian.com/chapter/${a}/${e.id}`}));return{title:`起点 ${s}`,link:`https://book.qidian.com/info/${a}`,description:o(`#bookSummary content`).text(),image:c,item:f}}export{i as route};