From 261555c2e6083f8abc0a7ff65ec766ecdcb71629 Mon Sep 17 00:00:00 2001 From: hjdhnx <49803097+hjdhnx@users.noreply.github.com> Date: Mon, 19 Jun 2023 16:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=94=AF=E6=8C=81=E4=B8=AD?= =?UTF-8?q?=E6=96=87=E9=80=97=E5=8F=B7=E3=80=82=E5=85=BC=E5=AE=B9=E6=9B=B4?= =?UTF-8?q?=E5=A4=9A=E5=86=99=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/live2cms.js | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/libs/live2cms.js b/libs/live2cms.js index 63766f9..9fe092a 100644 --- a/libs/live2cms.js +++ b/libs/live2cms.js @@ -275,15 +275,18 @@ function homeVod(params) { } __ext.data_dict[_get_url] = html; } - let arr = html.match(/.*?,#[\s\S].*?#/g); + // let arr = html.match(/.*?,#[\s\S].*?#/g); + let arr = html.match(/.*?[,,]#[\s\S].*?#/g); // 可能存在中文逗号 let _list = []; try { arr.forEach(it=>{ + let vname = it.split(/[,,]/)[0]; + let vtab = it.match(/#(.*?)#/)[0]; _list.push({ - vod_name:it.split(',')[0], - vod_id:_get_url+'$'+it.split(',')[0], + vod_name:vname, + vod_id:_get_url+'$'+vname, vod_pic:def_pic, - vod_remarks:it.split(',')[1], + vod_remarks:vtab, }); }); }catch (e) { @@ -314,15 +317,19 @@ function category(tid, pg, filter, extend) { } __ext.data_dict[_get_url] = html; } - let arr = html.match(/.*?,#[\s\S].*?#/g); + // let arr = html.match(/.*?[,,]#[\s\S].*?#/g); + let arr = html.match(/.*?[,,]#[\s\S].*?#/g); // 可能存在中文逗号 let _list = []; try { arr.forEach(it=>{ + let vname = it.split(/[,,]/)[0]; + let vtab = it.match(/#(.*?)#/)[0]; _list.push({ - vod_name:it.split(',')[0], - vod_id:_get_url+'$'+it.split(',')[0], + // vod_name:it.split(',')[0], + vod_name:vname, + vod_id:_get_url+'$'+vname, vod_pic:def_pic, - vod_remarks:it.split(',')[1], + vod_remarks:vtab, }); }); }catch (e) { @@ -368,11 +375,12 @@ function detail(tid) { // ⛵ 港•澳•台 } __ext.data_dict[_get_url] = html; } - let a = new RegExp(`.*?${_tab},#[\\s\\S].*?#`); + // let a = new RegExp(`.*?${_tab},#[\\s\\S].*?#`); + let a = new RegExp(`.*?${_tab.replace('(','\\(').replace(')','\\)')}[,,]#[\\s\\S].*?#`); let b = html.match(a)[0]; let c = html.split(b)[1]; - if(c.match(/.*?,#[\s\S].*?#/)){ - let d = c.match(/.*?,#[\s\S].*?#/)[0]; + if(c.match(/.*?[,,]#[\s\S].*?#/)){ + let d = c.match(/.*?[,,]#[\s\S].*?#/)[0]; c = c.split(d)[0]; } let arr = c.trim().split('\n');