copy: update headers (#137)

This commit is contained in:
Pacalini
2025-08-18 21:12:51 +08:00
committed by GitHub
parent 170eb738b9
commit c281495cee
2 changed files with 16 additions and 10 deletions

View File

@@ -4,7 +4,7 @@ class CopyManga extends ComicSource {
key = "copy_manga" key = "copy_manga"
version = "1.3.6" version = "1.3.7"
minAppVersion = "1.2.1" minAppVersion = "1.2.1"
@@ -12,30 +12,36 @@ class CopyManga extends ComicSource {
get headers() { get headers() {
let token = this.loadData("token"); let token = this.loadData("token");
let secret = "M2FmMDg1OTAzMTEwMzJlZmUwNjYwNTUwYTA1NjNhNTM="
if (!token) { if (!token) {
token = ""; token = "";
} else { } else {
token = " " + token; token = " " + token;
} }
let now = new Date(Date.now());
let year = now.getFullYear(); let ts = Math.floor(Date.now() / 1000).toString()
let month = (now.getMonth() + 1).toString().padStart(2, '0'); let sig = Convert.hmacString(
let day = now.getDate().toString().padStart(2, '0'); Convert.decodeBase64(secret),
Convert.encodeUtf8(ts),
"sha256"
)
return { return {
"User-Agent": "COPY/2.3.2", "User-Agent": "COPY/3.0.0",
"source": "copyApp", "source": "copyApp",
"deviceinfo": this.deviceinfo, "deviceinfo": this.deviceinfo,
"dt": `${year}.${month}.${day}`,
"platform": "3", "platform": "3",
"referer": `com.copymanga.app-2.3.2`, "referer": `com.copymanga.app-3.0.0`,
"version": "2.3.2", "version": "3.0.0",
"device": this.device, "device": this.device,
"pseudoid": this.pseudoid, "pseudoid": this.pseudoid,
"Accept": "application/json", "Accept": "application/json",
"region": this.copyRegion, "region": this.copyRegion,
"authorization": `Token${token}`, "authorization": `Token${token}`,
"umstring": "b4c89ca4104ea9a97750314d791520ac", "umstring": "b4c89ca4104ea9a97750314d791520ac",
"x-auth-timestamp": ts,
"x-auth-signature": sig,
} }
} }

View File

@@ -3,7 +3,7 @@
"name": "拷贝漫画", "name": "拷贝漫画",
"fileName": "copy_manga.js", "fileName": "copy_manga.js",
"key": "copy_manga", "key": "copy_manga",
"version": "1.3.6" "version": "1.3.7"
}, },
{ {
"name": "Komiic", "name": "Komiic",