diff --git a/docs/reading.md b/docs/reading.md index b69faa44eb..0e89ee48d2 100644 --- a/docs/reading.md +++ b/docs/reading.md @@ -444,11 +444,11 @@ count 的取值范围为 1-12,为防止请求次数过多,推荐设置为 5 ### 章节 - + ### 讨论区 - + ### 限时免费 diff --git a/docs/university.md b/docs/university.md index e12710013d..0a8ea9854f 100644 --- a/docs/university.md +++ b/docs/university.md @@ -1071,9 +1071,9 @@ pageClass: routes ### 研究生招生网通知公告 - + -### 东南大学计算机技术与工程学院 +### 计算机技术与工程学院 @@ -1738,7 +1738,7 @@ jsjxy.hbut.edu.cn 证书链不全,自建 RSSHub 可设置环境变量 NODE_TLS ### 教务处通知 - + | all | tzgg | ksap | wjgg | tmgz | djks | xjgl | bysj | syjs | | ---- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | diff --git a/lib/v2/qidian/chapter.js b/lib/v2/qidian/chapter.js index 8bdfeceb1f..ef23ba5760 100644 --- a/lib/v2/qidian/chapter.js +++ b/lib/v2/qidian/chapter.js @@ -8,30 +8,26 @@ module.exports = async (ctx) => { const response = await got(`https://m.qidian.com/book/${id}.html`); const $ = cheerio.load(response.data); - const name = $('.book-detail-info .book-title').text(); - const cover_url = 'https:' + $('.book-detail-info img').attr('src'); + const name = $('meta[property="og:title"]').attr('content'); + const coverUrl = `https:${$('.detail__header-cover__img').attr('src')}`; - const csrfToken = await got(`https://m.qidian.com/book/${id}/catalog/`).then((res) => res.headers['set-cookie'].join('').match(/_csrfToken=(\S*);/)[0]); - const chapters_response = await got(`https://m.qidian.com/majax/book/category?${csrfToken}&bookId=${id}`); - const chapter_item = []; + const { data: catalog } = await got(`https://m.qidian.com/book/${id}/catalog/`); + const $c = cheerio.load(catalog); + const { pageContext } = JSON.parse($c('#vite-plugin-ssr_pageContext').text()); - for (let i = 0; i < chapters_response.data.data.vs.length; i++) { - const chapters = chapters_response.data.data.vs[i].cs; - for (let j = 0; j < chapters.length; j++) { - const chapter = chapters[j]; - chapter_item.push({ - title: chapter.cN, - pubDate: parseDate(chapter.uT), - link: `https://vipreader.qidian.com/chapter/${id}/${chapter.id}`, - }); - } - } + const chapterItem = pageContext.pageProps.pageData.vs + .flatMap((v) => v.cs) + .map((c) => ({ + title: c.cN, + pubDate: parseDate(c.uT), + link: `https://vipreader.qidian.com/chapter/${id}/${c.id}`, + })); ctx.state.data = { title: `起点 ${name}`, link: `https://book.qidian.com/info/${id}`, description: $('#bookSummary content').text(), - image: cover_url, - item: chapter_item, + image: coverUrl, + item: chapterItem, }; }; diff --git a/lib/v2/qidian/maintainer.js b/lib/v2/qidian/maintainer.js index a74b4404f0..914980d4a0 100644 --- a/lib/v2/qidian/maintainer.js +++ b/lib/v2/qidian/maintainer.js @@ -1,7 +1,7 @@ module.exports = { '/author/:id': ['miles170'], - '/chapter/:id': ['Chingyat'], - '/forum/:id': ['Chingyat'], + '/chapter/:id': ['fuzy112'], + '/forum/:id': ['fuzy112'], '/free/:type?': ['LogicJake'], '/free-next/:type?': ['LogicJake'], };