steamutils 1.4.15 → 1.4.16

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.4.15",
3
+ "version": "1.4.16",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",
@@ -13,7 +13,7 @@ import SteamID from "steamid";
13
13
  // console.log(loginResult.cookie);
14
14
  // const user = new SteamUser(loginResult.cookie)
15
15
 
16
- const cookie = "steamLoginSecure=76561199027347696%7C%7CeyAidHlwIjogIkpXVCIsICJhbGciOiAiRWREU0EiIH0.eyAiaXNzIjogInI6MEVEQl8yNDdGRkVFOV9BREZDMSIsICJzdWIiOiAiNzY1NjExOTkwMjczNDc2OTYiLCAiYXVkIjogWyAid2ViIiwgIm1vYmlsZSIgXSwgImV4cCI6IDE3MTk0NjE2NzEsICJuYmYiOiAxNzEwNzMzNDgyLCAiaWF0IjogMTcxOTM3MzQ4MiwgImp0aSI6ICIwRjJBXzI0QTRFNzA0XzRFMUY5IiwgIm9hdCI6IDE3MTc0MDI5NzYsICJydF9leHAiOiAxNzM1NTcwOTk0LCAicGVyIjogMCwgImlwX3N1YmplY3QiOiAiMTQuMjMyLjIxNC4xODYiLCAiaXBfY29uZmlybWVyIjogIjE0LjIzMi4yMTQuMTg2IiB9.-91xjy2Z55LHw1i7OkzmAHf-KB-QeEfZqfznmDDgdSK_8ZUoesiiOs1DyFqCL7gM5hOsQGsMjYR3LgaCG0umDg;sessionid=b144c2eac0b3b2c577319ebd";
16
+ const cookie = "";
17
17
  const steamClient = new SteamClient({
18
18
  cookie,
19
19
  isAutoPlay: true,
package/utils.js CHANGED
@@ -153,3 +153,16 @@ export const secretAsBuffer = (sharedSecret) => {
153
153
  // It must be base64
154
154
  return Buffer.from(sharedSecret, "base64");
155
155
  };
156
+
157
+ export function decodeLoginQrUrl(qrUrl) {
158
+ if (!qrUrl || typeof qrUrl !== "string") {
159
+ return null;
160
+ }
161
+ const match = qrUrl.match(/^https?:\/\/s\.team\/q\/(\d+)\/(\d+)(\?|$)/);
162
+ if (!match) {
163
+ console.log("Invalid QR code URL");
164
+ return null;
165
+ }
166
+
167
+ return { clientId: match[2], version: parseInt(match[1], 10) };
168
+ }