From d5e96c3b58d1d7aef0a9e2361909ffcedd716f98 Mon Sep 17 00:00:00 2001 From: src48597962 <48597962@qq.com> Date: Tue, 9 Jul 2024 22:45:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'SrcJyPublic.js'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SrcJyPublic.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SrcJyPublic.js b/SrcJyPublic.js index 801307a4..a665a27d 100644 --- a/SrcJyPublic.js +++ b/SrcJyPublic.js @@ -39,8 +39,9 @@ function getDatas(lx, isyx) { } }else if(getItem('sourceMode','1')=='2'){ if(Juconfig['dySource']){ - let input = Juconfig['dySource']; - if(input.startsWith('http')){ + let dySource = Juconfig['dySource']; + let input; + if(dySource.startsWith('http')){ let dyJkTmpFile = "hiker://files/_cache/"+md5(Juconfig['dySource'])+".json"; if(!fileExist(dyJkTmpFile)){ let contnet = getJkContnet(Juconfig['dySource']); @@ -49,8 +50,10 @@ function getDatas(lx, isyx) { } } input = dyJkTmpFile; - }else if(!input.startsWith('file://')){ + }else if(!dySource.startsWith('file://')){ input = ''; + }else{ + input = dySource; } if(fileExist(input)){ @@ -75,15 +78,13 @@ function getDatas(lx, isyx) { }else if(/drpy2/.test(obj.api) && obj.type==3){ let extfile = obj.ext; 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; - if(input.startsWith('file://')){ + if(dySource.startsWith('file://')){ urlfile = 'hiker://files/' + extfile.split('/files/Documents/')[1]; - }else if(input.startsWith('http')){ + }else if(dySource.startsWith('http')){ try{ - log('进来'); let content = fetch(extfile, {timeout:2000}); if (content == '') { urlfile = ''; @@ -95,7 +96,6 @@ function getDatas(lx, isyx) { log(obj.name + 'ext文件缓存失败>' + e.message); } } - log(urlfile); if(urlfile){ arr = { "name": obj.name, "url": urlfile, "type": "hipy_t3", "ext": extfile}; if(arr.name.includes('[搜]')){