mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-12 08:10:32 +08:00
feat: add pornhub category & search (#5571)
Co-authored-by: Henry Wang <hi@henry.wang>
This commit is contained in:
@@ -68,9 +68,17 @@ Official RSS: https://eztv.io/ezrss.xml
|
|||||||
|
|
||||||
## PornHub
|
## PornHub
|
||||||
|
|
||||||
|
### Category
|
||||||
|
|
||||||
|
<RouteEn author="nczitzk" example="/pornhub/category/popular-with-women" path="/pornhub/category/:caty" :paramsDesc="['category,see [categories](https://cn.pornhub.com/webmasters/categories)']"/>
|
||||||
|
|
||||||
|
### Keyword Search
|
||||||
|
|
||||||
|
<RouteEn author="nczitzk" example="/pornhub/search/stepsister" path="/pornhub/search/:keyword" :paramsDesc="['keyword']"/>
|
||||||
|
|
||||||
### Video List
|
### Video List
|
||||||
|
|
||||||
<Route 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']"/>
|
<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']"/>
|
||||||
|
|
||||||
|
|
||||||
## Sankaku Complex
|
## Sankaku Complex
|
||||||
|
|||||||
@@ -271,6 +271,14 @@ pageClass: routes
|
|||||||
|
|
||||||
## PornHub
|
## PornHub
|
||||||
|
|
||||||
|
### 分类
|
||||||
|
|
||||||
|
<Route author="nczitzk" example="/pornhub/category/popular-with-women" path="/pornhub/category/:caty" :paramsDesc="['类别,参见 [categories](https://cn.pornhub.com/webmasters/categories)']"/>
|
||||||
|
|
||||||
|
### 搜索
|
||||||
|
|
||||||
|
<Route author="nczitzk" example="/pornhub/search/stepsister" path="/pornhub/search/:keyword" :paramsDesc="['关键字']"/>
|
||||||
|
|
||||||
### 视频列表
|
### 视频列表
|
||||||
|
|
||||||
<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 编码']"/>
|
<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 编码']"/>
|
||||||
|
|||||||
@@ -303,6 +303,8 @@ router.get('/konachan.com/post/popular_recent/:period', require('./routes/konach
|
|||||||
router.get('/konachan.net/post/popular_recent/:period', require('./routes/konachan/post_popular_recent'));
|
router.get('/konachan.net/post/popular_recent/:period', require('./routes/konachan/post_popular_recent'));
|
||||||
|
|
||||||
// PornHub
|
// PornHub
|
||||||
|
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/category_url/:url?', require('./routes/pornhub/category_url'));
|
||||||
|
|
||||||
// yande.re
|
// yande.re
|
||||||
|
|||||||
22
lib/routes/pornhub/category.js
Normal file
22
lib/routes/pornhub/category.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const currentUrl = `https://pornhub.com/webmasters/search?category=${ctx.params.caty}`;
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: currentUrl,
|
||||||
|
});
|
||||||
|
|
||||||
|
const list = response.data.videos.map((item) => ({
|
||||||
|
title: item.title,
|
||||||
|
link: item.url,
|
||||||
|
description: `<img src="${item.thumb}">`,
|
||||||
|
pubDate: new Date(item.publish_date).toUTCString(),
|
||||||
|
}));
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `Pornhub - ${ctx.params.caty}`,
|
||||||
|
link: currentUrl,
|
||||||
|
item: list,
|
||||||
|
};
|
||||||
|
};
|
||||||
22
lib/routes/pornhub/search.js
Normal file
22
lib/routes/pornhub/search.js
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
const got = require('@/utils/got');
|
||||||
|
|
||||||
|
module.exports = async (ctx) => {
|
||||||
|
const currentUrl = `https://pornhub.com/webmasters/search?search=${ctx.params.keyword}`;
|
||||||
|
const response = await got({
|
||||||
|
method: 'get',
|
||||||
|
url: currentUrl,
|
||||||
|
});
|
||||||
|
|
||||||
|
const list = response.data.videos.map((item) => ({
|
||||||
|
title: item.title,
|
||||||
|
link: item.url,
|
||||||
|
description: `<img src="${item.thumb}">`,
|
||||||
|
pubDate: new Date(item.publish_date).toUTCString(),
|
||||||
|
}));
|
||||||
|
|
||||||
|
ctx.state.data = {
|
||||||
|
title: `Pornhub - ${ctx.params.keyword}`,
|
||||||
|
link: currentUrl,
|
||||||
|
item: list,
|
||||||
|
};
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user