aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/videos/import.ts10
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'
26import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils' 26import { cleanUpReqFiles, createReqFiles } from '../../../helpers/express-utils'
27import { logger } from '../../../helpers/logger' 27import { logger } from '../../../helpers/logger'
28import { getSecureTorrentName } from '../../../helpers/utils' 28import { getSecureTorrentName } from '../../../helpers/utils'
29import { YoutubeDL, YoutubeDLInfo } from '../../../helpers/youtube-dl' 29import { YoutubeDLWrapper, YoutubeDLInfo } from '../../../helpers/youtube-dl'
30import { CONFIG } from '../../../initializers/config' 30import { CONFIG } from '../../../initializers/config'
31import { MIMETYPES } from '../../../initializers/constants' 31import { MIMETYPES } from '../../../initializers/constants'
32import { sequelizeTypescript } from '../../../initializers/database' 32import { 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
376async function processYoutubeSubtitles (youtubeDL: YoutubeDL, targetUrl: string, videoId: number) { 376async 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