From c4799cd1b919a0e7081872b995fe1637c174cab8 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 1 Sep 2023 09:55:08 +0200 Subject: [PATCH] Avoid illegal characters in torrent filename --- server/server/helpers/webtorrent.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/server/helpers/webtorrent.ts b/server/server/helpers/webtorrent.ts index 29062dae3..c5146c78b 100644 --- a/server/server/helpers/webtorrent.ts +++ b/server/server/helpers/webtorrent.ts @@ -259,5 +259,7 @@ function buildUrlList (video: MVideo, videoFile: MVideoFile) { } function buildInfoName (video: MVideo, videoFile: MVideoFile) { - return `${video.name} ${videoFile.resolution}p${videoFile.extname}` + const videoName = video.name.replace(/[/\\?%*:|"<>]/g, '-') + + return `${videoName} ${videoFile.resolution}p${videoFile.extname}` }