aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-01-04 10:05:47 +0100
committerChocobozzz <me@florianbigard.com>2021-01-04 10:05:47 +0100
commit027e3080998c3e99e3a16bc336ccf47e0f1d5a8e (patch)
treeb826cecd5012457bfd3193dd18fc9e2271af1f25
parent2dbc170da35c9f88770653cd3114f4c59d482094 (diff)
downloadPeerTube-027e3080998c3e99e3a16bc336ccf47e0f1d5a8e.tar.gz
PeerTube-027e3080998c3e99e3a16bc336ccf47e0f1d5a8e.tar.zst
PeerTube-027e3080998c3e99e3a16bc336ccf47e0f1d5a8e.zip
Don't crash on youtube-dl update write error
-rw-r--r--server/helpers/youtube-dl.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts
index 9e8ef90d8..74e5f896c 100644
--- a/server/helpers/youtube-dl.ts
+++ b/server/helpers/youtube-dl.ts
@@ -170,7 +170,12 @@ async function updateYoutubeDLBinary () {
170 return res() 170 return res()
171 } 171 }
172 172
173 downloadFile.pipe(createWriteStream(bin, { mode: 493 })) 173 const writeStream = createWriteStream(bin, { mode: 493 }).on('error', err => {
174 logger.error('youtube-dl update error in write stream', { err })
175 return res()
176 })
177
178 downloadFile.pipe(writeStream)
174 }) 179 })
175 180
176 downloadFile.on('error', err => { 181 downloadFile.on('error', err => {