取消图片代理;新增视频链接、自定义cookie

This commit is contained in:
2026-07-19 19:12:06 +08:00
parent 0b6afa0665
commit 3eef54496c
13 changed files with 184 additions and 30 deletions
+14 -1
View File
@@ -5,7 +5,7 @@ import Router from '@koa/router';
import NodeRSS from 'rss';
import { RSSKoaContext, RSSKoaState } from '../types';
import config from '../config';
import { DomainNotFoundError, statusToHTML, UserNotFoundError } from './weibo/weibo';
import { DomainNotFoundError, statusToHTML, UserNotFoundError, WeiboCookieInvalidError } from './weibo/weibo';
import { ThrottledError } from './throttler';
import { logger } from './logger';
@@ -78,6 +78,11 @@ export const registerRoutes = (
ctx.body = `找不到用户,可能用户仅登录可见,不支持订阅。可以通过打开 https://m.weibo.cn/u/:uid 验证(<a href="https://m.weibo.cn/u/${uid}" target="_blank">uid: ${uid}</a>`;
return;
}
if (error instanceof WeiboCookieInvalidError) {
ctx.status = 401;
ctx.body = `微博 Cookie 可能已过期或失效,请更新 WEIBO_COOKIE 后重试。uid: ${uid}`;
return;
}
if (error instanceof ThrottledError) {
ctx.status = 503;
ctx.body = `暂时无法拉取到数据,请稍后再试。uid: ${uid}`;
@@ -123,6 +128,14 @@ export const registerRoutes = (
};
return;
}
if (error instanceof WeiboCookieInvalidError) {
ctx.status = 401;
ctx.body = {
success: false,
msg: '微博 Cookie 可能已过期或失效,请更新 WEIBO_COOKIE 后重试',
};
return;
}
logger.error(error);
ctx.status = 500;
ctx.body = {