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

WeLoMa.mjs : Change URL #7088

Merged
merged 2 commits into from
May 18, 2024
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
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));
});
}
}
}
Loading