From 377a31fc9dfba84bf1e8d99c15a5ebac621df8e5 Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Sun, 4 Jun 2023 21:53:51 +0800 Subject: [PATCH] fix(route): 141JAV & 141PPV (#12594) * fix(route): 141JAV & 141PPV * fix radar --- assets/radar-rules.js | 76 ------------------------- docs/multimedia.md | 56 +++++++++--------- lib/radar-rules.js | 76 ------------------------- lib/router.js | 4 +- lib/routes/141jav/141jav.js | 37 ------------ lib/routes/141ppv/141ppv.js | 37 ------------ lib/v2/141jav/index.js | 71 +++++++++++++++++++++++ lib/v2/141jav/maintainer.js | 3 + lib/v2/141jav/radar.js | 40 +++++++++++++ lib/v2/141jav/router.js | 3 + lib/v2/141jav/templates/description.art | 47 +++++++++++++++ lib/v2/141ppv/index.js | 71 +++++++++++++++++++++++ lib/v2/141ppv/maintainer.js | 3 + lib/v2/141ppv/radar.js | 40 +++++++++++++ lib/v2/141ppv/router.js | 3 + lib/v2/141ppv/templates/description.art | 47 +++++++++++++++ 16 files changed, 358 insertions(+), 256 deletions(-) delete mode 100644 lib/routes/141jav/141jav.js delete mode 100644 lib/routes/141ppv/141ppv.js create mode 100644 lib/v2/141jav/index.js create mode 100644 lib/v2/141jav/maintainer.js create mode 100644 lib/v2/141jav/radar.js create mode 100644 lib/v2/141jav/router.js create mode 100644 lib/v2/141jav/templates/description.art create mode 100644 lib/v2/141ppv/index.js create mode 100644 lib/v2/141ppv/maintainer.js create mode 100644 lib/v2/141ppv/radar.js create mode 100644 lib/v2/141ppv/router.js create mode 100644 lib/v2/141ppv/templates/description.art diff --git a/assets/radar-rules.js b/assets/radar-rules.js index fd70980c8..4eceeeb24 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -286,82 +286,6 @@ }, ], }, - '141jav.com': { - _name: '141JAV BT', - '.': [ - { - title: '今日种子', - docs: 'https://docs.rsshub.app/multimedia.html#141jav', - source: '/', - target: (params, url, document) => { - const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); - return `/141jav/day/${today}`; - }, - }, - { - title: '今日演员', - docs: 'https://docs.rsshub.app/multimedia.html#141jav', - source: '/', - target: (params, url, document) => { - const star = document.querySelector('div.card-content > div > a').getAttribute('href'); - return `/141jav${star}`; - }, - }, - { - title: '页面种子', - docs: 'https://docs.rsshub.app/multimedia.html#141jav', - source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], - target: (params, url, document) => { - const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day'; - let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; - if (ikey === '' && itype === 'tag') { - ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F'); - } else if (ikey === '' && itype === 'actress') { - ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); - } - return `/141jav/${itype}/${ikey}`; - }, - }, - ], - }, - '141ppv.com': { - _name: '141ppv BT', - '.': [ - { - title: '今日种子', - docs: 'https://docs.rsshub.app/multimedia.html#141pvp', - source: '/', - target: (params, url, document) => { - const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); - return `/141ppv/day/${today}`; - }, - }, - { - title: '今日演员', - docs: 'https://docs.rsshub.app/multimedia.html#141ppv', - source: '/', - target: (params, url, document) => { - const star = document.querySelector('div.card-content > div > a').getAttribute('href'); - return `/141ppv${star}`; - }, - }, - { - title: '页面种子', - docs: 'https://docs.rsshub.app/multimedia.html#141ppv', - source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], - target: (params, url, document) => { - const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day'; - let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; - if (ikey === '' && itype === 'tag') { - ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F'); - } else if (ikey === '' && itype === 'actress') { - ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); - } - return `/141ppv/${itype}/${ikey}`; - }, - }, - ], - }, 'sexinsex.net': { _name: 'sexinsex', '.': [ diff --git a/docs/multimedia.md b/docs/multimedia.md index 7e428b6e6..f188d5fa9 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -12,43 +12,43 @@ pageClass: routes ::: -### 141JAV BT +### 通用 - + **类型** -| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 | -| ---- | ------- | ------ | -------- | -------- | -------- | -| new | popular | random | actress | tag | day | +| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | +| ---- | ------- | ------ | -------- | -------- | +| new | popular | random | actress | tag | **关键词** -| 空 | 日期范围 | 演员名 | 标签名 | 日期 | -| -- | ----------- | ------------ | -------------- | -------- | -| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | YYYYMMDD | +| 空 | 日期范围 | 演员名 | 标签名 | +| --- | ----------- | ------------ | -------------- | +| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | **示例说明** - `/141jav/new` - 仅当类型为 `new` `popular` 或 `random` 时关键词可为 **空** + 仅当类型为 `new` `popular` 或 `random` 时关键词为 **空** - `/141jav/popular/30` - `popular` `random` 类型的关键词可填写 `7` `30` 或 `60` 三个 **日期范围** 之一 + `popular` `random` 类型的关键词可填写 `7` `30` 或 `60` 三个 **日期范围** 之一,分别对应 **7天**、**30天** 或 **60天内** - `/141jav/actress/Yua%20Mikami` - `actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141jav.com/actress/) 演员单页链接中获取 + `actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141jav.com/actress) 演员单页链接中获取 - `/141jav/tag/Adult%20Awards` - `tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141jav.com/tag/) 标签单页链接中获取 + `tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141jav.com/tag) 标签单页链接中获取 -- `/141jav/day/20200730` +- `/141jav/date/2020/07/30` - `day` 类型的关键词必须填写 **日期** ,按照示例写成形如 `20200730` 的格式 + `date` 类型的关键词必须填写 **日期** @@ -60,43 +60,43 @@ pageClass: routes ::: -### 141PPV BT +### 通用 - + **类型** -| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | 指定日期 | -| ---- | ------- | ------ | -------- | -------- | -------- | -| new | popular | random | actress | tag | day | +| 最新 | 热门 | 随机 | 指定演员 | 指定标签 | +| ---- | ------- | ------ | -------- | -------- | +| new | popular | random | actress | tag | **关键词** -| 空 | 日期范围 | 演员名 | 标签名 | 日期 | -| -- | ----------- | ------------ | -------------- | -------- | -| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | YYYYMMDD | +| 空 | 日期范围 | 演员名 | 标签名 | +| --- | ----------- | ------------ | -------------- | +| | 7 / 30 / 60 | Yua%20Mikami | Adult%20Awards | **示例说明** - `/141ppv/new` - 仅当类型为 `new` `popular` 或 `random` 时关键词可为 **空** + 仅当类型为 `new` `popular` 或 `random` 时关键词为 **空** - `/141ppv/popular/30` - `popular` `random` 类型的关键词可填写 `7` `30` 或 `60` 三个 **日期范围** 之一 + `popular` `random` 类型的关键词可填写 `7` `30` 或 `60` 三个 **日期范围** 之一,分别对应 **7天**、**30天** 或 **60天内** - `/141ppv/actress/Yua%20Mikami` - `actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141ppv.com/actress/) 演员单页链接中获取 + `actress` 类型的关键词必须填写 **演员名** ,可在 [此处](https://141ppv.com/actress) 演员单页链接中获取 - `/141ppv/tag/Adult%20Awards` - `tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141ppv.com/tag/) 标签单页链接中获取 + `tag` 类型的关键词必须填写 **标签名** 且标签中的 `/` 必须替换为 `%2F` ,可在 [此处](https://141ppv.com/tag) 标签单页链接中获取 -- `/141ppv/day/20200730` +- `/141ppv/date/2020/07/30` - `day` 类型的关键词必须填写 **日期** ,按照示例写成形如 `20200730` 的格式 + `date` 类型的关键词必须填写 **日期** diff --git a/lib/radar-rules.js b/lib/radar-rules.js index 76c893aa4..a6108a586 100644 --- a/lib/radar-rules.js +++ b/lib/radar-rules.js @@ -789,82 +789,6 @@ module.exports = { }, ], }, - '141jav.com': { - _name: '141JAV BT', - '.': [ - { - title: '今日种子', - docs: 'https://docs.rsshub.app/multimedia.html#141jav', - source: '/', - target: (params, url, document) => { - const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); - return `/141jav/day/${today}`; - }, - }, - { - title: '今日演员', - docs: 'https://docs.rsshub.app/multimedia.html#141jav', - source: '/', - target: (params, url, document) => { - const star = document.querySelector('div.card-content > div > a').getAttribute('href'); - return `/141jav${star}`; - }, - }, - { - title: '页面种子', - docs: 'https://docs.rsshub.app/multimedia.html#141jav', - source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], - target: (params, url, document) => { - const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day'; - let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; - if (ikey === '' && itype === 'tag') { - ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F'); - } else if (ikey === '' && itype === 'actress') { - ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); - } - return `/141jav/${itype}/${ikey}`; - }, - }, - ], - }, - '141ppv.com': { - _name: '141ppv BT', - '.': [ - { - title: '今日种子', - docs: 'https://docs.rsshub.app/multimedia.html#141pvp', - source: '/', - target: (params, url, document) => { - const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); - return `/141ppv/day/${today}`; - }, - }, - { - title: '今日演员', - docs: 'https://docs.rsshub.app/multimedia.html#141ppv', - source: '/', - target: (params, url, document) => { - const star = document.querySelector('div.card-content > div > a').getAttribute('href'); - return `/141ppv${star}`; - }, - }, - { - title: '页面种子', - docs: 'https://docs.rsshub.app/multimedia.html#141ppv', - source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], - target: (params, url, document) => { - const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day'; - let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; - if (ikey === '' && itype === 'tag') { - ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace('/', '%2F'); - } else if (ikey === '' && itype === 'actress') { - ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); - } - return `/141ppv/${itype}/${ikey}`; - }, - }, - ], - }, 'sexinsex.net': { _name: 'sexinsex', '.': [ diff --git a/lib/router.js b/lib/router.js index 86975f7d0..9313aeaa6 100644 --- a/lib/router.js +++ b/lib/router.js @@ -3037,10 +3037,10 @@ router.get('/hfut/tzgg', lazyloadRouteHandler('./routes/universities/hfut/tzgg') router.get('/onejav/:type/:key?', lazyloadRouteHandler('./routes/onejav/one')); // 141jav -router.get('/141jav/:type/:key?', lazyloadRouteHandler('./routes/141jav/141jav')); +// router.get('/141jav/:type/:key?', lazyloadRouteHandler('./routes/141jav/141jav')); // 141ppv -router.get('/141ppv/:type/:key?', lazyloadRouteHandler('./routes/141ppv/141ppv')); +// router.get('/141ppv/:type/:key?', lazyloadRouteHandler('./routes/141ppv/141ppv')); // CuriousCat router.get('/curiouscat/user/:id', lazyloadRouteHandler('./routes/curiouscat/user')); diff --git a/lib/routes/141jav/141jav.js b/lib/routes/141jav/141jav.js deleted file mode 100644 index 822de5db8..000000000 --- a/lib/routes/141jav/141jav.js +++ /dev/null @@ -1,37 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const type = ctx.params.type || 'new'; - const key = type === 'day' ? ctx.params.key.slice(0, 4) + '/' + ctx.params.key.slice(4, 6) + '/' + ctx.params.key.slice(6, 8) : ctx.params.key || ''; - const link = 'https://www.141jav.com' + `/${type === 'day' ? '' : type}${type === 'new' ? '' : '/' + key}`.replace('//', '/'); - const response = await got({ - method: 'get', - url: link, - }); - - const $ = cheerio.load(response.data); - const list = $('div.columns'); - - let itemPicUrl; - - ctx.state.data = { - title: `141jav - ${type} ${key}`, - link, - item: - list && - list - .map((index, item) => { - item = $(item); - itemPicUrl = item.find('img').attr('src'); - return { - title: '【' + item.find('div.card-content.is-flex > h5 > a').text() + '】' + item.find('div.card-content.is-flex > h5 > span').text(), - description: `
Time: ${item.find('p.subtitle.is-6 > a').text()}
Desc: ${item.find('p.level.has-text-grey-dark').text()}`, - link: item.find('div.card-content.is-flex > h5 > a').attr('href'), - enclosure_url: item.find('div.card-content.is-flex > a').attr('href'), - enclosure_type: 'application/x-bittorrent', - }; - }) - .get(), - }; -}; diff --git a/lib/routes/141ppv/141ppv.js b/lib/routes/141ppv/141ppv.js deleted file mode 100644 index c42d80248..000000000 --- a/lib/routes/141ppv/141ppv.js +++ /dev/null @@ -1,37 +0,0 @@ -const got = require('@/utils/got'); -const cheerio = require('cheerio'); - -module.exports = async (ctx) => { - const type = ctx.params.type || 'new'; - const key = type === 'day' ? ctx.params.key.slice(0, 4) + '/' + ctx.params.key.slice(4, 6) + '/' + ctx.params.key.slice(6, 8) : ctx.params.key || ''; - const link = 'https://www.141ppv.com' + `/${type === 'day' ? '' : type}${type === 'new' ? '' : '/' + key}`.replace('//', '/'); - const response = await got({ - method: 'get', - url: link, - }); - - const $ = cheerio.load(response.data); - const list = $('div.columns'); - - let itemPicUrl; - - ctx.state.data = { - title: `141ppv - ${type} ${key}`, - link, - item: - list && - list - .map((index, item) => { - item = $(item); - itemPicUrl = item.find('img').attr('src'); - return { - title: '【' + item.find('div.card-content.is-flex > h5 > a').text() + '】' + item.find('div.card-content.is-flex > h5 > span').text(), - description: `
Time: ${item.find('p.subtitle.is-6 > a').text()}
Desc: ${item.find('p.level.has-text-grey-dark').text()}`, - link: item.find('div.card-content.is-flex > h5 > a').attr('href'), - enclosure_url: item.find('div.card-content.is-flex > a').attr('href'), - enclosure_type: 'application/x-bittorrent', - }; - }) - .get(), - }; -}; diff --git a/lib/v2/141jav/index.js b/lib/v2/141jav/index.js new file mode 100644 index 000000000..2b462f677 --- /dev/null +++ b/lib/v2/141jav/index.js @@ -0,0 +1,71 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const path = require('path'); + +module.exports = async (ctx) => { + const rootUrl = 'https://www.141jav.com'; + const currentUrl = `${rootUrl}${ctx.path}`; + + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + if (ctx.path === '/') { + ctx.redirect(`/141jav${$('.overview').first().attr('href')}`); + return; + } + + const items = $('.columns') + .toArray() + .map((item) => { + item = $(item); + + const id = item.find('.title a').text(); + const size = item.find('.title span').text(); + const pubDate = item.find('.subtitle a').attr('href').split('/date/').pop(); + const description = item.find('.has-text-grey-dark').text(); + const actresses = item + .find('.panel-block') + .toArray() + .map((a) => $(a).text().trim()); + const tags = item + .find('.tag') + .toArray() + .map((t) => $(t).text().trim()); + const magnet = item.find('a[title="Magnet torrent"]').attr('href'); + const link = item.find('a[title="Download .torrent"]').attr('href'); + const image = item.find('.image').attr('src'); + + return { + title: `${id} ${size}`, + pubDate: parseDate(pubDate, 'YYYY/MM/DD'), + link: new URL(item.find('a').first().attr('href'), rootUrl).href, + description: art(path.join(__dirname, 'templates/description.art'), { + image, + id, + size, + pubDate, + description, + actresses, + tags, + magnet, + link, + }), + author: actresses.join(', '), + category: [...tags, ...actresses], + enclosure_type: 'application/x-bittorrent', + enclosure_url: magnet, + }; + }); + + ctx.state.data = { + title: `141JAV - ${$('title').text().split('-')[0].trim()}`, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/v2/141jav/maintainer.js b/lib/v2/141jav/maintainer.js new file mode 100644 index 000000000..cba342fc0 --- /dev/null +++ b/lib/v2/141jav/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:type?/:keyword?': ['cgkings', 'nczitzk'], +}; diff --git a/lib/v2/141jav/radar.js b/lib/v2/141jav/radar.js new file mode 100644 index 000000000..ba9c89f10 --- /dev/null +++ b/lib/v2/141jav/radar.js @@ -0,0 +1,40 @@ +module.exports = { + '141jav.com': { + _name: '141JAV', + '.': [ + { + title: '今日种子', + docs: 'https://docs.rsshub.app/multimedia.html#_141jav', + source: '/', + target: (params, url, document) => { + const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); + return `/141jav/day/${today}`; + }, + }, + { + title: '今日演员', + docs: 'https://docs.rsshub.app/multimedia.html#_141jav', + source: '/', + target: (params, url, document) => { + const star = document.querySelector('div.card-content > div > a').getAttribute('href'); + return `/141jav${star}`; + }, + }, + { + title: '页面种子', + docs: 'https://docs.rsshub.app/multimedia.html#_141jav', + source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], + target: (params, url, document) => { + const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day'; + let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; + if (ikey === '' && itype === 'tag') { + ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace(/\//g, '%2F'); + } else if (ikey === '' && itype === 'actress') { + ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); + } + return `/141jav/${itype}/${ikey}`; + }, + }, + ], + }, +}; diff --git a/lib/v2/141jav/router.js b/lib/v2/141jav/router.js new file mode 100644 index 000000000..406315685 --- /dev/null +++ b/lib/v2/141jav/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get(/([\w-/]+)?/, require('./index')); +}; diff --git a/lib/v2/141jav/templates/description.art b/lib/v2/141jav/templates/description.art new file mode 100644 index 000000000..9f744864a --- /dev/null +++ b/lib/v2/141jav/templates/description.art @@ -0,0 +1,47 @@ +{{ if image }} + +{{ /if }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID{{ id }}
Size{{ size }}
Date{{ pubDate }}
Description{{ description }}
Actress + {{ each actresses actress }} + {{ actress }}  + {{ /each }} +
Tag + {{ each tags tag }} + {{ tag }}  + {{ /each }} +
Magnet torrentMagnet torrent link
Download .torrentDownload torrent
\ No newline at end of file diff --git a/lib/v2/141ppv/index.js b/lib/v2/141ppv/index.js new file mode 100644 index 000000000..2789e8d56 --- /dev/null +++ b/lib/v2/141ppv/index.js @@ -0,0 +1,71 @@ +const got = require('@/utils/got'); +const cheerio = require('cheerio'); +const { parseDate } = require('@/utils/parse-date'); +const { art } = require('@/utils/render'); +const path = require('path'); + +module.exports = async (ctx) => { + const rootUrl = 'https://www.141ppv.com'; + const currentUrl = `${rootUrl}${ctx.path}`; + + const response = await got({ + method: 'get', + url: currentUrl, + }); + + const $ = cheerio.load(response.data); + + if (ctx.path === '/') { + ctx.redirect(`/141ppv${$('.overview').first().attr('href')}`); + return; + } + + const items = $('.columns') + .toArray() + .map((item) => { + item = $(item); + + const id = item.find('.title a').text(); + const size = item.find('.title span').text(); + const pubDate = item.find('.subtitle a').attr('href').split('/date/').pop(); + const description = item.find('.has-text-grey-dark').text(); + const actresses = item + .find('.panel-block') + .toArray() + .map((a) => $(a).text().trim()); + const tags = item + .find('.tag') + .toArray() + .map((t) => $(t).text().trim()); + const magnet = item.find('a[title="Magnet torrent"]').attr('href'); + const link = item.find('a[title="Download .torrent"]').attr('href'); + const image = item.find('.image').attr('src'); + + return { + title: `${id} ${size}`, + pubDate: parseDate(pubDate, 'YYYY/MM/DD'), + link: new URL(item.find('a').first().attr('href'), rootUrl).href, + description: art(path.join(__dirname, 'templates/description.art'), { + image, + id, + size, + pubDate, + description, + actresses, + tags, + magnet, + link, + }), + author: actresses.join(', '), + category: [...tags, ...actresses], + enclosure_type: 'application/x-bittorrent', + enclosure_url: magnet, + }; + }); + + ctx.state.data = { + title: `141PPV - ${$('title').text().split('-')[0].trim()}`, + link: currentUrl, + item: items, + }; +}; diff --git a/lib/v2/141ppv/maintainer.js b/lib/v2/141ppv/maintainer.js new file mode 100644 index 000000000..cba342fc0 --- /dev/null +++ b/lib/v2/141ppv/maintainer.js @@ -0,0 +1,3 @@ +module.exports = { + '/:type?/:keyword?': ['cgkings', 'nczitzk'], +}; diff --git a/lib/v2/141ppv/radar.js b/lib/v2/141ppv/radar.js new file mode 100644 index 000000000..b7054657c --- /dev/null +++ b/lib/v2/141ppv/radar.js @@ -0,0 +1,40 @@ +module.exports = { + '141ppv.com': { + _name: '141JAV', + '.': [ + { + title: '今日种子', + docs: 'https://docs.rsshub.app/multimedia.html#_141ppv', + source: '/', + target: (params, url, document) => { + const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); + return `/141ppv/day/${today}`; + }, + }, + { + title: '今日演员', + docs: 'https://docs.rsshub.app/multimedia.html#_141ppv', + source: '/', + target: (params, url, document) => { + const star = document.querySelector('div.card-content > div > a').getAttribute('href'); + return `/141ppv${star}`; + }, + }, + { + title: '页面种子', + docs: 'https://docs.rsshub.app/multimedia.html#_141ppv', + source: ['/:type', '/:type/:key', '/:type/:key/:morekey'], + target: (params, url, document) => { + const itype = params.morekey === undefined ? params.type : params.type === 'tag' ? 'tag' : 'day'; + let ikey = `${itype === 'day' ? params.type : ''}${params.key || ''}${itype === 'tag' && params.morekey !== undefined ? '%2F' : ''}${params.morekey || ''}`; + if (ikey === '' && itype === 'tag') { + ikey = document.querySelector('div.thumbnail.is-inline > a').getAttribute('href').replace('/tag/', '').replace(/\//g, '%2F'); + } else if (ikey === '' && itype === 'actress') { + ikey = document.querySelector('div.card > a').getAttribute('href').replace('/actress/', ''); + } + return `/141ppv/${itype}/${ikey}`; + }, + }, + ], + }, +}; diff --git a/lib/v2/141ppv/router.js b/lib/v2/141ppv/router.js new file mode 100644 index 000000000..406315685 --- /dev/null +++ b/lib/v2/141ppv/router.js @@ -0,0 +1,3 @@ +module.exports = function (router) { + router.get(/([\w-/]+)?/, require('./index')); +}; diff --git a/lib/v2/141ppv/templates/description.art b/lib/v2/141ppv/templates/description.art new file mode 100644 index 000000000..9f744864a --- /dev/null +++ b/lib/v2/141ppv/templates/description.art @@ -0,0 +1,47 @@ +{{ if image }} + +{{ /if }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ID{{ id }}
Size{{ size }}
Date{{ pubDate }}
Description{{ description }}
Actress + {{ each actresses actress }} + {{ actress }}  + {{ /each }} +
Tag + {{ each tags tag }} + {{ tag }}  + {{ /each }} +
Magnet torrentMagnet torrent link
Download .torrentDownload torrent
\ No newline at end of file