// 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<string>((_, rej) => {
timer = setTimeout(() => rej(new Error('YoutubeDL download timeout.')), timeout)
})
.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() }))
it('Should import a peertube video', async function () {
this.timeout(120_000)
+ const toTest = [ FIXTURE_URLS.peertube_long ]
+
// TODO: include peertube_short when https://github.com/ytdl-org/youtube-dl/pull/29475 is merged
- for (const targetUrl of [ FIXTURE_URLS.peertube_long ]) {
- // for (const targetUrl of [ FIXTURE_URLS.peertube_long, FIXTURE_URLS.peertube_short ]) {
+ if (mode === 'yt-dlp') {
+ toTest.push(FIXTURE_URLS.peertube_short)
+ }
+
+ for (const targetUrl of toTest) {
await servers[0].config.disableTranscoding()
const attributes = {