fix: deepscan errors again

This commit is contained in:
DIYgod 2023-03-18 21:10:46 +00:00
parent c767e6c7b8
commit 1c52cec40a
No known key found for this signature in database
4 changed files with 7 additions and 7 deletions

View File

@ -11,7 +11,7 @@ module.exports = async (ctx) => {
url: `https://www.bilibili.com/bangumi/media/md${mediaid}`,
});
mediaData = JSON.parse(response.data.match(/window\.__INITIAL_STATE__=([\s\S]+);\(function\(\)/)[1]) || {};
seasonid = mediaData.mediaInfo.season_id;
seasonid = mediaData?.mediaInfo.season_id;
}
const { data } = await got.get(`https://api.bilibili.com/pgc/web/season/section?season_id=${seasonid}`);
@ -42,9 +42,9 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: mediaData?.mediaInfo.title,
link: `https://www.bilibili.com/bangumi/media/md${mediaData.mediaInfo.media_id}/`,
image: mediaData.mediaInfo.cover,
description: mediaData.mediaInfo.evaluate,
link: `https://www.bilibili.com/bangumi/media/md${mediaData?.mediaInfo.media_id}/`,
image: mediaData?.mediaInfo.cover,
description: mediaData?.mediaInfo.evaluate,
item: episodes,
};
};

View File

@ -201,7 +201,7 @@ module.exports = async (ctx) => {
const videoHTMLSource = videoHTML ? `<br>${videoHTML}` : '';
return `${description}${originName}<br>${getUrl(data)}${getUrl(origin)}${getIframe(data)}${getIframe(origin)}${imgHTMLSource}${videoHTMLSource}`;
})(),
pubDate: item.desc ? (item.desc.timestamp ? parseDate(item.desc.timestamp, 'X') : null) : null,
pubDate: item.desc?.timestamp ? parseDate(item.desc.timestamp, 'X') : null,
link,
};
}),

View File

@ -129,7 +129,7 @@ module.exports = async (ctx) => {
return `${description}${originName}${getIframe(data)}${getIframe(origin)}${imgHTMLSource}${videoHTMLSource}`;
})(),
pubDate: new Date(item.desc.timestamp * 1000).toUTCString(),
pubDate: new Date(item.desc?.timestamp * 1000).toUTCString(),
link,
};
}),

View File

@ -523,7 +523,7 @@ module.exports = async (ctx) => {
let mediaTag = '';
if (showMediaTagInTitle) {
msgTypes.forEach((type) => {
if (type !== REPLY || type !== VIA_BOT || (type === REPLY && showReplyTo) || (type === FORWARDED && showFwdFrom) || (type === VIA_BOT && showViaBot)) {
if (type !== REPLY || (type === REPLY && showReplyTo) || (type === FORWARDED && showFwdFrom) || (type === VIA_BOT && showViaBot)) {
mediaTag += showMediaTagAsEmoji ? mediaTagDict[type][1] : mediaTagDict[type][0];
}
});