Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/4t145/rudanmaku-core
bilibili 直播间事件转发服务
https://github.com/4t145/rudanmaku-core
bilibili bilibili-api bilibili-live bilibili-live-tools rudanmaku rust
Last synced: about 2 months ago
JSON representation
bilibili 直播间事件转发服务
- Host: GitHub
- URL: https://github.com/4t145/rudanmaku-core
- Owner: 4t145
- Created: 2022-05-27T18:49:34.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-06T16:56:25.000Z (almost 2 years ago)
- Last Synced: 2024-04-20T09:01:31.308Z (9 months ago)
- Topics: bilibili, bilibili-api, bilibili-live, bilibili-live-tools, rudanmaku, rust
- Language: Rust
- Homepage:
- Size: 229 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# rudanmaku-core
提供批量对bilibili直播间的监控服务gui: https://github.com/4t145/rudanmaku-shell
# 启动
- 使用配置启动: `rudanmaku-core config `
- 单房间在localhost启动 `rudanmaku-core `
## 启动配置
配置是toml格式的,以下是一个例子
```toml
[net]
port = 10200
# 优先采用ipv4
ipv4 = [0,0,0,0]
# 如果没有ipv4,采用ipv6
ipv6 = [0,0,0,0,0,0,0,0]
# 如果都没有设置,默认采用ipv4 0.0.0.0[[room]]
# 房间id长短都可以
roomid = 23840076
# channel 目前支持json|bincode
channel = ["json", "bincode"][[room]]
roomid = 5229
channel = ["json", "bincode"]# mongodb 作为数据库
[db.mongo]
# 数据库名称
db = "virtuareal"
host = "localhost"
port = 27017
```# 连接
地址 `ws://://`如`ws://localhost:10200/477317922/json`
## json
示例如下
![json示例](./.readme/example.png)
## JavaScript/TypeScript 支持
```bash
npm install [email protected]
```
### 使用例
```TypeScript
import {Event, DanmakuEvent} from 'bilive-danmaku-json';
function on_danmaku(data: DanmakuEvent['data']) {
if(data.junk_flag===0) {
console.log(data.message);
}
// ...
}
// ... 获取data
const evt = JSON.parse(data);
if(evt.tag === 'Danmaku') {
on_danmaku(evt.data);
}
```
## 事件类型
参见[这个仓库](https://github.com/4t145/bilive-danmaku)## 关于bincode
bincode是二进制编码的数据结构,如果你对接此服务的应用是用rust编写的,bincode可能可以给你提供更高的正反序列化效率对接端可以用本项目的依赖库`bilive-danmaku`,并启用`event`和`bincode`
```toml
[dependencies]
bilive-danmaku = {git = "https://github.com/4t145/bilive-danmaku", branch = "ver-0.1.0", features = ["event", "bincode"]}
```
bincode详情请参见[此仓库](https://github.com/bincode-org/bincode)# 自行编译可能遇到的问题
## 我从未使用过rust?
1. 根据官网指导安装rust工具链https://www.rust-lang.org/zh-CN
2. 安装`nightly`版本工具链: `rustup toolchain install nightly`
3. 在本文件夹内切换到nightly版本: `rustup override set nightly`
4. 编译发行版 `cargo build --release`
5. 编译完的可运行程序在`/target/release`中
## linux上NativeTLS相关?
我的评价是,直接google报错内容!