mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-03-11 21:26:53 +00:00
fix torrent file download
This commit is contained in:
parent
6f136c2ecf
commit
e09f4c6269
1 changed files with 2 additions and 2 deletions
|
|
@ -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) => ({
|
||||
|
|
|
|||
Loading…
Reference in a new issue