diff --git a/lib/routes/141jav/141jav.js b/lib/routes/141jav/141jav.js new file mode 100644 index 000000000..440f34f1b --- /dev/null +++ b/lib/routes/141jav/141jav.js @@ -0,0 +1,37 @@ +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: 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 new file mode 100644 index 000000000..ec3d8e63d --- /dev/null +++ b/lib/routes/141ppv/141ppv.js @@ -0,0 +1,37 @@ +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: 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(), + }; +};