diff options
author | Chocobozzz <me@florianbigard.com> | 2023-09-01 09:55:08 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-09-01 09:55:08 +0200 |
commit | c4799cd1b919a0e7081872b995fe1637c174cab8 (patch) | |
tree | d83d5365dafc125ba888e7eee7950e115ce54b4e | |
parent | ca8a00d0e7cb71b77f8abc3a830810be9d50c9ad (diff) | |
download | PeerTube-c4799cd1b919a0e7081872b995fe1637c174cab8.tar.gz PeerTube-c4799cd1b919a0e7081872b995fe1637c174cab8.tar.zst PeerTube-c4799cd1b919a0e7081872b995fe1637c174cab8.zip |
Avoid illegal characters in torrent filename
-rw-r--r-- | server/server/helpers/webtorrent.ts | 4 |
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 | ||
261 | function buildInfoName (video: MVideo, videoFile: MVideoFile) { | 261 | function 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 | } |