From 5f617b94da8df5699b359f7d548110795c89793d Mon Sep 17 00:00:00 2001 From: Dahi <81472122+dahisea@users.noreply.github.com> Date: Sun, 5 Oct 2025 16:13:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=A6=81=E6=BC=AB=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E6=BA=90fallback=20(#163)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在远程源res添加了try,防止目标访问不了直接抛弃而无法进入fallback --- jm.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/jm.js b/jm.js index 90bf9a3..d7f6238 100644 --- a/jm.js +++ b/jm.js @@ -7,11 +7,11 @@ class JM extends ComicSource { // unique id of the source key = "jm" - version = "1.3.0" + version = "1.3.1" minAppVersion = "1.5.0" - static jmVersion = "2.0.6" + static jmVersion = "2.0.11" static jmPkgName = "com.example.app" @@ -127,11 +127,13 @@ class JM extends ComicSource { let message = "" let servers = [] let domains = [] - let res = await fetch( - url, - {headers: this.baseHeaders} - ) - if (res.status === 200) { + let res = null; + try { + res = await fetch(url, { headers: this.baseHeaders }); + } catch (error) { + res = null; + } + if (res && res.status === 200) { let data = this.convertData(await res.text(), domainSecret) let json = JSON.parse(data) if (json["Server"]) {