Flow Details
Bilibili Live
An AWESOME App that shows your live online count during your living/streaming time or followers count on the other time for your Bilibili account.
Also shows views count and likes count.
Icon
You may need downloading these two icons from Icon Database:
bilibililive and bilibiliblink
You may also use upload assets function in this page.
Usage
Go to https://live.bilibili.com/ , open your Bilibili live room.
Find the Room ID in the URL https://live.bilibili.com/room_id.
Go to https://space.bilibili.com/.
Find the UID in the URL https://space.bilibili.com/uid.
Find the SESSDATA in your Cookie.
Set Room ID in the Data: Room ID node.
Set UID and SESSDATA in the Data: UID & Cookie node.
Set IP address of your Awtrix Light in the AwtrixLight/Custom node.
[
{
"id": "564493a53a16092d",
"type": "group",
"z": "809eb5406b944369",
"name": "App: Bilibili Live",
"style": {
"label": true
},
"nodes": [
"49777e3324420dc4",
"0933ea448648fc03",
"5a3c8c2a60f6271c",
"606a362d6622e6e4",
"b7e25289f418c04c",
"1508d99f7f81bba3",
"92f3470332aa9037",
"25b2eefecf50ddad",
"35881e6b409f55a0",
"8b07250552e7d3a4",
"86bb55aa45c1f4cc",
"b918c457216d8569"
],
"x": 14,
"y": 959,
"w": 1212,
"h": 242
},
{
"id": "49777e3324420dc4",
"type": "inject",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "1x/min",
"props": [],
"repeat": "60",
"crontab": "",
"once": true,
"onceDelay": "0.5",
"topic": "",
"x": 120,
"y": 1100,
"wires": [
[
"92f3470332aa9037",
"b7e25289f418c04c"
]
]
},
{
"id": "0933ea448648fc03",
"type": "http request",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Bilibili API",
"method": "GET",
"ret": "obj",
"paytoqs": "query",
"url": "https://api.live.bilibili.com/room/v1/Room/get_info",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "User-Agent",
"keyValue": "",
"valueType": "other",
"valueValue": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15"
}
],
"x": 380,
"y": 1040,
"wires": [
[
"5a3c8c2a60f6271c"
]
]
},
{
"id": "5a3c8c2a60f6271c",
"type": "function",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Parser 1",
"func": "var data = msg.payload.data;\nvar follower = String(data.attention);\nvar online = String(data.online);\nvar isLiving = false;\nif (data.live_status == 1) {\n isLiving = true;\n}\n\nmsg.payload = {\n \"follower\": follower,\n \"online\": online,\n \"isLiving\": isLiving\n};\nmsg.topic = \"data1\";\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 540,
"y": 1040,
"wires": [
[
"8b07250552e7d3a4"
]
]
},
{
"id": "606a362d6622e6e4",
"type": "comment",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Bilibili Live",
"info": "Go to https://live.bilibili.com/ , open your Bilibili live room. \nFind the **Room ID** in the URL https://live.bilibili.com/**room_id**. \nGo to https://space.bilibili.com/. \nFind the **UID** in the URL https://space.bilibili.com/**uid**. \nFind the **SESSDATA** in your Cookie.\n\nSet **Room ID** in the **_Data: Room ID_** node. \nSet **UID** and **SESSDATA** in the **_Data: UID & Cookie_** node. \nSet IP address of your Awtrix Light in the **_AwtrixLight/Custom_** node.\n",
"x": 120,
"y": 1000,
"wires": []
},
{
"id": "b7e25289f418c04c",
"type": "function",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Data: Room ID",
"func": "msg.payload = {\n \"room_id\": \"22090988\"\n};\nmsg.topic = \"data1\";\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 200,
"y": 1040,
"wires": [
[
"0933ea448648fc03"
]
]
},
{
"id": "1508d99f7f81bba3",
"type": "http request",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Bilibili API",
"method": "GET",
"ret": "obj",
"paytoqs": "query",
"url": "https://api.bilibili.com/x/space/upstat",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "User-Agent",
"keyValue": "",
"valueType": "other",
"valueValue": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15"
},
{
"keyType": "other",
"keyValue": "Cookie",
"valueType": "msg",
"valueValue": "cookie"
}
],
"x": 380,
"y": 1160,
"wires": [
[
"25b2eefecf50ddad"
]
]
},
{
"id": "92f3470332aa9037",
"type": "function",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Data: UID & Cookie",
"func": "msg.payload = {\n \"mid\": \"43209730\",\n \"jsonp\": \"jsonp\"\n};\nmsg.cookie = \"SESSDATA=<<PUT_YOUR_SESSDATA_HERE>>;\";\nmsg.topic = \"data2\";\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 210,
"y": 1160,
"wires": [
[
"1508d99f7f81bba3"
]
]
},
{
"id": "25b2eefecf50ddad",
"type": "function",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Parser 2",
"func": "var data = msg.payload.data;\nvar viewCount = String(data.archive.view);\nvar likes = String(data.likes);\n\nmsg.payload = {\n \"viewCount\": viewCount,\n \"likes\": likes\n};\nmsg.topic = \"data2\";\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 540,
"y": 1160,
"wires": [
[
"8b07250552e7d3a4"
]
]
},
{
"id": "35881e6b409f55a0",
"type": "function",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Parser",
"func": "var data1 = msg.payload.data1;\nvar data2 = msg.payload.data2;\n\nvar follower = data1.follower;\nvar online = data1.online;\nvar isLiving = data1.isLiving;\nvar viewCount = data2.viewCount;\nvar likes = data2.likes;\n\nif (isLiving) {\n msg.payload = [\n { \"text\": online, \"icon\": \"bilibililive\", \"color\": \"#FF0000\", \"duration\": 10 },\n { \"text\": follower, \"icon\": \"bilibiliblink\", \"duration\": 10 },\n { \"text\": viewCount, \"icon\": \"bilibiliblink\", \"color\": \"#00FF00\", \"duration\": 10 },\n { \"text\": likes, \"icon\": \"bilibiliblink\", \"color\": \"#FD4A88\", \"duration\": 10 },\n ];\n}else {\n msg.payload = [\n { \"text\": follower, \"icon\": \"bilibiliblink\", \"duration\": 10 },\n { \"text\": viewCount, \"icon\": \"bilibiliblink\", \"color\": \"#00FF00\", \"duration\": 10 },\n { \"text\": likes, \"icon\": \"bilibiliblink\", \"color\": \"#FD4A88\", \"duration\": 10 },\n ];\n}\nmsg.topic = \"bilibili\";\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 890,
"y": 1100,
"wires": [
[
"86bb55aa45c1f4cc"
]
]
},
{
"id": "8b07250552e7d3a4",
"type": "join",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Combine",
"mode": "custom",
"build": "object",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": "\\n",
"joinerType": "str",
"accumulate": false,
"timeout": "",
"count": "2",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "num",
"reduceFixup": "",
"x": 730,
"y": 1100,
"wires": [
[
"35881e6b409f55a0"
]
]
},
{
"id": "86bb55aa45c1f4cc",
"type": "http request",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "AwtrixLight/Custom",
"method": "POST",
"ret": "txt",
"paytoqs": "body",
"url": "http://10.10.10.192/api/custom?name=bilibili",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [
{
"keyType": "Content-Type",
"keyValue": "",
"valueType": "other",
"valueValue": "application/json"
}
],
"x": 1080,
"y": 1100,
"wires": [
[
"b918c457216d8569"
]
]
},
{
"id": "b918c457216d8569",
"type": "debug",
"z": "809eb5406b944369",
"g": "564493a53a16092d",
"name": "Response",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1120,
"y": 1160,
"wires": []
}
]
![/flows/RJM9oLYlOLzX/bilibiliblink.gif](/flows/RJM9oLYlOLzX/bilibiliblink.gif)
![/flows/RJM9oLYlOLzX/bilibililive.gif](/flows/RJM9oLYlOLzX/bilibililive.gif)
-- Flow first published on November 9, 2023, last updated on November 10, 2023 at 18:02.