feat: add pornhub model/pornstar (#5629)

This commit is contained in:
I2IMk
2020-09-08 19:39:59 +08:00
committed by GitHub
parent 1667a7ff6d
commit 269e178a0b
6 changed files with 93 additions and 1 deletions

View File

@@ -76,6 +76,22 @@ Official RSS: https://eztv.io/ezrss.xml
<RouteEn author="nczitzk" example="/pornhub/search/stepsister" path="/pornhub/search/:keyword" :paramsDesc="['keyword']"/>
### Verified amateur / Model
<RouteEn author="I2IMk" example="/pornhub/model/stacy-starando" path="/pornhub/model/:username/:sort?" :paramsDesc="['username, part of the url e.g. `pornhub.com/model/stacy-starando`', 'sorting method, see below']" />
### Verified model / Pornstar
<RouteEn author="I2IMk" example="/pornhub/pornstar/june-liu" path="/pornhub/pornstar/:username/:sort?" :paramsDesc="['username, part of the url e.g. `pornhub.com/pornstar/june-liu`', 'sorting method, see below']" />
**`sort`**
| mr | mv | tr | lg | cm |
| ----------- | ----------- | --------- | ------- | ------ |
| Most Recent | Most Viewed | Top Rated | Longest | Newest |
### Video List
<RouteEn author="I2IMk" example="/pornhub/category_url/video%3Fc%3D15%26o%3Dmv%26t%3Dw%26cc%3Djp" path="/pornhub/category_url/:url?" :paramsDesc="['relative path after `pornhub.com/`, need to be URL encoded']"/>

View File

@@ -279,6 +279,20 @@ pageClass: routes
<Route author="nczitzk" example="/pornhub/search/stepsister" path="/pornhub/search/:keyword" :paramsDesc="['关键字']"/>
### 素人Verified amateur /model
<Route author="I2IMk" example="/pornhub/model/stacy-starando" path="/pornhub/model/:username/:sort?" :paramsDesc="['用户名, 对应其专页地址的后面部分, 如 `pornhub.com/model/stacy-starando`', '排序方式, 下文会提到']" />
### 色情明星Verified model /pornstar
<Route author="I2IMk" example="/pornhub/pornstar/june-liu" path="/pornhub/pornstar/:username/:sort?" :paramsDesc="['用户名, 对应其专页地址的后面部分, 如 `pornhub.com/pornstar/june-liu`', '排序方式, 下文会提到']" />
**排序方式 `sort`**
| mr | mv | tr | lg | cm |
| -------------------- | ---------------------- | ------------------ | ------------ | ----------- |
| Most Recent 最新精选 | Most Viewed 最多次观看 | Top Rated 评价最好 | Longest 最长 | Newest 最新 |
### 视频列表
<Route author="I2IMk" example="/pornhub/category_url/video%3Fc%3D15%26o%3Dmv%26t%3Dw%26cc%3Djp" path="/pornhub/category_url/:url?" :paramsDesc="['相对路径, `pornhub.com/` 后的部分, 需手动 URL 编码']"/>

View File

@@ -306,6 +306,8 @@ router.get('/konachan.net/post/popular_recent/:period', require('./routes/konach
router.get('/pornhub/category/:caty', require('./routes/pornhub/category'));
router.get('/pornhub/search/:keyword', require('./routes/pornhub/search'));
router.get('/pornhub/category_url/:url?', require('./routes/pornhub/category_url'));
router.get('/pornhub/model/:username/:sort?', require('./routes/pornhub/model'));
router.get('/pornhub/pornstar/:username/:sort?', require('./routes/pornhub/pornstar'));
// yande.re
router.get('/yande.re/post/popular_recent', require('./routes/yande.re/post_popular_recent'));

View File

@@ -21,7 +21,7 @@ module.exports = async (ctx) => {
return {
title: e.find('span.title a').text(),
link: `https://www.pornhub.com` + e.find('span.title a').attr('href'),
description: `<img src=${e.find('img').attr('src')}>`,
description: `<img src=${e.find('img').attr('data-thumb_url')}>`,
};
})
.get(),

View File

@@ -0,0 +1,30 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const username = ctx.params.username;
const sort = ctx.params.sort ? ctx.params.sort : 'mr';
const link = `https://www.pornhub.com/model/${username}/videos?o=${sort}`;
const response = await got.get(link);
const $ = cheerio.load(response.data);
const list = $('#mostRecentVideosSection .videoBox');
ctx.state.data = {
title: $('title').first().text(),
link: link,
item:
list &&
list
.map((_, e) => {
e = $(e);
return {
title: e.find('span.title a').text(),
link: `https://www.pornhub.com` + e.find('span.title a').attr('href'),
description: `<img src="${e.find('img').attr('data-thumb_url')}">`,
};
})
.get(),
};
};

View File

@@ -0,0 +1,30 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
module.exports = async (ctx) => {
const username = ctx.params.username;
const sort = ctx.params.sort ? ctx.params.sort : 'mr';
const link = `https://www.pornhub.com/pornstar/${username}/videos?o=${sort}`;
const response = await got.get(link);
const $ = cheerio.load(response.data);
const list = $('#mostRecentVideosSection .videoBox');
ctx.state.data = {
title: $('title').first().text(),
link: link,
item:
list &&
list
.map((_, e) => {
e = $(e);
return {
title: e.find('span.title a').text(),
link: `https://www.pornhub.com` + e.find('span.title a').attr('href'),
description: `<img src="${e.find('img').attr('data-thumb_url')}">`,
};
})
.get(),
};
};