From 0e4a1f3f39b264f36e5d55004c4156c129614601 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Sun, 16 Oct 2022 18:15:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcLive.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcLive.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/SrcLive.js b/SrcLive.js index 179c4e1e..017a003c 100644 --- a/SrcLive.js +++ b/SrcLive.js @@ -2,7 +2,6 @@ function Live() { addListener("onClose", $.toString(() => { //clearMyVar('guanlicz'); })); - setPageTitle("⚙直播设置⚙"); var d = []; let livefile = "hiker://files/rules/Src/Juying/live.txt"; let JYlive=fetch(livefile); @@ -191,7 +190,7 @@ function LiveSet() { //clearMyVar('guanlicz'); refreshPage(false); })); - + setPageTitle("⚙直播设置⚙"); var d = []; d.push({ title: '导入聚直播', @@ -248,29 +247,33 @@ function LiveSet() { } let fails = []; var task = function(obj) { - let code = JSON.parse(request(obj.url,{onlyHeaders:true,timeout:2000})); - if(code!=200){ - fails.push(obj.name+','+obj.url); + try{ + let url = obj.split(',')[1]; + let code = JSON.parse(request(url,{onlyHeaders:true,timeout:2000})); + if(code!=200){ + fails.push(obj); + } + }catch(e){ + } return 1; } let urlscheck = urls.map((list)=>{ return { func: task, - param: { - name: list.split(',')[0], - url: list.split(',')[1] - }, - id: list.split(',')[1] + param: list, + id: list } }); + log(urlscheck.length) be(urlscheck, { - func: function(obj, id, error, taskResult) { + func: function(obj, id, error, taskResult) { }, param: { } }); + log(fails.length) for(let i = 0; i < JYlives.length; i++){ if(fails.indexOf(lJYlives[i])>-1){ JYlives.splice(i,1);