mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-12-16 09:21:16 +00:00
[manhuagui] Fixed the issue of some uncategorized manga chapters. (#199)
This commit is contained in:
@@ -96,7 +96,7 @@
|
|||||||
"name": "漫画柜",
|
"name": "漫画柜",
|
||||||
"fileName": "manhuagui.js",
|
"fileName": "manhuagui.js",
|
||||||
"key": "ManHuaGui",
|
"key": "ManHuaGui",
|
||||||
"version": "1.2.0"
|
"version": "1.2.1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "漫蛙吧",
|
"name": "漫蛙吧",
|
||||||
|
|||||||
36
manhuagui.js
36
manhuagui.js
@@ -4,7 +4,7 @@ class ManHuaGui extends ComicSource {
|
|||||||
|
|
||||||
key = "ManHuaGui";
|
key = "ManHuaGui";
|
||||||
|
|
||||||
version = "1.2.0";
|
version = "1.2.1";
|
||||||
|
|
||||||
minAppVersion = "1.4.0";
|
minAppVersion = "1.4.0";
|
||||||
|
|
||||||
@@ -934,10 +934,14 @@ class ManHuaGui extends ComicSource {
|
|||||||
// 查找所有章节分组标题
|
// 查找所有章节分组标题
|
||||||
let chapterGroups = chapterDocument.querySelectorAll(".chapter h4 span");
|
let chapterGroups = chapterDocument.querySelectorAll(".chapter h4 span");
|
||||||
if (chapterGroups.length === 0) {
|
if (chapterGroups.length === 0) {
|
||||||
|
let docGroups = document.querySelectorAll(".chapter h4 span");
|
||||||
|
if (docGroups.length > 0) {
|
||||||
chapterDocument = document;
|
chapterDocument = document;
|
||||||
chapterGroups = chapterDocument.querySelectorAll(".chapter h4 span");
|
chapterGroups = docGroups;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (chapterGroups.length > 0) {
|
||||||
// 处理每个分组
|
// 处理每个分组
|
||||||
for (let i = 0; i < chapterGroups.length; i++) {
|
for (let i = 0; i < chapterGroups.length; i++) {
|
||||||
let groupName = chapterGroups[i].text.trim();
|
let groupName = chapterGroups[i].text.trim();
|
||||||
@@ -958,6 +962,34 @@ class ManHuaGui extends ComicSource {
|
|||||||
chaptersMap.set(groupName, groupChapters);
|
chaptersMap.set(groupName, groupChapters);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 没有分组标题的情况,直接查找章节列表
|
||||||
|
let chapterLists = chapterDocument.querySelectorAll(".chapter-list");
|
||||||
|
if (chapterLists.length === 0 && chapterDocument !== document) {
|
||||||
|
chapterDocument = document;
|
||||||
|
chapterLists = chapterDocument.querySelectorAll(".chapter-list");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (chapterLists.length > 0) {
|
||||||
|
let groupName = "连载";
|
||||||
|
let groupChapters = new Map();
|
||||||
|
|
||||||
|
for (let chapterList of chapterLists) {
|
||||||
|
let lis = chapterList.querySelectorAll("li");
|
||||||
|
for (let li of lis) {
|
||||||
|
let a = li.querySelector("a");
|
||||||
|
if (a) {
|
||||||
|
let id = a.attributes["href"].split("/").pop().replace(".html", "");
|
||||||
|
let title = a.querySelector("span").text.trim();
|
||||||
|
groupChapters.set(id, title);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
groupChapters = new Map([...groupChapters].sort((a, b) => a[0] - b[0]));
|
||||||
|
chaptersMap.set(groupName, groupChapters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let chapters;
|
let chapters;
|
||||||
if (this.isAppVersionAfter && this.isAppVersionAfter("1.3.0")) {
|
if (this.isAppVersionAfter && this.isAppVersionAfter("1.3.0")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user