From 7ed6dd8e778832a02ee871fd9df72489a237b867 Mon Sep 17 00:00:00 2001
From: cgking <58586625+cgkings@users.noreply.github.com>
Date: Tue, 12 Jan 2021 09:12:51 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E141jav&141ppv?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lib/routes/141jav/141jav.js | 37 +++++++++++++++++++++++++++++++++++++
lib/routes/141ppv/141ppv.js | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 74 insertions(+)
create mode 100644 lib/routes/141jav/141jav.js
create mode 100644 lib/routes/141ppv/141ppv.js
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(),
+ };
+};