@bililive-tools/douyin-recorder 1.16.0 → 1.16.1

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 CHANGED
@@ -84,14 +84,14 @@ const { id } = await provider.resolveChannelInfoFromURL(url);
84
84
 
85
85
  `mobile` 及 `userHTML` 必须传入 `uid` 参数
86
86
 
87
- | 描述 | 备注 |
88
- | ---------------- | ---------------------------------------- |
89
- | web直播间接口 | 效果不错 |
90
- | mobile直播间接口 | 不易风控,无验证码,海外IP可能无法使用 |
91
- | 直播间web解析 | 易风控,有验证码,单个接口1M流量 |
92
- | 用户web解析 | 不易风控,海外IP无法使用,单个接口1M流量 |
93
- | 负载均衡 | 使用负载均衡算法来分摊防止风控 |
94
- | 随机 | 从几个接口里挑一个 |
87
+ | 描述 | 备注 |
88
+ | ---------------- | ------------------------------------------------------ |
89
+ | web直播间接口 | 效果不错 |
90
+ | mobile直播间接口 | 不易风控,无验证码,海外IP可能无法使用,不会应用Cookie |
91
+ | 直播间web解析 | 易风控,有验证码,单个接口1M流量 |
92
+ | 用户web解析 | 不易风控,海外IP无法使用,单个接口1M流量 |
93
+ | 负载均衡 | 使用负载均衡算法来分摊防止风控 |
94
+ | 随机 | 从几个接口里挑一个 |
95
95
 
96
96
  # 协议
97
97
 
package/lib/douyin_api.js CHANGED
@@ -153,6 +153,9 @@ async function getRoomInfoByUserWeb(secUserId, opts = {}) {
153
153
  if (res.data.includes("验证码")) {
154
154
  throw new Error("需要验证码,请在浏览器中打开链接获取" + url);
155
155
  }
156
+ if (!res.data.includes("抖音号")) {
157
+ throw new Error("userHTML页面没有正常加载" + String(res.data));
158
+ }
156
159
  if (!res.data.includes("直播中")) {
157
160
  return {
158
161
  living: false,
@@ -344,6 +347,7 @@ async function getRoomInfoByWeb(webRoomId, opts = {}) {
344
347
  }
345
348
  async function getRoomInfoByMobile(secUserId, opts = {}) {
346
349
  if (!secUserId) {
350
+ console.error(opts);
347
351
  throw new Error("Mobile API need secUserId, please set uid field");
348
352
  }
349
353
  if (typeof secUserId === "number") {
@@ -360,7 +364,7 @@ async function getRoomInfoByMobile(secUserId, opts = {}) {
360
364
  const res = await requester.get(`https://webcast.amemv.com/webcast/room/reflow/info/`, {
361
365
  params,
362
366
  headers: {
363
- cookie: opts.auth,
367
+ // cookie: opts.auth,
364
368
  },
365
369
  });
366
370
  // @ts-ignore
package/lib/index.js CHANGED
@@ -198,8 +198,8 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
198
198
  });
199
199
  };
200
200
  downloader.on("videoFileCreated", handleVideoCreated);
201
- downloader.on("videoFileCompleted", ({ filename }) => {
202
- this.emit("videoFileCompleted", { filename });
201
+ downloader.on("videoFileCompleted", (data) => {
202
+ this.emit("videoFileCompleted", data);
203
203
  });
204
204
  downloader.on("DebugLog", (data) => {
205
205
  this.emit("DebugLog", data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bililive-tools/douyin-recorder",
3
- "version": "1.16.0",
3
+ "version": "1.16.1",
4
4
  "description": "@bililive-tools douyin recorder implemention",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
@@ -39,7 +39,7 @@
39
39
  "mitt": "^3.0.1",
40
40
  "sm-crypto": "^0.3.13",
41
41
  "douyin-danma-listener": "0.4.1",
42
- "@bililive-tools/manager": "^1.16.0"
42
+ "@bililive-tools/manager": "^1.16.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "*"