jm: update version code, domain and UA (#36)

ref: https://goo.gle/4fZkFiE
This commit is contained in:
Pacalini
2025-01-14 15:48:25 +08:00
committed by GitHub
parent 6f69bc47a6
commit 36f133355b
2 changed files with 35 additions and 5 deletions

38
jm.js
View File

@@ -7,7 +7,7 @@ class JM extends ComicSource {
// unique id of the source
key = "jm"
version = "1.0.1"
version = "1.0.2"
minAppVersion = "1.0.2"
@@ -18,7 +18,7 @@ class JM extends ComicSource {
"https://www.jmapiproxyxxx.vip",
"https://www.cdnblackmyth.club",
"https://www.cdnmhws.cc",
"https://www.cdnxxx-proxy.co"
"https://www.cdnmhwscc.org"
];
static imageUrls = [
@@ -28,6 +28,10 @@ class JM extends ComicSource {
"https://cdn-msp3.jmapiproxy3.cc",
];
static apiUa = "Mozilla/5.0 (Linux; Android 10; K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/130.0.0.0 Mobile Safari/537.36"
static imgUa = "okhttp/3.12.1"
get baseUrl() {
let index = parseInt(this.loadSetting('apiDomain')) - 1
return JM.apiDomains[index]
@@ -43,6 +47,14 @@ class JM extends ComicSource {
return JM.imageUrls[index]
}
get apiUa() {
return JM.apiUa;
}
get imgUa() {
return JM.imgUa;
}
getCoverUrl(id) {
return `${this.imageUrl}/media/albums/${id}_3x4.jpg`
}
@@ -84,14 +96,15 @@ class JM extends ComicSource {
}
getHeaders(time) {
const jmVersion = "1.7.5"
const jmVersion = "1.7.6"
const jmAuthKey = "18comicAPPContent"
let token = Convert.md5(Convert.encodeUtf8(`${time}${jmAuthKey}`))
return {
"token": Convert.hexEncode(token),
"tokenparam": `${time},${jmVersion}`,
"accept-encoding": "gzip",
"Accept-Encoding": "gzip",
"User-Agent": this.apiUa,
}
}
@@ -503,6 +516,10 @@ class JM extends ComicSource {
return {}
}
return {
headers: {
"Accept-Encoding": "gzip",
"User-Agent": this.imgUa,
},
modifyImage: `
let modifyImage = (image) => {
const num = ${num}
@@ -530,6 +547,19 @@ class JM extends ComicSource {
`,
}
},
/**
* [Optional] provide configs for a thumbnail loading
* @param url {string}
* @returns {{}}
*/
onThumbnailLoad: (url) => {
return {
headers: {
"Accept-Encoding": "gzip",
"User-Agent": this.imgUa,
}
}
},
/**
* [Optional] load comments
* @param comicId {string}