mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +00:00
File diff suppressed because one or more lines are too long
BIN
javascript/icon/zh.manhuadb.png
Normal file
BIN
javascript/icon/zh.manhuadb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.7 KiB |
@@ -7,7 +7,7 @@ const mangayomiSources = [{
|
|||||||
"typeSource": "single",
|
"typeSource": "single",
|
||||||
"isManga": true,
|
"isManga": true,
|
||||||
"isNsfw": false,
|
"isNsfw": false,
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"apiUrl": "",
|
"apiUrl": "",
|
||||||
"dateFormat": "",
|
"dateFormat": "",
|
||||||
"dateFormatLocale": "",
|
"dateFormatLocale": "",
|
||||||
@@ -149,6 +149,7 @@ const mangayomiSources = [{
|
|||||||
url: element.attr("href")
|
url: element.attr("href")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
chapters.reverse();
|
||||||
return {
|
return {
|
||||||
name: title,
|
name: title,
|
||||||
imageUrl: cover,
|
imageUrl: cover,
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ const mangayomiSources = [{
|
|||||||
"lang": "zh",
|
"lang": "zh",
|
||||||
"baseUrl": "https://www.manhuadb.com",
|
"baseUrl": "https://www.manhuadb.com",
|
||||||
"apiUrl": "",
|
"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",
|
"typeSource": "single",
|
||||||
"isManga": true,
|
"isManga": true,
|
||||||
"isNsfw": false,
|
"isNsfw": false,
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"dateFormat": "",
|
"dateFormat": "",
|
||||||
"dateFormatLocale": "",
|
"dateFormatLocale": "",
|
||||||
"pkgPath": "manga/src/zh/manhuadb.js"
|
"pkgPath": "manga/src/zh/manhuadb.js"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const mangayomiSources = [{
|
|||||||
"typeSource": "single",
|
"typeSource": "single",
|
||||||
"isManga": true,
|
"isManga": true,
|
||||||
"isNsfw": false,
|
"isNsfw": false,
|
||||||
"version": "0.0.1",
|
"version": "0.0.2",
|
||||||
"dateFormat": "",
|
"dateFormat": "",
|
||||||
"dateFormatLocale": "",
|
"dateFormatLocale": "",
|
||||||
"pkgPath": "manga/src/zh/manhuagui.js"
|
"pkgPath": "manga/src/zh/manhuagui.js"
|
||||||
@@ -117,6 +117,10 @@ const mangayomiSources = [{
|
|||||||
}
|
}
|
||||||
|
|
||||||
class DefaultExtension extends MProvider {
|
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) {
|
getHeaders(url) {
|
||||||
return {
|
return {
|
||||||
Referer: this.source.baseUrl
|
Referer: this.source.baseUrl
|
||||||
@@ -124,7 +128,7 @@ const mangayomiSources = [{
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getItems(url, p) {
|
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 doc = new Document(res.body);
|
||||||
const mangas = [];
|
const mangas = [];
|
||||||
const elements = doc.select(p);
|
const elements = doc.select(p);
|
||||||
@@ -173,14 +177,14 @@ const mangayomiSources = [{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const params = [locations, categories, reader, status];
|
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 {
|
} else {
|
||||||
return await this.getItems(`/s/${query}_p${page}.html`, "div.book-result li");
|
return await this.getItems(`/s/${query}_p${page}.html`, "div.book-result li");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async getDetail(url) {
|
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 doc = new Document(res.body);
|
||||||
const title = doc.selectFirst("div.book-title h1").text;
|
const title = doc.selectFirst("div.book-title h1").text;
|
||||||
const cover = "https:" + doc.selectFirst("p.hcover img").attr("src");
|
const cover = "https:" + doc.selectFirst("p.hcover img").attr("src");
|
||||||
@@ -204,16 +208,23 @@ const mangayomiSources = [{
|
|||||||
chapter_html = new Document(text);
|
chapter_html = new Document(text);
|
||||||
}
|
}
|
||||||
const ch_title = chapter_html.select("h4 span");
|
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;
|
var index = 0;
|
||||||
for (const chs of ch_title) {
|
for (const chs of ch_title) {
|
||||||
const t = chs.text;
|
const t = chs.text;
|
||||||
for (const ch of chapters[index].select("a.status0")) {
|
for (const ch of chapters[index].select("ul")) {
|
||||||
eps.push({
|
const ep_ = [];
|
||||||
name: `|${t}|` + ch.attr("title"),
|
for (const c of ch.select("a.status0")) {
|
||||||
url: ch.attr("href")
|
ep_.push({
|
||||||
|
name: `|${t}|` + c.attr("title"),
|
||||||
|
url: c.attr("href")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
ep_.reverse();
|
||||||
|
for (const e of ep_) {
|
||||||
|
eps.push(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
index = index + 1;
|
index = index + 1;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
@@ -230,7 +241,7 @@ const mangayomiSources = [{
|
|||||||
async getPageList(url) {
|
async getPageList(url) {
|
||||||
const preference = new SharedPreferences();
|
const preference = new SharedPreferences();
|
||||||
const image_host = preference.get("imghost");
|
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 datas = decode(res.body);
|
||||||
const imgs = [];
|
const imgs = [];
|
||||||
for (const data of datas["files"]) {
|
for (const data of datas["files"]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user