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 |
@@ -1,258 +1,259 @@
|
|||||||
const mangayomiSources = [{
|
const mangayomiSources = [{
|
||||||
"name": "新新漫画",
|
"name": "新新漫画",
|
||||||
"lang": "zh",
|
"lang": "zh",
|
||||||
"baseUrl": "https://www.77mh.nl",
|
"baseUrl": "https://www.77mh.nl",
|
||||||
"apiUrl": "",
|
"apiUrl": "",
|
||||||
"iconUrl": "https://www.77mh.nl/favicon.ico",
|
"iconUrl": "https://www.77mh.nl/favicon.ico",
|
||||||
"typeSource": "single",
|
"typeSource": "single",
|
||||||
"isManga": true,
|
"isManga": true,
|
||||||
"isNsfw": false,
|
"isNsfw": false,
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"apiUrl": "",
|
"apiUrl": "",
|
||||||
"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)
|
||||||
};
|
};
|
||||||
if (!''.replace(/^/, String)) {
|
if (!''.replace(/^/, String)) {
|
||||||
while (c--) {
|
|
||||||
d[c.toString(a)] = k[c] || c.toString(a)
|
|
||||||
}
|
|
||||||
k = [function(e) {
|
|
||||||
return d[e]
|
|
||||||
}];
|
|
||||||
e = function() {
|
|
||||||
return '\\w+'
|
|
||||||
};
|
|
||||||
c = 1
|
|
||||||
};
|
|
||||||
while (c--) {
|
while (c--) {
|
||||||
if (k[c]) {
|
d[c.toString(a)] = k[c] || c.toString(a)
|
||||||
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
|
}
|
||||||
}
|
k = [function(e) {
|
||||||
|
return d[e]
|
||||||
|
}];
|
||||||
|
e = function() {
|
||||||
|
return '\\w+'
|
||||||
|
};
|
||||||
|
c = 1
|
||||||
|
};
|
||||||
|
while (c--) {
|
||||||
|
if (k[c]) {
|
||||||
|
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
|
||||||
}
|
}
|
||||||
return p
|
|
||||||
}
|
}
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
StringResolve2(p, a, c, k, e, d) {
|
StringResolve2(p, a, c, k, e, d) {
|
||||||
e = function(c) {
|
e = function(c) {
|
||||||
return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
|
return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
|
||||||
};
|
};
|
||||||
if (!''.replace(/^/, String)) {
|
if (!''.replace(/^/, String)) {
|
||||||
while (c--) {
|
|
||||||
d[e(c)] = k[c] || e(c)
|
|
||||||
}
|
|
||||||
k = [function(e) {
|
|
||||||
return d[e]
|
|
||||||
}];
|
|
||||||
e = function() {
|
|
||||||
return '\\w+'
|
|
||||||
};
|
|
||||||
c = 1
|
|
||||||
};
|
|
||||||
while (c--) {
|
while (c--) {
|
||||||
if (k[c]) {
|
d[e(c)] = k[c] || e(c)
|
||||||
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return p
|
k = [function(e) {
|
||||||
}
|
return d[e]
|
||||||
|
}];
|
||||||
async getIndex1(url) {
|
e = function() {
|
||||||
const res = await new Client().get(url);
|
return '\\w+'
|
||||||
const doc = new Document(res.body);
|
|
||||||
const elements = doc.select("div.ar_list_co li");
|
|
||||||
const mangas = [];
|
|
||||||
for (const element of elements) {
|
|
||||||
const title = element.selectFirst("span a").text;
|
|
||||||
const url = element.selectFirst("span a").attr("href");
|
|
||||||
const cover = element.selectFirst("img").attr("src");
|
|
||||||
mangas.push({
|
|
||||||
name: title,
|
|
||||||
link: url,
|
|
||||||
imageUrl: cover
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
list: mangas,
|
|
||||||
hasNextPage: true
|
|
||||||
};
|
};
|
||||||
|
c = 1
|
||||||
}
|
};
|
||||||
|
while (c--) {
|
||||||
async getIndex2(url) {
|
if (k[c]) {
|
||||||
const res = await new Client().get(url);
|
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
|
||||||
const doc = new Document(res.body);
|
|
||||||
const elements = doc.select("div.ar_list_co dl");
|
|
||||||
const mangas = [];
|
|
||||||
for (const element of elements) {
|
|
||||||
const title = element.selectFirst("h1 a").text.replace("<em>", "").replace("</em>", "");
|
|
||||||
const url = element.selectFirst("h1 a").attr("href");
|
|
||||||
const cover = element.selectFirst("img").attr("src");
|
|
||||||
mangas.push({
|
|
||||||
name: title,
|
|
||||||
link: url,
|
|
||||||
imageUrl: cover
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return {
|
|
||||||
list: mangas,
|
|
||||||
hasNextPage: true
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
async getPopular(page) {
|
async getIndex1(url) {
|
||||||
return await this.getIndex1(this.source.baseUrl + "/new_coc.html");
|
const res = await new Client().get(url);
|
||||||
}
|
const doc = new Document(res.body);
|
||||||
|
const elements = doc.select("div.ar_list_co li");
|
||||||
async getLatestUpdates(page) {
|
const mangas = [];
|
||||||
return await this.getIndex1(`${this.source.baseUrl}/lianzai/index_${page - 1}.html`);
|
for (const element of elements) {
|
||||||
}
|
const title = element.selectFirst("span a").text;
|
||||||
|
const url = element.selectFirst("span a").attr("href");
|
||||||
async search(query, page, filters) {
|
const cover = element.selectFirst("img").attr("src");
|
||||||
var url;
|
mangas.push({
|
||||||
if (query == "") {
|
|
||||||
url = `${this.source.baseUrl}${filters[0]["values"][filters[0]["state"]]["value"]}/index_${page-1}.html`
|
|
||||||
} else {
|
|
||||||
url = `${this.source.baseUrl.replace("www","so")}/k.php?k=${query}&p=${page}`;
|
|
||||||
}
|
|
||||||
return await this.getIndex2(url);
|
|
||||||
}
|
|
||||||
|
|
||||||
async getDetail(url) {
|
|
||||||
const res = await new Client().get(this.source.baseUrl + url);
|
|
||||||
const doc = new Document(res.body);
|
|
||||||
const info = doc.selectFirst("div.ar_list_coc");
|
|
||||||
const cover = info.selectFirst("img").attr("src");
|
|
||||||
const title = info.selectFirst("h1").text;
|
|
||||||
const info_other = info.selectFirst("ul.ar_list_coc");
|
|
||||||
const author = info_other.selectFirst("a").text;
|
|
||||||
const status_str = info_other.select("a")[1].text;
|
|
||||||
var status;
|
|
||||||
if (status_str == "已完结") {
|
|
||||||
status = 1;
|
|
||||||
} else {
|
|
||||||
status = 0;
|
|
||||||
}
|
|
||||||
const desc = info.selectFirst("i#det").text;
|
|
||||||
const elements = doc.select("ul.ar_rlos_bor li a");
|
|
||||||
const chapters = [];
|
|
||||||
for (const element of elements) {
|
|
||||||
chapters.push({
|
|
||||||
name: element.text,
|
|
||||||
url: element.attr("href")
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
name: title,
|
name: title,
|
||||||
imageUrl: cover,
|
link: url,
|
||||||
description: desc,
|
imageUrl: cover
|
||||||
author: author,
|
});
|
||||||
status: status,
|
|
||||||
episodes: chapters
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
return {
|
||||||
|
list: mangas,
|
||||||
|
hasNextPage: true
|
||||||
|
};
|
||||||
|
|
||||||
async getPageList(url) {
|
}
|
||||||
const preference = new SharedPreferences();
|
|
||||||
const image_host = preference.get("imghost");
|
async getIndex2(url) {
|
||||||
const res = await new Client().get(this.source.baseUrl + url);
|
const res = await new Client().get(url);
|
||||||
const strs = res.body.match(/return p}\('(.*?)'.split\('/)[1].split(',');
|
const doc = new Document(res.body);
|
||||||
var result;
|
const elements = doc.select("div.ar_list_co dl");
|
||||||
try {
|
const mangas = [];
|
||||||
result = this.StringResolve1(strs[0], strs[1], strs[2], strs[3].split('|'), 0, {}).replaceAll("'", "");
|
for (const element of elements) {
|
||||||
} catch {
|
const title = element.selectFirst("h1 a").text.replace("<em>", "").replace("</em>", "");
|
||||||
result = this.StringResolve2(strs[0], strs[1], strs[2], strs[3].split('|'), 0, {}).replaceAll("'", "");
|
const url = element.selectFirst("h1 a").attr("href");
|
||||||
}
|
const cover = element.selectFirst("img").attr("src");
|
||||||
const url_part = result.match(/var img_s=(.*?);var preLink_b/)[1];
|
mangas.push({
|
||||||
const urls = result.match(/var msg=(.*?);var maxPage/)[1].replaceAll("\\", "").split('|');
|
name: title,
|
||||||
const pages = [];
|
link: url,
|
||||||
for (const url of urls) {
|
imageUrl: cover
|
||||||
pages.push(image_host + `/h${url_part}/` + url);
|
});
|
||||||
}
|
|
||||||
return pages;
|
|
||||||
}
|
}
|
||||||
|
return {
|
||||||
|
list: mangas,
|
||||||
|
hasNextPage: true
|
||||||
|
};
|
||||||
|
|
||||||
getFilterList() {
|
}
|
||||||
return [{
|
|
||||||
type: "category",
|
async getPopular(page) {
|
||||||
name: "分类",
|
return await this.getIndex1(this.source.baseUrl + "/new_coc.html");
|
||||||
type_name: "SelectFilter",
|
}
|
||||||
values: [{
|
|
||||||
value: "/rexue",
|
async getLatestUpdates(page) {
|
||||||
name: "热血机战",
|
return await this.getIndex1(`${this.source.baseUrl}/lianzai/index_${page - 1}.html`);
|
||||||
type_name: "SelectOption"
|
}
|
||||||
},
|
|
||||||
{
|
async search(query, page, filters) {
|
||||||
value: "/kehuan",
|
var url;
|
||||||
name: "科幻未来",
|
if (query == "") {
|
||||||
type_name: "SelectOption"
|
url = `${this.source.baseUrl}${filters[0]["values"][filters[0]["state"]]["value"]}/index_${page-1}.html`
|
||||||
},
|
} else {
|
||||||
{
|
url = `${this.source.baseUrl.replace("www","so")}/k.php?k=${query}&p=${page}`;
|
||||||
value: "/kongbu",
|
|
||||||
name: "恐怖惊悚",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/xuanyi",
|
|
||||||
name: "推理悬疑",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/gaoxiao",
|
|
||||||
name: "滑稽搞笑",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/love",
|
|
||||||
name: "恋爱生活",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/danmei",
|
|
||||||
name: "耽美人生",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/tiyu",
|
|
||||||
name: "体育竞技",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/chunqing",
|
|
||||||
name: "纯情少女",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/qihuan",
|
|
||||||
name: "魔法奇幻",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
value: "/wuxia",
|
|
||||||
name: "武侠经典",
|
|
||||||
type_name: "SelectOption"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
|
return await this.getIndex2(url);
|
||||||
|
}
|
||||||
|
|
||||||
getSourcePreferences() {
|
async getDetail(url) {
|
||||||
return [{
|
const res = await new Client().get(this.source.baseUrl + url);
|
||||||
"key": "imghost",
|
const doc = new Document(res.body);
|
||||||
"listPreference": {
|
const info = doc.selectFirst("div.ar_list_coc");
|
||||||
"title": "图片服务器",
|
const cover = info.selectFirst("img").attr("src");
|
||||||
"summary": "",
|
const title = info.selectFirst("h1").text;
|
||||||
"valueIndex": 0,
|
const info_other = info.selectFirst("ul.ar_list_coc");
|
||||||
"entries": ["服务器1", "服务器2"],
|
const author = info_other.selectFirst("a").text;
|
||||||
"entryValues": ["https://picsh.77dm.top", "https://imgsh.dm365.top"],
|
const status_str = info_other.select("a")[1].text;
|
||||||
|
var status;
|
||||||
|
if (status_str == "已完结") {
|
||||||
|
status = 1;
|
||||||
|
} else {
|
||||||
|
status = 0;
|
||||||
|
}
|
||||||
|
const desc = info.selectFirst("i#det").text;
|
||||||
|
const elements = doc.select("ul.ar_rlos_bor li a");
|
||||||
|
const chapters = [];
|
||||||
|
for (const element of elements) {
|
||||||
|
chapters.push({
|
||||||
|
name: element.text,
|
||||||
|
url: element.attr("href")
|
||||||
|
});
|
||||||
|
}
|
||||||
|
chapters.reverse();
|
||||||
|
return {
|
||||||
|
name: title,
|
||||||
|
imageUrl: cover,
|
||||||
|
description: desc,
|
||||||
|
author: author,
|
||||||
|
status: status,
|
||||||
|
episodes: chapters
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
async getPageList(url) {
|
||||||
|
const preference = new SharedPreferences();
|
||||||
|
const image_host = preference.get("imghost");
|
||||||
|
const res = await new Client().get(this.source.baseUrl + url);
|
||||||
|
const strs = res.body.match(/return p}\('(.*?)'.split\('/)[1].split(',');
|
||||||
|
var result;
|
||||||
|
try {
|
||||||
|
result = this.StringResolve1(strs[0], strs[1], strs[2], strs[3].split('|'), 0, {}).replaceAll("'", "");
|
||||||
|
} catch {
|
||||||
|
result = this.StringResolve2(strs[0], strs[1], strs[2], strs[3].split('|'), 0, {}).replaceAll("'", "");
|
||||||
|
}
|
||||||
|
const url_part = result.match(/var img_s=(.*?);var preLink_b/)[1];
|
||||||
|
const urls = result.match(/var msg=(.*?);var maxPage/)[1].replaceAll("\\", "").split('|');
|
||||||
|
const pages = [];
|
||||||
|
for (const url of urls) {
|
||||||
|
pages.push(image_host + `/h${url_part}/` + url);
|
||||||
|
}
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFilterList() {
|
||||||
|
return [{
|
||||||
|
type: "category",
|
||||||
|
name: "分类",
|
||||||
|
type_name: "SelectFilter",
|
||||||
|
values: [{
|
||||||
|
value: "/rexue",
|
||||||
|
name: "热血机战",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/kehuan",
|
||||||
|
name: "科幻未来",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/kongbu",
|
||||||
|
name: "恐怖惊悚",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/xuanyi",
|
||||||
|
name: "推理悬疑",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/gaoxiao",
|
||||||
|
name: "滑稽搞笑",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/love",
|
||||||
|
name: "恋爱生活",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/danmei",
|
||||||
|
name: "耽美人生",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/tiyu",
|
||||||
|
name: "体育竞技",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/chunqing",
|
||||||
|
name: "纯情少女",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/qihuan",
|
||||||
|
name: "魔法奇幻",
|
||||||
|
type_name: "SelectOption"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: "/wuxia",
|
||||||
|
name: "武侠经典",
|
||||||
|
type_name: "SelectOption"
|
||||||
}
|
}
|
||||||
}];
|
]
|
||||||
}
|
}];
|
||||||
|
}
|
||||||
|
|
||||||
|
getSourcePreferences() {
|
||||||
|
return [{
|
||||||
|
"key": "imghost",
|
||||||
|
"listPreference": {
|
||||||
|
"title": "图片服务器",
|
||||||
|
"summary": "",
|
||||||
|
"valueIndex": 0,
|
||||||
|
"entries": ["服务器1", "服务器2"],
|
||||||
|
"entryValues": ["https://picsh.77dm.top", "https://imgsh.dm365.top"],
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user