steamutils 1.0.28 → 1.0.30
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 +10 -5
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -694,10 +694,13 @@ function SteamClient({
|
|
694
694
|
}
|
695
695
|
|
696
696
|
async function autoRequestFreeLicense(log = false, max = 10) {
|
697
|
-
const steamUtils = new SteamUtils(
|
697
|
+
const steamUtils = new SteamUtils(getCookie())
|
698
698
|
|
699
699
|
const ownedAppsCount = log ? (await steamUtils.getDynamicStoreUserData()).rgOwnedApps.length : 0
|
700
|
-
|
700
|
+
let recommendedApps = _.shuffle((await steamUtils.getDynamicStoreUserData())?.rgRecommendedApps)
|
701
|
+
if (!recommendedApps.length) {
|
702
|
+
recommendedApps = (await axios.request({url: 'https://raw.githubusercontent.com/5x/easy-steam-free-packages/master/src/script/packages_db.json'}))?.data?.packages
|
703
|
+
}
|
701
704
|
if (max) {
|
702
705
|
recommendedApps.length = Math.min(recommendedApps.length, max)
|
703
706
|
}
|
@@ -724,6 +727,10 @@ function SteamClient({
|
|
724
727
|
}
|
725
728
|
}
|
726
729
|
|
730
|
+
function getCookie() {
|
731
|
+
return cookie || steamClient?.webSession?.cookies?.join?.(';')
|
732
|
+
}
|
733
|
+
|
727
734
|
return {
|
728
735
|
init,
|
729
736
|
partySearch,
|
@@ -733,9 +740,7 @@ function SteamClient({
|
|
733
740
|
getUsername() {
|
734
741
|
return username
|
735
742
|
},
|
736
|
-
getCookie
|
737
|
-
return cookie
|
738
|
-
},
|
743
|
+
getCookie,
|
739
744
|
getLogOnDetails() {
|
740
745
|
return steamClient?._logOnDetails
|
741
746
|
},
|