From 79546d4c678608478adce41aea3f26cbacc20192 Mon Sep 17 00:00:00 2001 From: Wenmoux Date: Tue, 2 Mar 2021 13:06:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(route)=20:=20=E5=9C=BA=E5=BA=93=20-=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8E=9F=E7=BD=91=E9=A1=B5=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E8=A7=86=E9=A2=91=E5=88=86=E7=B1=BB=20(#7?= =?UTF-8?q?048)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: GitHub Action --- docs/multimedia.md | 22 ++++++++++++++++++++++ lib/router.js | 2 ++ lib/routes/changku/index.js | 11 ++++++----- 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/docs/multimedia.md b/docs/multimedia.md index bb4464908..5b786a11a 100644 --- a/docs/multimedia.md +++ b/docs/multimedia.md @@ -765,6 +765,28 @@ pageClass: routes +### 分类 + + + +| 创意 | 励志 | 搞笑 | 广告 | 汽车 | 旅行 | +| ---- | ---- | ---- | ---- | ---- | ---- | +| 6 | 7 | 8 | 13 | 92 | 11 | + +| 爱情 | 剧情 | 运动 | 动画 | 音乐 | 科幻 | +| ---- | ---- | ---- | ---- | ---- | ---- | +| 12 | 17 | 10 | 16 | 18 | 23 | + +| 预告 | 记录 | 混剪 | 游戏 | 时尚 | 实验 | +| ---- | ---- | ---- | ---- | ---- | ---- | +| 43 | 24 | 44 | 104 | 88 | 45 | + +| 生活 | +| ---- | +| 78 | + + + ## 低端影视 ### 影视剧集更新 diff --git a/lib/router.js b/lib/router.js index 4542c512e..c62a3af62 100644 --- a/lib/router.js +++ b/lib/router.js @@ -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')); diff --git a/lib/routes/changku/index.js b/lib/routes/changku/index.js index 540a4cb51..c2f8b72eb 100644 --- a/lib/routes/changku/index.js +++ b/lib/routes/changku/index.js @@ -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', @@ -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 () => { @@ -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, }; };