diff options
Diffstat (limited to 'server/helpers/youtube-dl.ts')
-rw-r--r-- | server/helpers/youtube-dl.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts index 70b4e1b78..b74351b42 100644 --- a/server/helpers/youtube-dl.ts +++ b/server/helpers/youtube-dl.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | import { truncate } from 'lodash' | 1 | import { truncate } from 'lodash' |
2 | import { CONSTRAINTS_FIELDS, VIDEO_CATEGORIES } from '../initializers' | 2 | import { CONSTRAINTS_FIELDS, VIDEO_CATEGORIES } from '../initializers' |
3 | import { logger } from './logger' | 3 | import { logger } from './logger' |
4 | import { generateVideoTmpPath } from './utils' | 4 | import { generateVideoImportTmpPath } from './utils' |
5 | import { join } from 'path' | 5 | import { join } from 'path' |
6 | import { root } from './core-utils' | 6 | import { root } from './core-utils' |
7 | import { ensureDir, writeFile, remove } from 'fs-extra' | 7 | import { ensureDir, writeFile, remove } from 'fs-extra' |
@@ -24,10 +24,10 @@ const processOptions = { | |||
24 | 24 | ||
25 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { | 25 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { |
26 | return new Promise<YoutubeDLInfo>(async (res, rej) => { | 26 | return new Promise<YoutubeDLInfo>(async (res, rej) => { |
27 | const options = opts || [ '-j', '--flat-playlist' ] | 27 | const args = opts || [ '-j', '--flat-playlist' ] |
28 | 28 | ||
29 | const youtubeDL = await safeGetYoutubeDL() | 29 | const youtubeDL = await safeGetYoutubeDL() |
30 | youtubeDL.getInfo(url, options, (err, info) => { | 30 | youtubeDL.getInfo(url, args, processOptions, (err, info) => { |
31 | if (err) return rej(err) | 31 | if (err) return rej(err) |
32 | if (info.is_live === true) return rej(new Error('Cannot download a live streaming.')) | 32 | if (info.is_live === true) return rej(new Error('Cannot download a live streaming.')) |
33 | 33 | ||
@@ -40,7 +40,7 @@ function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> | |||
40 | } | 40 | } |
41 | 41 | ||
42 | function downloadYoutubeDLVideo (url: string, timeout: number) { | 42 | function downloadYoutubeDLVideo (url: string, timeout: number) { |
43 | const path = generateVideoTmpPath(url) | 43 | const path = generateVideoImportTmpPath(url) |
44 | let timer | 44 | let timer |
45 | 45 | ||
46 | logger.info('Importing youtubeDL video %s', url) | 46 | logger.info('Importing youtubeDL video %s', url) |