4.9 KiB
4.9 KiB
Bililive-go API
GET /api/info Get app info
- Request:
method: GET path: http://127.0.0.1:8080/api/info - Response:
{ "app_name": "BiliLive-go", "app_version": "0.5.0-rc.3-3-g31ceeda", "build_time": "2020-05-05_01:07:16", "git_hash": "31ceeda8f508ba5546cfdefef5f3945828a87651", "pid": 33295, "platform": "darwin/amd64", "go_version": "go1.14.2" }
GET /api/lives Get all live info
- Request:
method: GET path: http://127.0.0.1:8080/api/lives - Response:
[ { "id": "212d9c98c7b376b730d4336bb49f6d3f", "live_url": "https://live.bilibili.com/14917277", "platform_cn_name": "哔哩哔哩", "host_name": "湊-阿库娅Official", "room_name": "【B站限定】棉花糖&唱歌!!!!", "status": false, "listening": true, "recoding": false }, { "id": "63dc965c77d3d81058c92c3e38822256", "live_url": "https://live.bilibili.com/11588230", "platform_cn_name": "哔哩哔哩", "host_name": "白上吹雪Official", "room_name": "古老niconico老人会with☆乐园", "status": false, "listening": true, "recoding": false }, { "id": "dfb964a56725bbad165cb9ea1ef8ac5b", "live_url": "https://live.bilibili.com/1030", "platform_cn_name": "哔哩哔哩", "host_name": "怕上火暴王老菊", "room_name": "直播做饭", "status": false, "listening": true, "recoding": false } ]
GET /api/lives/{id} Get live info by id
- Request:
method: GET path: http://127.0.0.1:8080/api/lives/212d9c98c7b376b730d4336bb49f6d3f - Response:
{ "id": "212d9c98c7b376b730d4336bb49f6d3f", "live_url": "https://live.bilibili.com/14917277", "platform_cn_name": "哔哩哔哩", "host_name": "湊-阿库娅Official", "room_name": "【B站限定】棉花糖&唱歌!!!!", "status": false, "listening": true, "recoding": false }
POST /api/lives Add live
- Request:
method: POST path: http://127.0.0.1:8080/api/lives body: [ { "url": "https://live.bilibili.com/14917277", "listen": true } ] - Response:
[ { "id": "212d9c98c7b376b730d4336bb49f6d3f", "live_url": "https://live.bilibili.com/14917277", "platform_cn_name": "哔哩哔哩", "host_name": "湊-阿库娅Official", "room_name": "【B站限定】棉花糖&唱歌!!!!", "status": false, "listening": true, "recoding": false } ]
DELETE /api/lives/{id} Delete live by id
- Request:
method: DELETE path: http://127.0.0.1:8080/api/lives/212d9c98c7b376b730d4336bb49f6d3f - Response:
OK
GET /api/lives/{id}/start Start listen live by id
- Request:
method: GET path: http://127.0.0.1:8080/api/lives/212d9c98c7b376b730d4336bb49f6d3f/start - Response:
{ "id": "212d9c98c7b376b730d4336bb49f6d3f", "live_url": "https://live.bilibili.com/14917277", "platform_cn_name": "哔哩哔哩", "host_name": "湊-阿库娅Official", "room_name": "【B站限定】棉花糖&唱歌!!!!", "status": false, "listening": true, "recoding": false }
GET /api/lives/{id}/stop Stop listen and record live by id
- Request:
method: GET path: http://127.0.0.1:8080/api/lives/212d9c98c7b376b730d4336bb49f6d3f/stop - Response:
{ "id": "212d9c98c7b376b730d4336bb49f6d3f", "live_url": "https://live.bilibili.com/14917277", "platform_cn_name": "哔哩哔哩", "host_name": "湊-阿库娅Official", "room_name": "【B站限定】棉花糖&唱歌!!!!", "status": false, "listening": false, "recoding": false }
GET /api/config Get config info
- Request:
method: GET path: http://127.0.0.1:8080/api/config - Response:
{ "RPC": { "Enable": true, "Bind": "127.0.0.1:8080" }, "Debug": false, "Interval": 15, "OutPutPath": "/tmp", "Feature": { "UseNativeFlvParser": false }, "LiveRooms": null }
PUT /api/config Save lives info to config file
- Request:
method: PUT path: http://127.0.0.1:8080/api/config - Response:
OK