From eccf70f020cb8b0d9ceddc2561713ccfddb72095 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 3 Dec 2019 10:41:23 +0100 Subject: Fix private video download --- server/controllers/static.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'server/controllers/static.ts') diff --git a/server/controllers/static.ts b/server/controllers/static.ts index 7c900be92..0aab12756 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts @@ -10,7 +10,7 @@ import { WEBSERVER } from '../initializers/constants' import { cacheRoute } from '../middlewares/cache' -import { asyncMiddleware, videosGetValidator } from '../middlewares' +import { asyncMiddleware, videosDownloadValidator } from '../middlewares' import { VideoModel } from '../models/video/video' import { UserModel } from '../models/account/user' import { VideoCommentModel } from '../models/video/video-comment' @@ -39,12 +39,12 @@ staticRouter.use( ) staticRouter.use( STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+).torrent', - asyncMiddleware(videosGetValidator), + asyncMiddleware(videosDownloadValidator), asyncMiddleware(downloadTorrent) ) staticRouter.use( STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+)-hls.torrent', - asyncMiddleware(videosGetValidator), + asyncMiddleware(videosDownloadValidator), asyncMiddleware(downloadHLSVideoFileTorrent) ) @@ -62,13 +62,13 @@ staticRouter.use( staticRouter.use( STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension', - asyncMiddleware(videosGetValidator), + asyncMiddleware(videosDownloadValidator), asyncMiddleware(downloadVideoFile) ) staticRouter.use( STATIC_DOWNLOAD_PATHS.HLS_VIDEOS + ':id-:resolution([0-9]+)-fragmented.:extension', - asyncMiddleware(videosGetValidator), + asyncMiddleware(videosDownloadValidator), asyncMiddleware(downloadHLSVideoFile) ) -- cgit v1.2.3