Skip to content

Commit

Permalink
FIX ManhwaLatino : mangalist and chapters (#6409)
Browse files Browse the repository at this point in the history
* FIX ManhwaLatino : mangalist and chapters

Fixes #6408

* remove junk pages

* add referer for images
  • Loading branch information
MikeZeDev authored Dec 31, 2023
1 parent 2ef3572 commit 6f2cd1b
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion src/web/mjs/connectors/ManhwaLatino.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,36 @@ export default class ManhwaLatino extends WordPressMadara {
super.label = 'Manhwa-Latino';
this.tags = [ 'webtoon', 'hentai', 'spanish' ];
this.url = 'https://manhwa-latino.com';
this.requestOptions.headers.set('x-referer', this.url);

}

_createMangaRequest(page) {
return new Request(new URL(`/manga/page/${page}/`, this.url), this.requestOptions);
}

async _getChapters(manga) {
const uri = new URL(manga.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'li.wp-manga-chapter div.mini-letters > a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim()
};
});
}

async _getPages(chapter) {
const uri = new URL(chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'div.page-break source.img-responsive');
return data.map(image => {
const payload = {
url : image.getAttribute('data-src'),
referer : request.url
};
return this.createConnectorURI(payload);
});
}
}
}

0 comments on commit 6f2cd1b

Please sign in to comment.