Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge branch 4 #8

Merged
merged 59 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
c6aaa26
Merge branch 'manga-download:master' into master
MikeZeDev Dec 1, 2022
57d0245
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Dec 4, 2022
c1a715e
Add projectsuki icon
MikeZeDev Dec 4, 2022
f4bf377
Add ProjectSuki
MikeZeDev Dec 4, 2022
a2b74e2
Add niceoppai Icon
MikeZeDev Dec 4, 2022
f205a50
Add NiceOppai
MikeZeDev Dec 4, 2022
45432bb
Update WordPressLightPro to use new coding style
MikeZeDev Dec 4, 2022
9131628
Add Mangatigre icon
MikeZeDev Dec 5, 2022
d20ca17
Add MangaTigre
MikeZeDev Dec 5, 2022
29694bb
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Dec 6, 2022
35a2ea2
Add ManhwaManga
MikeZeDev Dec 6, 2022
b5e3b1f
add ManhwaManga icon
MikeZeDev Dec 6, 2022
dde50ed
Add TruyenVN
MikeZeDev Dec 6, 2022
c3e93ea
add truyenvn icon
MikeZeDev Dec 6, 2022
9388eb3
Add ManhuaDB
MikeZeDev Dec 6, 2022
2e48ad5
add ManhuaDB icon
MikeZeDev Dec 6, 2022
a67ed74
Add ManhuaDB
MikeZeDev Dec 6, 2022
af59019
Add Manhuadb icon
MikeZeDev Dec 6, 2022
65d6b07
Add ManhuaDB
MikeZeDev Dec 6, 2022
a7e527c
Add MangaScanWS
MikeZeDev Dec 7, 2022
40d5157
Add MangaScanWS icon
MikeZeDev Dec 7, 2022
00df95d
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Dec 8, 2022
e5eb42c
Add NovelMania
MikeZeDev Dec 8, 2022
dd4bbaa
add novelmania icon
MikeZeDev Dec 8, 2022
478f093
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Dec 9, 2022
0c0ec7f
Code refactor on MangaScanWS
MikeZeDev Dec 18, 2022
1c7fd42
Add files via upload
MikeZeDev Dec 27, 2022
91a9f87
Fix lint
MikeZeDev Dec 31, 2022
8a204b2
Delete BeautyManga.mjs
MikeZeDev Jan 3, 2023
fab6657
Delete MadaraDex.mjs
MikeZeDev Jan 3, 2023
2150d3d
Delete manga1st
MikeZeDev Jan 3, 2023
53f1078
Delete Manga1st.mjs
MikeZeDev Jan 3, 2023
1d54c34
Delete MangaHereToday.mjs
MikeZeDev Jan 3, 2023
934b0c1
Delete MangaFull.mjs
MikeZeDev Jan 3, 2023
3ca5222
Delete ManhwaFull.mjs
MikeZeDev Jan 3, 2023
2650d31
Delete MangaFoxFull.mjs
MikeZeDev Jan 3, 2023
8989a3f
Delete mangafoxfull
MikeZeDev Jan 3, 2023
ab6bef4
Delete ManhuaDragon.mjs
MikeZeDev Jan 3, 2023
afc22aa
Delete manhuadragon
MikeZeDev Jan 3, 2023
22eeb00
Delete beautymanga
MikeZeDev Jan 3, 2023
0f612c9
Delete madaradex
MikeZeDev Jan 3, 2023
eff3e37
Delete mangachill
MikeZeDev Jan 3, 2023
d499de3
Delete mangaheretoday
MikeZeDev Jan 3, 2023
f8b62d7
Delete painfulnightz
MikeZeDev Jan 3, 2023
19dc093
Delete webcomicme
MikeZeDev Jan 3, 2023
03a0f7a
Delete MangaChill.mjs
MikeZeDev Jan 3, 2023
6313b2f
Create MangaFull.mjs
MikeZeDev Jan 3, 2023
a9f5c91
Delete PainfulNightz.mjs
MikeZeDev Jan 3, 2023
62a3eda
Add files via upload
MikeZeDev Jan 3, 2023
01a03be
Delete Webcomicme.mjs
MikeZeDev Jan 3, 2023
4601a26
Delete Pururin.mjs
MikeZeDev Jan 3, 2023
539b0e3
Update MangaFull.mjs
MikeZeDev Jan 3, 2023
e8658a0
Create Pururin.mjs
MikeZeDev Jan 3, 2023
35eacf8
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Jan 3, 2023
0d9b523
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Jan 6, 2023
956c054
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Jan 8, 2023
1d64edd
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Jan 9, 2023
dd866e2
Merge branch 'manga-download:master' into MZD-dev4
MikeZeDev Jan 12, 2023
8a1e815
Merge branch 'master' into MZD-dev4
MikeZeDev Nov 24, 2024
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
Binary file added src/web/img/connectors/mangascanws
Binary file not shown.
File renamed without changes.
Binary file added src/web/img/connectors/manhuadb
Binary file not shown.
Binary file added src/web/img/connectors/manhwamanga
Binary file not shown.
Binary file added src/web/img/connectors/niceoppai
Binary file not shown.
Binary file added src/web/img/connectors/novelmania
Binary file not shown.
Binary file added src/web/img/connectors/projectsuki
Binary file not shown.
Binary file added src/web/img/connectors/truyenvn
Binary file not shown.
53 changes: 0 additions & 53 deletions src/web/mjs/connectors/BeautyManga.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion src/web/mjs/connectors/MangaFull.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ export default class MangaFull extends Connector {
callback( error, undefined );
} );
}
}
}
25 changes: 25 additions & 0 deletions src/web/mjs/connectors/MangaScanWS.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import MangaReaderCMS from './templates/MangaReaderCMS.mjs';

