jm: fix domain api (#147)

This commit is contained in:
Pacalini
2025-09-01 20:43:04 +08:00
committed by GitHub
parent b6448c2055
commit edebc0c430
2 changed files with 17 additions and 17 deletions

View File

@@ -46,7 +46,7 @@
"name": "禁漫天堂", "name": "禁漫天堂",
"fileName": "jm.js", "fileName": "jm.js",
"key": "jm", "key": "jm",
"version": "1.2.1", "version": "1.2.2",
"description": "禁漫天堂漫畫源, 不能使用時請嘗試切換分流" "description": "禁漫天堂漫畫源, 不能使用時請嘗試切換分流"
}, },
{ {

32
jm.js
View File

@@ -7,22 +7,22 @@ class JM extends ComicSource {
// unique id of the source // unique id of the source
key = "jm" key = "jm"
version = "1.2.1" version = "1.2.2"
minAppVersion = "1.2.5" minAppVersion = "1.2.5"
static jmVersion = "2.0.1" static jmVersion = "2.0.6"
static jmPkgName = "com.example.app" static jmPkgName = "com.example.app"
// update url // update url
url = "https://git.nyne.dev/nyne/venera-configs/raw/branch/main/jm.js" url = "https://git.nyne.dev/nyne/venera-configs/raw/branch/main/jm.js"
static apiDomains = [ static fallbackServers = [
"www.cdnaspa.vip", "www.cdntwice.org",
"www.cdnaspa.club", "www.cdnsha.org",
"www.cdnplaystation6.vip", "www.cdnaspa.cc",
"www.cdnplaystation6.cc" "www.cdnntr.cc",
]; ];
static imageUrl = "https://cdn-msp.jmapinodeudzn.net" static imageUrl = "https://cdn-msp.jmapinodeudzn.net"
@@ -121,11 +121,11 @@ class JM extends ComicSource {
* @param showConfirmDialog {boolean} * @param showConfirmDialog {boolean}
*/ */
async refreshApiDomains(showConfirmDialog) { async refreshApiDomains(showConfirmDialog) {
let url = "https://jmapp03-1308024008.cos.ap-jakarta.myqcloud.com/server-2024.txt" let url = "https://rup4a04-c02.tos-cn-hongkong.bytepluses.com/newsvr-2025.txt"
let domainSecret = "diosfjckwpqpdfjkvnqQjsik" let domainSecret = "diosfjckwpqpdfjkvnqQjsik"
let title = "" let title = ""
let message = "" let message = ""
let jm3_Server = [] let servers = []
let domains = [] let domains = []
let res = await fetch( let res = await fetch(
url, url,
@@ -134,20 +134,20 @@ class JM extends ComicSource {
if (res.status === 200) { if (res.status === 200) {
let data = this.convertData(await res.text(), domainSecret) let data = this.convertData(await res.text(), domainSecret)
let json = JSON.parse(data) let json = JSON.parse(data)
if (json["jm3_Server"]) { if (json["Server"]) {
title = "Update Success" title = "Update Success"
message = "\n" message = "\n"
jm3_Server = json["jm3_Server"] servers = json["Server"].slice(0, 4)
} }
} }
if (jm3_Server.length === 0) { if (servers.length === 0) {
title = "Update Failed" title = "Update Failed"
message = `Using built-in domains:\n\n` message = `Using built-in domains:\n\n`
domains = JM.apiDomains servers = JM.fallbackServers
} }
for (let [domain, index] of jm3_Server) { for (let i = 0; i < servers.length; i++) {
message = message + `${index}: ${domain}\n` message = message + `線路${i + 1}: ${servers[i]}\n\n`
domains.push(domain) domains.push(servers[i])
} }
if (showConfirmDialog) { if (showConfirmDialog) {
UI.showDialog( UI.showDialog(