GithubHelp home page GithubHelp logo

is-a-gamer / bilibiliutilities Goto Github PK

View Code? Open in Web Editor NEW
58.0 2.0 12.0 56 KB

获取bilibili直播弹幕/通知消息,并且可在unity中使用,附带简单示例及视频演示

License: MIT License

C# 100.00%
bilibili danmu danmaku

bilibiliutilities's Introduction

The project repository is only for China, so the README and code comments will be in Chinese

BilibiliUtilities.Live NuGet version (BilibiliUtilities.Live)

BilibiliUtilities.Utils NuGet version (BilibiliUtilities.Utils)

该项目已经暂停维护

项目早已暂停, B站官方SDK也已经支持Unity,此项目将存档,如有类似需求,请前往 哔哩哔哩直播开放平台 查看 SDK For Unity

说明

一个希望将B站相关的数据获取到的包,现在还只有直播间的信息,比如直播间的弹幕 直播间的人气值

目前还是一个非常初始的版本,希望能帮助我寻找BUG,非常感谢

使用的示例代码在BilibiliUtilities.Test中,并且写了注释

更详细的说明请阅读源码

BilibiliUtilities.Live为直播间代码
BilibiliUtilities.Test为使用测试代码
BilibiliUtilities.Utils为其他模块提供代码

安装

dotnet add package BilibiliUtilities.Live --version 0.0.1
dotnet add package BilibiliUtilities.Utils --version 0.0.1

使用

视频演示

如果有BUG可以在issue中提出

如果你想支持一下,可以点击右上角的star

Bilibili UID:27609142


EndianBitConverter 来自 https://github.com/davidrea-MS/BitConverter

bilibiliutilities's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bilibiliutilities's Issues

解析时遇到意外字符

应用场景是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.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)

长时间连接后似乎会出现心跳包发送失败, 或者未发送失败但无法接收到任何消息的情况

发生的时间也不是很确定, 有时候一会儿就没反应了, 有时又能跑很久
在几个网络环境下测试都有概率发生
运行环境是.net6, winserver
调试输出里会报

引发的异常:“Newtonsoft.Json.JsonReaderException”(位于 Newtonsoft.Json.dll 中)
引发的异常:“Newtonsoft.Json.JsonReaderException”(位于 BilibiliUtilities.Live.dll 中)
引发的异常:“System.IO.IOException”(位于 BilibiliUtilities.Live.dll 中)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.