From f5dcf6cf39a003cfd5abc04ccab8bdf7fa4eff44 Mon Sep 17 00:00:00 2001 From: coomdev Date: Sun, 30 Jan 2022 00:51:00 +0100 Subject: [PATCH] Fix non-hotlinked thirdeye content --- main.meta.js | 2 +- main.user.js | 8 ++++---- src/thirdeye.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.meta.js b/main.meta.js index 4476188..46be16c 100644 --- a/main.meta.js +++ b/main.meta.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.161 +// @version 0.162 // @description uhh // @author You // @match https://boards.4channel.org/* diff --git a/main.user.js b/main.user.js index 7c19659..da10327 100644 --- a/main.user.js +++ b/main.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name PNGExtraEmbed // @namespace https://coom.tech/ -// @version 0.161 +// @version 0.162 // @description uhh // @author You // @match https://boards.4channel.org/* @@ -81,7 +81,7 @@ var define_BUILD_VERSION_default; var init_define_BUILD_VERSION = __esm({ ""() { - define_BUILD_VERSION_default = [0, 161]; + define_BUILD_VERSION_default = [0, 162]; } }); @@ -14525,11 +14525,11 @@ url: result[0].page }, filename: fn.substring(0, 33) + result[0].ext, - thumbnail: csettings3.hotlink ? prev || full : await (await ifetch(prev || full)).arrayBuffer(), + thumbnail: csettings3.hotlink ? prev || full : import_buffer7.Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), data: csettings3.hotlink ? full || prev : async (lsn) => { if (!cachedFile) cachedFile = await (await ifetch(full || prev, void 0, lsn)).arrayBuffer(); - return cachedFile; + return import_buffer7.Buffer.from(cachedFile); } }]; }; diff --git a/src/thirdeye.ts b/src/thirdeye.ts index 924b07e..a499ee0 100644 --- a/src/thirdeye.ts +++ b/src/thirdeye.ts @@ -165,11 +165,11 @@ const extract = async (b: Buffer, fn?: string) => { url: result[0].page }, filename: fn!.substring(0, 33) + result[0].ext, - thumbnail: csettings.hotlink ? (prev || full) : (await (await ifetch(prev || full)).arrayBuffer()), + thumbnail: csettings.hotlink ? (prev || full) : Buffer.from(await (await ifetch(prev || full)).arrayBuffer()), data: csettings.hotlink ? (full || prev) : (async (lsn) => { if (!cachedFile) cachedFile = (await (await ifetch(full || prev, undefined, lsn)).arrayBuffer()); - return cachedFile; + return Buffer.from(cachedFile); }) } as EmbeddedFile]; };