From 0af66b2496564ca504e55bb84f86e7f2df4217a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9luchu?= Date: Sun, 31 May 2020 22:04:15 +0200 Subject: [PATCH] Fix imageToBase64 --- src/utils/index.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/utils/index.js b/src/utils/index.js index 7209fda..0cfc5ab 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -236,12 +236,13 @@ const animeExtraInfo = async(title) =>{ }; const imageUrlToBase64 = async(url) => { + let res = await cloudscraper({ + url, + method: "GET", + encoding: null + }); - let base64image = "" - - await imageToBase64(url).then((response) => {base64image = response}) - - return base64image.toString("base64"); + return Buffer.from(res).toString("base64"); }; const MergeRecursive = (obj1 , obj2) => {