Skip to content

Commit

Permalink
fix(route): 「141jav」和「141ppv」路由失效 (#16354)
Browse files Browse the repository at this point in the history
  • Loading branch information
ueiu authored Aug 4, 2024
1 parent 49b967c commit 63e375b
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 41 deletions.
46 changes: 25 additions & 21 deletions lib/routes/141jav/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,53 @@ import { art } from '@/utils/render';
import path from 'node:path';

export const route: Route = {
path: '/{.*}?',
path: '/:type/:keyword{.*}?',
categories: ['multimedia'],
name: '通用',
maintainers: ['cgkings', 'nczitzk'],
parameters: { type: '类型,可查看下表的类型说明', keyword: '关键词,可查看下表的关键词说明' },
handler,
description: `**类型**
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 |
| ---- | ------- | ------ | -------- | -------- |
| new | popular | random | actress | tag |
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 日期 |
| ---- | ------- | ------ | -------- | -------- | ---- |
| new | popular | random | actress | tag | date |
**关键词**
**关键词**
| 空 | 日期范围 | 演员名 | 标签名 |
| -- | ----------- | ------------ | -------------- |
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards |
| 空 | 日期范围 | 演员名 | 标签名 | 年月日 |
| -- | ----------- | ------------ | -------------- | ---------- |
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | 2020/07/30 |
**示例说明**
**示例说明**
- \`/141jav/new\`
- \`/141jav/new\`
仅当类型为 \`new\` \`popular\` 或 \`random\` 时关键词为 **空**
仅当类型为 \`new\` \`popular\` 或 \`random\` 时关键词为 **空**
- \`/141jav/popular/30\`
- \`/141jav/popular/30\`
\`popular\` \`random\` 类型的关键词可填写 \`7\` \`30\` 或 \`60\` 三个 **日期范围** 之一,分别对应 **7 天**、**30 天** 或 **60 天内**
\`popular\` \`random\` 类型的关键词可填写 \`7\` \`30\` 或 \`60\` 三个 **日期范围** 之一,分别对应 **7 天**、**30 天** 或 **60 天内**
- \`/141jav/actress/Yua%20Mikami\`
- \`/141jav/actress/Yua%20Mikami\`
\`actress\` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141jav.com/actress) 演员单页链接中获取
\`actress\` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141jav.com/actress/) 演员单页链接中获取
- \`/141jav/tag/Adult%20Awards\`
- \`/141jav/tag/Adult%20Awards\`
\`tag\` 类型的关键词必须填写 **标签名** 且标签中的 \`/\` 必须替换为 \`%2F\` ,可在 [此处](https://141jav.com/tag) 标签单页链接中获取
\`tag\` 类型的关键词必须填写 **标签名** 且标签中的 \`/\` 必须替换为 \`%2F\` ,可在 [此处](https://141jav.com/tag/) 标签单页链接中获取
- \`/141jav/date/2020/07/30\`
- \`/141jav/date/2020/07/30\`
\`date\` 类型的关键词必须填写 **日期**`,
handler,
\`date\` 类型的关键词必须填写 **日期(年/月/日)**`,
};

async function handler(ctx) {
const rootUrl = 'https://www.141jav.com';
const currentUrl = `${rootUrl}${getSubPath(ctx)}`;
const type = ctx.req.param('type');
const keyword = ctx.req.param('keyword') ?? '';

const currentUrl = `${rootUrl}/${type}${keyword ? `/${keyword}` : ''}`;

const response = await got({
method: 'get',
Expand Down
44 changes: 24 additions & 20 deletions lib/routes/141ppv/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,53 @@ import { art } from '@/utils/render';
import path from 'node:path';

export const route: Route = {
path: '/{.*}?',
path: '/:type/:keyword{.*}?',
categories: ['multimedia'],
name: '通用',
maintainers: ['cgkings', 'nczitzk'],
parameters: { type: '类型,可查看下表的类型说明', keyword: '关键词,可查看下表的关键词说明' },
handler,
description: `**类型**
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 |
| ---- | ------- | ------ | -------- | -------- |
| new | popular | random | actress | tag |
| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 日期 |
| ---- | ------- | ------ | -------- | -------- | ---- |
| new | popular | random | actress | tag | date |
**关键词**
**关键词**
| 空 | 日期范围 | 演员名 | 标签名 |
| -- | ----------- | ------------ | -------------- |
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards |
| 空 | 日期范围 | 演员名 | 标签名 | 年月日 |
| -- | ----------- | ------------ | -------------- | ---------- |
| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | 2020/07/30 |
**示例说明**
**示例说明**
- \`/141ppv/new\`
- \`/141ppv/new\`
仅当类型为 \`new\` \`popular\` 或 \`random\` 时关键词为 **空**
仅当类型为 \`new\` \`popular\` 或 \`random\` 时关键词为 **空**
- \`/141ppv/popular/30\`
- \`/141ppv/popular/30\`
\`popular\` \`random\` 类型的关键词可填写 \`7\` \`30\` 或 \`60\` 三个 **日期范围** 之一,分别对应 **7 天**、**30 天** 或 **60 天内**
\`popular\` \`random\` 类型的关键词可填写 \`7\` \`30\` 或 \`60\` 三个 **日期范围** 之一,分别对应 **7 天**、**30 天** 或 **60 天内**
- \`/141ppv/actress/Yua%20Mikami\`
- \`/141ppv/actress/Yua%20Mikami\`
\`actress\` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141ppv.com/actress) 演员单页链接中获取
\`actress\` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141ppv.com/actress/) 演员单页链接中获取
- \`/141ppv/tag/Adult%20Awards\`
- \`/141ppv/tag/Adult%20Awards\`
\`tag\` 类型的关键词必须填写 **标签名** 且标签中的 \`/\` 必须替换为 \`%2F\` ,可在 [此处](https://141ppv.com/tag) 标签单页链接中获取
\`tag\` 类型的关键词必须填写 **标签名** 且标签中的 \`/\` 必须替换为 \`%2F\` ,可在 [此处](https://141ppv.com/tag/) 标签单页链接中获取
- \`/141ppv/date/2020/07/30\`
- \`/141ppv/date/2020/07/30\`
\`date\` 类型的关键词必须填写 **日期**`,
\`date\` 类型的关键词必须填写 **日期(年/月/日)**`,
};

async function handler(ctx) {
const rootUrl = 'https://www.141ppv.com';
const currentUrl = `${rootUrl}${getSubPath(ctx)}`;
const type = ctx.req.param('type');
const keyword = ctx.req.param('keyword') ?? '';

const currentUrl = `${rootUrl}/${type}${keyword ? `/${keyword}` : ''}`;

const response = await got({
method: 'get',
Expand Down

0 comments on commit 63e375b

Please sign in to comment.