Merge pull request #180 from Ftbom/main

fix 77mh and mikan && add gfmanhua
This commit is contained in:
Moustapha Kodjo Amadou
2025-03-07 15:24:34 +01:00
committed by GitHub
4 changed files with 1841 additions and 264 deletions

View File

@@ -1,13 +1,13 @@
const mangayomiSources = [{
"name": "蜜柑计划",
"lang": "zh",
"baseUrl": "https://mikanime.tv",
"baseUrl": "https://mikanani.me",
"apiUrl": "",
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.mikan.png",
"typeSource": "torrent",
"itemType": 1,
"isNsfw": false,
"version": "0.0.2",
"version": "0.0.25",
"dateFormat": "",
"dateFormatLocale": "",
"pkgPath": "anime/src/zh/mikan.js"
@@ -24,6 +24,15 @@ class DefaultExtension extends MProvider {
return timestamp;
}
baseURL () {
const preference = new SharedPreferences();
var base_url = preference.get("domain_url");
if (base_url.endsWith("/")) {
base_url = base_url.slice(0, -1);
}
return base_url;
}
getHeaders(url) {
throw new Error("getHeaders not implemented");
}
@@ -32,11 +41,11 @@ class DefaultExtension extends MProvider {
var res;
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.baseURL() + url, {
Cookie: `.AspNetCore.Identity.Application=${identity}`
});
} else {
res = await new Client().get(this.source.baseUrl + url);
res = await new Client().get(this.baseURL() + url);
}
const doc = new Document(res.body);
const items = [];
@@ -47,7 +56,7 @@ class DefaultExtension extends MProvider {
continue;
}
const title = element.selectFirst("a").attr("title");
const cover = this.source.baseUrl + element.selectFirst("img").attr("data-src");
const cover = this.baseURL() + element.selectFirst("img").attr("data-src");
items.push({
name: title,
imageUrl: cover,
@@ -69,13 +78,13 @@ class DefaultExtension extends MProvider {
}
async search(query, page, filters) {
const res = await new Client().get(this.source.baseUrl + `/Home/Search?searchstr=${query}`);
const res = await new Client().get(this.baseURL() + `/Home/Search?searchstr=${query}`);
const doc = new Document(res.body);
const items = [];
const elements = doc.select("div.central-container ul.list-inline li");
for (const element of elements) {
const title = element.selectFirst("div.an-text").text;
const cover = this.source.baseUrl + element.selectFirst("span").attr("data-src");
const cover = this.baseURL() + element.selectFirst("span").attr("data-src");
const url = element.selectFirst("a").attr("href");
items.push({
name: title,
@@ -90,9 +99,9 @@ class DefaultExtension extends MProvider {
}
async getDetail(url) {
const res = await new Client().get(this.source.baseUrl + url);
const res = await new Client().get(this.baseURL() + url);
const doc = new Document(res.body);
const cover = this.source.baseUrl + doc.selectFirst("div.content img").attr("src");
const cover = this.baseURL() + doc.selectFirst("div.content img").attr("src");
const title = doc.selectFirst("p.title").text;
const desc = doc.selectFirst("div.info").text;
const eps = [];
@@ -101,7 +110,7 @@ class DefaultExtension extends MProvider {
//const header = list.selectFirst("span.title").text;
for (const item of list.select("div.m-bangumi-item")) {
const title = item.selectFirst("div.text").text;
const url = this.source.baseUrl + item.selectFirst("div.right a").attr("href");
const url = this.baseURL() + item.selectFirst("div.right a").attr("href");
const date = this.dateStringToTimestamp(item.selectFirst("div.date").text.split(" ")[0]);
eps.push({
name: title,
@@ -110,7 +119,7 @@ class DefaultExtension extends MProvider {
});
}
}
eps.reverse();
//eps.reverse();
return {
name: title,
imageUrl: cover,
@@ -126,6 +135,15 @@ class DefaultExtension extends MProvider {
getSourcePreferences() {
return [{
"key": "domain_url",
"editTextPreference": {
"title": "Url",
"summary": "蜜柑计划网址",
"value": "https://mikanani.me",
"dialogTitle": "URL",
"dialogMessage": "",
}
},{
"key": "cookies",
"editTextPreference": {
"title": "用户Cookies在webview中登陆则可不设",

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

View File

@@ -1,258 +1,258 @@
const mangayomiSources = [{
"name": "新新漫画",
"lang": "zh",
"baseUrl": "https://www.77mh.nl",
"apiUrl": "",
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.77mh.png",
"typeSource": "single",
"itemType": 0,
"isNsfw": false,
"version": "0.0.25",
"apiUrl": "",
"dateFormat": "",
"dateFormatLocale": "",
"pkgName": "manga/src/zh/77mh.js"
}];
class DefaultExtension extends MProvider {
StringResolve1(p, a, c, k, e, d) {
e = function(c) {
return c.toString(36)
};
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--) {
if (k[c]) {
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
}
}
return p
}
StringResolve2(p, a, c, k, e, d) {
e = function(c) {
return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
};
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--) {
if (k[c]) {
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
}
}
return p
}
async getIndex1(url) {
const res = await new Client().get(url);
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
};
}
async getIndex2(url) {
const res = await new Client().get(url);
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
};
}
"name": "新新漫画",
"lang": "zh",
"baseUrl": "http://www.77mh.xyz",
"apiUrl": "",
"iconUrl": "https://raw.githubusercontent.com/kodjodevf/mangayomi-extensions/main/javascript/icon/zh.77mh.png",
"typeSource": "single",
"itemType": 0,
"isNsfw": false,
"version": "0.0.3",
"apiUrl": "",
"dateFormat": "",
"dateFormatLocale": "",
"pkgName": "manga/src/zh/77mh.js"
}];
async getPopular(page) {
return await this.getIndex1(this.source.baseUrl + "/new_coc.html");
}
async getLatestUpdates(page) {
return await this.getIndex1(`${this.source.baseUrl}/lianzai/index_${page - 1}.html`);
}
async search(query, page, filters) {
var url;
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,
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"
class DefaultExtension extends MProvider {
StringResolve1(p, a, c, k, e, d) {
e = function(c) {
return c.toString(36)
};
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--) {
if (k[c]) {
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
}
]
}];
}
getSourcePreferences() {
return [{
"key": "imghost",
"listPreference": {
"title": "图片服务器",
"summary": "",
"valueIndex": 0,
"entries": ["服务器1", "服务器2"],
"entryValues": ["https://picsh.77dm.top", "https://imgsh.dm365.top"],
}
}];
return p
}
StringResolve2(p, a, c, k, e, d) {
e = function(c) {
return (c < a ? '' : e(parseInt(c / a))) + ((c = c % a) > 35 ? String.fromCharCode(c + 29) : c.toString(36))
};
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--) {
if (k[c]) {
p = p.replace(new RegExp('\\b' + e(c) + '\\b', 'g'), k[c])
}
}
return p
}
async getIndex1(url) {
const res = await new Client().get(url);
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
};
}
async getIndex2(url) {
const res = await new Client().get(url);
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").split("/").slice(-1)[0];
const cover = element.selectFirst("img").attr("src");
mangas.push({
name: title,
link: url,
imageUrl: cover
});
}
return {
list: mangas,
hasNextPage: true
};
}
async getPopular(page) {
return await this.getIndex1(this.source.baseUrl + "/new_coc.html");
}
async getLatestUpdates(page) {
return await this.getIndex1(`${this.source.baseUrl}/lianzai/index_${page - 1}.html`);
}
async search(query, page, filters) {
var url;
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,
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", "https://hws.gdbyhtl.net"],
}
}];
}
}
}

File diff suppressed because it is too large Load Diff