mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-16 03:40:30 +00:00
fix bugs
This commit is contained in:
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 |
@@ -12,9 +12,9 @@ const mangayomiSources = [{
|
||||
"dateFormat": "",
|
||||
"dateFormatLocale": "",
|
||||
"pkgName": "manga/src/zh/77mh.js"
|
||||
}];
|
||||
}];
|
||||
|
||||
class DefaultExtension extends MProvider {
|
||||
class DefaultExtension extends MProvider {
|
||||
StringResolve1(p, a, c, k, e, d) {
|
||||
e = function(c) {
|
||||
return c.toString(36)
|
||||
@@ -149,6 +149,7 @@ const mangayomiSources = [{
|
||||
url: element.attr("href")
|
||||
});
|
||||
}
|
||||
chapters.reverse();
|
||||
return {
|
||||
name: title,
|
||||
imageUrl: cover,
|
||||
|
||||
@@ -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,
|
||||
@@ -11,9 +11,9 @@ const mangayomiSources = [{
|
||||
"dateFormat": "",
|
||||
"dateFormatLocale": "",
|
||||
"pkgPath": "manga/src/zh/manhuadb.js"
|
||||
}];
|
||||
}];
|
||||
|
||||
class DefaultExtension extends MProvider {
|
||||
class DefaultExtension extends MProvider {
|
||||
base64decode(str) {
|
||||
var base64DecodeChars = new Array(-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1);
|
||||
var c1, c2, c3, c4;
|
||||
|
||||
@@ -11,9 +11,9 @@ const mangayomiSources = [{
|
||||
"dateFormat": "",
|
||||
"dateFormatLocale": "",
|
||||
"pkgPath": "manga/src/zh/manhuagui.js"
|
||||
}];
|
||||
}];
|
||||
|
||||
LZString = function() {
|
||||
LZString = function() {
|
||||
function o(o, r) {
|
||||
if (!t[o]) {
|
||||
t[o] = {};
|
||||
@@ -82,9 +82,9 @@ const mangayomiSources = [{
|
||||
}
|
||||
};
|
||||
return i
|
||||
}();
|
||||
}();
|
||||
|
||||
function decode(text) {
|
||||
function decode(text) {
|
||||
function packed(functionStr, a, c, data) {
|
||||
function e(c) {
|
||||
return String(c < a ? '' : e(Math.floor(c / a))) + String((c % a > 35) ? String.fromCharCode(c % a + 29) : tr(c % a, 36));
|
||||
@@ -114,9 +114,13 @@ const mangayomiSources = [{
|
||||
}
|
||||
const m = text.match(/^.*\}\(\'(.*)\',(\d*),(\d*),\'([\w|\+|\/|=]*)\'.*$/);
|
||||
return packed(m[1], parseInt(m[2]), parseInt(m[3]), LZString.decompressFromBase64(m[4]).split('|'));
|
||||
}
|
||||
}
|
||||
|
||||
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"
|
||||
};
|
||||
|
||||
class DefaultExtension extends MProvider {
|
||||
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"]) {
|
||||
|
||||
Reference in New Issue
Block a user