-
Notifications
You must be signed in to change notification settings - Fork 484
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Pururin and many Madara websites (#5149)
* Add Pururin * Add MangaHereToday * Add MangaFoxFull * Add MadaraDex * Add MangaChill * Add Webcomic.me * Add ManhuaDragon * Add Manhuadragon * Add painfulnightz * Add Manga1st
- Loading branch information
Showing
17 changed files
with
181 additions
and
21 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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,24 @@ | ||
import WordPressMadara from './templates/WordPressMadara.mjs'; | ||
export default class MadaraDex extends WordPressMadara { | ||
constructor() { | ||
super(); | ||
super.id = 'madaradex'; | ||
super.label = 'MadaraDex'; | ||
this.tags = [ 'manga', 'webtoon', 'english' ]; | ||
this.url = 'https://madaradex.org'; | ||
this.requestOptions.headers.set('x-referer', this.url); | ||
} | ||
async _handleConnectorURI(payload) { | ||
let request = new Request(payload.url, this.requestOptions); | ||
request.headers.set('x-sec-fetch-dest', 'image'); | ||
request.headers.set('accept', 'image/avif,image/webp,*/*'); | ||
request.headers.set('x-sec-fetch-mode', 'no-cors'); | ||
request.headers.set('Upgrade-Insecure-Requests', 1); | ||
request.headers.set('x-user-agent', 'Mozilla/5.0 (iPod; CPU iPhone OS 14_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/87.0.4280.163 Mobile/15E148 Safari/604.1'); | ||
let response = await fetch(request); | ||
let data = await response.blob(); | ||
data = await this._blobToBuffer(data); | ||
this._applyRealMime(data); | ||
return data; | ||
} | ||
} |
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,10 @@ | ||
import WordPressMadara from './templates/WordPressMadara.mjs'; | ||
export default class Manga1st extends WordPressMadara { | ||
constructor() { | ||
super(); | ||
super.id = 'manga1st'; | ||
super.label = 'Manga1st'; | ||
this.tags = [ 'manga', 'webtoon', 'english' ]; | ||
this.url = 'https://manga1st.com'; | ||
} | ||
} |
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,10 @@ | ||
import WordPressMadara from './templates/WordPressMadara.mjs'; | ||
export default class MangaChill extends WordPressMadara { | ||
constructor() { | ||
super(); | ||
super.id = 'mangachill'; | ||
super.label = 'MangaChill'; | ||
this.tags = [ 'manga', 'webtoon', 'english' ]; | ||
this.url = 'https://mangachill.io'; | ||
} | ||
} |
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,11 @@ | ||
import WordPressMadara from './templates/WordPressMadara.mjs'; | ||
export default class MangaFoxFull extends WordPressMadara { | ||
constructor() { | ||
super(); | ||
super.id = 'mangafoxfull'; | ||
super.label = 'MangaFoxFull'; | ||
this.tags = [ 'manga', 'webtoon', 'english' ]; | ||
this.url = 'https://mangafoxfull.com'; | ||
this.requestOptions.headers.set('x-referer', this.url); | ||
} | ||
} |
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,26 @@ | ||
import AnyACG from './templates/AnyACG.mjs'; | ||
import Manga from '../engine/Manga.mjs'; | ||
|
||
export default class MangaHereToday extends AnyACG { | ||
constructor() { | ||
super(); | ||
super.id = 'mangaheretoday'; | ||
super.label = 'MangaHereToday'; | ||
this.tags = [ 'manga', 'english' ]; | ||
this.url = 'http://mangahere.today'; | ||
this.queryMangas = 'div.row div.media-body'; | ||
this.queryMangaLink = 'a'; | ||
this.queryChapters = 'div.total-chapter:nth-of-type(4) h4 a'; | ||
this.queryPages = 'div.chapter-content-inner p#arraydata'; | ||
this.queryMangaTitle = 'div.media-body'; | ||
this.queryMangaTitleText = 'h1.title-manga'; | ||
} | ||
async _getMangaFromURI(uri) { | ||
let request = new Request(uri, this.requestOptions); | ||
let data = await this.fetchDOM(request, this.queryMangaTitle); | ||
let id = uri.pathname + uri.search; | ||
//HACK We need to remove trailing "Manga" from the title | ||
let title = data[0].querySelector(this.queryMangaTitleText).textContent.replace(/\s+Manga$/i, '').trim(); | ||
return new Manga(this, id, title); | ||
} | ||
} |
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,10 @@ | ||
import WordPressMadara from './templates/WordPressMadara.mjs'; | ||
export default class ManhuaDragon extends WordPressMadara { | ||
constructor() { | ||
super(); | ||
super.id = 'manhuadragon'; | ||
super.label = 'ManhuaDragon'; | ||
this.tags = [ 'manga', 'webtoon', 'english' ]; | ||
this.url = 'https://manhuadragon.com'; | ||
} | ||
} |
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,10 @@ | ||
import WordPressMadara from './templates/WordPressMadara.mjs'; | ||
export default class PainfulNightz extends WordPressMadara { | ||
constructor() { | ||
super(); | ||
super.id = 'painfulnightz'; | ||
super.label = 'PainfulNightz'; | ||
this.tags = [ 'manga', 'webtoon', 'english' ]; | ||
this.url = 'https://painfulnightz.com'; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,31 +1,80 @@ | ||
import Connector from '../engine/Connector.mjs'; | ||
|
||
/** | ||
* | ||
*/ | ||
import Manga from '../engine/Manga.mjs'; | ||
export default class Pururin extends Connector { | ||
|
||
/** | ||
* | ||
*/ | ||
constructor() { | ||
super(); | ||
super.id = 'pururin'; | ||
super.label = 'Pururin'; | ||
this.tags = []; | ||
this.url = 'https://pururin.io'; | ||
this.links = { | ||
login: 'https://pururin.io/login' | ||
}; | ||
this.tags = ['manga', 'hentai', 'english']; | ||
this.url = 'https://pururin.to'; | ||
this.CDN = "https://cdn.pururin.to/assets/images/data/"; | ||
this.path = "/browse/title"; | ||
this.api = "/api/contribute/gallery/info"; | ||
this.queryMangasPageCount = 'ul.pagination.flex-wrap li:nth-last-of-type(2) a'; | ||
this.queryMangas = 'a.card.card-gallery'; | ||
this.queryChapters ='div.gallery-action a'; | ||
this.requestOptions.headers.set('x-referer', this.url); | ||
this.requestOptions.headers.set('x-origin', this.url); | ||
} | ||
async _getMangas() { | ||
let mangaList = []; | ||
const uri = new URL(this.path, this.url); | ||
const request = new Request(uri, this.requestOptions); | ||
let data = await this.fetchDOM(request, this.queryMangasPageCount); | ||
let pageCount = parseInt(data[0].text); | ||
for(let page = 1; page <= pageCount; page++) { | ||
let mangas = await this._getMangasFromPage(page); | ||
mangaList.push(...mangas); | ||
} | ||
return mangaList; | ||
} | ||
async _getMangasFromPage(page) { | ||
let uri = new URL(this.path + '?page='+page, this.url); | ||
let request = new Request(uri, this.requestOptions); | ||
let data = await this.fetchDOM(request, this.queryMangas); | ||
return data.map(element => { | ||
return { | ||
id: this.getRootRelativeOrAbsoluteLink(element, request.url), | ||
title: element.querySelector('source.card-img-top').getAttribute('alt').trim() | ||
}; | ||
}); | ||
} | ||
|
||
_getMangaList( callback ) { | ||
callback( new Error( 'Please report this broken website on HakuNeko\'s GitHub project page.' ), undefined ); | ||
async _getChapters(manga) { | ||
return [{ id: manga.id, title: 'Chapter' }]; | ||
} | ||
_getChapterList( manga, callback ) { | ||
callback( new Error( 'Please report this broken website on HakuNeko\'s GitHub project page.' ), undefined ); | ||
async _getPages(chapter) { | ||
let mangaID = chapter.id.match(/\/gallery\/([0-9]+)/)[1]; | ||
const uri = new URL(this.api, this.url); | ||
const request = this.getApiRequest(uri, mangaID); | ||
const data = await this.fetchJSON(request); | ||
let pagesMax = data.gallery.total_pages; | ||
let extension = data.gallery.image_extension; | ||
//https://cdn.pururin.to/assets/images/data/<mangaid>/<i>.image_extension | ||
return new Array(pagesMax).fill().map((_, index) => new URL(`${this.CDN}/${mangaID}/${index + 1}.${extension}`).href); | ||
} | ||
_getPageList( manga, chapter, callback ) { | ||
callback( new Error( 'Please report this broken website on HakuNeko\'s GitHub project page.' ), undefined ); | ||
async _getMangaFromURI(uri) { | ||
let mangaID = uri.href.match(/\/gallery\/([0-9]+)/)[1]; | ||
const req = new URL(this.api, this.url); | ||
const request = this.getApiRequest(req, mangaID); | ||
const data = await this.fetchJSON(request); | ||
const title = data.gallery.title; | ||
const id = this.getRootRelativeOrAbsoluteLink(uri, this.url); | ||
return new Manga(this, id, title); | ||
} | ||
getApiRequest(url, id) { | ||
let params = { | ||
id: id, | ||
type:2 | ||
}; | ||
return new Request(url, { | ||
method: 'POST', | ||
body: JSON.stringify(params), | ||
headers: { | ||
'x-origin': this.url, | ||
'x-referer': this.url, | ||
'Content-Type': 'application/json;charset=UTF-8', | ||
'X-Requested-With': 'XMLHttpRequest', | ||
} | ||
}); | ||
} | ||
} | ||
} |
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,10 @@ | ||
import WordPressMadara from './templates/WordPressMadara.mjs'; | ||
export default class WebComicMe extends WordPressMadara { | ||
constructor() { | ||
super(); | ||
super.id = 'webcomicme'; | ||
super.label = 'WebComic (Webcomic.me)'; | ||
this.tags = [ 'manga', 'webtoon', 'english' ]; | ||
this.url = 'https://webcomic.me'; | ||
} | ||
} |