mirror of
https://github.com/kodjodevf/mangayomi-extensions.git
synced 2026-02-14 10:51:17 +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": "",
|
"dateFormat": "",
|
||||||
"dateFormatLocale": "",
|
"dateFormatLocale": "",
|
||||||
"pkgName": "manga/src/zh/77mh.js"
|
"pkgName": "manga/src/zh/77mh.js"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
class DefaultExtension extends MProvider {
|
class DefaultExtension extends MProvider {
|
||||||
StringResolve1(p, a, c, k, e, d) {
|
StringResolve1(p, a, c, k, e, d) {
|
||||||
e = function(c) {
|
e = function(c) {
|
||||||
return c.toString(36)
|
return c.toString(36)
|
||||||
@@ -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,7 +3,7 @@ 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,
|
||||||
@@ -11,9 +11,9 @@ const mangayomiSources = [{
|
|||||||
"dateFormat": "",
|
"dateFormat": "",
|
||||||
"dateFormatLocale": "",
|
"dateFormatLocale": "",
|
||||||
"pkgPath": "manga/src/zh/manhuadb.js"
|
"pkgPath": "manga/src/zh/manhuadb.js"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
class DefaultExtension extends MProvider {
|
class DefaultExtension extends MProvider {
|
||||||
base64decode(str) {
|
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 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;
|
var c1, c2, c3, c4;
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ const mangayomiSources = [{
|
|||||||
"dateFormat": "",
|
"dateFormat": "",
|
||||||
"dateFormatLocale": "",
|
"dateFormatLocale": "",
|
||||||
"pkgPath": "manga/src/zh/manhuagui.js"
|
"pkgPath": "manga/src/zh/manhuagui.js"
|
||||||
}];
|
}];
|
||||||
|
|
||||||
LZString = function() {
|
LZString = function() {
|
||||||
function o(o, r) {
|
function o(o, r) {
|
||||||
if (!t[o]) {
|
if (!t[o]) {
|
||||||
t[o] = {};
|
t[o] = {};
|
||||||
@@ -82,9 +82,9 @@ const mangayomiSources = [{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return i
|
return i
|
||||||
}();
|
}();
|
||||||
|
|
||||||
function decode(text) {
|
function decode(text) {
|
||||||
function packed(functionStr, a, c, data) {
|
function packed(functionStr, a, c, data) {
|
||||||
function e(c) {
|
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));
|
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|\+|\/|=]*)\'.*$/);
|
const m = text.match(/^.*\}\(\'(.*)\',(\d*),(\d*),\'([\w|\+|\/|=]*)\'.*$/);
|
||||||
return packed(m[1], parseInt(m[2]), parseInt(m[3]), LZString.decompressFromBase64(m[4]).split('|'));
|
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) {
|
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