fix: update 3dm rss (#493)

closes #442
This commit is contained in:
Jeff Wen
2018-08-20 11:43:37 +08:00
committed by DIYgod
parent 54a29fd6b2
commit 29673882dc
4 changed files with 15 additions and 34 deletions
-1
View File
@@ -160,7 +160,6 @@ RSSHub 是一个轻量、易于扩展的 RSS 生成器,可以给任何奇奇
- 新闻中心
- 新闻
- 攻略
- 下载
- 喜马拉雅
- 专辑
- EZTV
-8
View File
@@ -1322,14 +1322,6 @@ language,语言,可在 [Trending 页](https://github.com/trending/javascript
参数: name,游戏的编号可以在专题页的 url 中找到
### 下载 <Author uid="jacky2001114"/>
举例: [https://rsshub.app/3dm/detroitbecomehuman/download](https://rsshub.app/3dm/detroitbecomehuman/download)
路由: `/3dm/:name/download`
参数: name,游戏的编号可以在专题页的 url 中找到
## 喜马拉雅
### 专辑 <Author uid="jjeejj"/>
+5 -5
View File
@@ -18,20 +18,21 @@ module.exports = async (ctx) => {
const data = response.data;
const $ = cheerio.load(data);
const list = $('.dowlnewslist a');
const list = $('.ZQ_Left .lis');
const items = [];
for (let i = 0; i < list.length; i++) {
let item = $(list[i]);
const url = item.attr('href');
const url = item.find('.bt').attr('href');
const value = await ctx.cache.get(url);
if (value) {
item = JSON.parse(value);
} else {
item = {
title: item.find('p').text(),
pubDate: item.find('span').text(),
title: item.find('.bt').text(),
pubDate: item.find('.time p').text(),
description: item.find('.miaoshu').text(),
link: url,
guid: url,
};
@@ -47,7 +48,6 @@ module.exports = async (ctx) => {
.text()
.split('_')[0],
link: url,
description: $('.game-pc>p').text(),
item: items,
};
};
+10 -20
View File
@@ -14,14 +14,14 @@ module.exports = async (ctx) => {
});
const data = res.data;
const $ = cheerio.load(data);
const list = $('.QZlisttxt ul li p');
const list = $('.news_list .list li');
const out = [];
for (let i = 0; i < Math.min(list.length, 10); i++) {
let $ = cheerio.load(data);
const $ = cheerio.load(data);
const item = list[i];
const itemUrl = $(item)
.find('a:nth-child(2)')
.find('.selectarcpost')
.attr('href');
const cache = await ctx.cache.get(itemUrl);
if (cache) {
@@ -29,24 +29,14 @@ module.exports = async (ctx) => {
continue;
}
const title = $(item)
.find('a:nth-child(2)')
.find('.bt')
.text();
const content = $(item)
.find('p')
.text();
const pageInfo = $(item)
.find('.time')
.text();
let itemRes;
try {
itemRes = await axios({
method: 'get',
url: itemUrl,
headers: {
'User-Agent': config.ua,
},
});
} catch (e) {
continue;
}
const itemPage = itemRes.data;
$ = cheerio.load(itemPage);
const content = $('.con div:nth-child(2)').html();
const pageInfo = $('.arctitle>span').text();
const regex = /\d{4}-\d{2}-\d{2} \d{2}:\d{2}/;
const regRes = regex.exec(pageInfo);
const time = regRes === null ? new Date() : new Date(regRes[0]);