diff options
Diffstat (limited to 'server/controllers/static.ts')
-rw-r--r-- | server/controllers/static.ts | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/server/controllers/static.ts b/server/controllers/static.ts index a4bb3a4d9..4c6cf9597 100644 --- a/server/controllers/static.ts +++ b/server/controllers/static.ts | |||
@@ -45,12 +45,12 @@ staticRouter.use( | |||
45 | staticRouter.use( | 45 | staticRouter.use( |
46 | STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+).torrent', | 46 | STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+).torrent', |
47 | asyncMiddleware(videosDownloadValidator), | 47 | asyncMiddleware(videosDownloadValidator), |
48 | asyncMiddleware(downloadTorrent) | 48 | downloadTorrent |
49 | ) | 49 | ) |
50 | staticRouter.use( | 50 | staticRouter.use( |
51 | STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+)-hls.torrent', | 51 | STATIC_DOWNLOAD_PATHS.TORRENTS + ':id-:resolution([0-9]+)-hls.torrent', |
52 | asyncMiddleware(videosDownloadValidator), | 52 | asyncMiddleware(videosDownloadValidator), |
53 | asyncMiddleware(downloadHLSVideoFileTorrent) | 53 | downloadHLSVideoFileTorrent |
54 | ) | 54 | ) |
55 | 55 | ||
56 | // Videos path for webseeding | 56 | // Videos path for webseeding |
@@ -68,13 +68,13 @@ staticRouter.use( | |||
68 | staticRouter.use( | 68 | staticRouter.use( |
69 | STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension', | 69 | STATIC_DOWNLOAD_PATHS.VIDEOS + ':id-:resolution([0-9]+).:extension', |
70 | asyncMiddleware(videosDownloadValidator), | 70 | asyncMiddleware(videosDownloadValidator), |
71 | asyncMiddleware(downloadVideoFile) | 71 | downloadVideoFile |
72 | ) | 72 | ) |
73 | 73 | ||
74 | staticRouter.use( | 74 | staticRouter.use( |
75 | STATIC_DOWNLOAD_PATHS.HLS_VIDEOS + ':id-:resolution([0-9]+)-fragmented.:extension', | 75 | STATIC_DOWNLOAD_PATHS.HLS_VIDEOS + ':id-:resolution([0-9]+)-fragmented.:extension', |
76 | asyncMiddleware(videosDownloadValidator), | 76 | asyncMiddleware(videosDownloadValidator), |
77 | asyncMiddleware(downloadHLSVideoFile) | 77 | downloadHLSVideoFile |
78 | ) | 78 | ) |
79 | 79 | ||
80 | // HLS | 80 | // HLS |
@@ -325,7 +325,7 @@ async function generateNodeinfo (req: express.Request, res: express.Response) { | |||
325 | return res.send(json).end() | 325 | return res.send(json).end() |
326 | } | 326 | } |
327 | 327 | ||
328 | async function downloadTorrent (req: express.Request, res: express.Response) { | 328 | function downloadTorrent (req: express.Request, res: express.Response) { |
329 | const video = res.locals.videoAll | 329 | const video = res.locals.videoAll |
330 | 330 | ||
331 | const videoFile = getVideoFile(req, video.VideoFiles) | 331 | const videoFile = getVideoFile(req, video.VideoFiles) |
@@ -334,7 +334,7 @@ async function downloadTorrent (req: express.Request, res: express.Response) { | |||
334 | return res.download(getTorrentFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p.torrent`) | 334 | return res.download(getTorrentFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p.torrent`) |
335 | } | 335 | } |
336 | 336 | ||
337 | async function downloadHLSVideoFileTorrent (req: express.Request, res: express.Response) { | 337 | function downloadHLSVideoFileTorrent (req: express.Request, res: express.Response) { |
338 | const video = res.locals.videoAll | 338 | const video = res.locals.videoAll |
339 | 339 | ||
340 | const playlist = getHLSPlaylist(video) | 340 | const playlist = getHLSPlaylist(video) |
@@ -346,7 +346,7 @@ async function downloadHLSVideoFileTorrent (req: express.Request, res: express.R | |||
346 | return res.download(getTorrentFilePath(playlist, videoFile), `${video.name}-${videoFile.resolution}p-hls.torrent`) | 346 | return res.download(getTorrentFilePath(playlist, videoFile), `${video.name}-${videoFile.resolution}p-hls.torrent`) |
347 | } | 347 | } |
348 | 348 | ||
349 | async function downloadVideoFile (req: express.Request, res: express.Response) { | 349 | function downloadVideoFile (req: express.Request, res: express.Response) { |
350 | const video = res.locals.videoAll | 350 | const video = res.locals.videoAll |
351 | 351 | ||
352 | const videoFile = getVideoFile(req, video.VideoFiles) | 352 | const videoFile = getVideoFile(req, video.VideoFiles) |
@@ -355,7 +355,7 @@ async function downloadVideoFile (req: express.Request, res: express.Response) { | |||
355 | return res.download(getVideoFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p${videoFile.extname}`) | 355 | return res.download(getVideoFilePath(video, videoFile), `${video.name}-${videoFile.resolution}p${videoFile.extname}`) |
356 | } | 356 | } |
357 | 357 | ||
358 | async function downloadHLSVideoFile (req: express.Request, res: express.Response) { | 358 | function downloadHLSVideoFile (req: express.Request, res: express.Response) { |
359 | const video = res.locals.videoAll | 359 | const video = res.locals.videoAll |
360 | const playlist = getHLSPlaylist(video) | 360 | const playlist = getHLSPlaylist(video) |
361 | if (!playlist) return res.status(404).end | 361 | if (!playlist) return res.status(404).end |