feat: improve pornhub routes by introducing a language option (#6874)
* feat: improve pornhub routes by introducing a `language` option * chore(docs): fix pornhub en docs
This commit is contained in:
+10
-7
@@ -2,7 +2,7 @@
|
||||
pageClass: routes
|
||||
---
|
||||
|
||||
# Multimedia
|
||||
# Multimedia
|
||||
|
||||
## 60-Second Science - Scientific American
|
||||
|
||||
@@ -78,15 +78,15 @@ Official RSS: https://eztv.io/ezrss.xml
|
||||
|
||||
### Users
|
||||
|
||||
<RouteEn author="I2IMk" example="/pornhub/users/0maru0" path="/pornhub/users/:username" :paramsDesc="['username, part of the url e.g. `pornhub.com/users/0maru0`']" />
|
||||
<RouteEn author="I2IMk queensferryme" example="/pornhub/users/pornhubmodels" path="/pornhub/:language?/users/:username" :paramsDesc="['language, see below', 'username, part of the url e.g. `pornhub.com/users/pornhubmodels`']" />
|
||||
|
||||
### 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']" />
|
||||
<RouteEn author="I2IMk queensferryme" example="/pornhub/model/stacy-starando" path="/pornhub/:language?/model/:username/:sort?" :paramsDesc="['language, see below', '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']" />
|
||||
<RouteEn author="I2IMk queensferryme" example="/pornhub/pornstar/june-liu" path="/pornhub/:language?/pornstar/:username/:sort?" :paramsDesc="['language, see below', 'username, part of the url e.g. `pornhub.com/pornstar/june-liu`', 'sorting method, see below']" />
|
||||
|
||||
**`sort`**
|
||||
|
||||
@@ -94,12 +94,15 @@ Official RSS: https://eztv.io/ezrss.xml
|
||||
| ----------- | ----------- | --------- | ------- | ------ |
|
||||
| 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']"/>
|
||||
<RouteEn author="I2IMk queensferryme" example="/pornhub/category_url/video%3Fc%3D15%26o%3Dmv%26t%3Dw%26cc%3Djp" path="/pornhub/:language?/category_url/:url?" :paramsDesc="['language, see below', 'relative path after `pornhub.com/`, need to be URL encoded']"/>
|
||||
|
||||
**`language`**
|
||||
|
||||
Refer to [Pornhub F.A.Qs](https://help.pornhub.com/hc/en-us/articles/360044327034-How-do-I-change-the-language-), English by default. For example:
|
||||
- `cn` (Chinese), for Pornhub in China <https://cn.pornhub.com/>;
|
||||
- `jp` (Japanese), for Pornhub in Japan <https://jp.pornhub.com/> etc.
|
||||
|
||||
## Sankaku Complex
|
||||
|
||||
|
||||
+14
-7
@@ -163,7 +163,7 @@ pageClass: routes
|
||||
|
||||
::: tip 提示
|
||||
|
||||
栏目 ID 查找示例:
|
||||
栏目 ID 查找示例:
|
||||
打开栏目具体某一期页面,F12 控制台输入`column_id`得到栏目 ID。
|
||||
|
||||
:::
|
||||
@@ -518,15 +518,15 @@ pageClass: routes
|
||||
|
||||
### 用户
|
||||
|
||||
<Route author="I2IMk" example="/pornhub/users/0maru0" path="/pornhub/users/:username" :paramsDesc="['用户名, 对应其专页地址的后面部分, 如 `pornhub.com/users/0maru0`']" />
|
||||
<Route author="I2IMk queensferryme" example="/pornhub/users/pornhubmodels" path="/pornhub/:language?/users/:username" :paramsDesc="['语言,下文会提到', '用户名, 对应其专页地址的后面部分, 如 `pornhub.com/users/pornhubmodels`']" />
|
||||
|
||||
### 素人(Verified amateur /model)
|
||||
### 素人(Verified amateur / Model)
|
||||
|
||||
<Route author="I2IMk" example="/pornhub/model/stacy-starando" path="/pornhub/model/:username/:sort?" :paramsDesc="['用户名, 对应其专页地址的后面部分, 如 `pornhub.com/model/stacy-starando`', '排序方式, 下文会提到']" />
|
||||
<Route author="I2IMk queensferryme" example="/pornhub/model/stacy-starando" path="/pornhub/:language?/model/:username/:sort?" :paramsDesc="['语言,下文会提到', '用户名, 对应其专页地址的后面部分, 如 `pornhub.com/model/stacy-starando`', '排序方式, 下文会提到']" />
|
||||
|
||||
### 色情明星(Verified model /pornstar)
|
||||
### 色情明星(Verified model / Pornstar)
|
||||
|
||||
<Route author="I2IMk" example="/pornhub/pornstar/june-liu" path="/pornhub/pornstar/:username/:sort?" :paramsDesc="['用户名, 对应其专页地址的后面部分, 如 `pornhub.com/pornstar/june-liu`', '排序方式, 下文会提到']" />
|
||||
<Route author="I2IMk queensferryme" example="/pornhub/pornstar/june-liu" path="/pornhub/:language?/pornstar/:username/:sort?" :paramsDesc="['语言,下文会提到', '用户名, 对应其专页地址的后面部分, 如 `pornhub.com/pornstar/june-liu`', '排序方式, 下文会提到']" />
|
||||
|
||||
**排序方式 `sort`**
|
||||
|
||||
@@ -536,7 +536,14 @@ pageClass: routes
|
||||
|
||||
### 视频列表
|
||||
|
||||
<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 queensferryme" example="/pornhub/category_url/video%3Fc%3D15%26o%3Dmv%26t%3Dw%26cc%3Djp" path="/pornhub/:language?/category_url/:url?" :paramsDesc="['语言,下文会提到', '相对路径, `pornhub.com/` 后的部分, 需手动 URL 编码']"/>
|
||||
|
||||
**语言 `language`**
|
||||
|
||||
参见 [Pornhub F.A.Qs](https://help.pornhub.com/hc/en-us/articles/360044327034-How-do-I-change-the-language-),放空则默认为英文。常见的有:
|
||||
|
||||
- `cn`(中文),对应中文站 <https://cn.pornhub.com/>;
|
||||
- `jp`(日语),对应日语站 <https://jp.pornhub.com/> 等。
|
||||
|
||||
## Prestige 蚊香社
|
||||
|
||||
|
||||
+4
-4
@@ -323,10 +323,10 @@ router.get('/konachan.net/post/popular_recent/:period', require('./routes/konach
|
||||
// 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/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'));
|
||||
router.get('/pornhub/:language?/category_url/:url?', require('./routes/pornhub/category_url'));
|
||||
router.get('/pornhub/:language?/users/:username', require('./routes/pornhub/users'));
|
||||
router.get('/pornhub/:language?/model/:username/:sort?', require('./routes/pornhub/model'));
|
||||
router.get('/pornhub/:language?/pornstar/:username/:sort?', require('./routes/pornhub/pornstar'));
|
||||
|
||||
// Prestige
|
||||
router.get('/prestige-av/series/:mid/:sort?', require('./routes/prestige-av/series'));
|
||||
|
||||
@@ -2,8 +2,9 @@ const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const language = ctx.params.language || 'www';
|
||||
const url = ctx.params.url || 'video';
|
||||
const link = `https://www.pornhub.com/${url}`;
|
||||
const link = `https://${language}.pornhub.com/${url}`;
|
||||
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
@@ -2,9 +2,10 @@ const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const language = ctx.params.language || 'www';
|
||||
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 sort = ctx.params.sort || 'mr';
|
||||
const link = `https://${language}.pornhub.com/model/${username}/videos?o=${sort}`;
|
||||
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
@@ -2,9 +2,10 @@ const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const language = ctx.params.language || 'www';
|
||||
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 sort = ctx.params.sort || 'mr';
|
||||
const link = `https://${language}.pornhub.com/pornstar/${username}/videos?o=${sort}`;
|
||||
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
|
||||
@@ -2,8 +2,9 @@ const got = require('@/utils/got');
|
||||
const cheerio = require('cheerio');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const language = ctx.params.language || 'www';
|
||||
const username = ctx.params.username;
|
||||
const link = `https://www.pornhub.com/users/${username}/videos`;
|
||||
const link = `https://${language}.pornhub.com/users/${username}/videos`;
|
||||
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.data);
|
||||
@@ -12,6 +13,7 @@ module.exports = async (ctx) => {
|
||||
ctx.state.data = {
|
||||
title: $('title').first().text(),
|
||||
link: link,
|
||||
allowEmpty: true,
|
||||
item:
|
||||
list &&
|
||||
list
|
||||
|
||||
Reference in New Issue
Block a user