Download the PHP package hejunjie/bililive without Composer

On this page you can find all versions of the php package hejunjie/bililive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bililive

发行说明

B站直播 WebSocket 连接的核心组件库,提供简洁的接口实现,包括登录、直播间信息流加密/解密、以及相关的关键方法。适合集成到需要对接 Bilibili 直播间的项目中(弹幕监控,礼物答谢、定时广告、关注感谢,自动回复等)

安装指南

使用 Composer 安装:

当前支持的方法列表

说明
Login 登录相关方法
Live 直播间相关方法
WebSocket 直播间信息流相关方法

登录相关方法

方法 说明
Login::getQrcode() 获取扫描二维码
Login::checkQrcode() 验证登录信息
Login::getUserInfo() 获取用户基本信息

直播间相关方法

方法 说明
Live::getRealRoomId() 获取真实房间号
Live::getRealRoomInfo() 获取直播间基本信息
Live::getInitialWebSocketUrl() 获取直播间连接信息
Live::sendMsg() 发送弹幕
Live::reportLiveHeartbeat() web端直播心跳上报(60秒一次)
Live::getOnlineGoldRank() 获取直播间在线榜

WebSocket

方法 说明
WebSocket::buildAuthPayload() 构建认证包数据
WebSocket::buildHeartbeatPayload() 构建心跳包数据
WebSocket::parseResponsePayload() 解构响应数据包

在实时通讯和弹幕系统的开发中,常见的实现方案多基于 Java、Python 或 Go 语言,但少有采用 PHP 的项目。

传统的 PHP-FPM 架构确实不太适合即时通讯一类的方向,但随着 Workerman、Swoole 等优秀常驻进程方案的出现,PHP 在这一领域的潜力逐渐显现。

基于此,我决定创建这样一个库,以 PHP 的方式来实现 B站的弹幕连接,希望给需要用 PHP 做类似弹幕姬项目的朋友提供一个简单方便的工具


Workerman实现B站直播信息流的监听

基础实例,代码自行调整

弹幕监控,礼物答谢、定时广告、关注感谢,自动回复等功能于 onMessageReceived 方法中自行实现


All versions of bililive with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
ext-brotli Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hejunjie/bililive contains the following files

Loading the files please wait ....