remove invalid sources and fix some broken ones

This commit is contained in:
ftbom
2024-12-01 20:19:34 +08:00
parent c39a807581
commit 2bdcd342a0
13 changed files with 55 additions and 1290 deletions

View File

@@ -3,11 +3,11 @@ const mangayomiSources = [{
"lang": "zh", "lang": "zh",
"baseUrl": "https://mikanime.tv", "baseUrl": "https://mikanime.tv",
"apiUrl": "", "apiUrl": "",
"iconUrl": "https://mikanime.tv/images/mikan-pic.png", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.mikan.png",
"typeSource": "torrent", "typeSource": "torrent",
"isManga": false, "isManga": false,
"isNsfw": false, "isNsfw": false,
"version": "0.0.15", "version": "0.0.2",
"dateFormat": "", "dateFormat": "",
"dateFormatLocale": "", "dateFormatLocale": "",
"pkgPath": "anime/src/zh/mikan.js" "pkgPath": "anime/src/zh/mikan.js"
@@ -30,9 +30,10 @@ class DefaultExtension extends MProvider {
async getItems(url, cookies) { async getItems(url, cookies) {
var res; var res;
if (cookies) { const identity = new SharedPreferences().get("cookies");
if ((cookies) && (identity.length > 0)) {
res = await new Client().get(this.source.baseUrl + url, { res = await new Client().get(this.source.baseUrl + url, {
Cookie: `.AspNetCore.Identity.Application=${new SharedPreferences().get("cookies")}` Cookie: `.AspNetCore.Identity.Application=${identity}`
}); });
} else { } else {
res = await new Client().get(this.source.baseUrl + url); res = await new Client().get(this.source.baseUrl + url);
@@ -127,7 +128,7 @@ class DefaultExtension extends MProvider {
return [{ return [{
"key": "cookies", "key": "cookies",
"editTextPreference": { "editTextPreference": {
"title": "用户Cookies", "title": "用户Cookies在webview中登陆则可不设",
"summary": "用于读取用户订阅的Cookies.AspNetCore.Identity.Application", "summary": "用于读取用户订阅的Cookies.AspNetCore.Identity.Application",
"value": "", "value": "",
"dialogTitle": "Cookies", "dialogTitle": "Cookies",

View File

@@ -1,13 +1,13 @@
const mangayomiSources = [{ const mangayomiSources = [{
"name": "樱花动漫", "name": "樱花动漫",
"lang": "zh", "lang": "zh",
"baseUrl": "http://www.iyinghua.io", "baseUrl": "http://www.iyinghua.com",
"apiUrl": "", "apiUrl": "",
"iconUrl": "http://www.iyinghua.io/js/20180601/favicon.ico", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.yhdm.png",
"typeSource": "single", "typeSource": "single",
"isManga": false, "isManga": false,
"isNsfw": false, "isNsfw": false,
"version": "0.0.15", "version": "0.0.2",
"dateFormat": "", "dateFormat": "",
"dateFormatLocale": "", "dateFormatLocale": "",
"pkgPath": "anime/src/zh/yhdm.js" "pkgPath": "anime/src/zh/yhdm.js"
@@ -51,12 +51,21 @@ class DefaultExtension extends MProvider {
return String.fromCharCode.apply(null, charCodes); return String.fromCharCode.apply(null, charCodes);
} }
getBaseUrl() {
const preference = new SharedPreferences();
var base_url = preference.get("domain_url");
if (base_url.endsWith("/")) {
return base_url.slice(0, -1);
}
return base_url;
}
getHeaders(url) { getHeaders(url) {
throw new Error("getHeaders not implemented"); throw new Error("getHeaders not implemented");
} }
async getItems(url, p, d) { async getItems(url, p, d) {
const res = await new Client().get(this.source.baseUrl + url); const res = await new Client().get(this.getBaseUrl() + url);
const doc = new Document(res.body); const doc = new Document(res.body);
const items = []; const items = [];
const elements = doc.select(p); const elements = doc.select(p);
@@ -91,7 +100,7 @@ class DefaultExtension extends MProvider {
} }
async getDetail(url) { async getDetail(url) {
const res = await new Client().get(this.source.baseUrl + url); const res = await new Client().get(this.getBaseUrl() + url);
const doc = new Document(res.body); const doc = new Document(res.body);
const cover = doc.selectFirst("div.thumb img").attr("src"); const cover = doc.selectFirst("div.thumb img").attr("src");
const title = this.stringUTF8(doc.selectFirst("div.rate h1").text, true); const title = this.stringUTF8(doc.selectFirst("div.rate h1").text, true);
@@ -119,7 +128,7 @@ class DefaultExtension extends MProvider {
} }
async getVideoList(url) { async getVideoList(url) {
const res = await new Client().get(this.source.baseUrl + url); const res = await new Client().get(this.getBaseUrl() + url);
const doc = new Document(res.body); const doc = new Document(res.body);
const video_url = this.stringUTF8(doc.selectFirst("div#playbox").attr("data-vid").split("$")[0], true); const video_url = this.stringUTF8(doc.selectFirst("div#playbox").attr("data-vid").split("$")[0], true);
return [{ return [{
@@ -354,6 +363,16 @@ class DefaultExtension extends MProvider {
} }
getSourcePreferences() { getSourcePreferences() {
throw new Error("getSourcePreferences not implemented"); return [{
"key": "domain_url",
"editTextPreference": {
"title": "Url",
"summary": "樱花动漫网址",
"value": "http://www.iyinghua.com",
"dialogTitle": "URL",
"dialogMessage": "",
}
}
];
} }
} }

BIN
javascript/icon/zh.77mh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 959 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 701 B

BIN
javascript/icon/zh.dmzj.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

BIN
javascript/icon/zh.yhdm.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@@ -3,7 +3,7 @@ const mangayomiSources = [{
"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://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.77mh.png",
"typeSource": "single", "typeSource": "single",
"isManga": true, "isManga": true,
"isNsfw": false, "isNsfw": false,

View File

@@ -3,11 +3,11 @@ const mangayomiSources = [{
"lang": "zh", "lang": "zh",
"baseUrl": "https://www.mangacopy.com", "baseUrl": "https://www.mangacopy.com",
"apiUrl": "https://api.mangacopy.com", "apiUrl": "https://api.mangacopy.com",
"iconUrl": "https://hi77-overseas.mangafuna.xyz/static/free.ico", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.copymanga.png",
"typeSource": "single", "typeSource": "single",
"isManga": true, "isManga": true,
"isNsfw": false, "isNsfw": false,
"version": "0.0.2", "version": "0.0.25",
"dateFormat": "", "dateFormat": "",
"dateFormatLocale": "", "dateFormatLocale": "",
"pkgPath": "manga/src/zh/copymanga.js" "pkgPath": "manga/src/zh/copymanga.js"
@@ -100,6 +100,21 @@ const mangayomiSources = [{
Referer: this.source.baseUrl Referer: this.source.baseUrl
}; };
} }
reqHeaders() {
const date = new Date();
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return {
'User-Agent': 'duoTuoCartoon/3.2.4 (iPhone; iOS 18.0.1; Scale/3.00) iDOKit/1.0.0 RSSX/1.0.0',
'version': `${year}.${month}.${day}`,
'region': '0',
'webp': '0',
"platform": "1",
"Referer": "https://www.copymanga.com/"
}
}
async getManga(url) { async getManga(url) {
const res = await new Client().get(this.source.apiUrl + url); const res = await new Client().get(this.source.apiUrl + url);
@@ -128,14 +143,8 @@ const mangayomiSources = [{
async search(query, page, filters) { async search(query, page, filters) {
if (query != "") { if (query != "") {
const res = await new Client().get(this.source.apiUrl + `/api/v3/search/comic?platform=1&q=${query}&limit=16&offset=${(page -1)*16}&q_type=&_update=true`, { const res = await new Client().get(this.source.apiUrl + `/api/v3/search/comic?platform=1&q=${query}&limit=16&offset=${(page -1)*16}&q_type=&_update=true`,
"webp": '1', this.reqHeaders());
"region": '1',
"platform": '1',
"version": '2022.10.20',
"accept": 'application/json',
'content-encoding': 'gzip, compress, br'
});
const datas = JSON.parse(res.body)["results"]["list"]; const datas = JSON.parse(res.body)["results"]["list"];
const manga = []; const manga = [];
for (const data of datas) { for (const data of datas) {
@@ -167,7 +176,7 @@ const mangayomiSources = [{
async getDetail(url) { async getDetail(url) {
url = url.substringAfter("/comic/"); url = url.substringAfter("/comic/");
const res = await new Client().get(this.source.apiUrl + `/api/v3/comic2/${url}`); const res = await new Client().get(this.source.apiUrl + `/api/v3/comic2/${url}`, this.reqHeaders());
const data = JSON.parse(res.body)["results"]["comic"]; const data = JSON.parse(res.body)["results"]["comic"];
const title = this.stringUTF8(data["name"]); const title = this.stringUTF8(data["name"]);
const cover = data["cover"]; const cover = data["cover"];

View File

@@ -3,11 +3,11 @@ const mangayomiSources = [{
"lang": "zh", "lang": "zh",
"baseUrl": "https://www.dmzj.com", "baseUrl": "https://www.dmzj.com",
"apiUrl": "", "apiUrl": "",
"iconUrl": "https://www.dmzj.com/_nuxt/logo_dmzj.1c94014a.png", "iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.dmzj.png",
"typeSource": "single", "typeSource": "single",
"isManga": true, "isManga": true,
"isNsfw": false, "isNsfw": false,
"version": "0.0.25", "version": "0.0.3",
"dateFormat": "", "dateFormat": "",
"dateFormatLocale": "", "dateFormatLocale": "",
"pkgPath": "manga/src/zh/dmzj.js" "pkgPath": "manga/src/zh/dmzj.js"

View File

@@ -1,669 +0,0 @@
const mangayomiSources = [{
"name": "漫画DB",
"lang": "zh",
"baseUrl": "https://www.manhuadb.com",
"apiUrl": "",
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.manhuadb.png",
"typeSource": "single",
"isManga": true,
"isNsfw": false,
"version": "0.0.25",
"dateFormat": "",
"dateFormatLocale": "",
"pkgPath": "manga/src/zh/manhuadb.js"
}];
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;
var i, len, out;
len = str.length;
i = 0;
out = "";
while (i < len) {
do {
c1 = base64DecodeChars[str.charCodeAt(i++) & 0xff]
} while (i < len && c1 == -1);
if (c1 == -1)
break;
do {
c2 = base64DecodeChars[str.charCodeAt(i++) & 0xff]
} while (i < len && c2 == -1);
if (c2 == -1)
break;
out += String.fromCharCode((c1 << 2) | ((c2 & 0x30) >> 4));
do {
c3 = str.charCodeAt(i++) & 0xff;
if (c3 == 61)
return out;
c3 = base64DecodeChars[c3]
} while (i < len && c3 == -1);
if (c3 == -1)
break;
out += String.fromCharCode(((c2 & 0XF) << 4) | ((c3 & 0x3C) >> 2));
do {
c4 = str.charCodeAt(i++) & 0xff;
if (c4 == 61)
return out;
c4 = base64DecodeChars[c4]
} while (i < len && c4 == -1);
if (c4 == -1)
break;
out += String.fromCharCode(((c3 & 0x03) << 6) | c4)
}
return out
}
coverUrlConvert(cover_url) {
if (cover_url.search("com") == -1) {
return this.source.baseUrl + cover_url;
}
return cover_url;
}
async getMangas(url, search) {
const res = await new Client().get(this.source.baseUrl + url);
const doc = new Document(res.body);
var str;
if (search) {
str = "div.comicbook-index";
} else {
str = "div.media";
}
const items = doc.select(str);
const mangas = [];
for (const item of items) {
const cover = this.coverUrlConvert(item.selectFirst("a.d-block img").attr("src"));
var title;
if (search) {
title = item.selectFirst("a.d-block").attr("title");
} else {
title = item.selectFirst("a.d-block img").attr("alt");
title = title.replace("的封面图", "");
}
const url = item.selectFirst("a.d-block").attr("href");
mangas.push({
name: title,
link: url,
imageUrl: cover
});
}
return {
list: mangas,
hasNextPage: true
}
}
async getPopular(page) {
const res = await new Client().get(this.source.baseUrl);
const doc = new Document(res.body);
const items = doc.select("div.comicbook-index");
var mangas = [];
for (let item of items) {
const cover = this.coverUrlConvert(item.selectFirst("a img").attr("src"));
const title = item.selectFirst("a img").attr("alt");
const url = item.selectFirst("a").attr("href")
mangas.push({
name: title.replace("封面", ""),
link: url,
imageUrl: cover
});
}
return {
list: mangas,
hasNextPage: false
};
}
async getLatestUpdates(page) {
return await this.getMangas(`/manhua/list-page-${page}.html`, false);
}
async search(query, page, filters) {
if (query == "") {
var locations, readers, status, categories;
for (const filter of filters) {
if (filter["type"] == "locations") {
locations = filter["values"][filter["state"]]["value"];
} else if (filter["type"] == "readers") {
readers = filter["values"][filter["state"]]["value"];
} else if (filter["type"] == "status") {
status = filter["values"][filter["state"]]["value"];
} else if (filter["type"] == "categories") {
categories = filter["values"][filter["state"]]["value"];
}
}
const url = `/manhua/list${locations}${readers}${status}${categories}-page-${page}.html`;
return await this.getMangas(url.replaceAll("all", ""), false);
} else {
return await this.getMangas(`/search?q=${query}&p=${page}`, true);
}
}
async getDetail(url) {
const res = await new Client().get(this.source.baseUrl + url);
const doc = new Document(res.body);
const title = doc.selectFirst("h1.comic-title").text;
const cover = this.coverUrlConvert(doc.selectFirst("td.comic-cover img").attr("src"));
const desc = doc.selectFirst("p.comic_story").text;
const author = doc.selectFirst("ul.creators a").text;
var tags = doc.select("ul.tags a").map(e => e.text);
var status = 5;
if (tags[0] == "已完结") {
status = 1;
tags.shift();
}
if (tags[0] == "连载中") {
status = 0;
tags.shift();
}
const items = doc.select("ol.links-of-books");
const episodes = [];
const ep_names = doc.select("span.h3");
const ep_titles = [];
for (const ep_name of ep_names) {
ep_titles.push(ep_name.text);
}
var index = 0;
for (const lists of items) {
const chapters = lists.select("li");
for (const chapter of chapters) {
const name = chapter.selectFirst("a").attr("title");
const url = chapter.selectFirst("a").attr("href");
episodes.push({
name: `[[${ep_titles[index]}]]${name}`,
url: url
});
}
index = index + 1;
}
episodes.reverse();
return {
name: title,
imageUrl: cover,
description: desc,
episodes: episodes,
genre: tags,
author: author,
status: status
};
}
async getPageList(url) {
const res = await new Client().get(this.source.baseUrl + url);
const html = res.body;
const doc = new Document(html);
const urls = [];
var script_str = html.match(/<script>var img_data = '([^']*)';<\/script>/)[1];
const img_urls = JSON.parse(this.base64decode(script_str));
var img_base = doc.selectFirst("img.show-pic").attr("src");
img_base = img_base.substring(0, img_base.search(img_urls[0]['img']));
for (const url of img_urls) {
urls.push(img_base + url['img']);
}
return urls;
}
getFilterList() {
return [{
type: "locations",
name: "地区",
type_name: "SelectFilter",
values: [{
value: "all",
name: "全部",
type_name: "SelectOption"
},
{
value: "-r-4",
name: "日本",
type_name: "SelectOption"
},
{
value: "-r-5",
name: "香港",
type_name: "SelectOption"
},
{
value: "-r-6",
name: "韩国",
type_name: "SelectOption"
},
{
value: "-r-7",
name: "台湾",
type_name: "SelectOption"
},
{
value: "-r-8",
name: "内地",
type_name: "SelectOption"
},
{
value: "-r-9",
name: "欧美",
type_name: "SelectOption"
}
]
},
{
type: "readers",
name: "读者",
type_name: "SelectFilter",
values: [{
value: "all",
name: "全部",
type_name: "SelectOption"
},
{
value: "-a-3",
name: "少年",
type_name: "SelectOption"
},
{
value: "-a-4",
name: "青年",
type_name: "SelectOption"
},
{
value: "-a-5",
name: "少女",
type_name: "SelectOption"
},
{
value: "-a-6",
name: "男性",
type_name: "SelectOption"
},
{
value: "-a-7",
name: "女性",
type_name: "SelectOption"
},
{
value: "-a-9",
name: "通用",
type_name: "SelectOption"
},
{
value: "-a-10",
name: "儿童",
type_name: "SelectOption"
},
{
value: "-a-11",
name: "女青",
type_name: "SelectOption"
},
{
value: "-a-12",
name: "18限",
type_name: "SelectOption"
}
]
},
{
type: "status",
name: "状态",
type_name: "SelectFilter",
values: [{
value: "all",
name: "全部",
type_name: "SelectOption"
},
{
value: "-s-1",
name: "连载中",
type_name: "SelectOption"
},
{
value: "-s-2",
name: "已完结",
type_name: "SelectOption"
}
]
},
{
type: "categories",
name: "类型",
type_name: "SelectFilter",
values: [{
value: "all",
name: "全部",
type_name: "SelectOption"
},
{
value: "-c-26",
name: "爱情",
type_name: "SelectOption"
},
{
value: "-c-66",
name: "东方",
type_name: "SelectOption"
},
{
value: "-c-12",
name: "冒险",
type_name: "SelectOption"
},
{
value: "-c-64",
name: "欢乐向",
type_name: "SelectOption"
},
{
value: "-c-39",
name: "百合",
type_name: "SelectOption"
},
{
value: "-c-41",
name: "搞笑",
type_name: "SelectOption"
},
{
value: "-c-20",
name: "科幻",
type_name: "SelectOption"
},
{
value: "-c-40",
name: "校园",
type_name: "SelectOption"
},
{
value: "-c-33",
name: "生活",
type_name: "SelectOption"
},
{
value: "-c-48",
name: "魔幻",
type_name: "SelectOption"
},
{
value: "-c-13",
name: "奇幻",
type_name: "SelectOption"
},
{
value: "-c-46",
name: "热血",
type_name: "SelectOption"
},
{
value: "-c-44",
name: "格斗",
type_name: "SelectOption"
},
{
value: "-c-71",
name: "其他",
type_name: "SelectOption"
},
{
value: "-c-52",
name: "神鬼",
type_name: "SelectOption"
},
{
value: "-c-43",
name: "魔法",
type_name: "SelectOption"
},
{
value: "-c-27",
name: "悬疑",
type_name: "SelectOption"
},
{
value: "-c-18",
name: "动作",
type_name: "SelectOption"
},
{
value: "-c-55",
name: "竞技",
type_name: "SelectOption"
},
{
value: "-c-72",
name: "纯爱",
type_name: "SelectOption"
},
{
value: "-c-32",
name: "喜剧",
type_name: "SelectOption"
},
{
value: "-c-59",
name: "萌系",
type_name: "SelectOption"
},
{
value: "-c-16",
name: "恐怖",
type_name: "SelectOption"
},
{
value: "-c-53",
name: "耽美",
type_name: "SelectOption"
},
{
value: "-c-56",
name: "四格",
type_name: "SelectOption"
},
{
value: "-c-80",
name: "ゆり",
type_name: "SelectOption"
},
{
value: "-c-54",
name: "治愈",
type_name: "SelectOption"
},
{
value: "-c-60",
name: "伪娘",
type_name: "SelectOption"
},
{
value: "-c-73",
name: "舰娘",
type_name: "SelectOption"
},
{
value: "-c-47",
name: "励志",
type_name: "SelectOption"
},
{
value: "-c-58",
name: "职场",
type_name: "SelectOption"
},
{
value: "-c-30",
name: "战争",
type_name: "SelectOption"
},
{
value: "-c-51",
name: "侦探",
type_name: "SelectOption"
},
{
value: "-c-21",
name: "惊悚",
type_name: "SelectOption"
},
{
value: "-c-22",
name: "职业",
type_name: "SelectOption"
},
{
value: "-c-9",
name: "历史",
type_name: "SelectOption"
},
{
value: "-c-11",
name: "体育",
type_name: "SelectOption"
},
{
value: "-c-45",
name: "美食",
type_name: "SelectOption"
},
{
value: "-c-68",
name: "秀吉",
type_name: "SelectOption"
},
{
value: "-c-67",
name: "性转换",
type_name: "SelectOption"
},
{
value: "-c-19",
name: "推理",
type_name: "SelectOption"
},
{
value: "-c-70",
name: "音乐舞蹈",
type_name: "SelectOption"
},
{
value: "-c-57",
name: "后宫",
type_name: "SelectOption"
},
{
value: "-c-29",
name: "料理",
type_name: "SelectOption"
},
{
value: "-c-61",
name: "机战",
type_name: "SelectOption"
},
{
value: "-c-78",
name: "AA",
type_name: "SelectOption"
},
{
value: "-c-37",
name: "社会",
type_name: "SelectOption"
},
{
value: "-c-76",
name: "节操",
type_name: "SelectOption"
},
{
value: "-c-17",
name: "音乐",
type_name: "SelectOption"
},
{
value: "-c-23",
name: "武侠",
type_name: "SelectOption"
},
{
value: "-c-65",
name: "西方魔幻",
type_name: "SelectOption"
},
{
value: "-c-28",
name: "资料集",
type_name: "SelectOption"
},
{
value: "-c-10",
name: "传记",
type_name: "SelectOption"
},
{
value: "-c-49",
name: "宅男",
type_name: "SelectOption"
},
{
value: "-c-69",
name: "轻小说",
type_name: "SelectOption"
},
{
value: "-c-62",
name: "黑道",
type_name: "SelectOption"
},
{
value: "-c-50",
name: "舞蹈",
type_name: "SelectOption"
},
{
value: "-c-42",
name: "杂志",
type_name: "SelectOption"
},
{
value: "-c-34",
name: "灾难",
type_name: "SelectOption"
},
{
value: "-c-77",
name: "宅系",
type_name: "SelectOption"
},
{
value: "-c-74",
name: "颜艺",
type_name: "SelectOption"
},
{
value: "-c-63",
name: "腐女",
type_name: "SelectOption"
},
{
value: "-c-81",
name: "露营",
type_name: "SelectOption"
},
{
value: "-c-82",
name: "旅行",
type_name: "SelectOption"
},
{
value: "-c-83",
name: "TS",
type_name: "SelectOption"
}
]
}
]
}
getSourcePreferences() {
throw new Error("getSourcePreferences not implemented");
}
}

View File

@@ -1,595 +0,0 @@
const mangayomiSources = [{
"name": "漫画柜",
"lang": "zh",
"baseUrl": "https://www.manhuagui.com",
"apiUrl": "",
"iconUrl": "https://www.manhuagui.com/favicon.ico",
"typeSource": "single",
"isManga": true,
"isNsfw": false,
"version": "0.0.25",
"dateFormat": "",
"dateFormatLocale": "",
"pkgPath": "manga/src/zh/manhuagui.js"
}];
LZString = function() {
function o(o, r) {
if (!t[o]) {
t[o] = {};
for (var n = 0; n < o.length; n++) t[o][o.charAt(n)] = n
}
return t[o][r]
}
var r = String.fromCharCode,
n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",
t = {},
i = {
decompressFromBase64: function(r) {
return null == r ? "" : "" == r ? null : i._decompress(r.length, 32, function(e) {
return o(n, r.charAt(e))
})
},
_decompress: function(o, n, e) {
var t, i, s, p, u, c, a, l, f = [],
h = 4,
d = 4,
m = 3,
v = "",
w = [],
A = {
val: e(0),
position: n,
index: 1
};
for (i = 0; 3 > i; i += 1) f[i] = i;
for (p = 0, c = Math.pow(2, 2), a = 1; a != c;) u = A.val & A.position, A.position >>= 1, 0 == A.position && (A.position = n, A.val = e(A.index++)), p |= (u > 0 ? 1 : 0) * a, a <<= 1;
switch (t = p) {
case 0:
for (p = 0, c = Math.pow(2, 8), a = 1; a != c;) u = A.val & A.position, A.position >>= 1, 0 == A.position && (A.position = n, A.val = e(A.index++)), p |= (u > 0 ? 1 : 0) * a, a <<= 1;
l = r(p);
break;
case 1:
for (p = 0, c = Math.pow(2, 16), a = 1; a != c;) u = A.val & A.position, A.position >>= 1, 0 == A.position && (A.position = n, A.val = e(A.index++)), p |= (u > 0 ? 1 : 0) * a, a <<= 1;
l = r(p);
break;
case 2:
return ""
}
for (f[3] = l, s = l, w.push(l);;) {
if (A.index > o) return "";
for (p = 0, c = Math.pow(2, m), a = 1; a != c;) u = A.val & A.position, A.position >>= 1, 0 == A.position && (A.position = n, A.val = e(A.index++)), p |= (u > 0 ? 1 : 0) * a, a <<= 1;
switch (l = p) {
case 0:
for (p = 0, c = Math.pow(2, 8), a = 1; a != c;) u = A.val & A.position, A.position >>= 1, 0 == A.position && (A.position = n, A.val = e(A.index++)), p |= (u > 0 ? 1 : 0) * a, a <<= 1;
f[d++] = r(p), l = d - 1, h--;
break;
case 1:
for (p = 0, c = Math.pow(2, 16), a = 1; a != c;) u = A.val & A.position, A.position >>= 1, 0 == A.position && (A.position = n, A.val = e(A.index++)), p |= (u > 0 ? 1 : 0) * a, a <<= 1;
f[d++] = r(p), l = d - 1, h--;
break;
case 2:
return w.join("")
}
if (0 == h && (h = Math.pow(2, m), m++), f[l]) v = f[l];
else {
if (l !== d) return null;
v = s + s.charAt(0)
}
w.push(v), f[d++] = s + v.charAt(0), h--, s = v, 0 == h && (h = Math.pow(2, m), m++)
}
}
};
return i
}();
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));
}
function tr(value, num) {
var tmp = itr(value, num);
return tmp == '' ? '0' : tmp;
}
function itr(value, num) {
const d = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
return value <= 0 ? '' : itr(Math.floor(value / num), num) + d[value % num];
}
c = c - 1;
const d = {};
while (c + 1) {
d[e(c)] = data[c] == '' ? e(c) : data[c];
c -= 1;
}
const pieces = functionStr.split(/\b(\w+)\b/);
const js = pieces.map(function(x) {
return d[x] !== undefined ? d[x] : x;
}).join('').replace(/\\'/g, '\'');
return JSON.parse(js.match(/^.*\((\{.*\})\).*$/)[1]);
}
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"
};
getHeaders(url) {
return {
Referer: this.source.baseUrl
}
}
async getItems(url, p) {
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);
for (const element of elements) {
const title = element.selectFirst("a").attr("title");
const url = element.selectFirst("a").attr("href");
var cover = element.selectFirst("img").attr("src");
if (cover == "") {
cover = element.selectFirst("img").attr("data-src");
}
cover = "https:" + cover;
mangas.push({
name: title,
imageUrl: cover,
link: url
});
}
return {
list: mangas,
hasNextPage: true
};
}
async getPopular(page) {
return await this.getItems(`/list/view_p${page}.html`, "ul#contList li");
}
async getLatestUpdates(page) {
return await this.getItems(`/list/index_p${page}.html`, "ul#contList li");
}
async search(query, page, filters) {
if (query == "") {
var sort, locations, categories, status, reader;
for (const filter of filters) {
if (filter["type"] == "sort") {
sort = filter["values"][filter["state"]]["value"];
} else if (filter["type"] == "locations") {
locations = filter["values"][filter["state"]]["value"];
} else if (filter["type"] == "categories") {
categories = filter["values"][filter["state"]]["value"];
} else if (filter["type"] == "status") {
status = filter["values"][filter["state"]]["value"];
} else if (filter["type"] == "reader") {
reader = filter["values"][filter["state"]]["value"];
}
}
const params = [locations, categories, reader, status];
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, 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");
const desc = doc.selectFirst("div#intro-all").text;
const info = doc.select("ul.detail-list li")[1].select("span");
const authors = info[1].text.replace("漫画作者:", "");
const genres = info[0].select("a").map(e => e.text);
const status_str = doc.selectFirst("li.status span").text;
var status;
if (status_str == "已完结") {
status = 1;
} else {
status = 0;
}
const eps = [];
var chapter_html;
if (res.body.search("请点击此处继续阅读!") == -1) {
chapter_html = doc;
} else {
const text = LZString.decompressFromBase64(doc.selectFirst("input#__VIEWSTATE").attr("value"));
chapter_html = new Document(text);
}
const ch_title = chapter_html.select("h4 span");
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("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;
}
eps.reverse();
return {
name: title,
imageUrl: cover,
description: desc,
genre: genres,
author: authors,
status: status,
episodes: eps
};
}
async getPageList(url) {
const preference = new SharedPreferences();
const image_host = preference.get("imghost");
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"]) {
imgs.push(`https://${image_host}.hamreus.com` + datas["path"] + data + `?e=${datas["sl"]["e"]}&m=${datas["sl"]["m"]}`);
}
return imgs;
}
getFilterList() {
return [{
type: "sort",
name: "排序",
type_name: "SelectFilter",
values: [{
type_name: "SelectOption",
name: "最新发布",
value: "index"
},
{
type_name: "SelectOption",
name: "最新更新",
value: "update"
},
{
type_name: "SelectOption",
name: "人气最旺",
value: "view"
},
{
type_name: "SelectOption",
name: "评分最高",
value: "rate"
}
]
},
{
type: "locations",
name: "地区",
type_name: "SelectFilter",
values: [{
type_name: "SelectOption",
name: "全部",
value: ""
},
{
type_name: "SelectOption",
name: "日本",
value: "japan"
},
{
type_name: "SelectOption",
name: "港台",
value: "hongkong"
},
{
type_name: "SelectOption",
name: "其他",
value: "other"
},
{
type_name: "SelectOption",
name: "欧美",
value: "europe"
},
{
type_name: "SelectOption",
name: "内地",
value: "china"
},
{
type_name: "SelectOption",
name: "韩国",
value: "korea"
}
]
},
{
type: "categories",
name: "剧情",
type_name: "SelectFilter",
values: [{
type_name: "SelectOption",
name: "全部",
value: ""
},
{
type_name: "SelectOption",
name: "热血",
value: "rexue"
},
{
type_name: "SelectOption",
name: "冒险",
value: "maoxian"
},
{
type_name: "SelectOption",
name: "魔幻",
value: "mohuan"
},
{
type_name: "SelectOption",
name: "神鬼",
value: "shengui"
},
{
type_name: "SelectOption",
name: "搞笑",
value: "gaoxiao"
},
{
type_name: "SelectOption",
name: "萌系",
value: "mengxi"
},
{
type_name: "SelectOption",
name: "爱情",
value: "aiqing"
},
{
type_name: "SelectOption",
name: "科幻",
value: "kehuan"
},
{
type_name: "SelectOption",
name: "魔法",
value: "mofa"
},
{
type_name: "SelectOption",
name: "格斗",
value: "gedou"
},
{
type_name: "SelectOption",
name: "武侠",
value: "wuxia"
},
{
type_name: "SelectOption",
name: "机战",
value: "jizhan"
},
{
type_name: "SelectOption",
name: "战争",
value: "zhanzheng"
},
{
type_name: "SelectOption",
name: "竞技",
value: "jingji"
},
{
type_name: "SelectOption",
name: "体育",
value: "tiyu"
},
{
type_name: "SelectOption",
name: "校园",
value: "xiaoyuan"
},
{
type_name: "SelectOption",
name: "生活",
value: "shenghuo"
},
{
type_name: "SelectOption",
name: "励志",
value: "lizhi"
},
{
type_name: "SelectOption",
name: "历史",
value: "lishi"
},
{
type_name: "SelectOption",
name: "伪娘",
value: "weiniang"
},
{
type_name: "SelectOption",
name: "宅男",
value: "zhainan"
},
{
type_name: "SelectOption",
name: "腐女",
value: "funv"
},
{
type_name: "SelectOption",
name: "耽美",
value: "danmei"
},
{
type_name: "SelectOption",
name: "百合",
value: "baihe"
},
{
type_name: "SelectOption",
name: "后宫",
value: "hougong"
},
{
type_name: "SelectOption",
name: "治愈",
value: "zhiyu"
},
{
type_name: "SelectOption",
name: "美食",
value: "meishi"
},
{
type_name: "SelectOption",
name: "推理",
value: "tuili"
},
{
type_name: "SelectOption",
name: "悬疑",
value: "xuanyi"
},
{
type_name: "SelectOption",
name: "恐怖",
value: "kongbu"
},
{
type_name: "SelectOption",
name: "四格",
value: "sige"
},
{
type_name: "SelectOption",
name: "职场",
value: "zhichang"
},
{
type_name: "SelectOption",
name: "侦探",
value: "zhentan"
},
{
type_name: "SelectOption",
name: "社会",
value: "shehui"
},
{
type_name: "SelectOption",
name: "音乐",
value: "yinyue"
},
{
type_name: "SelectOption",
name: "舞蹈",
value: "wudao"
},
{
type_name: "SelectOption",
name: "杂志",
value: "zazhi"
},
{
type_name: "SelectOption",
name: "黑道",
value: "heidao"
}
]
},
{
type: "reader",
name: "受众",
type_name: "SelectFilter",
values: [{
type_name: "SelectOption",
name: "全部",
value: ""
},
{
type_name: "SelectOption",
name: "少女",
value: "shaonv"
},
{
type_name: "SelectOption",
name: "少年",
value: "shaonian"
},
{
type_name: "SelectOption",
name: "青年",
value: "qingnian"
},
{
type_name: "SelectOption",
name: "儿童",
value: "ertong"
},
{
type_name: "SelectOption",
name: "通用",
value: "tongyong"
}
]
},
{
type: "status",
name: "状态",
type_name: "SelectFilter",
values: [{
type_name: "SelectOption",
name: "全部",
value: ""
},
{
type_name: "SelectOption",
name: "连载中",
value: "lianzai"
},
{
type_name: "SelectOption",
name: "已完结",
value: "wanjie"
}
]
}
];
}
getSourcePreferences() {
return [{
"key": "imghost",
"listPreference": {
"title": "图片服务器",
"summary": "",
"valueIndex": 0,
"entries": ["通用", "欧洲", "美国"],
"entryValues": ["i", "eu", "us"],
}
}];
}
}