Skip to content

Commit

Permalink
WeLoMa.mjs : Change URL (#7088)
Browse files Browse the repository at this point in the history
* Update WeLoMa.mjs

* Update WeLoMa.mjs

---------

Co-authored-by: MikeZeDev <[email protected]>
  • Loading branch information
Torablue and MikeZeDev authored May 18, 2024
1 parent 471944b commit 54fbc61
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions src/web/mjs/connectors/WeLoMa.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ export default class WeLoMa extends FlatManga {
super.id = 'weloma';
super.label = 'WeLoveManga';
this.tags = ['manga', 'hentai', 'raw', 'japanese'];
this.url = 'https://weloma.net';
this.path = '/list-manga.html';
this.url = 'https://weloma.art';
this.path = '/manga-list.html';
this.requestOptions.headers.set('x-referer', this.url);

this.queryMangaTitle = 'ul.manga-info h3';
this.queryMangas = 'div.card-body div.series-title a';
this.queryChapters = 'ul.list-chapters > a';
this.queryChapterTitle = 'div.chapter-name';
this.queryPages = 'div.chapter-content embed';
}

async _initializeConnector() {
Expand Down Expand Up @@ -70,25 +69,4 @@ export default class WeLoMa extends FlatManga {
const request = new Request(uri, this.requestOptions);
return Engine.Request.fetchUI(request, script);
}

async _getPages(chapter) {
const uri = new URL(chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const data = await this.fetchDOM(request, this.queryPages);
return data.map(element => {
const link = [...element.attributes]
.filter(attribute => !['src', 'class', 'alt'].includes(attribute.name))
.map(attribute => {
try {
return atob(attribute.value.trim());
} catch (_) {
return attribute.value.trim();
}
})
.find(value => {
return /^http/.test(value);
});
return this.createConnectorURI(this.getAbsolutePath(link || element, request.url));
});
}
}
}

0 comments on commit 54fbc61

Please sign in to comment.