steamutils 1.0.69 → 1.0.72
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/SteamClient.js +7 -3
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -838,7 +838,7 @@ function SteamClient({
|
|
838
838
|
|
839
839
|
async function _getStoreSteamPoweredResponse(cookie) {
|
840
840
|
let response = null
|
841
|
-
for (let i = 0; i <
|
841
|
+
for (let i = 0; i < 50; i++) {
|
842
842
|
if(!response){
|
843
843
|
try {
|
844
844
|
response = (await axios.request({
|
@@ -847,7 +847,9 @@ function SteamClient({
|
|
847
847
|
accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.75',
|
848
848
|
},
|
849
849
|
}))
|
850
|
-
} catch (e) {
|
850
|
+
} catch (e) {
|
851
|
+
await sleep(1000)
|
852
|
+
}
|
851
853
|
}
|
852
854
|
}
|
853
855
|
return response
|
@@ -876,7 +878,7 @@ function SteamClient({
|
|
876
878
|
|
877
879
|
async function loginWithCookie(cookie, tryNewCookie = false) {
|
878
880
|
let response;
|
879
|
-
for (let i = 0; i <
|
881
|
+
for (let i = 0; i < 20; i++) {
|
880
882
|
try {
|
881
883
|
response = (await axios.request({
|
882
884
|
url: 'https://steamcommunity.com/chat/clientjstoken',
|
@@ -894,12 +896,14 @@ function SteamClient({
|
|
894
896
|
|
895
897
|
const result = response?.data
|
896
898
|
if (result?.logged_in) {
|
899
|
+
console.log(`clientjstoken success`)
|
897
900
|
Object.assign(result, {
|
898
901
|
steamID: new SteamID(result.steamid), accountName: result.account_name, webLogonToken: result.token
|
899
902
|
})
|
900
903
|
steamClient.logOn(result)
|
901
904
|
return cookie
|
902
905
|
} else {
|
906
|
+
console.log(`clientjstoken fail`)
|
903
907
|
if (tryNewCookie) {
|
904
908
|
log('You are not logged in', cookie)
|
905
909
|
return null
|