export default class MangaScanWS extends MangaReaderCMS {

constructor() {
super();
super.id = 'mangascanws';
super.label = 'MangaScanWS';
this.tags = [ 'manga', 'webtoon', 'french' ];
this.url = 'https://mangascan.ws';
}
async _getPages(chapter) {
const data = await super._getPages(chapter);
return data.map(element => this.createConnectorURI(element));
}
async _handleConnectorURI(payload) {
let request = new Request(payload, this.requestOptions);
request.headers.set('x-referer', this.url);
let response = await fetch(request);
let data = await response.blob();
data = await this._blobToBuffer(data);
this._applyRealMime(data);
return data;
}
}
104 changes: 104 additions & 0 deletions src/web/mjs/connectors/MangaTigre.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';

export default class MangaTigre extends Connector {
constructor() {
super();
super.id = 'mangatigre';
super.label = 'MangaTigre';
this.tags = [ 'manga', 'webtoon', 'spanish' ];
this.url = 'https://www.mangatigre.net';
this.token = undefined;
this.requestOptions.headers.set('x-origin', this.url);
this.booktype = {
1: "manga",
2: "manhwa",
3: "manhua",
};
}

async _getMangas() {
const uri = new URL('/mangas', this.url);
await this.getToken(uri);
let mangaList = [];
for (let page = 1, run = true; run; page++) {
const mangas = await this._getMangasFromPage(page);
mangas.length > 0 ? mangaList.push(...mangas) : run = false;
}
return mangaList;
}

async _getMangasFromPage(page) {
const uri = new URL('/mangas', this.url);
const request = new Request(uri, {
method: 'POST',
body: JSON.stringify({_token : this.token, page : page}),
headers: {
'content-type': 'application/json',
'x-referer': uri.href
}
});
const response = await fetch(request);
const data = await response.json();
return data.data.map(element => {
let btype = this.booktype[element.type];
return {
id: '/'+btype+'/'+element.slug,
title: element.name.trim()
};
});
}

async _getChapters(manga) {
const slug = manga.id.split('/')[2];
const uri = new URL(manga.id, this.url);
await this.getToken(uri);
const request = new Request(uri, {
method: 'POST',
body: JSON.stringify({_token : this.token}),
headers: {
'content-type': 'application/json',
'x-referer': uri.href
}
});
const data = await this.fetchDOM(request, 'a');
return data.map(element => {
return {
id: element.pathname,
title: element.text.trim()
};
});
}

async _getPages(chapter) {
const uri = new URL(chapter.id, this.url);
const script = `
new Promise(resolve => {
resolve({
chap : window.chapter, cdn : window.cdn
});
});
`;
const request = new Request(uri);
const response = await Engine.Request.fetchUI(request, script);
const chap = JSON.parse(response.chap);
const CDN = response.cdn;
let keyz = Object.keys(chap.images).sort();
let pagelist = [];
for (let i = 0; i < keyz.length; i++ ) {
let key = keyz[i];
let image = chap.images[key];
let link = '//'.concat(CDN, '/chapters/').concat(chap.manga.slug, '/').concat(chap.number, '/').concat(image.name, '.').concat(image.format);
pagelist.push(this.getAbsolutePath(link, request.url));
}
return pagelist;
}
async getToken(url) {
try{
let request = new Request(url, this.requestOptions);
let data = await this.fetchDOM(request, 'button[data-token]', 3);
this.token = data[0].getAttribute('data-token');
} catch(e) {
}
}
}
72 changes: 72 additions & 0 deletions src/web/mjs/connectors/ManhuaDB.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';
export default class ManhuaDB extends Connector {
constructor() {
super();
super.id = 'manhuadb';
super.label = 'ManhuaDB';
this.tags = [ 'manga', 'webtoon', 'chinese' ];
this.url = 'https://www.manhuadb.com';
this.path = '/manhua/list.html';
this.queryMangas = 'div.media.comic-book-unit div.media-body h2 > a';
this.queryMangasPagesArray = 'select#page-selector option';
this.queryChapters = 'ol.links-of-books li a';
this.queryPages = 'div.content-text source[loading="lazy"]';
this.queryMangaTitleURI = 'div.comic-main-section div.comic-info h1.comic-title';
}
async _getMangaFromURI(uri) {
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryMangaTitleURI);
return new Manga(this, uri.pathname, data[0].textContent.trim());
}
async _getMangas() {
let mangaList = [];
const uri = new URL(this.path, this.url);
const request = new Request(uri, this.requestOptions);
const pagesArray = await this.fetchDOM(request, this.queryMangasPagesArray);
for(let i = 0; i < pagesArray.length; i++) {
const page = new URL(pagesArray[i].value, this.url);
const mangas = await this._getMangasFromPage(page);
mangaList.push(...mangas);
}
return mangaList;
}
async _getMangasFromPage(uri) {
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryMangas);
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim()
};
});
}
async _getChapters(manga) {
const uri = new URL(manga.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryChapters);
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.title.trim()
};
}).reverse();
}
async _getPages(chapter) {
const uri = new URL(chapter.id, this.url);
const script = `
new Promise(resolve => {
resolve({
img_pre : window.img_pre, img_data_arr : window.img_data_arr , img_host : window.img_host
});
});
`;
const request = new Request(uri);
const response = await Engine.Request.fetchUI(request, script);
let pagelist = [];
response.img_data_arr.forEach(image =>{
pagelist.push(response.img_host+response.img_pre +image.img);
});
return pagelist;
}
}
62 changes: 62 additions & 0 deletions src/web/mjs/connectors/ManhwaManga.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';
export default class ManhwaManga extends Connector {
constructor() {
super();
super.id = 'manhwamanga';
super.label = 'ManhwaManga';
this.tags = [ 'manga', 'webtoon', 'english', 'hentai' ];
this.url = 'https://manhwamanga.net';
this.path = '/latest-updates';
this.queryMangas = 'a.item-cover';
this.queryMangasPagesCount = 'ul.pagination li:last-of-type a';
this.queryChapters = 'div.episode-list div.main a';
this.queryPages = 'div#viewer source[data-src]';
this.queryMangaTitleURI = 'h1.item-title span';
}
async _getMangaFromURI(uri) {
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryMangaTitleURI);
return new Manga(this, uri.pathname, data[0].textContent.trim());
}
async _getMangas() {
let mangaList = [];
const uri = new URL(this.path, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryMangasPagesCount);
const pageCount = parseInt(data[0].getAttribute('data-page'));
for(let page = 1; page <= pageCount; page++) {
const mangas = await this._getMangasFromPage(page);
mangaList.push(...mangas);
}
return mangaList;
}
async _getMangasFromPage(page) {
const uri = new URL(this.path + '/page/'+ page, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryMangas);
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.title.trim()
};
});
}
async _getChapters(manga) {
const uri = new URL(manga.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryChapters);
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.querySelector('b').textContent.trim()
};
});
}
async _getPages(chapter) {
const uri = new URL(chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryPages);
return data.map(image => this.getAbsolutePath(image.getAttribute('data-src'), request.url));
}
}
35 changes: 35 additions & 0 deletions src/web/mjs/connectors/NiceOppai.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import WordPressLightPro from './templates/WordPressLightPro.mjs';

export default class NiceOppai extends WordPressLightPro {

constructor() {
super();
super.id = 'niceoppai';
super.label ='NiceOppai';
this.tags = ['manga', 'thai'];
this.url = 'https://www.niceoppai.net';
this.path = '/manga_list/all/any/name-az/';
this.queryMangas = 'div.mng_lst div.nde div.det a';
this.queryChapters = 'div.mng_det ul.lst li a.lst';
this.queryPages = 'div#image-container source';
}

async _getChaptersFromPage(manga, page) {
const request = new Request (new URL(this.url + manga.id+ 'chapter-list/' + page), this.requestOptions);
const data = await this.fetchDOM(request, this.queryChapters);
return data.map(element => {
return {
id: this.getRelativeLink( element ),
title: element.innerText.replace( manga.title, '' ).trim(),
language: this.language
};
});
}

async _getPages(chapter) {
const uri = new URL(chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryPages);
return data.map(image => this.getAbsolutePath(image, request.url));
}
}
Loading
Loading