fix(route): bilibili 路由增加 4100000 提示 (#15564)

* fix(route): bilibili 路由增加 4100000 提示

* fix(route): 修复部分问题
This commit is contained in:
CaoMeiYouRen
2024-05-12 17:06:07 +08:00
committed by GitHub
parent 05fe33293b
commit 9779ac09c8
+3 -1
View File
@@ -47,7 +47,6 @@ async function handler(ctx) {
const displayArticle = fallback(undefined, queryToBoolean(routeParams.displayArticle), false);
const name = await cache.getUsernameFromUID(uid);
const cookie = config.bilibili.cookies[uid];
if (cookie === undefined) {
throw new ConfigNotFoundError('缺少对应 uid 的 Bilibili 用户登录后的 Cookie 值');
@@ -64,6 +63,9 @@ async function handler(ctx) {
if (response.data.code === -6) {
throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户的 Cookie 已过期');
}
if (response.data.code === 4_100_000) {
throw new ConfigNotFoundError('对应 uid 的 Bilibili 用户 请求失败');
}
const data = JSONbig.parse(response.body).data.cards;
const getTitle = (data) => (data ? data.title || data.description || data.content || (data.vest && data.vest.content) || '' : '');