steamutils 1.1.77 → 1.1.79
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +11 -1
- package/package.json +1 -1
package/index.js
CHANGED
@@ -1543,6 +1543,9 @@ class SteamUser {
|
|
1543
1543
|
if (customURL) {
|
1544
1544
|
this._myProfile = `id/${customURL}`
|
1545
1545
|
}
|
1546
|
+
} else if (redirectURL?.startsWith('https://steamcommunity.com/login/')) {
|
1547
|
+
console.error('Login first', this._steamid_user)
|
1548
|
+
return null
|
1546
1549
|
}
|
1547
1550
|
|
1548
1551
|
console.log(`Redirect to ${redirectURL}`)
|
@@ -5219,6 +5222,8 @@ class SteamUser {
|
|
5219
5222
|
}
|
5220
5223
|
}
|
5221
5224
|
|
5225
|
+
if(!result) return
|
5226
|
+
|
5222
5227
|
const descriptions = result.descriptions
|
5223
5228
|
const $ = cheerio.load(result.html?.replaceAll(/[\t\n\r]/gi, '')
|
5224
5229
|
?.trim() || '')
|
@@ -5631,7 +5636,12 @@ class SteamUser {
|
|
5631
5636
|
const response = await this._httpRequestAjax({
|
5632
5637
|
url: `miniprofile/${SteamUser.steamID642Miniprofile(steamId)}/json/?origin=https://steamcommunity.com/`
|
5633
5638
|
})
|
5634
|
-
|
5639
|
+
const miniProfile = response.data;
|
5640
|
+
const avatar_hash = SteamUser.GetAvatarHashFromURL(miniProfile?.avatar_url) || ''
|
5641
|
+
return {
|
5642
|
+
...miniProfile,
|
5643
|
+
avatar_hash,
|
5644
|
+
}
|
5635
5645
|
const example = {
|
5636
5646
|
"level": 0,
|
5637
5647
|
"level_class": "friendPlayerLevel lvl_0",
|