feat: add pornhub users (#5655)
This commit is contained in:
parent
2d03b4d433
commit
3532000fbd
|
|
@ -76,6 +76,10 @@ Official RSS: https://eztv.io/ezrss.xml
|
|||
|
||||
<RouteEn author="nczitzk" example="/pornhub/search/stepsister" path="/pornhub/search/:keyword" :paramsDesc="['keyword']"/>
|
||||
|
||||
### Users
|
||||
|
||||
<RouteEn author="I2IMk" example="/pornhub/users/0maru0" path="/pornhub/users/:username" :paramsDesc="['username, part of the url e.g. `pornhub.com/users/0maru0`']" />
|
||||
|
||||
### 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']" />
|
||||
|
|
|
|||
|
|
@ -279,6 +279,10 @@ pageClass: routes
|
|||
|
||||
<Route author="nczitzk" example="/pornhub/search/stepsister" path="/pornhub/search/:keyword" :paramsDesc="['关键字']"/>
|
||||
|
||||
### 用户
|
||||
|
||||
<Route author="I2IMk" example="/pornhub/users/0maru0" path="/pornhub/users/:username" :paramsDesc="['用户名, 对应其专页地址的后面部分, 如 `pornhub.com/users/0maru0`']" />
|
||||
|
||||
### 素人(Verified amateur /model)
|
||||
|
||||
<Route author="I2IMk" example="/pornhub/model/stacy-starando" path="/pornhub/model/:username/:sort?" :paramsDesc="['用户名, 对应其专页地址的后面部分, 如 `pornhub.com/model/stacy-starando`', '排序方式, 下文会提到']" />
|
||||
|
|
|
|||
|
|
@ -306,6 +306,7 @@ 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/users/:username', require('./routes/pornhub/users'));
|
||||
router.get('/pornhub/model/:username/:sort?', require('./routes/pornhub/model'));
|
||||
router.get('/pornhub/pornstar/:username/:sort?', require('./routes/pornhub/pornstar'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const username = ctx.params.username;
|
||||
const link = `https://www.pornhub.com/users/${username}/videos`;
|
||||
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
const list = $('.videoUList .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.thumb').attr('data-thumb_url')}">`,
|
||||
};
|
||||
})
|
||||
.get(),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue