This commit is contained in:
Ftbom
2024-05-04 14:11:32 +00:00
parent fade24ed1a
commit 9504fead9c
4 changed files with 1465 additions and 1453 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@@ -149,6 +149,7 @@ const mangayomiSources = [{
url: element.attr("href")
});
}
chapters.reverse();
return {
name: title,
imageUrl: cover,

View File

@@ -3,7 +3,7 @@ const mangayomiSources = [{
"lang": "zh",
"baseUrl": "https://www.manhuadb.com",
"apiUrl": "",
"iconUrl": "https://www.manhuadb.com/assets/www/img/favicon.png",
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.manhuadb.png",
"typeSource": "single",
"isManga": true,
"isNsfw": false,

View File

@@ -117,6 +117,10 @@ const mangayomiSources = [{
}
class DefaultExtension extends MProvider {
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
};
getHeaders(url) {
return {
Referer: this.source.baseUrl
@@ -124,7 +128,7 @@ const mangayomiSources = [{
}
async getItems(url, p) {
const res = await new Client().get(this.source.baseUrl + url);
const res = await new Client().get(this.source.baseUrl + url, this.headers);
const doc = new Document(res.body);
const mangas = [];
const elements = doc.select(p);
@@ -173,14 +177,14 @@ const mangayomiSources = [{
}
}
const params = [locations, categories, reader, status];
return await this.getItems(`/list${"/"+params.filter(item => item != "").join("_")}/update_p${page}.html`, "ul#contList li");
return await this.getItems(`/list${"/"+params.filter(item => item != "").join("_")}/${sort}_p${page}.html`, "ul#contList li");
} else {
return await this.getItems(`/s/${query}_p${page}.html`, "div.book-result li");
}
}
async getDetail(url) {
const res = await new Client().get(this.source.baseUrl + url);
const res = await new Client().get(this.source.baseUrl + url, this.headers);
const doc = new Document(res.body);
const title = doc.selectFirst("div.book-title h1").text;
const cover = "https:" + doc.selectFirst("p.hcover img").attr("src");
@@ -204,16 +208,23 @@ const mangayomiSources = [{
chapter_html = new Document(text);
}
const ch_title = chapter_html.select("h4 span");
const chapters = chapter_html.select("div#chapter-list-0")
const chapters = chapter_html.select("div.chapter-list")
var index = 0;
for (const chs of ch_title) {
const t = chs.text;
for (const ch of chapters[index].select("a.status0")) {
eps.push({
name: `|${t}|` + ch.attr("title"),
url: ch.attr("href")
for (const ch of chapters[index].select("ul")) {
const ep_ = [];
for (const c of ch.select("a.status0")) {
ep_.push({
name: `|${t}|` + c.attr("title"),
url: c.attr("href")
});
}
ep_.reverse();
for (const e of ep_) {
eps.push(e);
}
}
index = index + 1;
}
return {
@@ -230,7 +241,7 @@ const mangayomiSources = [{
async getPageList(url) {
const preference = new SharedPreferences();
const image_host = preference.get("imghost");
const res = await new Client().get(this.source.baseUrl + url);
const res = await new Client().get(this.source.baseUrl + url, this.headers);
const datas = decode(res.body);
const imgs = [];
for (const data of datas["files"]) {