一分钟搭建影视站,支持Docker等部署方式
fix: 解决 Issue #110 (新添加的api不会保存)
wangfujieb3d6670ceb32
diff --git a/index.html b/index.htmlindex 8b3d106..5d63128 100644--- a/index.html+++ b/index.html@@ -414,6 +414,7 @@window._jsSha256 = window.sha256;</script><script src="js/config.js"></script>+ <script src="js/customer_site.js"></script><script src="js/ui.js"></script><script src="js/api.js"></script><script src="js/douban.js"></script>diff --git a/js/config.js b/js/config.jsindex d1ed94c..337e19d 100644--- a/js/config.js+++ b/js/config.js@@ -184,6 +184,16 @@ const API_SITES = {// },};+// 定义合并方法+function extendAPISites(newSites) {+ Object.assign(API_SITES, newSites);+}++// 暴露到全局+window.API_SITES = API_SITES;+window.extendAPISites = extendAPISites;++// 添加聚合搜索的配置选项const AGGREGATED_SEARCH_CONFIG = {enabled: true, // 是否启用聚合搜索diff --git a/js/customer_site.js b/js/customer_site.jsnew file mode 100644index 0000000..ff64494--- /dev/null+++ b/js/customer_site.js@@ -0,0 +1,13 @@+const CUSTOMER_SITES = {+ qiqi: {+ api: 'https://www.qiqidys.com/api.php/provide/vod',+ name: '七七资源',+ }+};++// 调用全局方法合并+if (window.extendAPISites) {+ window.extendAPISites(CUSTOMER_SITES);+} else {+ console.error("错误:请先加载 config.js!");+}diff --git a/player.html b/player.htmlindex 934a31d..d822e1b 100644--- a/player.html+++ b/player.html@@ -227,6 +227,7 @@<script src="libs/artplayer.min.js" crossorigin="anonymous"></script><script src="js/config.js"></script>+ <script src="js/customer_site.js"></script><script src="js/password.js"></script><script src="js/ui.js"></script><script src="js/api.js"></script>@@ -278,4 +279,4 @@});</script></body>-</html>\ No newline at end of file+</html>