diff options
Diffstat (limited to 'server/helpers')
-rw-r--r-- | server/helpers/youtube-dl/youtube-dl-wrapper.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/youtube-dl/youtube-dl-wrapper.ts b/server/helpers/youtube-dl/youtube-dl-wrapper.ts index 6960fbae4..edbd28fa4 100644 --- a/server/helpers/youtube-dl/youtube-dl-wrapper.ts +++ b/server/helpers/youtube-dl/youtube-dl-wrapper.ts | |||
@@ -73,12 +73,11 @@ class YoutubeDLWrapper { | |||
73 | // Leave empty the extension, youtube-dl will add it | 73 | // Leave empty the extension, youtube-dl will add it |
74 | const pathWithoutExtension = generateVideoImportTmpPath(this.url, '') | 74 | const pathWithoutExtension = generateVideoImportTmpPath(this.url, '') |
75 | 75 | ||
76 | let timer: NodeJS.Timeout | ||
77 | |||
78 | logger.info('Importing youtubeDL video %s to %s', this.url, pathWithoutExtension, lTags()) | 76 | logger.info('Importing youtubeDL video %s to %s', this.url, pathWithoutExtension, lTags()) |
79 | 77 | ||
80 | const youtubeDL = await YoutubeDLCLI.safeGet() | 78 | const youtubeDL = await YoutubeDLCLI.safeGet() |
81 | 79 | ||
80 | let timer: NodeJS.Timeout | ||
82 | const timeoutPromise = new Promise<string>((_, rej) => { | 81 | const timeoutPromise = new Promise<string>((_, rej) => { |
83 | timer = setTimeout(() => rej(new Error('YoutubeDL download timeout.')), timeout) | 82 | timer = setTimeout(() => rej(new Error('YoutubeDL download timeout.')), timeout) |
84 | }) | 83 | }) |
@@ -102,6 +101,7 @@ class YoutubeDLWrapper { | |||
102 | .catch(async err => { | 101 | .catch(async err => { |
103 | const path = await this.guessVideoPathWithExtension(pathWithoutExtension, fileExt) | 102 | const path = await this.guessVideoPathWithExtension(pathWithoutExtension, fileExt) |
104 | 103 | ||
104 | logger.debug('Error in youtube-dl import, deleting file %s.', path, { err, ...lTags() }) | ||
105 | remove(path) | 105 | remove(path) |
106 | .catch(err => logger.error('Cannot remove file in youtubeDL timeout.', { err, ...lTags() })) | 106 | .catch(err => logger.error('Cannot remove file in youtubeDL timeout.', { err, ...lTags() })) |
107 | 107 | ||