From 26de2f40200287b32affc1fbba22f35155f55ed6 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 30 Jan 2023 07:39:49 -0600 Subject: [PATCH] fix(route): 18comic (#11725) --- docs/anime.md | 134 ++++++++++++++++++++-------------------- lib/v2/18comic/album.js | 3 +- lib/v2/18comic/blogs.js | 3 +- lib/v2/18comic/radar.js | 68 +++++++++++--------- lib/v2/18comic/utils.js | 16 ++--- 5 files changed, 116 insertions(+), 108 deletions(-) diff --git a/docs/anime.md b/docs/anime.md index 8e159cb00a..67676ed616 100644 --- a/docs/anime.md +++ b/docs/anime.md @@ -10,73 +10,6 @@ pageClass: routes -## 18comic 禁漫天堂 - -### 成人 A 漫 - - - -分类 - -| 全部 | 其他漫畫 | 同人 | 韓漫 | 美漫 | 短篇 | 單本 | -| --- | ------- | ------ | ------ | ------ | ----- | ------ | -| all | another | doujin | hanman | meiman | short | single | - -时间范围 - -| 全部 | 今天 | 这周 | 本月 | -| -- | -- | -- | -- | -| a | t | w | m | - -排列顺序 - -| 最新 | 最多点阅 | 最多图片 | 最爱 | -| -- | ---- | ---- | -- | -| mr | mv | mp | tf | - -关键字(供参考) - -| YAOI | 女性向 | NTR | 非 H | 3D | 獵奇 | -| ---- | --- | --- | --- | -- | -- | - - - -### 搜索 - - - -::: tip 提示 - -关键字必须超过两个字,这是来自网站的限制。 - -::: - - - -### 专辑 - - - -::: tip 提示 - -专辑 id 不包括 URL 中标题的部分。 - -::: - - - -### 文庫 - - - -分类 - -| 全部 | 紳夜食堂 | 遊戲文庫 | JG GAMES | 模型山下 | -| -- | ------ | ------- | -------- | ------ | -| | dinner | raiders | jg | figure | - - - ## 1draw #深夜の真剣お絵描き 60 分一本勝負 ### 投稿一览 @@ -663,6 +596,73 @@ Sources +## 禁漫天堂 + +### 成人 A 漫 + + + +分类 + +| 全部 | 其他漫畫 | 同人 | 韓漫 | 美漫 | 短篇 | 單本 | +| --- | ------- | ------ | ------ | ------ | ----- | ------ | +| all | another | doujin | hanman | meiman | short | single | + +时间范围 + +| 全部 | 今天 | 这周 | 本月 | +| -- | -- | -- | -- | +| a | t | w | m | + +排列顺序 + +| 最新 | 最多点阅 | 最多图片 | 最爱 | +| -- | ---- | ---- | -- | +| mr | mv | mp | tf | + +关键字(供参考) + +| YAOI | 女性向 | NTR | 非 H | 3D | 獵奇 | +| ---- | --- | --- | --- | -- | -- | + + + +### 搜索 + + + +::: tip 提示 + +关键字必须超过两个字,这是来自网站的限制。 + +::: + + + +### 专辑 + + + +::: tip 提示 + +专辑 id 不包括 URL 中标题的部分。 + +::: + + + +### 文庫 + + + +分类 + +| 全部 | 紳夜食堂 | 遊戲文庫 | JG GAMES | 模型山下 | +| -- | ------ | ------- | -------- | ------ | +| | dinner | raiders | jg | figure | + + + ## 看漫画 ### 漫画更新 diff --git a/lib/v2/18comic/album.js b/lib/v2/18comic/album.js index da0c87ae2a..0c9ea43a03 100644 --- a/lib/v2/18comic/album.js +++ b/lib/v2/18comic/album.js @@ -38,13 +38,14 @@ module.exports = async (ctx) => { return { title: item.text(), link: `${rootUrl}${item.attr('href')}`, + guid: `https://18comic.org${item.attr('href')}`, pubDate: parseDate(item.find('.hidden-xs').text()), }; }); items = await Promise.all( items.map((item) => - ctx.cache.tryGet(item.link, async () => { + ctx.cache.tryGet(item.guid, async () => { const detailResponse = await got({ method: 'get', url: item.link, diff --git a/lib/v2/18comic/blogs.js b/lib/v2/18comic/blogs.js index c77aea1257..9b341a690c 100644 --- a/lib/v2/18comic/blogs.js +++ b/lib/v2/18comic/blogs.js @@ -24,12 +24,13 @@ module.exports = async (ctx) => { return { title: item.text(), link: `${rootUrl}${item.parent().attr('href')}`, + guid: `https://18comic.org${item.parent().attr('href')}`, }; }); items = await Promise.all( items.map((item) => - ctx.cache.tryGet(item.link, async () => { + ctx.cache.tryGet(item.guid, async () => { const detailResponse = await got({ method: 'get', url: item.link, diff --git a/lib/v2/18comic/radar.js b/lib/v2/18comic/radar.js index f1e2021faf..3a0f3f6991 100644 --- a/lib/v2/18comic/radar.js +++ b/lib/v2/18comic/radar.js @@ -1,31 +1,41 @@ +const _18comic = { + _name: '禁漫天堂', + '.': [ + { + title: '成人 A 漫', + docs: 'https://docs.rsshub.app/anime.html#jin-man-tian-tang-cheng-ren-a-man', + source: ['/'], + target: '/18comic/:category?/:time?/:order?/:keyword?', + }, + { + title: '搜索', + docs: 'https://docs.rsshub.app/anime.html#jin-man-tian-tang-sou-suo', + source: ['/'], + target: '/18comic/search/:option?/:category?:keyword?/:time?/:order?', + }, + { + title: '专辑', + docs: 'https://docs.rsshub.app/anime.html#jin-man-tian-tang-zhuan-ji', + source: ['/'], + target: '/18comic/album/:id', + }, + { + title: '文庫', + docs: 'https://docs.rsshub.app/anime.html#jin-man-tian-tang-wen-ku', + source: ['/'], + target: '/18comic/blogs/:category?', + }, + ], +}; + module.exports = { - '18comic.org': { - _name: '18comic 禁漫天堂', - '.': [ - { - title: '成人 A 漫', - docs: 'https://docs.rsshub.app/anime.html#18comic-jin-man-tian-tang-cheng-ren-a-man', - source: ['/'], - target: '/18comic/:category?/:time?/:order?/:keyword?', - }, - { - title: '搜索', - docs: 'https://docs.rsshub.app/anime.html#18comic-jin-man-tian-tang-sou-suo', - source: ['/'], - target: '/18comic/search/:option?/:category?:keyword?/:time?/:order?', - }, - { - title: '专辑', - docs: 'https://docs.rsshub.app/anime.html#18comic-jin-man-tian-tang-zhuan-ji', - source: ['/'], - target: '/18comic/album/:id', - }, - { - title: '文庫', - docs: 'https://docs.rsshub.app/anime.html#18comic-jin-man-tian-tang-wen-ku', - source: ['/'], - target: '/18comic/blogs/:category?', - }, - ], - }, + '18comic.org': _18comic, + '18comic.vip': _18comic, + // + 'jmcomic.me': _18comic, + 'jmcomic1.me': _18comic, + // + 'jmcomic.rocks': _18comic, + 'jmcomic1.rocks': _18comic, + 'jmcomic.group': _18comic, }; diff --git a/lib/v2/18comic/utils.js b/lib/v2/18comic/utils.js index 961b845944..d14ea6c96d 100644 --- a/lib/v2/18comic/utils.js +++ b/lib/v2/18comic/utils.js @@ -2,17 +2,15 @@ const got = require('@/utils/got'); const cheerio = require('cheerio'); const { parseDate } = require('@/utils/parse-date'); -const rootUrl = 'https://18comic.org'; +const rootUrl = 'https://jmcomic.me'; +// list of address: https://jmcomic1.bet module.exports = { rootUrl, ProcessItems: async (ctx, currentUrl) => { currentUrl = currentUrl.replace(/\?$/, ''); - const response = await got({ - method: 'get', - url: currentUrl, - }); + const response = await got(currentUrl); const $ = cheerio.load(response.data); @@ -25,16 +23,14 @@ module.exports = { return { title: item.text().trim(), link: `${rootUrl}${item.prev().find('a').attr('href')}`, + guid: `https://18comic.org${item.prev().find('a').attr('href')}`, }; }); items = await Promise.all( items.map((item) => - ctx.cache.tryGet(item.link, async () => { - const detailResponse = await got({ - method: 'get', - url: item.link, - }); + ctx.cache.tryGet(item.guid, async () => { + const detailResponse = await got(item.link); const content = cheerio.load(detailResponse.data);