diff --git a/lib/routes/missevan/drama.js b/lib/routes/missevan/drama.js
index ce133fd72..7949b0077 100644
--- a/lib/routes/missevan/drama.js
+++ b/lib/routes/missevan/drama.js
@@ -5,19 +5,37 @@ module.exports = async (ctx) => {
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);
+
+ const items = await Promise.all(
+ dramaResp.data.info.episodes.episode.map(
+ async (item) =>
+ await ctx.cache.tryGet(`https://www.missevan.com/sound/getsound?soundid=${item.sound_id}`, async () => {
+ const soundResponse = await got({
+ method: 'get',
+ url: `https://www.missevan.com/sound/getsound?soundid=${item.sound_id}`,
+ });
+ const soundData = soundResponse.data.info.sound;
+ return {
+ title: item.name,
+ enclosure_url: soundData.soundurl,
+ enclosure_length: soundData.duration,
+ enclosure_type: 'audio/mpeg',
+ image: dramaResp.data.info.drama.cover,
+ itunes_author: soundData.username,
+ itunes_category: '',
+ link: `https://www.missevan.com/sound/player?id=${item.sound_id}`,
+ description: `
${soundData.intro}`,
+ pubDate: new Date(soundData.last_update_time * 1000).toUTCString(),
+ };
+ })
+ )
+ );
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: `
${e.intro}`,
- link: `https://${host}/sound/player?id=${e.id}`,
- })),
+ item: items,
};
};