From: qydysky Date: Sun, 28 Jul 2024 10:09:24 +0000 (+0800) Subject: Fix 表情代码包含文件名非法字符 X-Git-Tag: v0.14.13~1 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=6efa31f7d03d4d5e9a6b0252d8133fa72a2f3721;p=bili_danmu%2F.git Fix 表情代码包含文件名非法字符 --- diff --git a/Reply/F/danmuEmotes/danmuEmotes.go b/Reply/F/danmuEmotes/danmuEmotes.go index 1b3d454..22bd3f9 100644 --- a/Reply/F/danmuEmotes/danmuEmotes.go +++ b/Reply/F/danmuEmotes/danmuEmotes.go @@ -52,10 +52,10 @@ func saveEmote(ctx context.Context, ptr Danmu) (ret any, err error) { if url, ok := m[`url`].(string); ok { if !strings.Contains(*ptr.Msg, "[") { if emoticon_unique, ok := m[`emoticon_unique`].(string); ok { - *ptr.Msg = "[" + hashr(*ptr.Msg+emoticon_unique) + "]" + *ptr.Msg = "[" + *ptr.Msg + emoticon_unique + "]" } } - + *ptr.Msg = hashr(*ptr.Msg) savePath := "emots/" + *ptr.Msg + ".png" if !file.New(savePath, 0, true).IsExist() { go func() { @@ -103,7 +103,7 @@ func saveEmote(ctx context.Context, ptr Danmu) (ret any, err error) { continue } - savePath := hashr("emots/" + k + ".png") + savePath := "emots/" + hashr(k) + ".png" if file.New(savePath, 0, true).IsExist() { continue }