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.6
    • :wink: 节日快乐
    • 面板稍微添加了一点小小的工作
  • v0.2.5
    • 前端添加条件搜索
  • 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.6.tar.gz (258.2 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_blive_danmaku-0.2.6.tar.gz
Algorithm Hash digest
SHA256 2c864e8a24a4a90863ce027915a24c4dfad3986632a98aa344334f9b685e3f72
MD5 520a19e55654465724ca409648421587
BLAKE2b-256 86fa2a9e6934a3194f3b5602f30dc0c042df74b8b269900945236c159940fae2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nonebot_plugin_blive_danmaku-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b782183a67dcf98c905f47d182f2f435310489769ee9081a9ab56ffdc420d6db
MD5 6d55c70d1f7e60945653451489939a3e
BLAKE2b-256 419d420e93870e78268685feda06edd42c428ff065907b00b8c0cb018d701f3f

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