steamutils 1.1.77 → 1.1.79

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.
Files changed (2) hide show
  1. package/index.js +11 -1
  2. 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
- return response.data
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.1.77",
3
+ "version": "1.1.79",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "axios": "^1.3.4",