Skip to main content

A danmaku plugin for Nonebot2

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot_plugin_blive_danmaku

💫 B站直播间路灯插件 💫

pypi python license

简介

  • 基于nonebot2开发的B站直播间弹幕监听插件,参考了Haruka和blivechat的部分代码。
  • 起源于哈鹿hallu的一条动态,苦于做视频时没有人做路灯,翻录播的时候头都大了,说要花钱请个全职路灯,我寻思与其把钱送给别人,不如交给Bot去做路灯。
  • 路灯:指把直播过程中有趣的点记录下来,给剪辑根据记录的时间点和内容做出对应的视频。

功能

  • 用弹幕的形式记录直播高能点
  • 弹幕指令为#路灯加上记录的内容
  • 仅在开播时弹幕指令才会生效

依赖

  • Python >= 3.10
  • OneBot V11

安装

  • 方式一:使用nb-cli安装插件
nb plugin install nonebot-plugin-blive-danmaku
  • 方式二:使用pip安装
python -m pip install nonebot-plugin-blive-danmaku

配置

名称 类型 默认值 描述
danmaku_group_notice bool False 全局群开播提醒
danmaku_host str 外部访问地址,若配置了公网访问地址请填写此项,以便bot能够发送正确的面板地址,例如:“http://www.your_domain.com”“http://192.168.0.2"

指令

指令 说明
/添加订阅 UID UID为B站用户的uid,不是直播间id,以下同理
/取消订阅 UID 删除订阅
/开启路灯 UID 开启直播间弹幕监听
/关闭路灯 UID 关闭直播间弹幕监听
/订阅列表
/查看面板 打开网页版查询

效果预览

反向代理(可选,如果需要配置外部网络访问面板)

这里仅以最简单的配置为例,不包含SSL访问

Nginx

server {
        listen       80;
        server_name  www.your_domain.com;

        location /danmaku/ {
            proxy_pass http://127.0.0.1:8080/danmaku/;
            proxy_http_version 1.1;
			proxy_set_header Upgrade $http_upgrade;
			proxy_set_header Connection keep-alive;
			proxy_set_header Host $host;
			proxy_set_header X-Real-IP $remote_addr;
			proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
			proxy_cache_bypass $http_upgrade;
        }

        location /ws {
            deny all;
        }
    }

Apache

<VirtualHost *:80>
    ServerName  www.your_domain.com
    ProxyRequests Off
    ProxyPass "/danmaku/" http://127.0.0.1:8080/danmaku/
    ProxyPassReverse "/danmaku/" http://127.0.0.1:8080/danmaku/
</VirtualHost>

更新日志

  • v0.2.4
    • 移除直播间ws监听多余的输出
    • 更新前端
  • v0.2.0
    • 修复历史bug
    • 添加网页面板,外部访问请自行配置反向代理服务器
  • v0.1.4
    • 添加开播提醒,.env新增全局配置项danmaku_group_notice开关 #3
    • 调整日志级别 #5
  • v0.1.3
    • bot提醒在时间后面加上直播时长显示,避免直播画面没有当前时间的场景
  • v0.1.2
    • fix局部变量无法正常更新的bug
  • v0.1.0
    • 基于nonebot2,实现同步路灯弹幕到qq群

感谢

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_blive_danmaku-0.2.5.tar.gz (257.1 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file nonebot_plugin_blive_danmaku-0.2.5.tar.gz.

File metadata

File hashes

Hashes for nonebot_plugin_blive_danmaku-0.2.5.tar.gz
Algorithm Hash digest
SHA256 4517926a00e670eb2fbfac05b3029994eb9c70fd90f88189dfe32df9e58eb33e
MD5 13f4f16db324e4321b38f420801822b8
BLAKE2b-256 983184e9fb5b8429bd7457516cc98f5b4c03788d4ce0ed9fda7ea3408ef504d1

See more details on using hashes here.

File details

Details for the file nonebot_plugin_blive_danmaku-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_blive_danmaku-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d877d3e6adfbcc14fbffc1202cc842ec8125a361e1d52f606cd6d8fc54a8b2c6
MD5 fc285f0e4e48fe2d5f624bcd31d6b506
BLAKE2b-256 177603ca349244e473c88dcdc1bf4a1b5b194f563fa6d2d7fbaf14983cdee064

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page