|
|
@ -921,7 +921,7 @@ function shareResource() { |
|
|
|
}, Juconfig, it.path, cfgfile) |
|
|
|
}, Juconfig, it.path, cfgfile) |
|
|
|
}else if(input=="上传"){ |
|
|
|
}else if(input=="上传"){ |
|
|
|
const hikerPop = $.require("http://hiker.nokia.press/hikerule/rulelist.json?id=6966"); |
|
|
|
const hikerPop = $.require("http://hiker.nokia.press/hikerule/rulelist.json?id=6966"); |
|
|
|
let fruit = ["接口", "解析", "云盘", "直播"]; |
|
|
|
let fruit = ["接口", "解析", "云盘", "直播", "ghproxy"]; |
|
|
|
hikerPop.multiChoice({ |
|
|
|
hikerPop.multiChoice({ |
|
|
|
title: "选择要上传分享同步的项",
|
|
|
|
title: "选择要上传分享同步的项",
|
|
|
|
options: fruit,
|
|
|
|
options: fruit,
|
|
|
@ -938,49 +938,56 @@ function shareResource() { |
|
|
|
let text = {}; |
|
|
|
let text = {}; |
|
|
|
options.forEach((option,i)=>{ |
|
|
|
options.forEach((option,i)=>{ |
|
|
|
if(checked[i]){ |
|
|
|
if(checked[i]){ |
|
|
|
let filepath; |
|
|
|
if(option=="ghproxy"){ |
|
|
|
if(option=="接口"){ |
|
|
|
let ghproxy = $.require('ghproxy').getproxy(); |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').jkfile; |
|
|
|
if(ghproxy.length>0){ |
|
|
|
}else if(option=="解析"){ |
|
|
|
text["ghproxy"] = ghproxy; |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').jxfile; |
|
|
|
} |
|
|
|
}else if(option=="云盘"){ |
|
|
|
}else{ |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').ypfile; |
|
|
|
let filepath; |
|
|
|
}else if(option=="直播"){ |
|
|
|
if(option=="接口"){ |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').rulepath + "liveconfig.json"; |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').jkfile; |
|
|
|
} |
|
|
|
}else if(option=="解析"){ |
|
|
|
let datafile = fetch(filepath); |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').jxfile; |
|
|
|
let datalist = []; |
|
|
|
}else if(option=="云盘"){ |
|
|
|
if(datafile){ |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').ypfile; |
|
|
|
if(option=="直播"){ |
|
|
|
}else if(option=="直播"){ |
|
|
|
eval("let tvconfig=" + datafile+ ";"); |
|
|
|
filepath = globalMap0.getVar('Jy_gmParams').rulepath + "liveconfig.json"; |
|
|
|
text[option] = tvconfig; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
let datafile = fetch(filepath); |
|
|
|
try{ |
|
|
|
let datalist = []; |
|
|
|
eval("datalist=" + datafile+ ";"); |
|
|
|
if(datafile){ |
|
|
|
}catch(e){} |
|
|
|
if(option=="直播"){ |
|
|
|
if(datalist.length>600){ |
|
|
|
eval("let tvconfig=" + datafile+ ";"); |
|
|
|
toast(option+"超过600,建议先精简"); |
|
|
|
text[option] = tvconfig; |
|
|
|
}else if(datalist.length==0){ |
|
|
|
}else{ |
|
|
|
toast(option+"数量为0"); |
|
|
|
try{ |
|
|
|
} |
|
|
|
eval("datalist=" + datafile+ ";"); |
|
|
|
if(option=="接口"){ |
|
|
|
}catch(e){} |
|
|
|
for(let i=0;i<datalist.length;i++){ |
|
|
|
if(datalist.length>600){ |
|
|
|
let data = datalist[i]; |
|
|
|
toast(option+"超过600,建议先精简"); |
|
|
|
if(data.url.startsWith(globalMap0.getVar('Jy_gmParams').jkfilespath) && (($.type(data.ext)=="string" && data.ext.startsWith("file")) || !data.ext)){ |
|
|
|
}else if(datalist.length==0){ |
|
|
|
data.extstr = fetch(data.url) || fetch(data.ext.split("?")[0]); |
|
|
|
toast(option+"数量为0"); |
|
|
|
if(!data.extstr){ |
|
|
|
} |
|
|
|
|
|
|
|
if(option=="接口"){ |
|
|
|
|
|
|
|
for(let i=0;i<datalist.length;i++){ |
|
|
|
|
|
|
|
let data = datalist[i]; |
|
|
|
|
|
|
|
if(data.url.startsWith(globalMap0.getVar('Jy_gmParams').jkfilespath) && (($.type(data.ext)=="string" && data.ext.startsWith("file")) || !data.ext)){ |
|
|
|
|
|
|
|
data.extstr = fetch(data.url) || fetch(data.ext.split("?")[0]); |
|
|
|
|
|
|
|
if(!data.extstr){ |
|
|
|
|
|
|
|
datalist.splice(i,1); |
|
|
|
|
|
|
|
i = i - 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}else if(!data.url.startsWith(globalMap0.getVar('Jy_gmParams').jkfilespath) && data.url.startsWith("hiker")){ |
|
|
|
datalist.splice(i,1); |
|
|
|
datalist.splice(i,1); |
|
|
|
i = i - 1; |
|
|
|
i = i - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(!data.url.startsWith(globalMap0.getVar('Jy_gmParams').jkfilespath) && data.url.startsWith("hiker")){ |
|
|
|
|
|
|
|
datalist.splice(i,1); |
|
|
|
|
|
|
|
i = i - 1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if(datalist.length>0){ |
|
|
|
|
|
|
|
text[option] = datalist; |
|
|
|
|
|
|
|
}
|
|
|
|
} |
|
|
|
} |
|
|
|
if(datalist.length>0){ |
|
|
|
|
|
|
|
text[option] = datalist; |
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1207,9 +1214,7 @@ function updateResource(it,refresh) { |
|
|
|
let livefilepath = globalMap0.getVar('Jy_gmParams').rulepath + "liveconfig.json"; |
|
|
|
let livefilepath = globalMap0.getVar('Jy_gmParams').rulepath + "liveconfig.json"; |
|
|
|
let liveconfig = pastedata.直播; |
|
|
|
let liveconfig = pastedata.直播; |
|
|
|
if(it.mode!=2){ |
|
|
|
if(it.mode!=2){ |
|
|
|
log(livefilepath); |
|
|
|
|
|
|
|
let livefile = fetch(livefilepath); |
|
|
|
let livefile = fetch(livefilepath); |
|
|
|
log(livefile); |
|
|
|
|
|
|
|
if(livefile){ |
|
|
|
if(livefile){ |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
let olddata = JSON.parse(livefile).data; |
|
|
|
let olddata = JSON.parse(livefile).data; |
|
|
@ -1224,7 +1229,7 @@ function updateResource(it,refresh) { |
|
|
|
writeFile(livefilepath, JSON.stringify(liveconfig)); |
|
|
|
writeFile(livefilepath, JSON.stringify(liveconfig)); |
|
|
|
var sm = ",直播订阅已同步" |
|
|
|
var sm = ",直播订阅已同步" |
|
|
|
}catch(e){ |
|
|
|
}catch(e){ |
|
|
|
log("增量导入直播失败>"+e.message); |
|
|
|
//log("增量导入直播失败>"+e.message);
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(liveconfig.data){ |
|
|
|
}else if(liveconfig.data){ |
|
|
@ -1238,6 +1243,22 @@ function updateResource(it,refresh) { |
|
|
|
ypnum = yundisksave(ypdatalist, 1); |
|
|
|
ypnum = yundisksave(ypdatalist, 1); |
|
|
|
options.push('云盘'); |
|
|
|
options.push('云盘'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
let ghproxy = pastedata.ghproxy||[]; |
|
|
|
|
|
|
|
if(ghproxy.length>0){ |
|
|
|
|
|
|
|
if(it.mode!=2){ |
|
|
|
|
|
|
|
oldproxy = Juconfig['ghproxy'] || []; |
|
|
|
|
|
|
|
ghproxy.forEach(gh=>{ |
|
|
|
|
|
|
|
if(!oldproxy.some(item => gh.url==item.url)){ |
|
|
|
|
|
|
|
oldproxy.push(gh); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
Juconfig['ghproxy'] = oldproxy; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
Juconfig['ghproxy'] = ghproxy; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
options.push('ghproxy'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let resources = Juconfig['subResource'] || []; |
|
|
|
let resources = Juconfig['subResource'] || []; |
|
|
|
const index = resources.findIndex(item => item.path === it.path); |
|
|
|
const index = resources.findIndex(item => item.path === it.path); |
|
|
|
if (index !== -1) { |
|
|
|
if (index !== -1) { |
|
|
|