Skip to content

Commit

Permalink
fix(route): 18comic (DIYgod#11725)
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyRL authored Jan 30, 2023
1 parent f992838 commit 26de2f4
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 108 deletions.
134 changes: 67 additions & 67 deletions docs/anime.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,73 +10,6 @@ pageClass: routes

<Route author="junfengP" example="/005tv/zx/latest" path="/005tv/zx/latest"/>

## 18comic 禁漫天堂

### 成人 A 漫

<Route author="nczitzk" example="/18comic" path="/18comic/:category?/:time?/:order?/:keyword?" :paramsDesc="['分类,见下表,默认为 `all` 即全部', '时间范围,见下表,默认为 `a` 即全部', '排列顺序,见下表,默认为 `mr` 即最新', '关键字,见下表,默认为空']">

分类

| 全部 | 其他漫畫 | 同人 | 韓漫 | 美漫 | 短篇 | 單本 |
| --- | ------- | ------ | ------ | ------ | ----- | ------ |
| all | another | doujin | hanman | meiman | short | single |

时间范围

| 全部 | 今天 | 这周 | 本月 |
| -- | -- | -- | -- |
| a | t | w | m |

排列顺序

| 最新 | 最多点阅 | 最多图片 | 最爱 |
| -- | ---- | ---- | -- |
| mr | mv | mp | tf |

关键字(供参考)

| YAOI | 女性向 | NTR | 非 H | 3D | 獵奇 |
| ---- | --- | --- | --- | -- | -- |

</Route>

### 搜索

<Route author="nczitzk" example="/18comic/search/photos/all/NTR" path="/18comic/search/:option?/:category?:keyword?/:time?/:order?" :paramsDesc="['选项,可选 `video` 和 `photos`,默认为 `photos`', '分类,同上表,默认为 `all` 即全部', '关键字,同上表,默认为空', '时间范围,同上表,默认为 `a` 即全部', '排列顺序,同上表,默认为 `mr` 即最新']">

::: tip 提示

关键字必须超过两个字,这是来自网站的限制。

:::

</Route>

### 专辑

<Route author="nczitzk" example="/18comic/album/292282" path="/18comic/album/:id" :paramsDesc="['专辑 id,可在专辑页 URL 中找到']">

::: tip 提示

专辑 id 不包括 URL 中标题的部分。

:::

</Route>

### 文庫

<Route author="nczitzk" example="/18comic/blogs" path="/18comic/blogs/:category?" :paramsDesc="['分类,见下表,默认为空即全部']">

分类

| 全部 | 紳夜食堂 | 遊戲文庫 | JG GAMES | 模型山下 |
| -- | ------ | ------- | -------- | ------ |
| | dinner | raiders | jg | figure |

</Route>

## 1draw #深夜の真剣お絵描き 60 分一本勝負

### 投稿一览
Expand Down Expand Up @@ -663,6 +596,73 @@ Sources

<Route author="zytomorrow" path="/haimaoba/:id" example="/haimaoba/4026" :paramsDesc="['漫画id,漫画主页的地址栏中最后一位数字']" radar="1" rssbud="1"/>

## 禁漫天堂

### 成人 A 漫

<Route author="nczitzk" example="/18comic" path="/18comic/:category?/:time?/:order?/:keyword?" :paramsDesc="['分类,见下表,默认为 `all` 即全部', '时间范围,见下表,默认为 `a` 即全部', '排列顺序,见下表,默认为 `mr` 即最新', '关键字,见下表,默认为空']">

分类

| 全部 | 其他漫畫 | 同人 | 韓漫 | 美漫 | 短篇 | 單本 |
| --- | ------- | ------ | ------ | ------ | ----- | ------ |
| all | another | doujin | hanman | meiman | short | single |

时间范围

| 全部 | 今天 | 这周 | 本月 |
| -- | -- | -- | -- |
| a | t | w | m |

排列顺序

| 最新 | 最多点阅 | 最多图片 | 最爱 |
| -- | ---- | ---- | -- |
| mr | mv | mp | tf |

关键字(供参考)

| YAOI | 女性向 | NTR | 非 H | 3D | 獵奇 |
| ---- | --- | --- | --- | -- | -- |

</Route>

### 搜索

<Route author="nczitzk" example="/18comic/search/photos/all/NTR" path="/18comic/search/:option?/:category?:keyword?/:time?/:order?" :paramsDesc="['选项,可选 `video` 和 `photos`,默认为 `photos`', '分类,同上表,默认为 `all` 即全部', '关键字,同上表,默认为空', '时间范围,同上表,默认为 `a` 即全部', '排列顺序,同上表,默认为 `mr` 即最新']">

::: tip 提示

关键字必须超过两个字,这是来自网站的限制。

:::

</Route>

### 专辑

<Route author="nczitzk" example="/18comic/album/292282" path="/18comic/album/:id" :paramsDesc="['专辑 id,可在专辑页 URL 中找到']">

::: tip 提示

专辑 id 不包括 URL 中标题的部分。

:::

</Route>

### 文庫

<Route author="nczitzk" example="/18comic/blogs" path="/18comic/blogs/:category?" :paramsDesc="['分类,见下表,默认为空即全部']">

分类

| 全部 | 紳夜食堂 | 遊戲文庫 | JG GAMES | 模型山下 |
| -- | ------ | ------- | -------- | ------ |
| | dinner | raiders | jg | figure |

</Route>

## 看漫画

### 漫画更新
Expand Down
3 changes: 2 additions & 1 deletion lib/v2/18comic/album.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion lib/v2/18comic/blogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
68 changes: 39 additions & 29 deletions lib/v2/18comic/radar.js
Original file line number Diff line number Diff line change
@@ -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,
};
16 changes: 6 additions & 10 deletions lib/v2/18comic/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);

Expand Down

0 comments on commit 26de2f4

Please sign in to comment.