更新 'SrcJyPublic.js'

master
src48597962 4 months ago
parent 27d9ac314b
commit 68aec462cd
  1. 29
      SrcJyPublic.js

@ -921,7 +921,7 @@ function shareResource() {
}, Juconfig, it.path, cfgfile)
}else if(input=="上传"){
const hikerPop = $.require("http://hiker.nokia.press/hikerule/rulelist.json?id=6966");
let fruit = ["接口", "解析", "云盘", "直播"];
let fruit = ["接口", "解析", "云盘", "直播", "ghproxy"];
hikerPop.multiChoice({
title: "选择要上传分享同步的项",
options: fruit,
@ -938,6 +938,12 @@ function shareResource() {
let text = {};
options.forEach((option,i)=>{
if(checked[i]){
if(option=="ghproxy"){
let ghproxy = $.require('ghproxy').getproxy();
if(ghproxy.length>0){
text["ghproxy"] = ghproxy;
}
}else{
let filepath;
if(option=="接口"){
filepath = globalMap0.getVar('Jy_gmParams').jkfile;
@ -984,6 +990,7 @@ function shareResource() {
}
}
}
}
})
if(Object.keys(text).length==0){
return "toast://无内容分享";
@ -1207,9 +1214,7 @@ function updateResource(it,refresh) {
let livefilepath = globalMap0.getVar('Jy_gmParams').rulepath + "liveconfig.json";
let liveconfig = pastedata.直播;
if(it.mode!=2){
log(livefilepath);
let livefile = fetch(livefilepath);
log(livefile);
if(livefile){
try{
let olddata = JSON.parse(livefile).data;
@ -1224,7 +1229,7 @@ function updateResource(it,refresh) {
writeFile(livefilepath, JSON.stringify(liveconfig));
var sm = ",直播订阅已同步"
}catch(e){
log("增量导入直播失败>"+e.message);
//log("增量导入直播失败>"+e.message);
}
}
}else if(liveconfig.data){
@ -1238,6 +1243,22 @@ function updateResource(it,refresh) {
ypnum = yundisksave(ypdatalist, 1);
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'] || [];
const index = resources.findIndex(item => item.path === it.path);
if (index !== -1) {

Loading…
Cancel
Save