forked from manga-download/hakuneko
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(AGS): create connector (manga-download#6753)
- Loading branch information
1 parent
c0c6842
commit f06f82f
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
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,32 @@ | ||
import WordPressMangastream from './templates/WordPressMangastream.mjs'; | ||
|
||
export default class AGS extends WordPressMangastream { | ||
|
||
constructor() { | ||
super(); | ||
super.id = 'ags'; | ||
super.label = 'AGS (Animated Glitched Scans)'; | ||
this.tags = [ 'manga', 'english', 'scanlation' ]; | ||
this.url = 'https://agscomics.com'; | ||
this.path = '/series/?list'; | ||
} | ||
|
||
get icon() { | ||
return '/img/connectors/anigliscans'; | ||
} | ||
|
||
async _getPages(chapter) { | ||
const data = await super._getPages(chapter); | ||
return data.map(element => this.createConnectorURI(element)); | ||
} | ||
|
||
async _handleConnectorURI(payload) { | ||
const 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; | ||
} | ||
} |