steamutils 1.5.46 → 1.5.48
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/index.js +33 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -6208,6 +6208,9 @@ export default class SteamUser {
|
|
6208
6208
|
const loginLinkBlock = $(".market_login_link_ctn").length;
|
6209
6209
|
if (loginMsg1 || loginMsg2 || loginMsg3 || loginLinkBlock) return null;
|
6210
6210
|
|
6211
|
+
const tooManyRequestsMsg = $("body").find(':contains("You\'ve made too many requests recently. Please wait and try your request again later.")').length;
|
6212
|
+
if (tooManyRequestsMsg) return null; // or your desired error object
|
6213
|
+
|
6211
6214
|
const warningContainer = $(".market_headertip_container_warning");
|
6212
6215
|
const warningHeaderElement = warningContainer.find("#market_warning_header");
|
6213
6216
|
if (!warningContainer.length || !warningHeaderElement.length) {
|
@@ -8546,6 +8549,36 @@ export default class SteamUser {
|
|
8546
8549
|
/* empty */
|
8547
8550
|
}
|
8548
8551
|
}
|
8552
|
+
|
8553
|
+
/**
|
8554
|
+
* Retrieves the Steam Connection Manager (CM) server list by querying the Steam WebAPI.
|
8555
|
+
* Returns the `response` property from the API, which includes an array of connection manager servers,
|
8556
|
+
* as well as a status and message.
|
8557
|
+
*
|
8558
|
+
* @returns {Promise<undefined | {
|
8559
|
+
* serverlist: Array<{
|
8560
|
+
* endpoint: string,
|
8561
|
+
* legacy_endpoint: string,
|
8562
|
+
* type: string,
|
8563
|
+
* dc: string,
|
8564
|
+
* realm: string,
|
8565
|
+
* load: number,
|
8566
|
+
* wtd_load: number
|
8567
|
+
* }>,
|
8568
|
+
* success: boolean,
|
8569
|
+
* message: string
|
8570
|
+
* }>} The CM server list response, or undefined if the request failed.
|
8571
|
+
*/
|
8572
|
+
static async getCMListForConnect() {
|
8573
|
+
let response = null;
|
8574
|
+
try {
|
8575
|
+
response = (await axios.get("https://api.steampowered.com/ISteamDirectory/GetCMListForConnect/v1/")).data;
|
8576
|
+
} catch (e) {}
|
8577
|
+
if (!response) {
|
8578
|
+
return;
|
8579
|
+
}
|
8580
|
+
return response?.response;
|
8581
|
+
}
|
8549
8582
|
}
|
8550
8583
|
|
8551
8584
|
SteamUser.MAX_RETRY = 10;
|