From 5480933b7f088bf099b25fb467faace814f0da58 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 22 Oct 2021 14:25:19 +0200 Subject: Add peertube short link import test --- server/helpers/youtube-dl/youtube-dl-wrapper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/helpers/youtube-dl/youtube-dl-wrapper.ts') 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 { // Leave empty the extension, youtube-dl will add it const pathWithoutExtension = generateVideoImportTmpPath(this.url, '') - let timer: NodeJS.Timeout - logger.info('Importing youtubeDL video %s to %s', this.url, pathWithoutExtension, lTags()) const youtubeDL = await YoutubeDLCLI.safeGet() + let timer: NodeJS.Timeout const timeoutPromise = new Promise((_, rej) => { timer = setTimeout(() => rej(new Error('YoutubeDL download timeout.')), timeout) }) @@ -102,6 +101,7 @@ class YoutubeDLWrapper { .catch(async err => { const path = await this.guessVideoPathWithExtension(pathWithoutExtension, fileExt) + logger.debug('Error in youtube-dl import, deleting file %s.', path, { err, ...lTags() }) remove(path) .catch(err => logger.error('Cannot remove file in youtubeDL timeout.', { err, ...lTags() })) -- cgit v1.2.3