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

merche branch Dev3 #7565

Closed
wants to merge 113 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
5c114d9
Change Url for ComicHub
MikeZeDev Nov 9, 2022
074d500
Update Mangasushi url
MikeZeDev Nov 9, 2022
faddb56
Merge branch 'manga-download:master' into master
MikeZeDev Nov 9, 2022
d6a5312
Update Mangairo URL
MikeZeDev Nov 9, 2022
0612afc
Fixt test for fake image on IceKR
MikeZeDev Nov 10, 2022
85eddfa
Merge pull request #1 from MikeZeDev/MikeZeDev-patch-1
MikeZeDev Nov 10, 2022
947fea6
Fixing ComicFX
MikeZeDev Nov 10, 2022
c29d95f
Add OmegaScans icon
MikeZeDev Nov 10, 2022
4708191
Add OmegaScans connector
MikeZeDev Nov 10, 2022
204c0d9
Merge branch 'manga-download:master' into master
MikeZeDev Nov 10, 2022
88cbf09
Add scanhentaimenu icon
MikeZeDev Nov 10, 2022
44bdc0e
Add ScanHentaiMenu and LegionScan
MikeZeDev Nov 10, 2022
caf04ed
Add Akumanotenshi, Mangarolls, kawascans
MikeZeDev Nov 10, 2022
2319310
Add akumanotenshi icon
MikeZeDev Nov 10, 2022
002c55a
Add ManHatic and DrakeScans
MikeZeDev Nov 10, 2022
4025153
Add DrakeScans icon
MikeZeDev Nov 10, 2022
02b8936
Update KomikCast URL
MikeZeDev Nov 11, 2022
291d51f
Add BeautyManga
MikeZeDev Nov 11, 2022
20fd6cd
Add pururin support
MikeZeDev Nov 12, 2022
a851efd
Fix lint on ScanHentaiMenu
MikeZeDev Nov 12, 2022
25640d8
Merge branch 'manga-download:master' into master
MikeZeDev Nov 12, 2022
6f258b4
Merge branch 'manga-download:master' into MikeZeDev-work
MikeZeDev Nov 12, 2022
1f72e5a
Fixed BeautyManga formating
MikeZeDev Nov 12, 2022
70d04fc
Fixed bad class name
MikeZeDev Nov 12, 2022
d4d63f9
Add missing dummy icons
MikeZeDev Nov 12, 2022
19ef400
Fix another class
MikeZeDev Nov 12, 2022
d54ca1b
fix id case
MikeZeDev Nov 12, 2022
82c7960
Add MangaHereToday
MikeZeDev Nov 12, 2022
d2e47ba
Mangaheretoday icon
MikeZeDev Nov 12, 2022
dcfaf22
MangafoxFull icon
MikeZeDev Nov 12, 2022
3129e5c
Add MangaFoxFull connector
MikeZeDev Nov 12, 2022
aeabc6f
Add MadaraDex connector
MikeZeDev Nov 12, 2022
84bd755
Add madaradex icon
MikeZeDev Nov 12, 2022
9b01bc2
Add MangaChill connector
MikeZeDev Nov 12, 2022
d30bf77
Mangachill icon
MikeZeDev Nov 12, 2022
7e3c59d
Add Webcomic.me connector
MikeZeDev Nov 12, 2022
96ba148
Add webcomicme icon
MikeZeDev Nov 12, 2022
d63db43
Add ManhuaDragon connector
MikeZeDev Nov 12, 2022
14a26e4
Add Manhuadragon icon
MikeZeDev Nov 12, 2022
036d90b
Add painfulnightz connector
MikeZeDev Nov 12, 2022
0c02dfc
Add painfulnightz icon
MikeZeDev Nov 12, 2022
e9bd54d
Add Manga1st connector
MikeZeDev Nov 12, 2022
f39a772
Add Manga1st icon
MikeZeDev Nov 12, 2022
4cbe042
Merge branch 'manga-download:master' into master
MikeZeDev Nov 13, 2022
efa42b0
Merge pull request #2 from MikeZeDev/MikeZeDev-work
MikeZeDev Nov 13, 2022
23d52aa
Add icons for pururin and beautymanga
MikeZeDev Nov 13, 2022
409a8f6
Lint Fix attempt 1
MikeZeDev Nov 13, 2022
4fa1406
Attempt to Fix lint on pururin and beautymanga
MikeZeDev Nov 13, 2022
dd9031f
Attempt to fix lint on pururin and beautymanga 2
MikeZeDev Nov 13, 2022
edef6a4
FIx WebComicMe
MikeZeDev Nov 13, 2022
08bdea0
First attempt to use ToptoonGlobal api
MikeZeDev Nov 26, 2022
22749a0
Merge branch 'manga-download:master' into master
MikeZeDev Nov 29, 2022
b63f9f9
Merge branch 'manga-download:master' into Experiments
MikeZeDev Nov 30, 2022
7d7cde3
Attempt to fix ehentai "bounce login"
MikeZeDev Nov 30, 2022
000d4e1
Add NineMangaFR
MikeZeDev Nov 30, 2022
e197d06
Changes to Manhwas.net
MikeZeDev Dec 1, 2022
3e0d57b
Add NetComics
MikeZeDev Dec 1, 2022
9042110
Add NetComics icon
MikeZeDev Dec 1, 2022
72b3ac4
Merge branch 'manga-download:master' into MZD-dev3
MikeZeDev Dec 1, 2022
56429d0
Update Muctau
MikeZeDev Dec 1, 2022
c26d3f0
Merge branch 'manga-download:master' into Experiments
MikeZeDev Dec 2, 2022
95ef3c0
fixing Kakaopage
MikeZeDev Dec 2, 2022
b48986f
Add MangaTepesi
MikeZeDev Dec 2, 2022
db2a012
Add MangaTepesi Icon
MikeZeDev Dec 2, 2022
b0cf895
Add Nhentai.com
MikeZeDev Dec 2, 2022
2f1ca50
Nhentai.com icon
MikeZeDev Dec 2, 2022
17e14ca
Add Mangaowl.io
MikeZeDev Dec 2, 2022
4f5e69a
Add Mangaowl icon
MikeZeDev Dec 2, 2022
0ff670d
fix typo on mangaowl
MikeZeDev Dec 2, 2022
f9bec6e
Add truyenchapvn
MikeZeDev Dec 2, 2022
eb35f41
Add truyenchapvn icon
MikeZeDev Dec 2, 2022
56f3bea
Nhentai.com : dont fetch manga list
MikeZeDev Dec 3, 2022
6df2afa
deleted badly placed icon
MikeZeDev Dec 3, 2022
8d376c5
Add netcomics icon
MikeZeDev Dec 3, 2022
65ee41d
Add TaoSect
MikeZeDev Dec 3, 2022
f21072e
Add Tao Sect icon
MikeZeDev Dec 3, 2022
ebd4dcf
Lezhin fix attempt
MikeZeDev Dec 3, 2022
0ed7be4
removed acc token on lezhin
MikeZeDev Dec 3, 2022
5dd1fc6
Lezhin, but better
MikeZeDev Dec 3, 2022
0d88305
Add ReadNovelFULL (not working)
MikeZeDev Dec 4, 2022
932fcde
Merge branch 'manga-download:master' into Experiments
MikeZeDev Dec 4, 2022
f84a3b2
Merge branch 'manga-download:master' into MZD-dev3
MikeZeDev Dec 4, 2022
cb9b4ce
Merge branch 'manga-download:master' into Experiments
MikeZeDev Dec 8, 2022
8125285
Merge branch 'manga-download:master' into MZD-dev3
MikeZeDev Dec 8, 2022
1ef32f4
WIP : Mangadig and INKR
MikeZeDev Dec 8, 2022
3f3d017
Merge branch 'manga-download:master' into Experiments
MikeZeDev Dec 9, 2022
288c0db
Merge branch 'manga-download:master' into MZD-dev3
MikeZeDev Dec 9, 2022
a5814f0
Add KickassAnimeRo
MikeZeDev Dec 9, 2022
89d3475
Add Kaas (video host for KickAssAnime)
MikeZeDev Dec 9, 2022
1c7af9f
First attempt to handle OK.ru streams
MikeZeDev Dec 11, 2022
41599cb
Add Cuutruyen connector
MikeZeDev Dec 13, 2022
c4c2183
Add files via upload
MikeZeDev Dec 27, 2022
7187f57
lint
MikeZeDev Dec 31, 2022
3f5e0a0
Add files via upload
MikeZeDev Dec 31, 2022
5c8f348
Update MangaTepesi.mjs
MikeZeDev Jan 9, 2023
23e6248
Update NHentaiCom.mjs
MikeZeDev Jan 9, 2023
0a83637
Update TaoSect.mjs
MikeZeDev Jan 9, 2023
2730259
Update NHentaiCom.mjs
MikeZeDev Jan 18, 2023
b7bcdb8
Update NetComics.mjs
MikeZeDev Jan 20, 2023
07c7657
Update NetComics.mjs
MikeZeDev Jan 20, 2023
dd659ea
Update NetComics.mjs
MikeZeDev Apr 11, 2023
c30430f
INKR : finally it works
MikeZeDev Jun 15, 2023
dccaa04
INKR: handle no unlocked chapters
MikeZeDev Jun 15, 2023
c7d2cd1
INKR : code refactoring <3
MikeZeDev Jun 15, 2023
c7abff0
INKR: get best picture resolution
MikeZeDev Jun 17, 2023
22edbb0
Bookwalker test
MikeZeDev Jul 7, 2023
a5787c1
Update INKR.mjs
MikeZeDev Jul 7, 2023
8a5f9c3
Add manga listing <3
MikeZeDev Jul 7, 2023
037ec45
Add TopMangasFR
MikeZeDev Jul 16, 2023
c7aae46
Merge branch 'master' into Experiments
MikeZeDev Nov 24, 2024
c344fb7
updates
MikeZeDev Nov 24, 2024
256cae9
Merge pull request #5 from MikeZeDev/Experiments
MikeZeDev Nov 24, 2024
0155af5
Merge branch 'master' into MZD-dev3
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ cache
/redist/*.zip
/test/*.log
junit.xml
.idea/
.idea/
.vs
Binary file added src/web/img/connectors/beautymanga
Binary file not shown.
Binary file added src/web/img/connectors/mangatepesi
Binary file not shown.
Binary file added src/web/img/connectors/taosect
Binary file not shown.
53 changes: 53 additions & 0 deletions src/web/mjs/connectors/BeautyManga.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import WordPressMadara from './templates/WordPressMadara.mjs';
export default class BeautyManga extends WordPressMadara {
constructor() {
super();
super.id = 'beautymanga';
super.label = 'BeautyManga';
this.tags = [ 'manga', 'webtoon', 'english' ];
this.url = 'https://mangadex.today';
this.path = '/popular-manga';
this.queryMangas = 'div.item-thumb.hover-details.c-image-hover a';
this.queryMangasPageCount = 'ul.pagination li:nth-last-of-type(2) a';
this.pathMangas = '?page=%PAGE%';
this.queryPages = 'p#arraydata';
this.mangaTitleFilter = '';
}
async _getMangasFromPage(page) {
let uri = new URL(this.path + this.pathMangas.replace('%PAGE%', page), this.url);
uri.pathname = uri.pathname.replace(/\/+/g, '/');
let request = new Request(uri, this.requestOptions);
let data = await this.fetchDOM(request, this.queryMangas);
return data.map(element => {
return {
id: new URL(element.href, request.url).pathname,
title: element.title.replace(this.mangaTitleFilter, '').trim()
};
});
}
async _getChaptersAjaxOld(mangaID) {
const uri = new URL('/ajax-list-chapter?mangaID='+mangaID, this.url);
const request = new Request(uri, {
method: 'GET'
});
const data = await this.fetchDOM(request, this.queryChapters);
if (data.length) {
return data;
} else {
throw new Error('No chapters found (new ajax endpoint)!');
}
}
async _getPages(chapter) {
let uri = new URL(chapter.id, this.url);
let request = new Request(uri, this.requestOptions);
let data = await this.fetchDOM(request, this.queryPages);
let el = data[0].innerText.split(',');
return el.map(element => {
const uri = new URL(this.getAbsolutePath(element, request.url));
return this.createConnectorURI({
url: uri.href,
referer: uri.origin
});
});
}
}
154 changes: 154 additions & 0 deletions src/web/mjs/connectors/BookWalker.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';

export default class BookWalker extends Connector {

constructor() {
super();
super.id = 'bookwalker';
super.label = 'BookWalker';
this.tags = [ 'manga', 'japanese' ];
this.url = 'https://global.bookwalker.jp';
}

async _getMangaFromURI(uri) {
let id = uri.pathname;
let request = new Request(uri, this.requestOptions);
let data = await this.fetchDOM(request, 'div.detail-book-title h1[itemprop="name"]');
let title = data[0].textContent.trim();
return new Manga(this, id, title);
}

async _getChapters(manga) {
const url = new URL(manga.id, this.url);
url.searchParams.set('sample', '2');
return [{id : url.pathname+url.search, title : 'Free Sample',}];
}

async _getPages(chapter) {
const script = `
new Promise((resolve, reject) => {
setTimeout(async () => {

const a2f = NFBR.a2F ? new NFBR.a2F() : new NFBR.a2f();
const params = new URL(window.location).searchParams;
const parameters = await a2f.a5W({
contentId: params.get(NFBR.a5q.Key.CONTENT_ID), // Content ID => 'cid'
a6m: params.get(NFBR.a5q.Key.LICENSE_TOKEN), // License Token => 'lit'
preview: params.get(NFBR.a5q.Key.LOOK_INSIDE) === '1', // Look Inside => 'lin'
contentType: params.get(NFBR.a5q.Key.CONTENT_TYPE) || 1, // Content Type => 'cty'
title: params.get(NFBR.a5q.Key.CONTENT_TITLE), // Content Title => 'cti'
winWidth: 3840,
winHeight: 2160
});

//Create a model
const model = new NFBR.a6G.Model({
'settings': new self.NFBR.Settings('NFBR.SettingData'),
'viewerFontSize': self.NFBR.a0X.a3k,
'viewerFontFace': self.NFBR.a0X.a3k,
'viewerSpreadDouble': true,
'viewerb5c': null,
'viewerSpread': {},
'queryParamForContentUrl' : parameters.contentAppendParam,
});
//Create the bookloader
const bl = new NFBR.a5n();
bl.B0a = "normal_default";

//Create a "Content" that will be filled using the bookloader as5 async function
let data = new NFBR.a6i.Content(parameters.url);
let v_a6L = new NFBR.a6G.a6L(model);
await bl.a5s(data, "configuration", v_a6L);

//console.log(data);

//data is now our JSON with all the infos
const pages = data.configuration.contents.map((page, index) => {

let mode = 'raw';
let extension = '.jpeg';

//*****************/
//GETTING PAGE URL
//*****************/
//Create a Page
const fPage = new NFBR.a6i.Page(index, page.file, "0", extension, "");
const realURL = v_a6L.getPageContentUrl_(data, fPage);


