更新优化
This commit is contained in:
@@ -4,7 +4,7 @@ function configuredProxyHosts() {
|
||||
? configured
|
||||
: String(configured || '').split(/[\s,]+/);
|
||||
return new Set(
|
||||
values
|
||||
['zhiyanim.dfpnm.cn', ...values]
|
||||
.map(value => String(value || '').trim().toLowerCase().replace(/\.$/, ''))
|
||||
.filter(Boolean)
|
||||
);
|
||||
@@ -28,3 +28,20 @@ export function imageDisplayUrl(value) {
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
export function videoDisplayUrl(value) {
|
||||
const source = String(value || '').trim();
|
||||
if (!source || source.startsWith('blob:') || source.startsWith('data:')) return source;
|
||||
const streamUrl = new URL('/api/media_stream.php', window.location.origin);
|
||||
streamUrl.searchParams.set('url', source);
|
||||
return streamUrl.toString();
|
||||
}
|
||||
|
||||
export function useImageProxyFallback(event, value) {
|
||||
const image = event?.currentTarget;
|
||||
if (!image) return;
|
||||
const fallback = imageDisplayUrl(value);
|
||||
if (!fallback || fallback === value || image.dataset.proxyFallback === '1') return;
|
||||
image.dataset.proxyFallback = '1';
|
||||
image.src = fallback;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user