update SrcJySet.js.

pull/1/head
src48597962 3 years ago committed by Gitee
parent 54d17794dd
commit a3ee39cba1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
  1. 44
      SrcJySet.js

@ -532,8 +532,7 @@ function SRCSet() {
var reg = /("([^\\\"]*(\\.)?)*")|('([^\\\']*(\\.)?)*')|(\/{2,}.*?(\r|\n|$))|(\/\*(\n|.)*?\*\/)/g;
html = html.replace(reg, function(word) {
return /^\/{2,}/.test(word) || /^\/\*/.test(word) ? "" : word;
}).replace(/#.*?\n/g,"");
log(html)
}).replace(/^.*#.*$/mg,"");
var data = JSON.parse(html);
var jiekou = data.sites;
var jiexi = data.parses;
@ -552,7 +551,7 @@ function SRCSet() {
if(lx=="."){
urls.push({ "name": jiekou[i].split('@')[1].split('=')[0], "url": jiekou[i].split('@')[1].split('=')[1].split('#')[0], "group":jiekou[i].split('@')[0]})
}else{
if(jiekou[i].api=="csp_AppYsV2"){
if(/^csp_AppYs/.test(jiekou[i].api)){
urls.push({ "name": jiekou[i].name, "url": jiekou[i].ext})
}
if(jiekou[i].type==1){
@ -563,7 +562,7 @@ function SRCSet() {
let biuhtml = fetch(jiekou[i].ext,{timeout:2000});
biuhtml = biuhtml.replace(reg, function(word) {
return /^\/{2,}/.test(word) || /^\/\*/.test(word) ? "" : word;
}).replace(/#.*?\n/g,"");
}).replace(/^.*#.*$/mg,"");
let biujson = JSON.parse(biuhtml);
let biudata = {};
biudata.url = biujson.url;
@ -1026,7 +1025,42 @@ function SRCSet() {
titleVisible: true
}
});
if(getMyVar('guanlicz','0')=="1"){
let grouplist = datalist.map((list)=>{
return list.group||list.type;
})
//去重复
function uniq(array){
var temp = []; //一个新的临时数组
for(var i = 0; i < array.length; i++){
if(temp.indexOf(array[i]) == -1){
temp.push(array[i]);
}
}
return temp;
}
grouplist = uniq(grouplist);
for(var i in grouplist){
var lists = datalist.filter(item => {
return item.group==grouplist[i] || item.type==grouplist[i];
})
d.push({
title: grouplist[i]+'('+lists.length+')',
url: $('#noLoading#').lazyRule((guanlidata,lists)=>{
if(datalist.length>0){
deleteItemByCls('guanlidatalist');
let gldatalist = guanlidata(lists);
addItemBefore('guanliloading', gldatalist);
}
return "hiker://empty";
},guanlidata,lists),
col_type: "scroll_button",
extra: {
id: "grouplist"
}
});
}
}
let gldatalist = guanlidata(datalist);
d = d.concat(gldatalist);
}

Loading…
Cancel
Save