aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/youtube-dl
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-09 15:07:06 +0100
committerChocobozzz <me@florianbigard.com>2021-11-09 15:07:06 +0100
commitd7ce63d3dd63e51096f76371403ac4859d69bef5 (patch)
tree7412df1e698d6b778a77c2a5e7200827de5c7021 /server/helpers/youtube-dl
parent51353d9a035fb6b81f903a8b5f391292841649fd (diff)
downloadPeerTube-d7ce63d3dd63e51096f76371403ac4859d69bef5.tar.gz
PeerTube-d7ce63d3dd63e51096f76371403ac4859d69bef5.tar.zst
PeerTube-d7ce63d3dd63e51096f76371403ac4859d69bef5.zip
Fix error log of bad import
Diffstat (limited to 'server/helpers/youtube-dl')
-rw-r--r--server/helpers/youtube-dl/youtube-dl-wrapper.ts14
1 files changed, 8 insertions, 6 deletions
diff --git a/server/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
index edbd28fa4..6442c1e85 100644
--- a/server/helpers/youtube-dl/youtube-dl-wrapper.ts
+++ b/server/helpers/youtube-dl/youtube-dl-wrapper.ts
@@ -98,12 +98,14 @@ class YoutubeDLWrapper {
98 }) 98 })
99 99
100 return Promise.race([ downloadPromise, timeoutPromise ]) 100 return Promise.race([ downloadPromise, timeoutPromise ])
101 .catch(async err => { 101 .catch(err => {
102 const path = await this.guessVideoPathWithExtension(pathWithoutExtension, fileExt) 102 this.guessVideoPathWithExtension(pathWithoutExtension, fileExt)
103 103 .then(path => {
104 logger.debug('Error in youtube-dl import, deleting file %s.', path, { err, ...lTags() }) 104 logger.debug('Error in youtube-dl import, deleting file %s.', path, { err, ...lTags() })
105 remove(path) 105
106 .catch(err => logger.error('Cannot remove file in youtubeDL timeout.', { err, ...lTags() })) 106 return remove(path)
107 })
108 .catch(innerErr => logger.error('Cannot remove file in youtubeDL timeout.', { innerErr, ...lTags() }))
107 109
108 throw err 110 throw err
109 }) 111 })