Commit 838645d0 authored by Duhoux Pierre-Louis's avatar Duhoux Pierre-Louis

MangaHost (brasilian portuguese)

parent fc4f0682
if (typeof registerMangaObject === 'function') {
registerMangaObject({
mirrorName: "MangaHost",
canListFullMangas: false,
mirrorIcon: "mangahost.png",
languages: "br,pt",
domains: ["mangahost-br.cc"],
home: "https://mangahost-br.cc/",
getMangaList: async function (search) {
let doc = await amr.loadPage("https://mangahost-br.cc/find/" + search, {
nocache: true,
preventimages: true
})
let res = []
$(".table-search h3.entry-title a", doc).each(function (index) {
res.push([$(this).text(), $(this).attr("href")]);
});
return res
},
getListChaps: async function (urlManga) {
let doc = await amr.loadPage(urlManga, {
nocache: true,
preventimages: true
})
let res = [];
if ($("ul.list_chapters li a", doc).length > 0) {
$("ul.list_chapters li a", doc).each(function (index) {
res.push([$(this).attr("title"), urlManga + "/" + $(this).attr("id")]);
});
} else {
$("a.capitulo", doc).each(function (index) {
res.push([$(this).text(), $(this).attr("href")]);
});
}
return res
},
getInformationsFromCurrentPage: async function (doc, curUrl) {
let mg = $(".breadcrumb a[href*='/manga/']:first", doc)
let url = mg.attr("href")
let urlnomh = url.substr(0, url.indexOf("-mh"))
return {
"name": mg.text(),
"currentMangaURL": urlnomh,
"currentChapterURL": (curUrl.indexOf(url) >= 0 ? url : urlnomh) + "/" + $("select.chapters option:selected", doc).val()
}
},
getListImages: async function (doc, curUrl) {
var res = [];
var images = amr.getVariable("images", doc)
return images.map(astr => {
return $("img", $(astr)).attr("src")
})
},
getImageFromPageAndWrite: async function (urlImg, image) {
$(image).attr("src", urlImg);
},
whereDoIWriteScans: function (doc, curUrl) {
return $(".content-site", doc)
},
isCurrentPageAChapterPage: function (doc, curUrl) {
return $("#imageWrapper img", doc).length > 0;
},
doSomethingBeforeWritingScans: function (doc, curUrl) {
$(".content-site", doc).empty()
},
doAfterMangaLoaded: function (doc, curUrl) {
}
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment