Skip to content

Commit

Permalink
fix(route) : 场库 - 修改原网页地址 新增视频分类 (DIYgod#7048)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
Wenmoux and actions-user authored Mar 2, 2021
1 parent 84def4f commit 79546d4
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
22 changes: 22 additions & 0 deletions docs/multimedia.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,28 @@ pageClass: routes

<Route author="Wenmoux" example="/changku" path="/changku"/>

### 分类

<Route author="Wenmoux" example="/changku/cate/12" path="/changku/cate/:cateid" :paramsDesc="['分类id']">

| 创意 | 励志 | 搞笑 | 广告 | 汽车 | 旅行 |
| ---- | ---- | ---- | ---- | ---- | ---- |
| 6 | 7 | 8 | 13 | 92 | 11 |

| 爱情 | 剧情 | 运动 | 动画 | 音乐 | 科幻 |
| ---- | ---- | ---- | ---- | ---- | ---- |
| 12 | 17 | 10 | 16 | 18 | 23 |

| 预告 | 记录 | 混剪 | 游戏 | 时尚 | 实验 |
| ---- | ---- | ---- | ---- | ---- | ---- |
| 43 | 24 | 44 | 104 | 88 | 45 |

| 生活 |
| ---- |
| 78 |

</Route>

## 低端影视

### 影视剧集更新
Expand Down
2 changes: 2 additions & 0 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -3085,6 +3085,8 @@ router.get('/ems/news', require('./routes/ems/news'));

// 场库
router.get('/changku', require('./routes/changku/index'));
router.get('/changku/cate/:postid', require('./routes/changku/index'));

// SCMP
router.get('/scmp/:category_id', require('./routes/scmp/index'));

Expand Down
11 changes: 6 additions & 5 deletions lib/routes/changku/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const got = require('@/utils/got');
module.exports = async (ctx) => {
const url = `https://app.vmovier.com/apiv3/index/getIndexPosts/lastid/`;
const url = ctx.params.postid ? `https://app.vmovier.com/apiv3/post/getPostInCate?p=1&size=10&cateid=${ctx.params.postid}` : `https://app.vmovier.com/apiv3/index/getIndexPosts/lastid/`;
const config = {
headers: {
'user-agent': 'VmovierApp 5.7.7 / Android 10 / WIFI / 1080*2175 / 2.75',
Expand All @@ -11,8 +11,9 @@ module.exports = async (ctx) => {
method: 'get',
url: url,
});
const list = res.data.data.list ? res.data.data.list : res.data.data;
const items = await Promise.all(
res.data.data.list.map(async (list) => {
list.map(async (list) => {
const title = list.title;
const link = `https://app.vmovier.com/apiv3/post/view?postid=${list.postid}`;
const description = await ctx.cache.tryGet(link, async () => {
Expand All @@ -25,14 +26,14 @@ module.exports = async (ctx) => {
title: title,
description: description,
author: list.creator_username,
link: link,
link: `https://www.vmovier.com/${list.postid}`,
});
})
);
ctx.state.data = {
title: `场库-每日精选`,
title: `${ctx.params.postid ? list[0].cate[0].catename : '每日精选'}-场库`,
link: url,
description: '场库-每日精选',
description: '场库_高品质短片分享平台',
item: items,
};
};

0 comments on commit 79546d4

Please sign in to comment.