Decode URL of title
This commit is contained in:
parent
3bde6af554
commit
14b9363462
4
index.js
4
index.js
@ -73,7 +73,7 @@ async function sendPDF(website, tries = 0) {
|
|||||||
const response = await axios.get(website.toString(), {
|
const response = await axios.get(website.toString(), {
|
||||||
responseType: 'arraybuffer'
|
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'));
|
await sendToRemarkable(title, Buffer.from(response.data, 'binary'));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -92,7 +92,7 @@ async function sendEpub(website, tries = 0) {
|
|||||||
const response = await axios.get(website.toString(), {
|
const response = await axios.get(website.toString(), {
|
||||||
responseType: 'arraybuffer'
|
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');
|
await sendToRemarkable(title, Buffer.from(response.data, 'binary'), 'epub');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user