@laplace.live/ws 7.1.4 → 7.1.5-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/browser.js +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @laplace.live/ws
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
LAPLACE Live! flavored bilibili live WebSocket/TCP API.
|
|
4
4
|
|
|
5
5
|
This project is based on [bilibili-live-ws](https://github.com/simon300000/bilibili-live-ws) and has the exact same API as the original project, with the following differences:
|
|
6
6
|
|
|
@@ -48,7 +48,7 @@ live.addEventListener<{ custom: string }>("NEW_CMD", ({ data }) =>
|
|
|
48
48
|
### Browser
|
|
49
49
|
|
|
50
50
|
```typescript
|
|
51
|
-
import { LiveWS, KeepLiveWS } from "@laplace.live/ws/
|
|
51
|
+
import { LiveWS, KeepLiveWS } from "@laplace.live/ws/client";
|
|
52
52
|
|
|
53
53
|
const live = new LiveWS(25034104, { key: "...", address: "wss://..." });
|
|
54
54
|
live.addEventListener("DANMU_MSG", ({ data }) => console.log(data.msg_id));
|
|
@@ -67,7 +67,7 @@ keep.addEventListener("DANMU_MSG", ({ data }) => console.log(data.msg_id));
|
|
|
67
67
|
### TCP (Node.js / Bun only)
|
|
68
68
|
|
|
69
69
|
```typescript
|
|
70
|
-
import { LiveTCP } from "@laplace.live/ws";
|
|
70
|
+
import { LiveTCP } from "@laplace.live/ws/server";
|
|
71
71
|
|
|
72
72
|
const live = new LiveTCP(25034104, { key: "..." });
|
|
73
73
|
live.addEventListener("heartbeat", ({ data }) => console.log("Online:", data));
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
// src/inflate/browser.ts
|
|
2
|
-
import { inflate } from "pako";
|
|
3
|
-
|
|
4
1
|
// src/inflate/brotli.ts
|
|
5
2
|
var makeBrotliDecode = () => {
|
|
6
3
|
function InputStream(bytes) {
|
|
@@ -1783,7 +1780,10 @@ var makeBrotliDecode = () => {
|
|
|
1783
1780
|
var BrotliDecode = makeBrotliDecode();
|
|
1784
1781
|
|
|
1785
1782
|
// src/inflate/browser.ts
|
|
1786
|
-
var inflateAsync = (d) =>
|
|
1783
|
+
var inflateAsync = async (d) => {
|
|
1784
|
+
const { inflate } = await import("pako");
|
|
1785
|
+
return inflate(d);
|
|
1786
|
+
};
|
|
1787
1787
|
var brotliDecompressAsync = (d) => Uint8Array.from(BrotliDecode(Int8Array.from(d)));
|
|
1788
1788
|
var inflates = { inflateAsync, brotliDecompressAsync };
|
|
1789
1789
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@laplace.live/ws",
|
|
3
|
-
"version": "7.1.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.1.5-beta.0",
|
|
4
|
+
"description": "LAPLACE Live! flavored bilibili live WebSocket/TCP API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"browser": "./dist/browser.js",
|