From b3d0e74e5d45c5bc2a2abcd3e3398f70c68ca617 Mon Sep 17 00:00:00 2001 From: gyjune <14752+gyjune@noreply.example.org> Date: Wed, 5 Aug 2026 04:27:54 +0200 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20js/=E8=8C=B6=E6=9D=AF?= =?UTF-8?q?=E7=8B=90.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/茶杯狐.js | 563 --------------------------------------------------- 1 file changed, 563 deletions(-) delete mode 100644 js/茶杯狐.js diff --git a/js/茶杯狐.js b/js/茶杯狐.js deleted file mode 100644 index 59baf47..0000000 --- a/js/茶杯狐.js +++ /dev/null @@ -1,563 +0,0 @@ -/* -@header({ - searchable: 1, - filterable: 1, - quickSearch: 1, - title: '茶杯狐', - lang: 'cat' -}) -*/ - -const API_HOST = 'http://www.bnjxjd.com'; - -const HEADERS = { - 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', - 'accept-language': 'zh-CN,zh;q=0.9', - 'Referer': 'http://www.bnjxjd.com/', - 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', -}; - -// ============ 工具函数 ============ - -async function fetchHtml(url) { - try { - const res = await req(url, { headers: HEADERS }); - return res.content || ''; - } catch (e) { - return ''; - } -} - -function cleanHtml(text) { - if (!text) return ''; - return text.replace(/<[^>]+>/g, '').replace(/\s+/g, ' ').trim(); -} - -function fixUrl(url) { - if (!url) return ''; - if (url.startsWith('//')) return 'https:' + url; - if (url.startsWith('http')) return url; - if (url.startsWith('/')) return API_HOST + url; - return API_HOST + '/' + url; -} - -// ============ 解析视频列表(基于实际HTML结构) ============ - -function parseVideoList(html) { - const videos = []; - if (!html) return videos; - - // 匹配每个 li 中的 stui-vodlist__box - const boxPattern = /
]*class="col-pd"[^>]*>([\s\S]*?)<\/p>/);
- }
- if (descMatch) {
- info.vod_content = cleanHtml(descMatch[1].replace(/<[^>]+>/g, ''));
- } else {
- info.vod_content = '';
- }
-
- // 海报
- let picMatch = html.match(/]*class="img-responsive"[^>]*src="([^"]+)"/);
- if (!picMatch) {
- picMatch = html.match(/
]*src="([^"]+)"[^>]*class="[^"]*lazy[^"]*"/);
- }
- info.vod_pic = picMatch ? fixUrl(picMatch[1]) : '';
-
- // 演员
- const actorMatch = html.match(/主演:<\/span>([\s\S]*?)<\/p>/);
- info.vod_actor = actorMatch ? cleanHtml(actorMatch[1].replace(/<[^>]+>/g, '')) : '';
-
- // 导演
- const directorMatch = html.match(/导演:<\/span>([\s\S]*?)<\/p>/);
- info.vod_director = directorMatch ? cleanHtml(directorMatch[1].replace(/<[^>]+>/g, '')) : '';
-
- // 地区
- const areaMatch = html.match(/地区:<\/span>([\s\S]*?)<\/p>/);
- info.vod_area = areaMatch ? cleanHtml(areaMatch[1].replace(/<[^>]+>/g, '')) : '';
-
- // 年份
- const yearMatch = html.match(/年份:<\/span>([\s\S]*?)<\/p>/);
- info.vod_year = yearMatch ? cleanHtml(yearMatch[1].replace(/<[^>]+>/g, '')) : '';
-
- // 类型
- const typeMatch = html.match(/类型:<\/span>([\s\S]*?)<\/p>/);
- info.type_name = typeMatch ? cleanHtml(typeMatch[1].replace(/<[^>]+>/g, '')) : '';
-
- // ========== 提取播放列表 ==========
- const playFrom = [];
- const playUrls = [];
-
- // 提取线路名称
- const tabs = [];
- const tabPattern = /
]*class="stui-content__playlist[^"]*"[^>]*>([\s\S]*?)<\/ul>/g;
- const ulMatches = [];
- let ulMatch;
- while ((ulMatch = ulPattern.exec(html)) !== null) {
- ulMatches.push(ulMatch[1]);
- }
-
- for (let idx = 0; idx < ulMatches.length; idx++) {
- const ulContent = ulMatches[idx];
- const liPattern = /