Skip to content

Commit

Permalink
FIx XoxoComics: domain & manga listing (#6647)
Browse files Browse the repository at this point in the history
Fixes #6646
  • Loading branch information
MikeZeDev authored Jan 14, 2024
1 parent 07b09ff commit 2c39458
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/web/mjs/connectors/XoxoComics.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class XoxoComics extends Connector {
super.id = 'xoxocomics';
super.label = 'XoxoComics';
this.tags = [ 'comic', 'english' ];
this.url = 'https://xoxocomics.net';
this.url = 'https://xoxocomic.com';
}

async _getMangaFromURI(uri) {
Expand All @@ -20,17 +20,19 @@ export default class XoxoComics extends Connector {

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

async _getMangasFromPage(page) {
const uri = new URL('/comic-list/alphabet?c=&page=' + page, this.url);
async _getMangasFromPage(page, letter) {
const uri = new URL(`/comic-list/?c=${letter}&page=${page}`, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, 'div.chapter > a');
const data = await this.fetchDOM(request, 'div.chapter a');
return data.map(element => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
Expand Down Expand Up @@ -67,4 +69,4 @@ export default class XoxoComics extends Connector {
const data = await this.fetchDOM(request, 'div.page-chapter source');
return data.map(element => element.dataset['original'] || element.src);
}
}
}

0 comments on commit 2c39458

Please sign in to comment.