diff options
author | Keuin <[email protected]> | 2023-07-29 12:13:00 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-29 20:16:08 +0800 |
commit | 206796c05dd9054e43b12928e62e7379e882df94 (patch) | |
tree | 9801d8e38573f698bc4d33af62f9ed6cc300e56c /recording | |
parent | 0da1d6d8107f8619aa53f80e14b2cc1bc10ce2ae (diff) |
Log raw danmaku message if decoding is failed
Diffstat (limited to 'recording')
-rw-r--r-- | recording/watcher.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/recording/watcher.go b/recording/watcher.go index 0e4b459..f06b405 100644 --- a/recording/watcher.go +++ b/recording/watcher.go @@ -2,6 +2,7 @@ package recording import ( "context" + "encoding/base64" "encoding/json" errs "github.com/keuin/slbr/bilibili/errors" "github.com/keuin/slbr/danmaku" @@ -174,7 +175,8 @@ func watch( } dmm, err := dmmsg.ParseDanmakuMessage(raw) if err != nil { - logger.Error("Cannot parse danmaku message JSON: %v", err) + logger.Error("Cannot parse danmaku message JSON: %v, raw data (base64 encoded): %v", + err, base64.StdEncoding.EncodeToString(msg.Body)) continue } logger.Info("Danmaku: %v", dmm.String()) |