feat: add 人人影视 每日更新 (#5068)

This commit is contained in:
xinmeow
2020-06-28 11:26:16 +08:00
committed by GitHub
parent 1e86e2a8fc
commit 5315e8b73e
3 changed files with 42 additions and 0 deletions
+4
View File
@@ -429,6 +429,10 @@ pageClass: routes
<Route author="wb121017405" example="/rrys/review" path="/rrys/review" />
### 今日更新
<Route author="alcarl" example="/yyets/todayfilelist" path="/yyets/todayfilelist" />
## 色花堂中文论坛
### 分区帖子
+3
View File
@@ -875,6 +875,9 @@ router.get('/rs05/rs05', require('./routes/rs05/rs05'));
// 人人影视 (评测推荐)
router.get('/rrys/review', require('./routes/rrys/review'));
// 人人影视(每日更新)
router.get('/yyets/todayfilelist', require('./routes/yyets/todayfilelist'));
// 趣头条
router.get('/qutoutiao/category/:cid', require('./routes/qutoutiao/category'));
+35
View File
@@ -0,0 +1,35 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
// 发起 HTTP GET 请求
const response = await got({
method: 'get',
url: `http://file.apicvn.com/file/list`,
});
const data = response.data; // response.data 为 HTTP GET 请求返回的数据对象
// 这个对象中包含了数组名为 data,所以 response.data.data 则为需要的数据
ctx.state.data = {
// 源标题
title: `yyets 的今日更新`,
// 源链接
link: `http://file.apicvn.com/file/list`,
// 源说明
description: `yyets 的今日更新视频列表`,
// 遍历此前获取的数据
item: data.map((item) => ({
// 文章标题
title: item.file_name,
// 文章正文
description: ``,
// 文章发布时间
pubDate: item.create_time,
// 文章链接
link: `${item.magnet_url}&tr=http://tr.cili001.com:8070/announce&tr=udp://p4p.arenabg.com:1337&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://open.demonii.com:1337`,
enclosure_url: `${item.magnet_url}&tr=http://tr.cili001.com:8070/announce&tr=udp://p4p.arenabg.com:1337&tr=udp://tracker.opentrackr.org:1337/announce&tr=udp://open.demonii.com:1337`, // 磁力链接
enclosure_length: '', // 时间戳 (播放长度) , 一般是秒数,可选
enclosure_type: 'application/x-bittorrent', // 固定为 'application/x-bittorrent'
})),
};
};