From 63e375b86f56ce42852aaba6dd9dacd232209d5b Mon Sep 17 00:00:00 2001 From: ueiu <39592269+ueiu@users.noreply.github.com> Date: Sun, 4 Aug 2024 23:15:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(route):=20=E3=80=8C141jav=E3=80=8D=E5=92=8C?= =?UTF-8?q?=E3=80=8C141ppv=E3=80=8D=E8=B7=AF=E7=94=B1=E5=A4=B1=E6=95=88=20?= =?UTF-8?q?(#16354)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/141jav/index.ts | 46 +++++++++++++++++++++----------------- lib/routes/141ppv/index.ts | 44 +++++++++++++++++++----------------- 2 files changed, 49 insertions(+), 41 deletions(-) diff --git a/lib/routes/141jav/index.ts b/lib/routes/141jav/index.ts index 85d9b1026..5eb1d0757 100644 --- a/lib/routes/141jav/index.ts +++ b/lib/routes/141jav/index.ts @@ -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', diff --git a/lib/routes/141ppv/index.ts b/lib/routes/141ppv/index.ts index cf2d42c39..2e0844704 100644 --- a/lib/routes/141ppv/index.ts +++ b/lib/routes/141ppv/index.ts @@ -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',