Skip to content

Commit

Permalink
Fix ZeroScans: change url and fix paste support (#6671)
Browse files Browse the repository at this point in the history
* Change url and fix paste support

* Use regex to extract slug
  • Loading branch information
trendbloat authored Jan 12, 2024
1 parent 027c36b commit c241f88
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/web/mjs/connectors/ZeroScans.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default class ZeroScans extends Connector {
super.id = 'zeroscans';
super.label = 'ZeroScans';
this.tags = [ 'manga', 'high-quality', 'english', 'scanlation' ];
this.url = 'https://zeroscans.com';
this.url = 'https://zscans.com';

this.config = {
quality: {
Expand All @@ -24,11 +24,11 @@ export default class ZeroScans extends Connector {
}

async _getMangaFromURI(uri) {
const request = new Request(uri, this.requestOptions);
const script = `new Promise(resolve => resolve(JSON.stringify(window.__ZEROSCANS__)));`;
const { data } = await Engine.Request.fetchUI(request, script);
const details = data[0].details;
return new Manga(this, `${details.id}_${details.slug}`, details.name.trim());
const slug = uri.href.match(/\/comics\/([^/]+)$/)[1];
const detailsUrl = new URL(`/swordflake/comic/${slug}`, this.url);
const request = new Request(detailsUrl, this.requestOptions);
const { data } = await this.fetchJSON(request);
return new Manga(this, `${data.id}_${data.slug}`, data.name.trim());
}

async _getMangas() {
Expand Down

0 comments on commit c241f88

Please sign in to comment.