airmole / bilive-open-api
bilibili直播内容开放平台API
v1.0.0
2022-12-07 03:30 UTC
Requires
- php: >=7.4
- ext-curl: *
- ext-json: *
README
bilibili直播开放平台API接口。
install
composer require "airmole/bilive-open-api"
用法
<?php use Airmole\BiliveOpenApi\BiliveService; $biliveService = new BiliveService('access_key_id', 'access_key_secred'); $start = $biliveService->start('code', 'app_id'); echo "项目开启:\r\n"; print_r($start); $gameId = $start['data']['game_info']['game_id']; $heartBeat = $biliveService->heartBeat($gameId); echo "项目心跳:\r\n"; print_r($heartBeat); /* $batchHeartBeat = $biliveService->batchHeartBeat([$gameId]); echo "项目批量心跳:\r\n"; print_r($batchHeartBeat); */ echo "项目关闭:\r\n"; $close = $biliveService->end('app_id', $gameId); print_r($close);