|
|
@ -39,8 +39,9 @@ function getDatas(lx, isyx) { |
|
|
|
} |
|
|
|
} |
|
|
|
}else if(getItem('sourceMode','1')=='2'){ |
|
|
|
}else if(getItem('sourceMode','1')=='2'){ |
|
|
|
if(Juconfig['dySource']){ |
|
|
|
if(Juconfig['dySource']){ |
|
|
|
let input = Juconfig['dySource']; |
|
|
|
let dySource = Juconfig['dySource']; |
|
|
|
if(input.startsWith('http')){ |
|
|
|
let input; |
|
|
|
|
|
|
|
if(dySource.startsWith('http')){ |
|
|
|
let dyJkTmpFile = "hiker://files/_cache/"+md5(Juconfig['dySource'])+".json"; |
|
|
|
let dyJkTmpFile = "hiker://files/_cache/"+md5(Juconfig['dySource'])+".json"; |
|
|
|
if(!fileExist(dyJkTmpFile)){ |
|
|
|
if(!fileExist(dyJkTmpFile)){ |
|
|
|
let contnet = getJkContnet(Juconfig['dySource']); |
|
|
|
let contnet = getJkContnet(Juconfig['dySource']); |
|
|
@ -49,8 +50,10 @@ function getDatas(lx, isyx) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
input = dyJkTmpFile; |
|
|
|
input = dyJkTmpFile; |
|
|
|
}else if(!input.startsWith('file://')){ |
|
|
|
}else if(!dySource.startsWith('file://')){ |
|
|
|
input = ''; |
|
|
|
input = ''; |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
input = dySource; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(fileExist(input)){ |
|
|
|
if(fileExist(input)){ |
|
|
@ -75,15 +78,13 @@ function getDatas(lx, isyx) { |
|
|
|
}else if(/drpy2/.test(obj.api) && obj.type==3){ |
|
|
|
}else if(/drpy2/.test(obj.api) && obj.type==3){ |
|
|
|
let extfile = obj.ext; |
|
|
|
let extfile = obj.ext; |
|
|
|
if(extfile.startsWith('./')){ |
|
|
|
if(extfile.startsWith('./')){ |
|
|
|
extfile = input.substr(0, input.lastIndexOf('/')+1) + extfile.replace("./",""); |
|
|
|
extfile = dySource.substr(0, dySource.lastIndexOf('/')+1) + extfile.replace("./",""); |
|
|
|
} |
|
|
|
} |
|
|
|
log(extfile); |
|
|
|
|
|
|
|
let urlfile; |
|
|
|
let urlfile; |
|
|
|
if(input.startsWith('file://')){ |
|
|
|
if(dySource.startsWith('file://')){ |
|
|
|
urlfile = 'hiker://files/' + extfile.split('/files/Documents/')[1]; |
|
|
|
urlfile = 'hiker://files/' + extfile.split('/files/Documents/')[1]; |
|
|
|
}else if(input.startsWith('http')){ |
|
|
|
}else if(dySource.startsWith('http')){ |
|
|
|
try{ |
|
|
|
try{ |
|
|
|
log('进来'); |
|
|
|
|
|
|
|
let content = fetch(extfile, {timeout:2000}); |
|
|
|
let content = fetch(extfile, {timeout:2000}); |
|
|
|
if (content == '') { |
|
|
|
if (content == '') { |
|
|
|
urlfile = ''; |
|
|
|
urlfile = ''; |
|
|
@ -95,7 +96,6 @@ function getDatas(lx, isyx) { |
|
|
|
log(obj.name + 'ext文件缓存失败>' + e.message); |
|
|
|
log(obj.name + 'ext文件缓存失败>' + e.message); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
log(urlfile); |
|
|
|
|
|
|
|
if(urlfile){ |
|
|
|
if(urlfile){ |
|
|
|
arr = { "name": obj.name, "url": urlfile, "type": "hipy_t3", "ext": extfile}; |
|
|
|
arr = { "name": obj.name, "url": urlfile, "type": "hipy_t3", "ext": extfile}; |
|
|
|
if(arr.name.includes('[搜]')){ |
|
|
|
if(arr.name.includes('[搜]')){ |
|
|
|