@bililive-tools/douyu-recorder 1.7.0 → 1.7.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/lib/index.js +13 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -109,6 +109,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
109
109
|
try {
|
|
110
110
|
const liveInfo = await getInfo(this.channelId);
|
|
111
111
|
this.liveInfo = liveInfo;
|
|
112
|
+
this.state = "idle";
|
|
112
113
|
}
|
|
113
114
|
catch (error) {
|
|
114
115
|
this.state = "check-error";
|
|
@@ -458,11 +459,18 @@ export const provider = {
|
|
|
458
459
|
roomId = matched[1].trim();
|
|
459
460
|
}
|
|
460
461
|
else {
|
|
461
|
-
//
|
|
462
|
-
const
|
|
463
|
-
if (
|
|
464
|
-
|
|
465
|
-
|
|
462
|
+
// 解析出query中的rid参数
|
|
463
|
+
const rid = new URL(channelURL).searchParams.get("rid");
|
|
464
|
+
if (rid) {
|
|
465
|
+
roomId = rid;
|
|
466
|
+
}
|
|
467
|
+
else {
|
|
468
|
+
// 解析<link rel="canonical" href="xxxxxxx"/>中的href
|
|
469
|
+
const canonicalLink = html.match(/<link rel="canonical" href="(.*?)"/);
|
|
470
|
+
if (canonicalLink) {
|
|
471
|
+
const url = canonicalLink[1];
|
|
472
|
+
roomId = url.split("/").pop();
|
|
473
|
+
}
|
|
466
474
|
}
|
|
467
475
|
}
|
|
468
476
|
if (!roomId)
|