diff --git a/docs/en/multimedia.md b/docs/en/multimedia.md index 7f6b2deb50..360a10858c 100644 --- a/docs/en/multimedia.md +++ b/docs/en/multimedia.md @@ -68,9 +68,17 @@ Official RSS: https://eztv.io/ezrss.xml ## PornHub +### Category + + + +### Keyword Search + + + ### Video List - + ## Sankaku Complex diff --git a/docs/multimedia.md b/docs/multimedia.md index e113504aa5..38f381c171 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -271,6 +271,14 @@ pageClass: routes ## PornHub +### 分类 + + + +### 搜索 + + + ### 视频列表 diff --git a/lib/router.js b/lib/router.js index e786ec5715..c89b477689 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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')); // 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')); // yande.re diff --git a/lib/routes/pornhub/category.js b/lib/routes/pornhub/category.js new file mode 100644 index 0000000000..5dbc5a9576 --- /dev/null +++ b/lib/routes/pornhub/category.js @@ -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: ``, + pubDate: new Date(item.publish_date).toUTCString(), + })); + + ctx.state.data = { + title: `Pornhub - ${ctx.params.caty}`, + link: currentUrl, + item: list, + }; +}; diff --git a/lib/routes/pornhub/search.js b/lib/routes/pornhub/search.js new file mode 100644 index 0000000000..4d8dc925d9 --- /dev/null +++ b/lib/routes/pornhub/search.js @@ -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: ``, + pubDate: new Date(item.publish_date).toUTCString(), + })); + + ctx.state.data = { + title: `Pornhub - ${ctx.params.keyword}`, + link: currentUrl, + item: list, + }; +};