-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add OremangaNet.mjs Add file OremangaNet.mjs * Update OremangaNet.mjs Sort the code correctly. * Update OremangaNet.mjs * Add Logo Oremanga Add file logo Oremanga * Delete src/web/img/connectors/Oremanga * Add file logo oremanga --------- Co-authored-by: MikeZeDev <MikeZeDev@users.noreply.github.com>
- Loading branch information
1 parent
33d2197
commit d4f1e97
Showing
2 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import Connector from '../engine/Connector.mjs'; | ||
import Manga from '../engine/Manga.mjs'; | ||
|
||
export default class OremangaNet extends Connector { | ||
|
||
constructor() { | ||
super(); | ||
super.id = 'oremanga'; | ||
super.label = 'Oremanga'; | ||
this.tags = [ 'manga', 'webtoon', 'thai' ]; | ||
this.url = 'https://www.oremanga.net'; | ||
this.path = '/manga-list/'; | ||
this.queryMangas = 'div.mangalist-blc ul li a.series'; | ||
this.queryChapters = 'ul.series-chapterlist li div.flexch-infoz a'; | ||
this.queryPages = 'div.reader-area source'; | ||
this.queryMangaTitle = 'div.series-title h2'; | ||
} | ||
|
||
async _getMangaFromURI(uri) { | ||
const request = new Request(uri, this.requestOptions); | ||
const data = await this.fetchDOM(request, this.queryMangaTitle); | ||
const id = uri.pathname; | ||
const title = data[0].textContent.trim(); | ||
return new Manga(this, id, title); | ||
} | ||
|
||
async _getMangas() { | ||
const request = new Request(new URL(this.path, this.url), this.requestOptions); | ||
const data = await this.fetchDOM(request, this.queryMangas); | ||
return data.map(element => { | ||
return{ | ||
id: this.getRelativeLink( element ), | ||
title: element.text.trim() | ||
}; | ||
}); | ||
} | ||
|
||
async _getChapters(manga) { | ||
const request = new Request(new URL(manga.id, this.url), this.requestOptions); | ||
const data = await this.fetchDOM(request, this.queryChapters); | ||
return data.map(element => { | ||
const titleElement = element.querySelector('span'); | ||
const bloat = titleElement.querySelector('.date'); | ||
if (bloat) titleElement.removeChild(bloat); | ||
return{ | ||
id: this.getRelativeLink( element ), | ||
title: element.querySelector('span').textContent.trim() | ||
}; | ||
}); | ||
} | ||
|
||
async _getPages(chapter) { | ||
const request = new Request(new URL(chapter.id, this.url), this.requestOptions); | ||
const data = await this.fetchDOM(request, this.queryPages); | ||
return data.map(element => this.getRootRelativeOrAbsoluteLink(element, this.url)); | ||
} | ||
} |