]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Fix 移除录播路径可能出现的非法字符
authorqydysky <32743305+qydysky@users.noreply.github.com>
Sun, 29 Jan 2023 14:10:08 +0000 (22:10 +0800)
committerqydysky <32743305+qydysky@users.noreply.github.com>
Sun, 29 Jan 2023 14:10:08 +0000 (22:10 +0800)
Reply/stream.go

index 01285dbaabc4a4b43fbb9f33d114f121c0ca9eb4..bf5f6fd676c99665c1575ae077c89d914502fc67 100644 (file)
@@ -506,7 +506,7 @@ func (t *M4SStream) saveStream() (e error) {
        t.Current_save_path = t.config.save_path + "/" +
                time.Now().Format("2006_01_02-15_04_05") + "-" +
                strconv.Itoa(t.common.Roomid) + "-" +
-               t.common.Title + "-" +
+               strings.NewReplacer("\\", "", "\\/", "", ":", "", "*", "", "?", "", "\"", "", "<", "", ">", "", "|", "").Replace(t.common.Title) + "-" +
                pstring.Rand(2, 3) +
                `/`