Giter Site home page Giter Site logo

bililive-auto-streaming's Introduction

哔哩哔哩自动直播

使用方法

  • 安装 Python3.7 或更高的版本
  • 安装依赖
pip install -r requirements.txt
  • 执行 python3 login.py 扫码登录哔哩哔哩账号
    • 或从 https://api.bilibili.com/x/web-interface/nav 请求中获取 Cookies 填入
  • 复制配置文件
cp Config/config.example.yaml Config/config.yaml
  • 填写 Config/config.yaml 文件
  • 安装并配置 ffmpeg
  • 启动程序
python3 main.py

注意事项

  • 程序运行过程中强制停止可能会导致 ffmpeg 未停止运行,请留意
  • 若使用云服务器,请保证服务器位于**大陆,否则会因为哔哩哔哩的限制导致无法开播

bililive-auto-streaming's People

Contributors

kimmyxyc avatar

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bililive-auto-streaming's Issues

video path改为文件夹路径后无法使用

单个视频文件直播正常,改成文件夹报错
错误日志

2023-07-13 12:35:55.277 | SUCCESS | App.Live:start_live:35 - 直播已开始
2023-07-13 12:35:58.281 | SUCCESS | App.Live:start_live:39 - 开始推流
2023-07-13 12:35:58.282 | ERROR | App.Live:start_live:42 - 发生错误: expected str, bytes or os.PathLike object, not int
2023-07-13 12:36:01.520 | SUCCESS | App.Live:stop_live:54 - 停播成功
2023-07-13 12:36:01.640 | SUCCESS | App.Live:share_room:78 - 分享直播间成功
2023-07-13 12:36:01.832 | SUCCESS | App.Live:get_live_receive:65 - 获取奖励成功
2023-07-13 12:36:01.832 | SUCCESS | main:main:40 - 直播完成, 共耗时 6 秒

config
"deploy": {
"type": 1,
"video_path": "/root/bili/mingyun",
"live_time": -1
},

ffmpeg报错

Press [q] to stop, [?] for help
av_interleaved_write_frame(): End of file
[flv @ 029CC940] Failed to update header with correct duration.
[flv @ 029CC940] Failed to update header with correct filesize.
Error writing trailer of rtmp://live-push.bilivideo.com/live-bvc/?streamname=live_381831940_7339786&key=334d247****4464da&schedule=rtmp&pflag=1: End of file
frame= 8791 fps= 23 q=-1.0 Lsize= 317847kB time=00:06:06.25 bitrate=7109.3kbits/s speed=0.968x
video:305055kB audio:12398kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.123921%
Conversion failed!

关键行:
[flv @ 029CC940] Failed to update header with correct duration.
[flv @ 029CC940] Failed to update header with correct filesize.

如何触发:
播放文件夹中的视频,有两个视频,两个视频时长都是 1:30:00 一个半小时;第一个视频可以正常播放完,但是推流到第二个视频的时候就抛出这个异常了。第二个视频播了一分钟左右。

可能是视频时间太长了。

在网上查了一下,说是要在 ffmpeg 推流命令中加 -flvflags no_duration_filesize ,让它不报异常。

原文链接:https://blog.csdn.net/sinat_41892387/article/details/122288215

具体的我也不太懂,作者可以去看一下。

通知可以增加bark吗?

最好可以自定义bark的ip和密钥,还有就是开始直播后会发送通知开始直播吗?我这边没有显示通知

video path改为文件夹路径后无法使用

错误日志
直播已开始 开始推流 expected str, bytes or os.PathLike object, not int 停播成功 直播完成,共耗时 6 秒

config
"deploy": { "type": 1, "video_path": "E:/Auto-Streaming/video", "live_time": 4000

最新的代码报错

直播发生错误: message_push() missing 1 required positional argument: 'push_config'

2023-07-29 16:20:17.583 | SUCCESS | App.Live:start_live:36 - 直播已开始
2023-07-29 16:20:17.584 | ERROR | main:main:37 - 直播发生错误: message_push() missing 1 required positional argument: 'push_config'
2023-07-29 16:20:20.873 | SUCCESS | App.Live:stop_live:56 - 停播成功
2023-07-29 16:20:21.203 | SUCCESS | App.Live:share_room:82 - 分享直播间成功
2023-07-29 16:20:21.472 | SUCCESS | App.Live:get_live_receive:68 - 获取奖励成功
2023-07-29 16:20:21.474 | SUCCESS | main:main:43 - 直播完成, 共耗时 4 秒

config写好之后,执行main就直接报错了。
一周前的代码可以跑。

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.