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

add ReadAllComics and fix ComicExtra domain #7074

Merged
merged 3 commits into from
May 12, 2024
Merged
Show file tree
Hide file tree
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
Binary file added src/web/img/connectors/readallcomics
Binary file not shown.
4 changes: 2 additions & 2 deletions src/web/mjs/connectors/ComicExtra.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class ComicExtra extends Connector {
super.id = 'comicextra';
super.label = 'ComicExtra';
this.tags = ['comic', 'english'];
this.url = 'https://comicextra.org';
this.url = 'https://comixextra.com';
this.path = '/comic-list/';
}

Expand All @@ -21,7 +21,7 @@ export default class ComicExtra extends Connector {
return this.getRootRelativeOrAbsoluteLink(element, request.url);
});

for(let page of pages) {
for (let page of pages) {
const mangas = await this._getMangasFromPage(page);
mangaList.push(...mangas);
}
Expand Down
55 changes: 55 additions & 0 deletions src/web/mjs/connectors/ReadAllComics.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import Connector from '../engine/Connector.mjs';
import Manga from '../engine/Manga.mjs';

export default class ReadAllComics extends Connector {
constructor() {
super();
super.id = 'readallcomics';
super.label = 'Read All Comics';
this.tags = ['comics', 'english'];
this.url = 'https://readallcomics.com';
this.requestOptions.headers.set('x-referer', this.url);
}

MikeZeDev marked this conversation as resolved.
Show resolved Hide resolved
async _getMangaFromURI(uri) {
const request = new Request(uri, this.requestOptions);
const id = uri.pathname;
const [title] = await this.fetchDOM(request, 'div.description-archive h1');
return new Manga(this, id, title.textContent.trim());
}

async _getMangas() {
let request = new Request(
this.url + '/?story=&s=&type=comic',
this.requestOptions
);
let data = await this.fetchDOM(request, 'ul.categories li a');
return data.map((element) => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim(),
};
});
}

async _getChapters(manga) {
let request = new Request(this.url + manga.id, this.requestOptions);
let data = await this.fetchDOM(request, 'ul.list-story li a');
return data.map((element) => {
return {
id: this.getRootRelativeOrAbsoluteLink(element, this.url),
title: element.text.trim(),
language: '',
};
});
}

async _getPages(chapter) {
let request = new Request(this.url + chapter.id, this.requestOptions);
let data = await this.fetchDOM(
request,
'body > center > center > div source'
);
return data.map((element) => this.getAbsolutePath(element, request.url));
}
}
Loading