-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Steam Profile All Games to Skip Already Owned #5
Comments
If it helps this is how I pull appIDs off my profile in a PHP script I have for a different purpose:
|
The idea itself is good and an important feature to get implemented.
The packageIDs could be read out of this file easily with a short script. |
I've tested also a simper solution with javascript:
var elements = document.querySelectorAll(
"div[class='free_license_remove_link'] > a"
);
var games = [];
for (let i = 0; i < elements.length; i++) {
var game = elements[i].href;
game = game.match(/([1-9])\w+/g)[0];
games.push(game);
}
console.log(games);
|
One important aspect is that no very complex solution is needed because the script does create its own list with the already activated licenses. |
@cwilliams5 |
Yes but the script is currently attempting 16,512 licenses, sleeping 90sec each. I would wager I have probably 16,400 already on my account. So the amount of time this script has to run doing !addlicense wait 90s for stuff I already have is a big delay. I know the next time I run the script it wont matter because of the activated_packages.txt cache, but I'm talking about prefilling activated_packages.txt ahead of time.
Yes but if you incorporate this, then people need to supply your script/program with their steam credentials which a subset of people won't want to. My creds are already in ASF which you are using for the activations. If you use games page, then I would only need to provide you my profile URL
Same issue, have to be logged in. With the games page you don't. That said, I think the games page might be less complete in what it lists (like it might miss DLC or something), I don't know I havent compared it.
I think it could be two things.
EDIT* My statement that games page doesn't require logging in is only true for people who have it set to public. There is a way to make your profile private and obviously this would fail for them. |
I could just adapt the script which is working on the games page, but the reason I created it like it is, is because I do want the script to be added to autostart and run in the background so that it isn't any effort after installation.
Yes, it was just my browser trying to load the site. I've had a look into it and the output shows 4128 games out of the 8375 packages I do have currently activated. |
Saving up to 4k out of the 16k is a good speed up, with extra steps for those willing. So I don't know but sounds like the a good path:
|
I've implemented both. Edit: |
I'm testing now. OK both methods are working. Here is something interesting I'll share just because its a curiosity. I did a set comparison between the IDs from my profile games scrape (A) and those from the javascript on the licenses page (B). I knew B would have more, but to my surprise it looked like this: Turns out A (the games page scrape) has thousands of items that is NOT in B (the license export). Turns out the best way to prefill your script is to do BOTH methods and take the union. And in doing so, your script has no new licenses for me. But I think thats because your license file is 8 days old. Steam.db shows me a few dozen new ones, but I ran theirs less than 8 days ago. So I'm going to stay away from theirs and I bet I start picking up some in yours. Once you update it. How often do you update it? I look forward to running this with a fresh package update and then seeing if the steam.db tool still sees anything outstanding.
Thanks for making/distributing/maintaining this and being so responsive. I'm a better idea person than programmer xD Here's another two ideas to close out this "speed" issue. First, I think there is an improvement to be made with the way you use activated_packages.txt. Here's what you do:
There are 1 or 2 problems with this. First I don't know Python well enough, but you might be opening a disk file every item. But more to my point here, this does not "show" the user that a certain amount of data is already done. By that I mean, imagine that out of the 16k items in package_list.txt, I already have 5,000 activated. That means every 3rd or so item will be skipped, but the other 2/3 are still sleeping 90sec. It will not be obvious to me that they program is honoring my activated packages. I think all of this is addressed and smoother if the logic is changed to this:
This would is not only likely be more efficient from a filesystem perspective, but the user would in our example immediately see the progress bar rapidly fill to 33% then start slowly adding items. As to how to accomplish step 2, i dont know if python has a function or 3rd party library to subtract one array from another. If it does, great, if not, just do another loop before your main activation loop. I don't really know Python but probably something like: Split activated_packages into array activated. For Each activated, packagelist.remove(activated). OK - Last speed up. You currently sleep for 90 seconds. But 50 activation an hour is one activation every 72 seconds. Call it 74 seconds for safety if you want. Changing the sleep to 74 seconds would cause the program to compete 18% faster, which for a new steam account and your current package list would be 3 days faster. |
Didn't know that, but will change the instructions for users with many packages accordingly.
I will change the logic to this one.
I'm not sure if it would be faster because the 50 activations per hour is just a number which is calculated by the community and no official number. |
I've found that the code of activate_packages.py in line 77 +/- 5 lines triggers pretty heavy disk usage. |
Updated instructions as discussed in #5
While you are right about it not being official, I can tell you from using steamdb tools for YEARS that it is exactly 50 that you can do per hour, and this has been a stable fact for many years. My PR #14 includes speeding this up with almost 2 minutes of buffer time just in case. But otherwise this issue here is addressed completely, good work, closing |
Is your feature request related to a problem? Please describe.
It's imperfect that the script has to !addlicense for items I already own, is there a better way?
Describe the solution you'd like
I can see the the script builds out a activated_packages.txt for packages it knows are activated. Can't this list be prefilled by scrapping http://www.steamcommunity.com/id/XXX/games/?tab=all and taking any appIDs from there as already owned?
Describe alternatives you've considered
N/A
Additional context
For someone who has already used other methods to add packages and has a lot, the first run of this program is a super long time !addlicense for 10k+ items I already have. Could be mostly skipped by prefiltering owned items via steam profile.
The text was updated successfully, but these errors were encountered: