diff options
Diffstat (limited to 'server/lib/job-queue/handlers')
-rw-r--r-- | server/lib/job-queue/handlers/video-import.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/lib/job-queue/handlers/video-import.ts b/server/lib/job-queue/handlers/video-import.ts index 3067ce214..d71053e87 100644 --- a/server/lib/job-queue/handlers/video-import.ts +++ b/server/lib/job-queue/handlers/video-import.ts | |||
@@ -2,8 +2,10 @@ import * as Bull from 'bull' | |||
2 | import { move, remove, stat } from 'fs-extra' | 2 | import { move, remove, stat } from 'fs-extra' |
3 | import { extname } from 'path' | 3 | import { extname } from 'path' |
4 | import { retryTransactionWrapper } from '@server/helpers/database-utils' | 4 | import { retryTransactionWrapper } from '@server/helpers/database-utils' |
5 | import { YoutubeDL } from '@server/helpers/youtube-dl' | ||
5 | import { isPostImportVideoAccepted } from '@server/lib/moderation' | 6 | import { isPostImportVideoAccepted } from '@server/lib/moderation' |
6 | import { Hooks } from '@server/lib/plugins/hooks' | 7 | import { Hooks } from '@server/lib/plugins/hooks' |
8 | import { ServerConfigManager } from '@server/lib/server-config-manager' | ||
7 | import { isAbleToUploadVideo } from '@server/lib/user' | 9 | import { isAbleToUploadVideo } from '@server/lib/user' |
8 | import { addOptimizeOrMergeAudioJob } from '@server/lib/video' | 10 | import { addOptimizeOrMergeAudioJob } from '@server/lib/video' |
9 | import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' | 11 | import { generateVideoFilename, getVideoFilePath } from '@server/lib/video-paths' |
@@ -33,8 +35,6 @@ import { MThumbnail } from '../../../types/models/video/thumbnail' | |||
33 | import { federateVideoIfNeeded } from '../../activitypub/videos' | 35 | import { federateVideoIfNeeded } from '../../activitypub/videos' |
34 | import { Notifier } from '../../notifier' | 36 | import { Notifier } from '../../notifier' |
35 | import { generateVideoMiniature } from '../../thumbnail' | 37 | import { generateVideoMiniature } from '../../thumbnail' |
36 | import { YoutubeDL } from '@server/helpers/youtube-dl' | ||
37 | import { getEnabledResolutions } from '@server/lib/config' | ||
38 | 38 | ||
39 | async function processVideoImport (job: Bull.Job) { | 39 | async function processVideoImport (job: Bull.Job) { |
40 | const payload = job.data as VideoImportPayload | 40 | const payload = job.data as VideoImportPayload |
@@ -76,7 +76,7 @@ async function processYoutubeDLImport (job: Bull.Job, payload: VideoImportYoutub | |||
76 | videoImportId: videoImport.id | 76 | videoImportId: videoImport.id |
77 | } | 77 | } |
78 | 78 | ||
79 | const youtubeDL = new YoutubeDL(videoImport.targetUrl, getEnabledResolutions('vod')) | 79 | const youtubeDL = new YoutubeDL(videoImport.targetUrl, ServerConfigManager.Instance.getEnabledResolutions('vod')) |
80 | 80 | ||
81 | return processFile( | 81 | return processFile( |
82 | () => youtubeDL.downloadYoutubeDLVideo(payload.fileExt, VIDEO_IMPORT_TIMEOUT), | 82 | () => youtubeDL.downloadYoutubeDLVideo(payload.fileExt, VIDEO_IMPORT_TIMEOUT), |