1
0
Fork 0

Don't crash on youtube-dl update write error

This commit is contained in:
Chocobozzz 2021-01-04 10:05:47 +01:00
parent 2dbc170da3
commit 027e308099
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -170,7 +170,12 @@ async function updateYoutubeDLBinary () {
return res()
}
downloadFile.pipe(createWriteStream(bin, { mode: 493 }))
const writeStream = createWriteStream(bin, { mode: 493 }).on('error', err => {
logger.error('youtube-dl update error in write stream', { err })
return res()
})
downloadFile.pipe(writeStream)
})
downloadFile.on('error', err => {