Skip to content

Commit

Permalink
merge from master (#2805)
Browse files Browse the repository at this point in the history
* [Mgkomik] add website support (#2767)

* [SundayWebry] Add support for Yoru titles (#2784) (#2789)

* [nightcomic, neoxscan] updated domain (#2770)

* [comickiba] fixed page query (#2773)

* [morpheusfansub] added website support (#2775)

* [geceninlordu] added website support (#2775)

* [shosetsumanga] removed dead website (#2775)

* [manhwahentai] removed broken website (#2775)

* [komiku] provide full manga list (including website's broken manga links) (#2776)

* [hentai2read] fixed CSS queries, updated to async API method (#2777)

* [readhentai] added website support (#2778)

* [mangakatana] force image mime type detection, migrate to async API (#2780)

* [pixiv] fixed image link detection (#2788)

* [scantrad] updated base url for image links (#2791)

* [sekaikomik] fixed CSS queries (#2793)

* Fix ScanManga connector for french users (#2799)

* [skymangas] changed template (#2802)

* [pojokmanga] fixed copy & paste support (#2803)

* [team1x1] fixed page query (#2804)

Co-authored-by: Naufal Hakim <31276236+manh21@users.noreply.github.com>
Co-authored-by: bluefox57 <76176720+bluefox57@users.noreply.github.com>
Co-authored-by: Fabien Caylus <fabien.caylus@gmail.com>
  • Loading branch information
4 people authored Dec 22, 2020
1 parent d904ef4 commit c16c329
Show file tree
Hide file tree
Showing 27 changed files with 182 additions and 239 deletions.
Binary file added src/web/img/connectors/geceninlordu
Binary file not shown.
Binary file removed src/web/img/connectors/manhwahentai
Binary file not shown.
Binary file added src/web/img/connectors/mgkomik
Binary file not shown.
Binary file added src/web/img/connectors/morpheusfansub
Binary file not shown.
Binary file added src/web/img/connectors/readhentai
Binary file not shown.
Binary file removed src/web/img/connectors/shosetsumanga
Binary file not shown.
2 changes: 0 additions & 2 deletions src/web/mjs/connectors/ComicKiba.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ export default class ComicKiba extends WordPressMadara {
super.label = 'Comic Kiba';
this.tags = [ 'manga', 'webtoon', 'english' ];
this.url = 'https://comickiba.com';

this.queryPages = 'div.read-container source[src]:not([src=""])';
}
}
12 changes: 12 additions & 0 deletions src/web/mjs/connectors/GeceninLordu.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import WordPressMadara from './templates/WordPressMadara.mjs';

export default class GeceninLordu extends WordPressMadara {

constructor() {
super();
super.id = 'geceninlordu';
super.label = 'Gecenin Lordu';
this.tags = [ 'manga', 'webtoon', 'turkish' ];
this.url = 'https://geceninlordu.com';
}
}
125 changes: 43 additions & 82 deletions src/web/mjs/connectors/Hentai2Read.mjs
Original file line number Diff line number Diff line change
@@ -1,103 +1,64 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';

/**
*
*/
export default class Hentai2Read extends Connector {

/**
*
*/
constructor() {
super();
// Public members for usage in UI (mandatory)
super.id = 'hentai2read';
super.label = 'Hentai2R';
this.tags = [ 'hentai', 'english' ];
super.isLocked = false;
// Private members for internal usage only (convenience)
this.url = 'https://hentai2read.com';
// Private members for internal use that can be configured by the user through settings menu (set to undefined or false to hide from settings menu!)
this.config = undefined;
}

/**
*
*/
_getMangaListFromPages( mangaPageLinks, index ) {
index = index || 0;
return this.fetchDOM( mangaPageLinks[ index ], 'div.img-container div.img-overlay > a', 5 )
.then( data => {
let mangaList = data.map( element => {
return {
id: this.getRelativeLink( element ),
title: element.text.trim()
};
} );
if( index < mangaPageLinks.length - 1 ) {
return this._getMangaListFromPages( mangaPageLinks, index + 1 )
.then( mangas => mangaList.concat( mangas ) );
} else {
return Promise.resolve( mangaList );
}
} );
async _getMangaFromURI(uri) {
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'main div.content span[itemprop="name"]');
return new Manga(this, uri.pathname, data[0].textContent.trim());
}

/**
*
*/
_getMangaList( callback ) {
this.fetchDOM( this.url + '/hentai-list', 'ul.pagination li:nth-last-child(2) a' )
.then( data => {
let pageCount = parseInt( data[0].text.trim() );
let pageLinks = [... new Array( pageCount ).keys()].map( page => this.url + '/hentai-list/all/any/all/name-az/' + ( page + 1 ) + '/' );
return this._getMangaListFromPages( pageLinks );
} )
.then( data => {
callback( null, data );
} )
.catch( error => {
console.error( error, this );
callback( error, undefined );
} );
async _getMangas() {
let mangaList = [];
const uri = new URL('/hentai-list', this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'ul.pagination li:nth-last-child(2) a');
const pageCount = parseInt(data[0].text.trim());
for(let page = 1; page <= pageCount; page++) {
let mangas = await this._getMangasFromPage(page);
mangaList.push(...mangas);
}
return mangaList;
}

/**
*
*/
_getChapterList( manga, callback ) {
this.fetchDOM( this.url + manga.id, 'ul.nav-chapters li div.media > a' )
.then( data => {
let chapterList = data.map( element => {
return {
id: this.getRelativeLink( element ),
title: element.firstChild.textContent.replace( manga.title, '' ).trim(),
language: 'en'
};
} );
callback( null, chapterList );
} )
.catch( error => {
console.error( error, manga );
callback( error, undefined );
} );
async _getMangasFromPage(page) {
const uri = new URL(`/hentai-list/all/any/all/name-az/${page}/`, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'div.book-grid div.overlay div.overlay-title a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim()
};
});
}

/**
*
*/
_getPageList( manga, chapter, callback ) {
fetch( this.url + chapter.id, this.requestOptions )
.then( response => response.text() )
.then( data => {
let pageList = data.match( /['"]images['"]\s*:\s*(\[[^\]]*?\])/ )[1];
pageList = JSON.parse( pageList );
pageList = pageList.map( image => 'https://static.hentaicdn.com/hentai' + image );
callback( null, pageList );
} )
.catch( error => {
console.error( error, chapter );
callback( error, undefined );
} );
async _getChapters(manga) {
const uri = new URL(manga.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'ul.nav-chapters li div.media > a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.firstChild.textContent.trim()
};
});
}

async _getPages(chapter) {
const uri = new URL(chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchRegex(request, /['"]images['"]\s*:\s*(\[[^\]]*?\])/g);
return JSON.parse(data[0]).map(image => 'https://static.hentaicdn.com/hentai' + image);
}
}
1 change: 1 addition & 0 deletions src/web/mjs/connectors/HentaiShark.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';

// also base class for readhentai
export default class HentaiShark extends Connector {

constructor() {
Expand Down
8 changes: 4 additions & 4 deletions src/web/mjs/connectors/Komiku.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ export default class Komiku extends Connector {
}

async _getMangas() {
const uri = new URL(this.url);
const uri = new URL('/daftar-komik/', this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'nav ul li[itemprop="name"], div.perapih div.ls2, section#Terbaru div.ls4w div.ls4');
const data = await this.fetchDOM(request, 'div.ls4 div.ls4j h4 a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element.querySelector('a[href*="/manga/"]'), this.url),
title: element.querySelector('a span, div.ls2j h4 a, div.ls4j h4 a').textContent.trim()
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim()
};
});
}
Expand Down
96 changes: 44 additions & 52 deletions src/web/mjs/connectors/MangaKatana.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';

export default class MangaKatana extends Connector {

Expand All @@ -10,67 +11,58 @@ export default class MangaKatana extends Connector {
this.url = 'https://mangakatana.com';
}

async _getMangaListPage(pageNumber) {
let request = new Request(this.url + '/manga/page/' + pageNumber, this.requestOptions);
let data = await this.fetchDOM(request, 'div#book_list div.item div.text h3.title a');
async _getMangaFromURI(uri) {
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'meta[property="og:title"]');
return new Manga(this, uri.pathname, data[0].content.trim());
}

async _getMangas() {
let mangaList = [];
const uri = new URL('/manga', this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'div#book_list ul.uk-pagination li:nth-last-of-type(2) a');
let pageCount = parseInt(data[0].href.match(/\/(\d+)$/)[1]);
for(let page = 1; page <= pageCount; page++) {
let mangas = await this._getMangasFromPage(page);
mangaList.push(...mangas);
}
return mangaList;
}

async _getMangasFromPage(page) {
const uri = new URL('/manga/page/' + page, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'div#book_list div.item div.text h3.title a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, request.url),
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim()
};
});
}

async _getMangaList(callback) {
try {
let mangaList = [];
let request = new Request(this.url + '/manga', this.requestOptions);
let data = await this.fetchDOM(request, 'div#book_list ul.uk-pagination li:nth-last-of-type(2) a');
let pageCount = parseInt(data[0].href.match(/\/(\d+)$/)[1]);
for(let page = 1; page <= pageCount; page++) {
let mangas = await this._getMangaListPage(page);
mangaList.push(...mangas);
}
callback(null, mangaList);
} catch(error) {
console.error(error, this);
callback(error, undefined);
}
async _getChapters(manga) {
const uri = new URL(manga.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'div.chapters table tbody tr td div.chapter a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim()
};
});
}

async _getChapterList(manga, callback) {
try {
let request = new Request(this.url + manga.id, this.requestOptions);
let data = await this.fetchDOM(request, 'div.chapters table tbody tr td div.chapter a');
let chapterList = data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, request.url),
title: element.text.trim(),
language: ''
};
async _getPages(chapter) {
const script = `
new Promise(resolve => {
resolve(ytaw);
});
callback(null, chapterList);
} catch(error) {
console.error(error, manga);
callback(error, undefined);
}
}

async _getPageList(manga, chapter, callback) {
try {
let script = `
new Promise(resolve => {
//let images = [...document.querySelectorAll('div#imgs div.wrap_img img')].map(img => img.src);
//resolve(images);
resolve(ytaw);
});
`;
let request = new Request(this.url + chapter.id, this.requestOptions);
let data = await Engine.Request.fetchUI(request, script);
callback(null, data);
} catch(error) {
console.error(error, manga);
callback(error, undefined);
}
`;
const uri = new URL(chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await Engine.Request.fetchUI(request, script);
return data.map(link => this.createConnectorURI(link));
}
}
14 changes: 0 additions & 14 deletions src/web/mjs/connectors/ManhwaHentai.mjs

This file was deleted.

13 changes: 13 additions & 0 deletions src/web/mjs/connectors/Mgkomik.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import WordPressMadara from './templates/WordPressMadara.mjs';

export default class Mgkomik extends WordPressMadara {

constructor() {
super();
super.id = 'mgkomik';
super.label = 'MGKOMIK';
this.tags = [ 'webtoon', 'indonesian' ];
this.url = 'https://mgkomik.my.id';
}

}
14 changes: 14 additions & 0 deletions src/web/mjs/connectors/MorpheusFansub.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import WordPressMadara from './templates/WordPressMadara.mjs';

export default class MorpheusFansub extends WordPressMadara {

constructor() {
super();
super.id = 'morpheusfansub';
super.label = 'Morpheus Fansub';
this.tags = [ 'manga', 'webtoon', 'turkish' ];
this.url = 'https://morpheus.animemangabilgileri.com';

this.queryTitleForURI = 'div.profile-manga div.post-title h1';
}
}
2 changes: 1 addition & 1 deletion src/web/mjs/connectors/NeoxScan.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export default class NeoxScan extends WordPressMadara {
super.id = 'neoxscan';
super.label = 'Neox Scanlator';
this.tags = [ 'manga', 'webtoon', 'portuguese', 'scanlation' ];
this.url = 'https://neoxscans.com';
this.url = 'https://neoxscans.net';
}
}
2 changes: 1 addition & 1 deletion src/web/mjs/connectors/NightComic.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ export default class NightComic extends WordPressMadara {
super.id = 'nightcomic';
super.label = 'NIGHT COMIC';
this.tags = [ 'webtoon', 'english' ];
this.url = 'https://nightcomic.com';
this.url = 'https://www.nightcomic.com';
}
}
Loading

0 comments on commit c16c329

Please sign in to comment.