//*****************************/
//GETTING IMAGE SCRAMBLE DATA
//*****************************/

//Fill infos in the page for a7b to work
const fileinfos = data.files[index].FileLinkInfo.PageLinkInfoList[0].Page;
fPage.width = fileinfos.Size.Width;
fPage.height = fileinfos.Size.Height;
fPage.info = fileinfos;
//Fill more infos needed for unscrambling
fPage.A3j(data);

let blocks = [];
if (fileinfos.BlockHeight) //if we have a block size for the page, its a puzzle !
{
mode = 'puzzle';
blocks = window.NFBR.a6G.a5x.prototype.R8x(fPage, fPage.width, fPage.height)
}

return {
mode: mode,
imageUrl: realURL,
encryption: {
blocks: JSON.stringify(blocks),//stringify the array greatly speed up createConnectorURI
}
};
});

resolve(pages);


}, 1000);
});
`;
const uri = new URL( chapter.id, this.url );
const request = new Request( uri.href, this.requestOptions );
const data = await Engine.Request.fetchUI(request, script);
return data.map(page => page.mode == 'raw' ? page.imageUrl : this.createConnectorURI(page));
}

async _handleConnectorURI(payload) {
const uri = new URL(payload.imageUrl, this.url);
const request = new Request(uri, this.requestOptions);
const response = await fetch(request);
switch (payload.mode) {
case 'puzzle': {
let data = await response.blob();
data = await this._descrambleImage(data, payload.encryption.blocks);
return this._blobToBuffer(data);
}
default: {
let data = await response.blob();
return this._blobToBuffer(data);
}
}
}

async _descrambleImage(scrambled, blocks) {
let bitmap = await createImageBitmap(scrambled);
return new Promise(resolve => {
let canvas = document.createElement('canvas');
canvas.width = bitmap.width;
canvas.height = bitmap.height;
var ctx = canvas.getContext('2d');
const blockz = JSON.parse(blocks);
for (let q of blockz) {
ctx.drawImage(bitmap, q.destX, q.destY, q.width, q.height, q.srcX, q.srcY, q.width, q.height);
}
canvas.toBlob(data => {
resolve(data);
}, Engine.Settings.recompressionFormat.value, parseFloat(Engine.Settings.recompressionQuality.value)/100);
} );
}

}
135 changes: 135 additions & 0 deletions src/web/mjs/connectors/Cuutruyen.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';

export default class CuuTruyen extends Connector {
constructor() {
super();
super.id = 'cuutruyen';
super.label = 'Cứu Truyện';
this.tags = ['manga', 'vietnamese'];
this.url = 'https://cuutruyen.net';
}

async _getMangaFromURI(uri) {
const mangaid = uri.href.match(/\/mangas\/([0-9]+)/)[1];
const req = new URL(`/api/v2/mangas/${mangaid}`, this.url);
const request = new Request(req, this.requestOptions);
const { data: { name } } = await this.fetchJSON(request);
return new Manga(this, mangaid, name.trim());
}

async _getMangas() {
const uri = new URL('/api/v2/mangas/recently_updated?page=1&per_page=30', this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchJSON(request);
const pages = data._metadata.total_pages;

const mangaList = this._getMangasFromPage(data);

for (let page = 2; page <= pages; page++) {
const uri = new URL(`/api/v2/mangas/recently_updated?page=${page}&per_page=30`, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchJSON(request);
const mangas = this._getMangasFromPage(data);
mangaList.push(...mangas);
}
return mangaList;
}

_getMangasFromPage(data) {
return data.data.map((c) => ({
id: c.id,
title: c.name.trim(),
}));
}

async _getChapters(manga) {
const uri = new URL(`/api/v2/mangas/${manga.id}/chapters`, this.url);
const request = new Request(uri, this.requestOptions);
const { data } = await this.fetchJSON(request);
return data
.filter((chapter) => chapter.status === 'processed')
.map((chapter) => {
let title = `Chapter ${chapter.number}`;

if (chapter.name) {
title += `: ${chapter.name}`;
}

return { id: chapter.id, title };
});
}

async _getPages(chapter) {
const uri = new URL('/api/v2/chapters/' + chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const { data: { pages } } = await this.fetchJSON(request);

if (pages.some((image) => image.status !== 'processed')) {
throw new Error('This chapter is still processing, please try again later.');
}

return pages.map((image) => {
return this.createConnectorURI({
url: image.image_url,
drmData: image.drm_data,
});
});
}

async _handleConnectorURI(payload) {
const response = await fetch(payload.url, {
cache: 'no-cache',
referrer: `${this.url}/`,
headers: {
'accept': 'image/avif,image/webp,image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5',
},
});

if (!payload.drmData) {
return this._blobToBuffer(await response.blob());
}

const decryptedDrmData = this.decodeXorCipher(atob(payload.drmData), '3141592653589793');

if (!decryptedDrmData.startsWith('#v4|')) {
throw new Error(`Invalid DRM data (does not start with magic bytes): ${decryptedDrmData}`);
}

const image = await createImageBitmap(await response.blob());
const canvas = document.createElement('canvas');

canvas.width = image.width;
canvas.height = image.height;

const ctx = canvas.getContext('2d');
let sy = 0;

for (const t of decryptedDrmData.split('|').slice(1)) {
const [dy, height] = t.split('-', 2).map(Number);

ctx.drawImage(image, 0, sy, image.width, height, 0, dy, image.width, height);
sy += height;
}

return this._blobToBuffer(await this._canvasToBlob(canvas));
}

_canvasToBlob(canvas) {
return new Promise(resolve => {
canvas.toBlob(data => {
resolve(data);
}, Engine.Settings.recompressionFormat.value, parseFloat(Engine.Settings.recompressionQuality.value) / 100);
});
}

decodeXorCipher(data, key) {
let output = "";

for (let i = 0; i < data.length; i++) {
output += String.fromCharCode(data.charCodeAt(i) ^ key.charCodeAt(i % key.length));
}

return output;
}
}
Loading
Loading