Skip to content

Commit

Permalink
Update manhuagui.com.js
Browse files Browse the repository at this point in the history
  • Loading branch information
appdevelpo committed Oct 20, 2023
1 parent dd4106a commit 87de148
Showing 1 changed file with 38 additions and 33 deletions.
71 changes: 38 additions & 33 deletions repo/manhuagui.com.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==MiruExtension==
// @name 漫画柜
// @version v0.0.1
// @version v0.0.2
// @author appdevelpo
// @lang zh-cn
// @license MIT
Expand All @@ -10,49 +10,54 @@
// @webSite https://api-manhuagui.aoihosizora.top/v1
// @nsfw false
// ==/MiruExtension==
export default class Mangafx extends Extension {
export default class extends Extension {
async latest(page) {
const res = await this.request("", {
headers: {
"Miru-Url": "https://www.manhuagui.com/update/d30.html",
},
});
const bsxList = res.match(/<li>[\s\S]?<a class="cover"[\s\S]+?<\/li>/g);
const mangas = [];
bsxList.forEach((element) => {
const url = element.match(/src="\/\/cf.mhgui.com\/cpic\/m\/(\d+)/)[1];
const title = element.match(/title="(.+?)"/)[1];
const cover = "https:"+element.match(/src="(.+?)"/)[1];
mangas.push({
title,
url,
cover,
const bsxList = res.match(/<li>[\s\S]?<a class="cover"[\s\S]+?<\/li>/g);
const mangas = [];

bsxList.forEach((element) => {
const url_match = element.match(/href="\/comic\/(\d+)/);
const url = url_match ? url_match[1] : "";

const title_match = element.match(/title="(.+?)"/);
const title = title_match ? title_match[1] : null;
const coverMatch = element.match(/src="(.+?)"/);
const cover = coverMatch ? "https:" + coverMatch[1] : "";
mangas.push({
title,
url,
cover,
});
});
});
return mangas;
return mangas;
}

async search(kw, page) {
const res = await this.request("", {
headers: {
"Miru-Url": `https://www.manhuagui.com/s/${kw}.html`,
},
});
const bsxList = res.match(/<li class="cf">[\s\S]+?<\/li>/g);
const mangas = [];
bsxList.forEach((element) => {
const url = element.match(/href="\/comic\/(\d+)/)[1];
const title = element.match(/title="(.+?)"/)[1];
const cover = "https:"+element.match(/src="(.+?)"/)[1];
mangas.push({
title,
url,
cover,
const bsxList = res.match(/<li class="cf">[\s\S]+?<\/li>/g);
const mangas = [];
bsxList.forEach((element) => {
const url = element.match(/href="\/comic\/(\d+)/)[1];
const title = element.match(/title="(.+?)"/)[1];
const cover = "https:" + element.match(/src="(.+?)"/)[1];
mangas.push({
title,
url,
cover,
});
});
});
return mangas;
return mangas;
}

async detail(url) {
const res = await this.request(`/manga/${url}`);
const dat = res.data;
Expand All @@ -71,16 +76,16 @@ export default class Mangafx extends Extension {
],
};
}

async watch(url) {
const res = await this.request(`/manga/${url}`);
return {
urls: res.data.pages,
headers:{
headers: {
"Referer": "https://tw.manhuagui.com/",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36 Edg/107.0.1418.56"
}
}
};
}
}
}

0 comments on commit 87de148

Please sign in to comment.