ADD: 豆瓣美女 (#1193)

新添加豆瓣美女并修复一处文档拼写错误
This commit is contained in:
kba977 2018-11-26 14:34:57 +08:00 committed by DIYgod
parent b50f40ab7f
commit 0ef3046cd5
3 changed files with 59 additions and 1 deletions

View File

@ -861,7 +861,7 @@ GitHub 官方也提供了一些 RSS:
<route name="分区帖子" author="zhboner" example="/t66y/20/2" path="/t66y/:id/:type?" :paramsDesc="['分区 id, 可在分区页 URL 中找到', '类型 id, 可在分区类型过滤后的 URL 中找到']">
> 注意:并非所的分区都有子类型,可以参考成人文学交流区的[古典武侠]这一子类型。
> 注意:并非所的分区都有子类型,可以参考成人文学交流区的[古典武侠]这一子类型。
| 亚洲无码原创区 | 亚洲有码原创区 | 欧美原创区 | 动漫原创区 | 国产原创区 |
| -------------- | -------------- | ---------- | ---------- | ---------- |
@ -948,6 +948,16 @@ GitHub 官方也提供了一些 RSS:
<route name="详情" author="gee1k xyqfer" example="/mzitu/post/129452" path="/mzitu/post/:id" :paramsDesc="['详情 id, 可在详情页 URL 中找到']"/>
### 豆瓣美女
<route name="分类" author="kba977" example="/dbmv" path="/dbmv/:category?" :paramsDesc="['分类 id - 若不填该参数, 默认所有']">
| 大胸妹 | 小翘臀 | 黑丝袜 | 美腿控 | 有颜值 | 大杂烩 |
| ------ | ------ | ------ | ------ | ------ | ------ |
| 2 | 6 | 7 | 3 | 4 | 5 |
</route>
### 煎蛋
<route name="无聊图" author="Xuanwo xyqfer" example="/jandan/pic" path="/jandan/:sub_model" :paramsDesc="['煎蛋板块名称']"/>

View File

@ -866,4 +866,7 @@ router.get('/anigamer/anime/:sn', require('./routes/anigamer/anime'));
// Apkpure
router.get('/apkpure/versions/:region/:pkg', require('./routes/apkpure/versions'));
// 豆瓣美女
router.get('/dbmv/:category?', require('./routes/dbmv/index'));
module.exports = router;

45
routes/dbmv/index.js Normal file
View File

@ -0,0 +1,45 @@
const axios = require('../../utils/axios');
const cherrio = require('cheerio');
module.exports = async (ctx) => {
const { category = '' } = ctx.params;
let url;
if (category !== '') {
url = 'https://www.dbmeinv.com/index.htm?cid=' + category;
} else {
url = 'https://www.dbmeinv.com/';
}
const response = await axios({
method: 'get',
url: url,
headers: {
Referer: 'https://www.dbmeinv.com/',
},
});
const data = response.data;
const $ = cherrio.load(data);
const $list = $('li.span3 img');
const resultItem = [];
for (let i = 1; i <= $list.length; i++) {
const title = $list.eq(i).attr('title');
const img_url = $list.eq(i).attr('src');
const single = {
title: title,
link: img_url,
description: `<img referrerpolicy="no-referrer" src="${img_url}">`,
};
resultItem.push(single);
}
ctx.state.data = {
title: $('title').text(),
link: url,
item: resultItem,
description: '不羞涩 | 真实的图片分享交友社区',
};
};