Skip to content

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

fix: 兼容旧浏览器正则引擎

sswest4c20581efbc3
diff --git a/js/api.js b/js/api.js
index 8797bc9..6b5ca9a 100644
--- a/js/api.js
+++ b/js/api.js
@@ -219,18 +219,19 @@ async function handleFFZYDetail(id, sourceCode) {
const html = await response.text();
// 非凡影视使用不同的正则表达式
- const ffzyPattern = /(?<=\$)(https?:\/\/[^"'\s]+?\/\d{8}\/\d+_[a-f0-9]+\/index\.m3u8)/g;
+ const ffzyPattern = /(\$)(https?:\/\/[^"'\s]+?\/\d{8}\/\d+_[a-f0-9]+\/index\.m3u8)/g;
let matches = html.match(ffzyPattern) || [];
-
+
// 处理可能包含括号的链接
matches = matches.map(link => {
const parenIndex = link.indexOf('(');
return parenIndex > 0 ? link.substring(0, parenIndex) : link;
});
-
+
// 如果没有找到链接,尝试一个更通用的模式
if (matches.length === 0) {
- const generalPattern = /(?<=\$)(https?:\/\/[^"'\s]+?\.m3u8)/g;
+ // 移除命名捕获组,使用索引捕获组
+ const generalPattern = /(\$)(https?:\/\/[^"'\s]+?\.m3u8)/g;
matches = html.match(generalPattern) || [];
matches = matches.map(link => {
const parenIndex = link.indexOf('(');