From e09f4c6269b55a4697fc165730c2bb7b9667c901 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Sun, 19 Sep 2021 19:10:45 +0200 Subject: [PATCH] fix torrent file download --- scraper/lib/torrent.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scraper/lib/torrent.js b/scraper/lib/torrent.js index 1db25d1..6c53370 100644 --- a/scraper/lib/torrent.js +++ b/scraper/lib/torrent.js @@ -113,12 +113,12 @@ async function filesFromTorrentFile(torrent) { return Promise.reject(new Error("no torrentLink")); } - return axios.get(torrent.torrentLink, { timeout: 10000 }) + return axios.get(torrent.torrentLink, { timeout: 10000, responseType: 'arraybuffer' }) .then((response) => { if (!response.data || response.status !== 200) { throw new Error('torrent not found') } - return response.body + return response.data }) .then((body) => parseTorrent(body)) .then((info) => info.files.map((file, fileId) => ({