@bililive-tools/douyu-recorder 1.11.1 → 1.15.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/lib/requester.d.ts +1 -2
- package/lib/stream.d.ts +1 -0
- package/lib/stream.js +1 -0
- package/lib/utils.d.ts +0 -1
- package/lib/utils.js +0 -25
- package/package.json +3 -3
package/lib/requester.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const requester: axios.AxiosInstance;
|
|
1
|
+
export declare const requester: import("axios").AxiosInstance;
|
package/lib/stream.d.ts
CHANGED
package/lib/stream.js
CHANGED
|
@@ -36,6 +36,7 @@ export async function getInfo(channelId) {
|
|
|
36
36
|
liveStartTime: startTime,
|
|
37
37
|
liveId: utils.md5(`${channelId}-${startTime?.getTime() ?? Date.now()}`),
|
|
38
38
|
recordStartTime: recordStartTime,
|
|
39
|
+
area: data.room.second_lvl_name,
|
|
39
40
|
// gifts: data.gift.map((g) => ({
|
|
40
41
|
// id: g.id,
|
|
41
42
|
// name: g.name,
|
package/lib/utils.d.ts
CHANGED
|
@@ -18,4 +18,3 @@ export declare function getValuesFromArrayLikeFlexSpaceBetween<T>(array: T[], co
|
|
|
18
18
|
export declare function ensureFolderExist(fileOrFolderPath: string): void;
|
|
19
19
|
export declare function assert(assertion: unknown, msg?: string): asserts assertion;
|
|
20
20
|
export declare const uuid: () => `${string}-${string}-${string}-${string}-${string}`;
|
|
21
|
-
export declare function createInvalidStreamChecker(): (ffmpegLogLine: string) => boolean;
|
package/lib/utils.js
CHANGED
|
@@ -54,28 +54,3 @@ export function assert(assertion, msg) {
|
|
|
54
54
|
export const uuid = () => {
|
|
55
55
|
return crypto.randomUUID();
|
|
56
56
|
};
|
|
57
|
-
export function createInvalidStreamChecker() {
|
|
58
|
-
let prevFrame = 0;
|
|
59
|
-
let frameUnchangedCount = 0;
|
|
60
|
-
return (ffmpegLogLine) => {
|
|
61
|
-
const streamInfo = ffmpegLogLine.match(/frame=\s*(\d+) fps=.*? q=.*? size=.*? time=.*? bitrate=.*? speed=.*?/);
|
|
62
|
-
if (streamInfo != null) {
|
|
63
|
-
const [, frameText] = streamInfo;
|
|
64
|
-
const frame = Number(frameText);
|
|
65
|
-
if (frame === prevFrame) {
|
|
66
|
-
if (++frameUnchangedCount >= 15) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else {
|
|
71
|
-
prevFrame = frame;
|
|
72
|
-
frameUnchangedCount = 0;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
if (ffmpegLogLine.includes("HTTP error 404 Not Found")) {
|
|
77
|
-
return true;
|
|
78
|
-
}
|
|
79
|
-
return false;
|
|
80
|
-
};
|
|
81
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bililive-tools/douyu-recorder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "bililive-tools douyu recorder implemention",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"safe-eval": "^0.4.1",
|
|
40
40
|
"ws": "^8.18.0",
|
|
41
41
|
"lodash-es": "^4.17.21",
|
|
42
|
-
"axios": "^1.
|
|
42
|
+
"axios": "^1.15.0",
|
|
43
43
|
"douyu-api": "^0.2.1",
|
|
44
|
-
"@bililive-tools/manager": "^1.
|
|
44
|
+
"@bililive-tools/manager": "^1.14.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/ws": "^8.5.13"
|