diff options
Diffstat (limited to 'bilibili/streaming.go')
-rw-r--r-- | bilibili/streaming.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bilibili/streaming.go b/bilibili/streaming.go index f6ffac9..4ca8682 100644 --- a/bilibili/streaming.go +++ b/bilibili/streaming.go @@ -62,10 +62,15 @@ func (b Bilibili) CopyLiveStream( // blocking copy n, err := common.Copy(ctx, out, resp.Body) - if !errors.Is(err, context.Canceled) { + if err != nil && !errors.Is(err, context.Canceled) { // real error happens b.error.Printf("Stream copying was interrupted unexpectedly: %v", err) } + + if err == nil { + b.info.Printf("The live is ended. (room %v)", roomId) + } + b.info.Printf("Bytes copied: %v", n) return err } |