From b8a81c0105a4196c50610c30e1625c0e1a84fb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=92=E7=A0=82=E7=B3=96?= <90336521+lings03@users.noreply.github.com> Date: Tue, 27 May 2025 09:48:52 +0800 Subject: [PATCH] [copy_manga] Allow user to edit copyVersion (#73) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 干脆让这个也可以被手动改吧 --- copy_manga.js | 22 ++++++++++++++++------ index.json | 2 +- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/copy_manga.js b/copy_manga.js index 5431faf..1f7cab0 100644 --- a/copy_manga.js +++ b/copy_manga.js @@ -4,7 +4,7 @@ class CopyManga extends ComicSource { key = "copy_manga" - version = "1.1.6" + version = "1.1.7" minAppVersion = "1.2.1" @@ -12,7 +12,11 @@ class CopyManga extends ComicSource { headers = {} - static copyVersion = "2.3.0" + static defaultCopyVersion = "2.2.9" + + get copyVersion() { + return this.loadSetting('version') + } get apiUrl() { return `https://${this.loadSetting('base_url')}` @@ -26,13 +30,13 @@ class CopyManga extends ComicSource { token = " " + token; } this.headers = { - "User-Agent": "COPY/" + CopyManga.copyVersion, + "User-Agent": "COPY/" + this.copyVersion, "Accept": "*/*", "Accept-Encoding": "gzip", "source": "copyApp", "webp": "1", "region": "1", - "version": CopyManga.copyVersion, + "version": this.copyVersion, "authorization": `Token${token}`, "platform": "1", "umstring": "b4c89ca4104ea9a97750314d791520ac", @@ -61,13 +65,13 @@ class CopyManga extends ComicSource { let token = data.results.token this.saveData('token', token) this.headers = { - "User-Agent": "COPY/" + CopyManga.copyVersion, + "User-Agent": "COPY/" + this.copyVersion, "Accept": "*/*", "Accept-Encoding": "gzip", "source": "copyApp", "webp": "1", "region": "1", - "version": CopyManga.copyVersion, + "version": this.copyVersion, "authorization": `Token ${token}`, "platform": "1", "umstring": "b4c89ca4104ea9a97750314d791520ac", @@ -802,6 +806,12 @@ class CopyManga extends ComicSource { validator: '^(?!:\\/\\/)(?=.{1,253})([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$', default: 'www.copy20.com', }, + version: { + title: "拷贝版本(重启APP生效)", + type: "input", + validator: '^\\d+(?:\\.\\d+)*$', + default: CopyManga.defaultCopyVersion, + }, } /** diff --git a/index.json b/index.json index e890ed8..91adf89 100644 --- a/index.json +++ b/index.json @@ -3,7 +3,7 @@ "name": "拷贝漫画", "fileName": "copy_manga.js", "key": "copy_manga", - "version": "1.1.6" + "version": "1.1.7" }, { "name": "Komiic",