Skip to content
This repository was archived by the owner on Mar 23, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions plugins/catmanga/README.md

This file was deleted.

164 changes: 0 additions & 164 deletions plugins/catmanga/index.js

This file was deleted.

8 changes: 0 additions & 8 deletions plugins/catmanga/info.json

This file was deleted.

23 changes: 12 additions & 11 deletions plugins/cubari/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Cubari Proxy Plugin

This is the Mango plugin for [Cubari](https://cubari.moe/).

Note that

- Accepted Cubari chapter URLs look like `https://cubari.moe/read/gist/xxxxx/x/x/` or `https://cubari.moe/read/imgur/xxxxxx/x/x/`.
- Gist chapters will be placed in their respective series folder in your library.
- Imgur chapters will be placed in the `cubari` series folder in your library, named `imgur-{ID}`.
- nhentai chapter URLs are not supported. Use [this](https://github.com/hkalexling/mango-plugins/tree/master/plugins/nhentai) plugin instead.

# Cubari Proxy Plugin

This is the Mango plugin for [Cubari](https://cubari.moe/).

Note that

- Accepted Cubari chapter URLs look like `https://cubari.moe/read/gist/xxxxx/x/x/` or `https://cubari.moe/read/imgur/xxxxxx/x/x/` or `https://cubari.moe/read/mangasee/xxxxx/x/x/`.
- One can also download chapters from `mangasee` using this plugin. For example, a mangasee url like https://mangasee123.com/read-online/Tensei-Shitara-dai-Nana-Ouji-dattanode-Kimamani-Majutsu-o-Kiwamemasu-chapter-187-page-1.html can become https://cubari.moe/read/mangasee/Tensei-Shitara-dai-Nana-Ouji-dattanode-Kimamani-Majutsu-o-Kiwamemasu/187/1/ . Providing this URL to Cubari plugin will download the chapter.
- Mangasee and Gist chapters will be placed in their respective series folder in your library.
- Imgur chapters will be placed in the `cubari` series folder in your library, named `imgur-{ID}`.
- nhentai chapter URLs are not supported. Use [this](https://github.com/hkalexling/mango-plugins/tree/master/plugins/nhentai) plugin instead.

Maintained by [@TheBritishAccent](https://github.com/TheBritishAccent).
40 changes: 30 additions & 10 deletions plugins/cubari/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ function listChapters(query) {
manga.raise("Invalid Cubari URL.");
}

if (cubariURLMatch[1] != "gist" && cubariURLMatch[1] != "imgur") {
manga.raise("Invalid Cubari URL.");
}
// if (cubariURLMatch[1] != "gist" && cubariURLMatch[1] != "imgur") {
// manga.raise("Invalid Cubari URL.");
// }

var cubariType = cubariURLMatch[1]; // "imgur" or "gist"
var cubariType = cubariURLMatch[1]; // "imgur" or "gist" or "mangasee"
var mangaSlug = cubariURLMatch[2];
var mangaURL = API_URL + cubariType + "/series/" + mangaSlug + "/";

Expand Down Expand Up @@ -49,6 +49,7 @@ function listChapters(query) {
var slimObj = {};
slimObj["id"] = chapterID;
slimObj["title"] = chapterTitle;
slimObj["volume"] = chapter["volume"];

chapters.push(slimObj);
});
Expand All @@ -60,7 +61,7 @@ function listChapters(query) {
}

function selectChapter(id) {
var mangaIDMatch = /(gist|imgur)_{3}(.+?)_{3}(.+)$/.exec(id);
var mangaIDMatch = /(\w+)_{3}(.+?)_{3}(.+)$/.exec(id);
var cubariType = mangaIDMatch[1];
var mangaSlug = mangaIDMatch[2].replace(/\_/, "-"); // Convert '_' back to '-'
var chapterNum = mangaIDMatch[3].replace(/\_/, "."); // Convert '_' back to '.'
Expand All @@ -69,7 +70,7 @@ function selectChapter(id) {

var proxySlug = mangaSlug;

if (cubariType == "gist") {
if (cubariType != "imgur") {
var mangaURL = API_URL + cubariType + "/series/" + mangaSlug + "/";
var mangaJSONString = mango.get(mangaURL).body;

Expand All @@ -96,7 +97,11 @@ function selectChapter(id) {
proxySlug = mangaURLMatch[1];
}

chapterURL = API_URL + "imgur/chapter/" + proxySlug + "/";
if (cubariType == "gist") {
cubariType = "imgur";
}

chapterURL = API_URL + cubariType + "/chapter/" + proxySlug + "/";

var proxyJSONString = mango.get(chapterURL).body;

Expand All @@ -109,7 +114,14 @@ function selectChapter(id) {
imgURLs = [];
var chapterIndexAsArray = Object.keys(proxyJSON);
chapterIndexAsArray.forEach(function(index) {
imgURLs.push(proxyJSON[index]["src"]);
if (typeof proxyJSON[index] == "string") {
imgURLs.push(proxyJSON[index]);
} else if (proxyJSON[index] instanceof Object) {
imgURLs.push(proxyJSON[index]["src"]);
} else {
console.log(proxyJSON);
mango.raise("Failed to get image URLs.");
}
});

currentPage = 0;
Expand All @@ -127,7 +139,7 @@ function nextPage() {
}

var url = imgURLs[currentPage]
var filename = pad(currentPage, digits) + '.' + /\.(\w+)(\?.*)?$/.exec(url)[0];
var filename = pad(currentPage, digits)+ '.' + extension(url);

currentPage += 1;
return JSON.stringify({
Expand All @@ -141,4 +153,12 @@ function pad(n, width, z) {
z = z || '0';
n = n + '';
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
}

function extension(url) {
var extensionMatch = /\.(\w+)(\?.*)?$/.exec(url);
if (!extensionMatch) {
return "png";
}
return extensionMatch[0];
}
5 changes: 4 additions & 1 deletion plugins/dm5/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function listChapters(query) {
}

function reloadDM5() {
var url = 'http://www.dm5.com/m' + cid + '/';
var url = 'https://www.dm5.com/m' + cid + '/';

var html = mango.get(url, headers).body;
DM5 = {};
Expand Down Expand Up @@ -105,11 +105,14 @@ function nextPage() {
var imgAry = eval(html);
var imgURL = imgAry[0];
var filename = pad(currentPage, digits) + '.jpg'
var pageHeaders = Object.assign(headers);
pageHeaders['Referer'] = 'http://www.dm5.com/m' + cid;

currentPage += 1;

return JSON.stringify({
url: imgURL,
headers: pageHeaders,
filename: filename
});
}
Expand Down
2 changes: 2 additions & 0 deletions plugins/manganato/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
storage.json
subscriptions.json
14 changes: 11 additions & 3 deletions plugins/manganato/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const SEARCH_URL = "https://manganato.com/search/story/";
const MAIN_URL = "https://readmanganato.com/";
const MAIN_URL = "https://chapmanganato.to/";
const ALT_URL = "https://manganato.com/";

function searchManga(query) {
Expand Down Expand Up @@ -62,6 +62,14 @@ function parseTime(time) {
return year + "-" + months.indexOf(month) + "-" + day;
}


function newChapters(mangaId, after) {
var chapters = JSON.parse(listChapters(mangaId));
return JSON.stringify(chapters.filter(function (c) {
return c.published_at > after;
}));
}

function selectChapter(id) {
var mangaId = id.split("/")[0].toString();
const manga = getManga(mangaId);
Expand Down Expand Up @@ -116,7 +124,7 @@ function nextPage() {
authority: 'v13.mkklcdnv6tempv4.com',
accept: 'image/avif,image/webp,image/apng,image/svg+xml,image',
pragma: 'no-cache',
referer: 'https://readmanganato.com/'
referer: 'https://chapmanganato.to/'
}
});
}
}
8 changes: 0 additions & 8 deletions plugins/mangatx/info.json

This file was deleted.

4 changes: 2 additions & 2 deletions plugins/manhuadb/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ function selectChapter(id) {
if (res.status_code !== 200)
mango.raise('Failed to get chapter. Status ' + res.status_code);
var html = res.body;
var script = mango.text(mango.css(html, 'script')[7]);
script = script.substring(16, script.length - 2);
var script = mango.css(html, 'script')[7];
script = script.substring(16 + 8, script.length - 2 - 9);
var img_urls = JSON.parse(Base64.decode(script));
var img_url_front = mango.attribute(mango.css(html, '.show-pic')[0], 'src');
img_url_front = img_url_front.substring(0, img_url_front.search(img_urls[0]['img']));
Expand Down
2 changes: 2 additions & 0 deletions plugins/webtoons/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
storage.json
subscriptions.json
Loading