Add image proxy to prevent Discord from having sex with my mom.
This commit is contained in:
parent
d92713ffec
commit
6d572ba7bd
1 changed files with 2 additions and 1 deletions
|
@ -59,6 +59,7 @@ export default class DiscordRPC {
|
||||||
const self = this;
|
const self = this;
|
||||||
ipcMain.on("discordrpc:updateImage", async (_event, imageurl) => {
|
ipcMain.on("discordrpc:updateImage", async (_event, imageurl) => {
|
||||||
if (!this._utils.getStoreValue("general.privateEnabled")) {
|
if (!this._utils.getStoreValue("general.privateEnabled")) {
|
||||||
|
console.log("[DEBUG] "+imageurl)
|
||||||
fetch("https://api.cider.sh/v1/images", {
|
fetch("https://api.cider.sh/v1/images", {
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -68,7 +69,7 @@ export default class DiscordRPC {
|
||||||
})
|
})
|
||||||
.then((res) => res.json())
|
.then((res) => res.json())
|
||||||
.then(function (json) {
|
.then(function (json) {
|
||||||
self._attributes["artwork"]["url"] = json.imageUrl;
|
self._attributes["artwork"]["url"] = "https://images.weserv.nl/?url="+json.imageUrl+"&w=600&h=600&output=jpg"; // Image Caching Proxy to prevent Discord from going haha no.
|
||||||
self.setActivity(self._attributes);
|
self.setActivity(self._attributes);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue