Skip to content

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

增加一个极速资源源

developerd7d2a84a723f
diff --git a/index.html b/index.html
index 80b9339..e436a00 100644
--- a/index.html
+++ b/index.html
@@ -62,6 +62,7 @@
<option value="wolong">卧龙资源 (wolong)</option>
<option value="cjhw">新华为 (cjhw)</option>
<option value="dbzy">豆瓣资源 (dbzy)</option>
+ <option value="jisu">极速资源 (jisu)</option>
<option value="custom">自定义接口</option>
</select>
diff --git a/js/api.js b/js/api.js
index 2e1445d..9bb676b 100644
--- a/js/api.js
+++ b/js/api.js
@@ -100,10 +100,15 @@ async function handleApiRequest(url) {
throw new Error('无效的API来源');
}
- // 对于ffzy源,使用特殊处理方式
+ // 对于特殊源,使用特殊处理方式
if (sourceCode === 'ffzy' && API_SITES[sourceCode].detail) {
return await handleFFZYDetail(id, sourceCode);
}
+
+ // 新增: 对极速资源使用特殊处理方式
+ if (sourceCode === 'jisu' && API_SITES[sourceCode].detail) {
+ return await handleJisuDetail(id, sourceCode);
+ }
const detailUrl = customApi
? `${customApi}${API_CONFIG.detail.path}${id}`
@@ -275,6 +280,68 @@ async function handleFFZYDetail(id, sourceCode) {
}
}
+// 新增: 处理极速资源详情的特殊函数 - 类似非凡影视的处理方式
+async function handleJisuDetail(id, sourceCode) {
+ try {
+ // 构建详情页URL(使用配置中的detail URL而不是api URL)
+ const detailUrl = `${API_SITES[sourceCode].detail}/index.php/vod/detail/id/${id}.html`;
+
+ // 添加超时处理
+ const controller = new AbortController();
+ const timeoutId = setTimeout(() => controller.abort(), 10000);
+
+ // 获取详情页HTML
+ const response = await fetch(PROXY_URL + encodeURIComponent(detailUrl), {
+ headers: {
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36',
+ },
+ signal: controller.signal
+ });
+
+ clearTimeout(timeoutId);
+
+ if (!response.ok) {
+ throw new Error(`详情页请求失败: ${response.status}`);
+ }
+
+ // 获取HTML内容
+ const html = await response.text();
+
+ // 极速资源的正则表达式模式 - 类似非凡的处理方式
+ const jisuPattern = /\$(https?:\/\/[^"'\s]+?\.m3u8)/g;
+ let matches = html.match(jisuPattern) || [];
+
+ // 处理链接
+ matches = matches.map(link => {
+ link = link.substring(1, link.length);
+ const parenIndex = link.indexOf('(');
+ return parenIndex > 0 ? link.substring(0, parenIndex) : link;
+ });
+
+ // 提取可能存在的标题、简介等基本信息
+ const titleMatch = html.match(/<h1[^>]*>([^<]+)<\/h1>/);
+ const titleText = titleMatch ? titleMatch[1].trim() : '';
+
+ const descMatch = html.match(/<div[^>]*class=["']sketch["'][^>]*>([\s\S]*?)<\/div>/);
+ const descText = descMatch ? descMatch[1].replace(/<[^>]+>/g, ' ').trim() : '';
+
+ return JSON.stringify({
+ code: 200,
+ episodes: matches,
+ detailUrl: detailUrl,
+ videoInfo: {
+ title: titleText,
+ desc: descText,
+ source_name: API_SITES[sourceCode].name,
+ source_code: sourceCode
+ }
+ });
+ } catch (error) {
+ console.error('极速资源详情获取失败:', error);
+ throw error;
+ }
+}
+
// 新增: 处理聚合搜索
async function handleAggregatedSearch(searchQuery) {
// 获取可用的API源列表(排除aggregated和custom)
diff --git a/js/config.js b/js/config.js
index 171674d..77f0bcc 100644
--- a/js/config.js
+++ b/js/config.js
@@ -45,6 +45,11 @@ const API_SITES = {
api: 'https://cjhwba.com',
name: '新华为',
},
+ jisu: {
+ api: 'https://jszyapi.com',
+ name: '极速资源',
+ detail: 'https://jszyapi.com'
+ },
dbzy: {
api: 'https://dbzy.com',
name: '豆瓣资源',