一分钟搭建影视站,支持Docker等部署方式
Fix image loading issue by using proxy for Douban cover URLs to prevent cross-origin problems
developer1a0d322e1f2b
diff --git a/js/douban.js b/js/douban.jsindex a163804..3ada834 100644--- a/js/douban.js+++ b/js/douban.js@@ -206,14 +206,15 @@ function renderRecommend(tag, pageLimit, pageStart) {.replace(/</g, '<').replace(/>/g, '>');- // 修复图片加载问题:使用备用图片URL方案- // 1. 尝试使用原始图片地址但不通过代理- // 2. 如果加载失败,使用备用图片+ // 关键修复:使用内置的代理功能加载豆瓣图片+ // 1. 确保图片URL是安全的+ // 2. 使用PROXY_URL代理加载图片,避免跨域和豆瓣防盗链问题const originalCoverUrl = item.cover;+ const proxiedCoverUrl = PROXY_URL + encodeURIComponent(originalCoverUrl);card.innerHTML = `<div class="relative w-full aspect-[2/3] overflow-hidden cursor-pointer" onclick="fillSearchInput('${safeTitle}')">- <img src="${originalCoverUrl}" alt="${safeTitle}"+ <img src="${proxiedCoverUrl}" alt="${safeTitle}"class="w-full h-full object-cover transition-transform duration-500 hover:scale-110"onerror="this.onerror=null; this.src='https://via.placeholder.com/300x450/111111/FFFFFF?text=${encodeURIComponent(safeTitle)}'; this.classList.add('object-contain');"loading="lazy">