diff options
Diffstat (limited to 'server/controllers/api')
-rw-r--r-- | server/controllers/api/videos/import.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 4265f3217..eddb9b32d 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts | |||
@@ -26,7 +26,7 @@ import { isArray } from '../../../helpers/custom-validators/misc' | |||
26 | import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' | 26 | import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' |
27 | import { logger } from '../../../helpers/logger' | 27 | import { logger } from '../../../helpers/logger' |
28 | import { getSecureTorrentName } from '../../../helpers/utils' | 28 | import { getSecureTorrentName } from '../../../helpers/utils' |
29 | import { YoutubeDL, YoutubeDLInfo } from '../../../helpers/youtube-dl' | 29 | import { YoutubeDLWrapper, YoutubeDLInfo } from '../../../helpers/youtube-dl' |
30 | import { CONFIG } from '../../../initializers/config' | 30 | import { CONFIG } from '../../../initializers/config' |
31 | import { MIMETYPES } from '../../../initializers/constants' | 31 | import { MIMETYPES } from '../../../initializers/constants' |
32 | import { sequelizeTypescript } from '../../../initializers/database' | 32 | import { sequelizeTypescript } from '../../../initializers/database' |
@@ -134,12 +134,12 @@ async function addYoutubeDLImport (req: express.Request, res: express.Response) | |||
134 | const targetUrl = body.targetUrl | 134 | const targetUrl = body.targetUrl |
135 | const user = res.locals.oauth.token.User | 135 | const user = res.locals.oauth.token.User |
136 | 136 | ||
137 | const youtubeDL = new YoutubeDL(targetUrl, ServerConfigManager.Instance.getEnabledResolutions('vod')) | 137 | const youtubeDL = new YoutubeDLWrapper(targetUrl, ServerConfigManager.Instance.getEnabledResolutions('vod')) |
138 | 138 | ||
139 | // Get video infos | 139 | // Get video infos |
140 | let youtubeDLInfo: YoutubeDLInfo | 140 | let youtubeDLInfo: YoutubeDLInfo |
141 | try { | 141 | try { |
142 | youtubeDLInfo = await youtubeDL.getYoutubeDLInfo() | 142 | youtubeDLInfo = await youtubeDL.getInfoForDownload() |
143 | } catch (err) { | 143 | } catch (err) { |
144 | logger.info('Cannot fetch information from import for URL %s.', targetUrl, { err }) | 144 | logger.info('Cannot fetch information from import for URL %s.', targetUrl, { err }) |
145 | 145 | ||
@@ -373,9 +373,9 @@ function extractNameFromArray (name: string | string[]) { | |||
373 | return isArray(name) ? name[0] : name | 373 | return isArray(name) ? name[0] : name |
374 | } | 374 | } |
375 | 375 | ||
376 | async function processYoutubeSubtitles (youtubeDL: YoutubeDL, targetUrl: string, videoId: number) { | 376 | async function processYoutubeSubtitles (youtubeDL: YoutubeDLWrapper, targetUrl: string, videoId: number) { |
377 | try { | 377 | try { |
378 | const subtitles = await youtubeDL.getYoutubeDLSubs() | 378 | const subtitles = await youtubeDL.getSubtitles() |
379 | 379 | ||
380 | logger.info('Will create %s subtitles from youtube import %s.', subtitles.length, targetUrl) | 380 | logger.info('Will create %s subtitles from youtube import %s.', subtitles.length, targetUrl) |
381 | 381 | ||