Skip to content

Commit

Permalink
Update Tempestfansub.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeZeDev authored Jul 31, 2023
1 parent dc5d48b commit 268506e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/web/mjs/connectors/Tempestfansub.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,26 @@ export default class Tempestfansub extends WordPressMangastream {

this.path = '/manga/list-mode/';
}

async _getMangas() {
let mangaList = [];
for (let page = 1, run = true; run; page++) {
let mangas = await this._getMangasFromPage(page);
mangas.length > 0 ? mangaList.push(...mangas) : run = false;
}
return mangaList;
}

async _getMangasFromPage(page) {
const uri = new URL('/manga/?page=' + page, this.url);
const request = new Request(uri, this.requestOptions);
let data = await this.fetchDOM(request, 'div.bs div.bsx > a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, request.url),
title: element.title.trim()
};
});
}

}

0 comments on commit 268506e

Please sign in to comment.