aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-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 })