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

FIX : AsuraScans domain as a setting #6142

Merged
merged 2 commits into from
Aug 19, 2023
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
20 changes: 19 additions & 1 deletion src/web/mjs/connectors/AsuraScans.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,28 @@ export default class AsuraScans extends WordPressMangastream {
super.id = 'asurascans';
super.label = 'Asura Scans';
this.tags = ['webtoon', 'english'];
this.url = 'https://asura.gg';
this.path = '/manga/list-mode/';
this.queryPages = 'div#readerarea p img';
this.requestOptions.headers.set('x-user-agent', 'Mozilla/5.0 (Linux; Android 9; Pixel) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4026.0 Mobile Safari/537.36');
this.config = {
url: {
label: 'URL',
description: `This website change domains regularly.\nThis is the default URL which can also be manually set by the user.`,
input: 'text',
value: 'https://asura.nacm.xyz'
}
};
}

get url() {
return this.config.url.value;
}

set url(value) {
if (this.config && value) {
this.config.url.value = value;
Engine.Settings.save();
}
}

async _getPages(chapter) {
Expand Down
19 changes: 17 additions & 2 deletions src/web/mjs/connectors/AsuraScansTR.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
import AsuraScans from './AsuraScans.mjs';
import WordPressMangastream from './templates/WordPressMangastream.mjs';

export default class AsuraScansTR extends AsuraScans {
export default class AsuraScansTR extends WordPressMangastream {

constructor() {
super();
super.id = 'asurascans-tr';
super.label = 'Asura Scans (TR)';
this.tags = ['webtoon', 'turkish'];
this.url = 'https://asurascanstr.com';
this.path = '/manga/list-mode/';
this.queryPages = 'div#readerarea p img';
this.requestOptions.headers.set('x-user-agent', 'Mozilla/5.0 (Linux; Android 9; Pixel) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4026.0 Mobile Safari/537.36');
}

get icon() {
return '/img/connectors/asurascans';
}

async _getPages(chapter) {
const excludes = [
/panda_gif_large/i,
/2021\/04\/page100-10\.jpg/i,
/2021\/03\/20-ending-page-\.jpg/i,
/ENDING-PAGE/i
];
const images = await super._getPages(chapter);
return images.filter(link => !excludes.some(rgx => rgx.test(link)));
}

}
Loading