steamutils 1.0.66 → 1.0.68
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 +11 -6
- package/index.js +10 -10
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -864,12 +864,17 @@ function SteamClient({
|
|
864
864
|
cookieObj[name] = value
|
865
865
|
}
|
866
866
|
cookie = Object.keys(cookieObj).map(name => `${name}=${cookieObj[name]}`).join(';')
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
867
|
+
for (let i = 0; i < 10; i++) {
|
868
|
+
try {
|
869
|
+
response = (await axios.request({
|
870
|
+
url: 'https://store.steampowered.com/', headers: {
|
871
|
+
cookie,
|
872
|
+
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.7',
|
873
|
+
},
|
874
|
+
}))
|
875
|
+
break
|
876
|
+
} catch (e) { }
|
877
|
+
}
|
873
878
|
}
|
874
879
|
return cookie
|
875
880
|
}
|
package/index.js
CHANGED
@@ -1808,17 +1808,17 @@ class SteamUser {
|
|
1808
1808
|
return await this.getFriendsList()
|
1809
1809
|
}
|
1810
1810
|
|
1811
|
-
async getMyFriendsIDList() {
|
1812
|
-
|
1813
|
-
|
1814
|
-
|
1811
|
+
async getMyFriendsIDList () {
|
1812
|
+
for (let i = 0; i < 5; i++) {
|
1813
|
+
const { data } = await this._httpRequestAjax(`textfilter/ajaxgetfriendslist`) //{ success: 21 }
|
1814
|
+
if (data?.success === 1) {
|
1815
|
+
return data.friendslist.friends.filter(function (friend) {
|
1816
|
+
return EFriendRelationship.Friend === friend.efriendrelationship
|
1817
|
+
}).map(function (friend) {
|
1818
|
+
return friend.ulfriendid
|
1819
|
+
})
|
1820
|
+
}
|
1815
1821
|
}
|
1816
|
-
console.log(`data`, data)
|
1817
|
-
return data.friendslist.friends.filter(function (friend) {
|
1818
|
-
return EFriendRelationship.Friend === friend.efriendrelationship
|
1819
|
-
}).map(function (friend) {
|
1820
|
-
return friend.ulfriendid
|
1821
|
-
})
|
1822
1822
|
}
|
1823
1823
|
|
1824
1824
|
async getMyFollowingPlayersList() {
|