Revert "feat: extend image proxy to all images, not just douban"
This reverts commit d682cee427.
This commit is contained in:
+4
-18
@@ -399,11 +399,6 @@ export function processImageUrl(originalUrl: string): string {
|
|||||||
return originalUrl;
|
return originalUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 如果不是 http/https 开头(相对路径、data URI 等),直接返回
|
|
||||||
if (!originalUrl.startsWith('http://') && !originalUrl.startsWith('https://')) {
|
|
||||||
return originalUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理 TMDB 图片 URL 替换
|
// 处理 TMDB 图片 URL 替换
|
||||||
if (originalUrl.includes('image.tmdb.org')) {
|
if (originalUrl.includes('image.tmdb.org')) {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
@@ -429,21 +424,12 @@ export function processImageUrl(originalUrl: string): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 处理豆瓣图片代理
|
// 处理豆瓣图片代理
|
||||||
if (originalUrl.includes('doubanio.com')) {
|
if (!originalUrl.includes('doubanio.com')) {
|
||||||
const { proxyType, proxyUrl } = getDoubanImageProxyConfig();
|
return originalUrl;
|
||||||
return buildDoubanImageUrl(originalUrl, proxyType, proxyUrl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 其他图片(视频源封面图等)走本站代理,带缓存
|
const { proxyType, proxyUrl } = getDoubanImageProxyConfig();
|
||||||
// 可通过 localStorage 'proxyAllImages' = 'false' 关闭
|
return buildDoubanImageUrl(originalUrl, proxyType, proxyUrl);
|
||||||
if (typeof window !== 'undefined') {
|
|
||||||
const proxyAll = localStorage.getItem('proxyAllImages');
|
|
||||||
if (proxyAll !== 'false') {
|
|
||||||
return `/api/image-proxy?url=${encodeURIComponent(originalUrl)}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return originalUrl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user