aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-09-01 09:55:08 +0200
committerChocobozzz <me@florianbigard.com>2023-09-01 09:55:08 +0200
commitc4799cd1b919a0e7081872b995fe1637c174cab8 (patch)
treed83d5365dafc125ba888e7eee7950e115ce54b4e
parentca8a00d0e7cb71b77f8abc3a830810be9d50c9ad (diff)
downloadPeerTube-c4799cd1b919a0e7081872b995fe1637c174cab8.tar.gz
PeerTube-c4799cd1b919a0e7081872b995fe1637c174cab8.tar.zst
PeerTube-c4799cd1b919a0e7081872b995fe1637c174cab8.zip
Avoid illegal characters in torrent filename
-rw-r--r--server/server/helpers/webtorrent.ts4
1 files changed, 3 insertions, 1 deletions
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) {
259} 259}
260 260
261function buildInfoName (video: MVideo, videoFile: MVideoFile) { 261function buildInfoName (video: MVideo, videoFile: MVideoFile) {
262 return `${video.name} ${videoFile.resolution}p${videoFile.extname}` 262 const videoName = video.name.replace(/[/\\?%*:|"<>]/g, '-')
263
264 return `${videoName} ${videoFile.resolution}p${videoFile.extname}`
263} 265}