Skip to content

Commit

Permalink
Update AsuraScans.mjs (#6078)
Browse files Browse the repository at this point in the history
Changed URL for asura scans from asurascans.com to asura.gg.
This change happens from time to time since it's already been done but cancelled in the past, 
added the possibility of switching from one to the other.
  • Loading branch information
Bapt6401 authored Jul 31, 2023
1 parent 6bd44cf commit 97d8dcd
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/web/mjs/connectors/AsuraScans.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,36 @@ export default class AsuraScans extends WordPressMangastream {
super.id = 'asurascans';
super.label = 'Asura Scans';
this.tags = ['webtoon', 'english'];
this.url = 'https://www.asurascans.com';
this.config = {
url: {
label: 'URL',
description: 'This website changes between those two URL regularly.\n Please select the one to use',
input: 'select',
options: [
{ value: 'https://www.asurascans.com', name: 'asurascans.com' },
{ value: 'https://asura.gg', name: 'asura.gg' },
],
value: 'https://www.asurascans.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 url() {
return this.config.url.value;
}

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

async _getPages(chapter) {
const excludes = [
/panda_gif_large/i,
Expand All @@ -23,4 +46,4 @@ export default class AsuraScans extends WordPressMangastream {
const images = await super._getPages(chapter);
return images.filter(link => !excludes.some(rgx => rgx.test(link)));
}
}
}

0 comments on commit 97d8dcd

Please sign in to comment.