feat: add 猫耳FM (#5052)
This commit is contained in:
parent
fd0988c99f
commit
2d40bb3333
|
|
@ -371,6 +371,12 @@ pageClass: routes
|
|||
|
||||
<Route author="nczitzk" example="/lizhi/user/27151442948222380" path="/lizhi/user/:id" :paramsDesc="['用户 id,可以在电台的 URL 中找到']"/>
|
||||
|
||||
## 猫耳 FM
|
||||
|
||||
### 广播剧 / 有声漫画
|
||||
|
||||
<Route author="FlashWingShadow" example="/missevan/drama/28499" path="/missevan/drama/:id" :paramsDesc="['剧集 id,在剧集主页 URL 中可以找到']"/>
|
||||
|
||||
## 猫眼电影
|
||||
|
||||
### 正在热映
|
||||
|
|
|
|||
|
|
@ -2864,6 +2864,9 @@ router.get('/changku', require('./routes/changku/index'));
|
|||
// 上海市生态环境局
|
||||
router.get('/gov/shanghai/sthj', require('./routes/gov/shanghai/sthj'));
|
||||
|
||||
// 猫耳FM
|
||||
router.get('/missevan/drama/:id', require('./routes/missevan/drama'));
|
||||
|
||||
// Go语言爱好者周刊
|
||||
router.get('/go-weekly', require('./routes/go-weekly'));
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
const got = require('@/utils/got');
|
||||
|
||||
module.exports = async (ctx) => {
|
||||
const id = ctx.params.id;
|
||||
const host = 'www.missevan.com';
|
||||
const dramaUrl = `https://${host}/dramaapi/getdrama?drama_id=${id}`;
|
||||
const dramaResp = await got(dramaUrl);
|
||||
const episodesSize = dramaResp.data.info.episodes.episode.length;
|
||||
const episodesUrl = `https://${host}/dramaapi/getdramaepisodedetails?drama_id=${id}&p=1&page_size=${episodesSize}`;
|
||||
const episodesResp = await got(episodesUrl);
|
||||
|
||||
ctx.state.data = {
|
||||
title: dramaResp.data.info.drama.name,
|
||||
link: `https://${host}/mdrama/drama/${id}`,
|
||||
image: dramaResp.data.info.drama.cover,
|
||||
description: dramaResp.data.info.drama.abstract,
|
||||
item: episodesResp.data.info.Datas.map((e) => ({
|
||||
title: e.soundstr,
|
||||
description: `<img src="${e.front_cover}" /><br>${e.intro}`,
|
||||
link: `https://${host}/sound/player?id=${e.id}`,
|
||||
})),
|
||||
};
|
||||
};
|
||||
Loading…
Reference in New Issue