Commit f31416ef authored by Duhoux Pierre-Louis's avatar Duhoux Pierre-Louis

New mirrors in foreign languages (arabic, turkish, italian)

parent b4ba35cc
if (typeof registerMangaObject === 'function') {
registerMangaObject({
mirrorName: "ItaScan",
mirrorIcon: "itascan.png",
languages: "it",
domains: ["itascan.info"],
home: "https://itascan.info/",
getMangaList: async function (search) {
let json = await amr.loadJson("https://itascan.info/json/manga/" + search + ".json", { post: true, nocache: true })
let res = [];
for (let serie of json) {
res.push([serie.text, "https://itascan.info" + serie.url]);
}
return res;
},
getListChaps: async function (urlManga) {
let doc = await amr.loadPage(urlManga, { nocache: true, preventimages: true })
let res = [];
$("table a[href^='/view/']", doc).each(function (index) {
res.push([$(this).text(), "https://itascan.info" + $(this).attr("href")]);
});
return res
},
getInformationsFromCurrentPage: async function (doc, curUrl) {
let mg = $(".breadcrumb a[href^='/manga/']", doc)
return {
name: mg.text(),
currentMangaURL: "https://itascan.info" + mg.attr("href"),
currentChapterURL: "https://itascan.info" + $(".breadcrumb select.selectpicker:first option:selected", doc).val()
}
},
getListImages: async function (doc, curUrl) {
$(".breadcrumb select.selectpicker:first option:selected")
var res = [];
$(".breadcrumb select#page_manga option", doc).each(function (index) {
res[res.length] = "https://itascan.info" + $(this).val();
});
return res;
},
getImageFromPageAndWrite: async function (urlImg, image) {
let doc = await amr.loadPage(urlImg)
var src = "https:" + $("#page img.open", doc).attr("src");
$(image).attr("src", src);
},
whereDoIWriteScans: function (doc, curUrl) {
return $(".amr-container", doc);
},
isCurrentPageAChapterPage: function (doc, curUrl) {
return $("#page img.open", doc).length > 0
},
doSomethingBeforeWritingScans: function (doc, curUrl) {
$(".container", doc).remove();
$(".navbar", doc).after("<div class='amr-container'></div>")
},
doAfterMangaLoaded: function (doc, curUrl) {
}
})
}
\ No newline at end of file
if (typeof registerMangaObject === 'function') {
registerMangaObject({
mirrorName: "Manga Al-arab",
canListFullMangas: false,
mirrorIcon: "mangaae.png",
languages: "ar",
domains: ["www.manga.ae"],
home: "https://www.manga.ae/",
getMangaList: async function (search) {
let doc = await amr.loadPage("https://www.manga.ae/manga/search%3A" + search, {
nocache: true,
preventimages: true,
headers: {"user-agent": "Mozilla/5.0"} // if no user agent, manga al arab server failed
})
let res = []
$("#mangadirectory .mangacontainer", doc).each(function (index) {
let a = $("a.manga:first", $(this))
res.push([a.text(), a.attr("href")]);
});
return res
},
getListChaps: async function (urlManga) {
let doc = await amr.loadPage(urlManga, {
nocache: true,
preventimages: true,
headers: {"user-agent": "Mozilla/5.0"} // if no user agent, manga al arab server failed
})
let res = [];
$("ul.new-manga-chapters a.chapter", doc).each(function (index) {
res.push([$(this).text(), $(this).attr("href")]);
});
return res
},
getInformationsFromCurrentPage: async function (doc, curUrl) {
let mg = $(".showchapterdirectory .manga", doc)
return {
"name": mg.text(),
"currentMangaURL": this.addTrailingSlash(mg.attr("href")),
"currentChapterURL": this.addTrailingSlash($(".showchapterdirectory .chapter", doc).attr("href"))
}
},
addTrailingSlash: function(url) {
if (!url) return url
if (url.lastIndexOf("/") !== url.length - 1) {
return url + "/"
}
return url
},
getListImages: async function (doc, curUrl) {
var res = [];
$("#morepages a", doc).each(function (index) {
res.push($(this).attr("href"));
});
return res;
},
getImageFromPageAndWrite: async function (urlImg, image) {
let doc = await amr.loadPage(urlImg, {
headers: {"user-agent": "Mozilla/5.0"} // if no user agent, manga al arab server failed
})
var src = $("#showchaptercontainer img", doc).attr("src");
$(image).attr("src", src);
},
whereDoIWriteScans: function (doc, curUrl) {
return $(".amr-container", doc);
},
isCurrentPageAChapterPage: function (doc, curUrl) {
return $("#showchaptercontainer img", doc).length > 0;
},
doSomethingBeforeWritingScans: function (doc, curUrl) {
let nav = $("#navbar", doc)
while (nav.next() && !nav.next().is(".footer")) {
nav.next().remove()
}
nav.after($("<div class='amr-container'></div>"))
},
doAfterMangaLoaded: function (doc, curUrl) {
}
})
}
if (typeof registerMangaObject === 'function') {
registerMangaObject({
mirrorName: "Manga Turk",
canListFullMangas: true,
mirrorIcon: "mangaturk.png",
languages: "tr",
domains: ["www.mangaoku.net"],
home: "http://www.mangaoku.net/",
getMangaList: async function (search) {
let doc = await amr.loadPage("http://www.mangaoku.net/", { nocache: true, preventimages: true })
let res = []
$("select[name='manga'] option", doc).each(function (index) {
if ($(this).val() !== "0") {
res[res.length] = [$(this).text(), "http://www.mangaoku.net/" + $(this).val()];
}
});
return res
},
getListChaps: async function (urlManga) {
let doc = await amr.loadPage(urlManga, { nocache: true, preventimages: true })
let res = [];
let mgpart = $("select[name='manga'] option:selected", doc).val()
$("select[name='chapter'] option", doc).each(function (index) {
res[res.length] = [$(this).text(), "http://www.mangaoku.net/" + mgpart + "/" + $(this).val()];
});
return res
},
getInformationsFromCurrentPage: async function (doc, curUrl) {
let mg = $("select[name='manga'] option:selected", doc)
let chpart = $("select[name='chapter'] option:selected", doc).val()
return {
"name": mg.text(),
"currentMangaURL": "http://www.mangaoku.net/" + mg.val(),
"currentChapterURL": "http://www.mangaoku.net/" + mg.val() + "/" + chpart
}
},
getListImages: async function (doc, curUrl) {
let mgpart = $("select[name='manga'] option:selected", doc).val()
let chpart = $("select[name='chapter'] option:selected", doc).val()
var res = [];
$("select[name='page'] option", doc).each(function (index) {
res[res.length] = "http://www.mangaoku.net/" + mgpart + "/" + chpart + "/" + $(this).val()
});
return res;
},
getImageFromPageAndWrite: async function (urlImg, image) {
let doc = await amr.loadPage(urlImg)
var src = "http://www.mangaoku.net/" + $("#manga_img", doc).attr("src");
$(image).attr("src", src);
},
whereDoIWriteScans: function (doc, curUrl) {
return $("#cont", doc);
},
isCurrentPageAChapterPage: function (doc, curUrl) {
return $("#manga_img", doc).length > 0 && $("#manga_img", doc).attr("src") !== "";
},
doSomethingBeforeWritingScans: function (doc, curUrl) {
$(".container", doc).remove()
$("#cont", 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