Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX ReaperScansBR : getting chapters #5974

Merged
merged 1 commit into from
Jul 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/web/mjs/connectors/ReaperScansBR.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ export default class ReaperScansBR extends Connector {
this.tags = [ 'webtoon', 'portuguese' ];
this.api = 'https://api.reaperscans.net';
this.url = 'https://reaperscans.net';
this.queryChapters = 'ul.chapters-list-single > a';
this.queryPages = 'source.comic-chapter-image';
this.queryMangaTitle ='div.series-title > h1';
this.links = {
login: 'https://reaperscans.net/login'
Expand Down Expand Up @@ -54,13 +52,18 @@ export default class ReaperScansBR extends Connector {
async _getChapters(manga) {
const uri = new URL(manga.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryChapters);
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.querySelector('span.chapter-span.name').textContent.trim(),
};
const script = `
new Promise(resolve => {
const pages = __NEXT_DATA__.props.pageProps.series.chapters.map(element => {
const id = '${manga.id}'+ element.chapter_slug;
return {id : id, title : element.chapter_name.trim()};
});

resolve(pages);

});
`;
return await Engine.Request.fetchUI(request, script);
}
async _getPages(chapter) {
let request = new Request(this.url + chapter.id, this.requestOptions);
Expand Down