Skip to content

一分钟搭建影视站,支持Docker等部署方式

优化显示效果、清除不兼容api

developer4c74782ee53e
diff --git a/about.html b/about.html
index 91dbaf5..4d611db 100644
--- a/about.html
+++ b/about.html
@@ -6,7 +6,7 @@
<title>关于我们 - LibreTV</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="css/styles.css">
- <!-- ...existing head code... -->
+
</head>
<body class="page-bg text-white">
<div class="container mx-auto px-4 py-8">
diff --git a/index.html b/index.html
index 15baf8c..91f1331 100644
--- a/index.html
+++ b/index.html
@@ -34,19 +34,19 @@
<link rel="stylesheet" href="css/styles.css">
</head>
<body class="page-bg text-white">
- <!-- 将历史记录按钮移到左上角 -->
+ <!-- 将历史记录按钮移到左上角,并缩小尺寸 -->
<div class="fixed top-4 left-4 z-50">
- <button onclick="toggleHistory(event)" class="bg-[#222] hover:bg-[#333] border border-[#333] hover:border-white rounded-lg px-4 py-2 transition-colors" aria-label="观看历史">
- <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
+ <button onclick="toggleHistory(event)" class="bg-[#222] hover:bg-[#333] border border-[#333] hover:border-white rounded-lg px-3 py-1.5 transition-colors" aria-label="观看历史">
+ <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</button>
</div>
- <!-- 设置按钮保留在右上角 -->
+ <!-- 设置按钮保留在右上角,并缩小尺寸 -->
<div class="fixed top-4 right-4 z-50">
- <button onclick="toggleSettings(event)" class="bg-[#222] hover:bg-[#333] border border-[#333] hover:border-white rounded-lg px-4 py-2 transition-colors" aria-label="打开设置">
- <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
+ <button onclick="toggleSettings(event)" class="bg-[#222] hover:bg-[#333] border border-[#333] hover:border-white rounded-lg px-3 py-1.5 transition-colors" aria-label="打开设置">
+ <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path>
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path>
</svg>
@@ -248,7 +248,19 @@
</div>
<!-- 搜索结果:初始隐藏 -->
- <div id="resultsArea" class="w-full hidden"></div>
+ <div id="resultsArea" class="w-full hidden">
+ <!-- 添加返回主页按钮 -->
+ <div class="flex justify-between items-center mb-4">
+ <button onclick="resetToHome()" class="flex items-center gap-1 px-4 py-2 bg-gradient-to-r from-indigo-500 via-purple-500 to-pink-500 text-white rounded-lg hover:shadow-lg transition-all duration-300 transform hover:-translate-y-1">
+ <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M11 17l-5-5m0 0l5-5m-5 5h12" />
+ </svg>
+ 返回首页
+ </button>
+ <div class="text-sm text-gray-400">
+ <span id="searchResultsCount">0</span> 个结果
+ </div>
+ </div>
<div id="results" class="grid grid-cols-1 md:grid-cols-3 lg:grid-cols-4 gap-6">
</div>
</div>
diff --git a/js/app.js b/js/app.js
index b2b6072..bdc7128 100644
--- a/js/app.js
+++ b/js/app.js
@@ -663,6 +663,12 @@ async function search() {
}
});
+ // 更新搜索结果计数
+ const searchResultsCount = document.getElementById('searchResultsCount');
+ if (searchResultsCount) {
+ searchResultsCount.textContent = allResults.length;
+ }
+
// 显示结果区域,调整搜索区域
document.getElementById('searchArea').classList.remove('flex-1');
document.getElementById('searchArea').classList.add('mb-8');
@@ -704,7 +710,6 @@ async function search() {
// 添加XSS保护,使用textContent和属性转义
resultsDiv.innerHTML = allResults.map(item => {
- // ...existing code for rendering results...
const safeId = item.vod_id ? item.vod_id.toString().replace(/[^\w-]/g, '') : '';
const safeName = (item.vod_name || '').toString()
.replace(/</g, '&lt;')
@@ -823,7 +828,6 @@ async function showDetails(id, vod_name, sourceCode) {
const data = await response.json();
- // ...existing code for showing details...
const modal = document.getElementById('modal');
const modalTitle = document.getElementById('modalTitle');
const modalContent = document.getElementById('modalContent');
diff --git a/js/config.js b/js/config.js
index ce7afca..15c21ed 100644
--- a/js/config.js
+++ b/js/config.js
@@ -96,11 +96,6 @@ const API_SITES = {
name: 'souav资源',
adult: true
},
- siwa: {
- api: 'https://siwazyw.tv',
- name: '丝袜资源',
- adult: true
- },
r155: {
api: 'https://155api.com',
name: '155资源',
@@ -121,10 +116,6 @@ const API_SITES = {
api: 'https://api.zuidapi.com',
name: '最大资源'
},
- suoni: {
- api: 'https://suoniapi.com',
- name: '索尼资源'
- },
yutu: {
api: 'https://yutuzy10.com',
name: '玉兔资源',
diff --git a/js/douban.js b/js/douban.js
index ae9578e..923843e 100644
--- a/js/douban.js
+++ b/js/douban.js
@@ -149,7 +149,8 @@ function renderDoubanTags() {
// 设置换一批按钮事件
function setupDoubanRefreshBtn() {
- const btn = document.getElementById('douban-refresh-btn');
+ // 修复ID,使用正确的ID douban-refresh 而不是 douban-refresh-btn
+ const btn = document.getElementById('douban-refresh');
if (!btn) return;
btn.onclick = function() {
diff --git a/privacy.html b/privacy.html
index 52bdcf2..979afb9 100644
--- a/privacy.html
+++ b/privacy.html
@@ -6,7 +6,6 @@
<title>隐私政策 - LibreTV</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="css/styles.css">
- <!-- ...existing head code... -->
</head>
<body class="page-bg text-white">
<div class="container mx-auto px-4 py-8">