From 33db9acb30716004110c9576a9d49c0962d00646 Mon Sep 17 00:00:00 2001 From: Izumiko Date: Sat, 24 Feb 2024 00:22:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E5=AE=98=E6=96=B9=E4=B8=AD=E8=AF=91?= =?UTF-8?q?=E5=90=8D=E6=97=B6=EF=BC=8C=E5=B0=9D=E8=AF=95=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=8E=9F=E6=A0=87=E9=A2=98=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ede.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ede.js b/ede.js index f4eb4b1..592e411 100644 --- a/ede.js +++ b/ede.js @@ -888,6 +888,20 @@ showDebugInfo('查询失败:', error); return null; }); + if (animaInfo.animes.length == 0) { + const seriesUrl = baseUrl + '/Users/' + userId + '/Items/' + item.SeriesId; + const seriesInfo = await getSessionInfo(seriesUrl, authorization); + animeName = seriesInfo.OriginalTitle; + if (animeName.length > 0) { + searchUrl = apiPrefix + 'https://api.dandanplay.net/api/v2/search/episodes?anime=' + animeName + '&withRelated=true'; + animaInfo = await makeGetRequest(searchUrl) + .then((response) => isInTampermonkey ? JSON.parse(response) : response.json()) + .catch((error) => { + showDebugInfo('查询失败:', error); + return null; + }); + } + } if (animaInfo.animes.length == 0) { showDebugInfo('弹幕查询无结果'); return null; @@ -922,10 +936,12 @@ const initialep = match ? parseInt(match[1]) : 1; episode = (parseInt(episode) < initialep) ? parseInt(episode) - 1 : (parseInt(episode) - initialep); } + + const epTitlePrefix = animaInfo.animes[selecAnime_id].type === 'tvseries' ? `S${season}E${episode + 1}` : (animaInfo.animes[selecAnime_id].type); let episodeInfo = { episodeId: animaInfo.animes[selecAnime_id].episodes[episode].episodeId, animeTitle: animaInfo.animes[selecAnime_id].animeTitle, - episodeTitle: animaInfo.animes[selecAnime_id].type === 'tvseries' ? animaInfo.animes[selecAnime_id].episodes[episode].episodeTitle : (animaInfo.animes[selecAnime_id].type === 'movie' ? '剧场版' : 'Other'), + episodeTitle: epTitlePrefix + ' ' + animaInfo.animes[selecAnime_id].episodes[episode].episodeTitle, }; window.localStorage.setItem(_episode_key, JSON.stringify(episodeInfo)); window.ede.episode_info_str = episodeInfo.animeTitle + '\n' + episodeInfo.episodeTitle;