From 14b93634628fe77f79aa75e14afd69f49c7bd5d6 Mon Sep 17 00:00:00 2001 From: Marcus Noble Date: Sun, 18 Oct 2020 11:13:29 +0100 Subject: [PATCH] Decode URL of title --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 47f3f14..906e2b7 100644 --- a/index.js +++ b/index.js @@ -73,7 +73,7 @@ async function sendPDF(website, tries = 0) { const response = await axios.get(website.toString(), { responseType: 'arraybuffer' }) - const title = website.toString().substring(website.toString().lastIndexOf("/")+1, website.toString().lastIndexOf(".")) + const title = decodeURIComponent(website.toString().substring(website.toString().lastIndexOf("/")+1, website.toString().lastIndexOf("."))); await sendToRemarkable(title, Buffer.from(response.data, 'binary')); return true; @@ -92,7 +92,7 @@ async function sendEpub(website, tries = 0) { const response = await axios.get(website.toString(), { responseType: 'arraybuffer' }) - const title = website.toString().substring(website.toString().lastIndexOf("/")+1, website.toString().lastIndexOf(".")) + const title = decodeURIComponent(website.toString().substring(website.toString().lastIndexOf("/")+1, website.toString().lastIndexOf("."))); await sendToRemarkable(title, Buffer.from(response.data, 'binary'), 'epub'); return true;