再漫画支持每日签到

This commit is contained in:
Ftbom
2025-11-07 18:46:06 +08:00
committed by GitHub
parent 0d3be98981
commit 933884e6ca
3 changed files with 38 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ class Ehentai extends ComicSource {
// unique id of the source
key = "ehentai"
version = "1.1.6"
version = "1.1.7"
minAppVersion = "1.5.3"
@@ -554,6 +554,7 @@ class Ehentai extends ComicSource {
favorites = {
// whether support multi folders
multiFolder: true,
singleFolderForSingleComic: true,
/**
* add or delete favorite.
* throw `Login expired` to indicate login expired, App will automatically re-login and re-add/delete favorite

View File

@@ -40,7 +40,7 @@
"name": "ehentai",
"fileName": "ehentai.js",
"key": "ehentai",
"version": "1.1.6"
"version": "1.1.7"
},
{
"name": "禁漫天堂",
@@ -90,7 +90,7 @@
"name": "再漫画",
"fileName": "zaimanhua.js",
"key": "zaimanhua",
"version": "1.0.1"
"version": "1.0.2"
},
{
"name": "漫画柜",

View File

@@ -2,7 +2,7 @@ class Zaimanhua extends ComicSource {
// 基础信息
name = "再漫画";
key = "zaimanhua";
version = "1.0.1";
version = "1.0.2";
minAppVersion = "1.0.0";
url =
"https://git.nyne.dev/nyne/venera-configs/raw/branch/main/zaimanhua.js";
@@ -16,8 +16,31 @@ class Zaimanhua extends ComicSource {
}
// 构建 URL
buildUrl(path) {
this.signTask();
return `https://v4api.zaimanhua.com/app/v1/${path}`;
}
// 每日签到
async signTask() {
if (!this.isLogged) {
return;
}
if (!this.loadSetting("signTask")) {
return;
}
const lastSign = this.loadData("lastSign");
const newTime = new Date().toISOString().split("T")[0];
if (lastSign == newTime) {
return;
}
const res = await Network.post("https://i.zaimanhua.com/lpi/v1/task/sign_in", this.headers);
if (res.status !== 200) {
return;
}
this.saveData("lastSign", newTime);
if (JSON.parse(res.body)["errno"] == 0) {
UI.showMessage("签到成功");
}
}
//账户管理
account = {
@@ -368,7 +391,8 @@ class Zaimanhua extends ComicSource {
},
loadEp: async (comicId, epId) => {
const res = await Network.get(
this.buildUrl(`comic/chapter/${comicId}/${epId}`)
this.buildUrl(`comic/chapter/${comicId}/${epId}`),
this.headers
);
const data = JSON.parse(res.body).data.data;
return { images: data.page_url_hd || data.page_url };
@@ -487,4 +511,12 @@ class Zaimanhua extends ComicSource {
return "ok";
},
};
settings = {
signTask: {
title: "每日签到",
type: "switch",
default: false
}
};
}