aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/download.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/download.ts')
-rw-r--r--server/controllers/download.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/server/controllers/download.ts b/server/controllers/download.ts
index a270180c0..abd1df26f 100644
--- a/server/controllers/download.ts
+++ b/server/controllers/download.ts
@@ -7,7 +7,7 @@ import { VideoPathManager } from '@server/lib/video-path-manager'
7import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models' 7import { MStreamingPlaylist, MVideo, MVideoFile, MVideoFullLight } from '@server/types/models'
8import { HttpStatusCode, VideoStorage, VideoStreamingPlaylistType } from '@shared/models' 8import { HttpStatusCode, VideoStorage, VideoStreamingPlaylistType } from '@shared/models'
9import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants' 9import { STATIC_DOWNLOAD_PATHS } from '../initializers/constants'
10import { asyncMiddleware, videosDownloadValidator } from '../middlewares' 10import { asyncMiddleware, optionalAuthenticate, videosDownloadValidator } from '../middlewares'
11 11
12const downloadRouter = express.Router() 12const downloadRouter = express.Router()
13 13
@@ -20,12 +20,14 @@ downloadRouter.use(
20 20
21downloadRouter.use( 21downloadRouter.use(
22 STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension', 22 STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension',
23 optionalAuthenticate,
23 asyncMiddleware(videosDownloadValidator), 24 asyncMiddleware(videosDownloadValidator),
24 asyncMiddleware(downloadVideoFile) 25 asyncMiddleware(downloadVideoFile)
25) 26)
26 27
27downloadRouter.use( 28downloadRouter.use(
28 STATIC_DOWNLOAD_PATHS.HLS_VIDEOS + ':id-:resolution([0-9]+)-fragmented.:extension', 29 STATIC_DOWNLOAD_PATHS.HLS_VIDEOS + ':id-:resolution([0-9]+)-fragmented.:extension',
30 optionalAuthenticate,
29 asyncMiddleware(videosDownloadValidator), 31 asyncMiddleware(videosDownloadValidator),
30 asyncMiddleware(downloadHLSVideoFile) 32 asyncMiddleware(downloadHLSVideoFile)
31) 33)