Don't crash on youtube-dl update write error

pull/3543/head
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
1 changed files with 6 additions and 1 deletions

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 => {