BilibiliUtilities
BilibiliUtilities copied to clipboard
解析时遇到意外字符
应用场景是Unity,获取弹幕内容 高频率弹幕直播间大概100条弹幕内容报错 低频率弹幕直播间大概300条弹幕内容报错
JsonReaderException: After parsing a value an unexpected character was encountered: ". Path 'info[0][15].extra', line 1, position 591. Newtonsoft.Json.JsonTextReader.ParsePostValue (System.Boolean ignoreComments) (at <2676a2da6edc420e890ed28aa4572ee5>:0) Newtonsoft.Json.JsonTextReader.Read () (at <2676a2da6edc420e890ed28aa4572ee5>:0) Newtonsoft.Json.Linq.JContainer.ReadContentFrom (Newtonsoft.Json.JsonReader r, Newtonsoft.Json.Linq.JsonLoadSettings settings) (at <2676a2da6edc420e890ed28aa4572ee5>:0) Newtonsoft.Json.Linq.JContainer.ReadTokenFrom (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Linq.JsonLoadSettings options) (at <2676a2da6edc420e890ed28aa4572ee5>:0) Newtonsoft.Json.Linq.JObject.Load (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Linq.JsonLoadSettings settings) (at <2676a2da6edc420e890ed28aa4572ee5>:0) Newtonsoft.Json.Linq.JObject.Parse (System.String json, Newtonsoft.Json.Linq.JsonLoadSettings settings) (at <2676a2da6edc420e890ed28aa4572ee5>:0) Newtonsoft.Json.Linq.JObject.Parse (System.String json) (at <2676a2da6edc420e890ed28aa4572ee5>:0) BilibiliUtilities.Live.LiveRoom.ReadMessageLoop () (at D:/Projects/VideoRtmp/BilibiliUtilities-main/BilibiliUtilities-main/Src/BilibiliUtilities.Live/LiveRoom.cs:178) DanmuManager.ConnectBilibiliRoom () (at Assets/Scripts/DanmuManager.cs:35) System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <6073cf49ed704e958b8a66d540dea948>:0) UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <211e75180efa4e0fb5772e391a398210>:0) UnityEngine.UnitySynchronizationContext.Exec () (at <211e75180efa4e0fb5772e391a398210>:0) UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <211e75180efa4e0fb5772e391a398210>:0)
邮件已收到,我会尽快回复的。我是YJ,请确认有没有发错。
感谢反馈
碰到类似问题,这个是log出来的jsonStr。
{"cmd":"DANMU_MSG","info":[[0,1,25,16777215,1685848091210,-1843653850,0,"e1b08b9d",0,0,0,"",0,"{}","{}",{"mode":0,"show_player_type":0,"extra":"{"send_from_me":false,"mode":0,"color":16777215,"dm_type":0,"font_size":25,"player_mode":1,"show_player_type":0,"content":"我看的视频不是这样的[dog]","user_hash":"3786443677","emoticon_unique":"","bulge_display":0,"recommend_score":1,"main_state_dm_color":"","objective_state_dm_color":"","direction":0,"pk_direction":0,"quartet_direction":0,"anniversary_crowd":0,"yeah_space_type":"","yeah_space_url":"","jump_to_url":"","space_type":"","space_url":"","animation":{},"emots":{"[dog]":{"emoticon_id":208,"emoji":"[dog]","descript":"[dog]","url":"http://i0.hdslb.com/bfs/live/4428c84e694fbf4e0ef6c06e958d9352c3582740.png","width":20,"height":20,"emoticon_unique":"emoji_208","count":1}},"is_audited":false,"id_str":"239db7e27381fb8218c68e79df647c0069"}"},{"activity_identity":"","activity_source":0,"not_show":0}],"我看的视频不是这样的[dog]",[40884516,"欧阳修若",0,0,0,10000,1,""],[],[22,0,5805790,"\u003e50000",0],["",""],0,0,null,{"ts":1685848091,"ct":"B9092274"},0,0,null,null,0,7],"dm_v2":"CiIyMzlkYh""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
项目早已暂停, B站官方SDK也已经支持Unity,此项目将存档,如有类似需求,请前往 哔哩哔哩直播开放平台 查看 SDK For Unity