Skip to content

Commit

Permalink
Desu : use referrer to download images (#7352)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeZeDev authored Sep 7, 2024
1 parent f206c39 commit a88351d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/web/mjs/connectors/Desu.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ export default class Desu extends Connector {
const uri = new URL(chapter.id, this.url);
const request = new Request(uri, this.requestOptions);
const pages = await Engine.Request.fetchUI(request, script);
return pages.map(element => this.getAbsolutePath(element.url, this.url));
return pages.map(element => this.createConnectorURI(this.getAbsolutePath(element.url, this.url)));
}

async _handleConnectorURI(payload) {
const request = new Request(payload, this.requestOptions);
request.headers.set('x-referer', this.url);
const response = await fetch(request);
let data = await response.blob();
data = await this._blobToBuffer(data);
this._applyRealMime(data);
return data;
}
}

0 comments on commit a88351d

Please sign in to comment.