fix(route): 修复 bilibili 动态无法获取问题 (#7961)

This commit is contained in:
zsh2517
2021-08-15 01:12:14 -07:00
committed by GitHub
parent 47176b6724
commit 78eea945c4
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ module.exports = async (ctx) => {
link: `https://space.bilibili.com/${uid}/dynamic`,
description: `${data[0].desc.user_profile.info.uname} 的 bilibili 动态`,
item: data.map((item) => {
const getTitle = (data) => data.title || data.description || data.content || (data.vest && data.vest.content) || '';
const getTitle = (data) => (data ? data.title || data.description || data.content || (data.vest && data.vest.content) || '' : '');
const getDes = (data) =>
data.dynamic || data.desc || data.description || data.content || data.summary || (data.vest && data.vest.content) + (data.sketch && `<br>${data.sketch.title}<br>${data.sketch.desc_text}`) || data.intro || '';
const getOriginDes = (data) => (data && (data.apiSeasonInfo && data.apiSeasonInfo.title && `//转发自: ${data.apiSeasonInfo.title}`) + (data.index_title && `<br>${data.index_title}`)) || '';
+2 -2
View File
@@ -32,7 +32,7 @@ module.exports = async (ctx) => {
link: `https://t.bilibili.com`,
description: `${name} 关注的动态`,
item: data.map((item) => {
const getTitle = (data) => data.title || data.description || data.content || (data.vest && data.vest.content) || '';
const getTitle = (data) => (data ? data.title || data.description || data.content || (data.vest && data.vest.content) || '' : '');
const getDes = (data) =>
data.dynamic || data.desc || data.description || data.content || data.summary || (data.vest && data.vest.content) + (data.sketch && `<br>${data.sketch.title}<br>${data.sketch.desc_text}`) || data.intro || '';
const getOriginDes = (data) => (data && (data.apiSeasonInfo && data.apiSeasonInfo.title && `//转发自: ${data.apiSeasonInfo.title}`) + (data.index_title && `<br>${data.index_title}`)) || '';
@@ -41,7 +41,7 @@ module.exports = async (ctx) => {
const getIframe = (data) => (!disableEmbed && data && data.aid ? `<br><br>${utils.iframe(data.aid)}<br>` : '');
const parsed = JSONbig.parse(item.card);
const data = parsed.apiSeasonInfo || getTitle(parsed.item) ? parsed.item : parsed;
const data = parsed.apiSeasonInfo || (getTitle(parsed.item) ? parsed.item : parsed);
const origin = parsed.origin ? JSONbig.parse(parsed.origin) : null;
// img