BattleMaster Posted April 24, 2023 Report Posted April 24, 2023 Hello, I am completely new to using this library. I want to be able to find the download size of a game from my application. SteamDB does have this functionality (you can see the depots belonging to a game, and for each depot you can see the size), so there must be a way to do it; however, I wasn't able to achieve this with just the Steam Web API (do tell me if there is a way to do it with just the web api), and was thus wondering if I could do it using node-steam-user. I would greatly appreciate your help. Quote
Dr. McKay Posted April 25, 2023 Report Posted April 25, 2023 getProductInfo() will give you most of the stuff SteamDB is showing, including depot info and sizes. Quote
BattleMaster Posted April 25, 2023 Author Report Posted April 25, 2023 Thanks a lot! I tried to import steamuser with import * as steamuser from 'steam-user'; but now steamuser is just an empty object, what did I do wrong? Quote
Dr. McKay Posted April 25, 2023 Report Posted April 25, 2023 You probably just need to do import SteamUser from 'steam-user'; Quote
BattleMaster Posted April 25, 2023 Author Report Posted April 25, 2023 (edited) That didnt really work, now it was looking like this: SteamUser seems to be a class, so I tried const steamuser = new SteamUser(); and then when trying to use steamuser.getProductInfo(...) I got this error: Sorry if I am bothering too much, I am pretty new to node and js in general. Edited April 25, 2023 by BattleMaster Quote
Dr. McKay Posted April 25, 2023 Report Posted April 25, 2023 Did you log on? Show your full code please. Quote
BattleMaster Posted April 26, 2023 Author Report Posted April 26, 2023 Not yet, I wanted to try if this part works first, and I assumed that I wouldn't get an error like this, but rather one telling me to log on. But I guess I can try doing that first. By the way, is there a tutorial or something for using this library? Quote
Dr. McKay Posted April 26, 2023 Report Posted April 26, 2023 You need to log on to do anything. You can just log on anonymously if all you want to do is call getProductInfo. I'll grant that it would be ideal to have a more descriptive error when you try to call a method before logging on, but I just haven't gotten around to updating all hundred+ functions to throw such an error. That said, the error you got isn't because you aren't logged on. It's because you didn't call getProductInfo with the expected arguments. There are a few example scripts on GitHub. Quote
BattleMaster Posted April 27, 2023 Author Report Posted April 27, 2023 I still get a "not a function" error. minimal reproducible code: import SteamUser from 'steam-user'; await SteamUser.logOn({anonymous: true, machineName: 'Test', clientOS: 16}); nvm, i forgot this line var client = new SteamUser(); It works now, but getProductInfo seems to be stuck without doing anything console.log('logging on to Steam..'); await client.logOn({anonymous: true}); console.log('logged on'); console.log('getting product info..'); const product_info = await client.getProductInfo([10], []); console.log(`product_info: ${JSON.stringify(product_info)}`); Quote
4049_1572836826 Posted April 27, 2023 Report Posted April 27, 2023 (edited) Try call getProduct after emmit loggedOn see my code Edited April 27, 2023 by 4049_1572836826 SENPAY98K 1 Quote
Dr. McKay Posted April 27, 2023 Report Posted April 27, 2023 ^ this is correct. logOn does not return a promise; you need to wait for the loggedOn event. Quote
BattleMaster Posted May 1, 2023 Author Report Posted May 1, 2023 what exactly does "optional" on a depot mean? Quote
BattleMaster Posted May 1, 2023 Author Report Posted May 1, 2023 I would have thought that maybe it's something that you can turn on or off like a DLC but it doesn't look like it. It is included in the download size that Steam shows. Quote
BattleMaster Posted May 1, 2023 Author Report Posted May 1, 2023 How do I find out if a depot belongs to a beta? Quote
Dr. McKay Posted May 1, 2023 Report Posted May 1, 2023 Depots don't belong to betas; they might have a beta option though. What the Steam client calls a "beta" is actually a branch. The default branch is called "public", and any other branch is available in the beta tab of Steam. Public branches have their manifests listed plainly in appinfo (see the public and beta manifests in your screenshot; they match so both branches contain the same content for that depot). For private branches, you have to request the manifest info from Steam using the password. Quote
BattleMaster Posted May 1, 2023 Author Report Posted May 1, 2023 I'm asking because with a game like this for example, I would assume that the "DUSK SDK" depot only gets downloaded when you opt into the "dusk_sdk" branch, but it looks like it's also there with the public branch. Actually in this case it might actually be downloading the data even if you don't opt into the beta, because this seems to match the download size that Steam shows me (Dusk Content + Dusk SDK + Soundtrack): Quote
BattleMaster Posted May 1, 2023 Author Report Posted May 1, 2023 What does this "maxsize" field mean? "max" of what? Is it the max out of any branch? Quote
Dr. McKay Posted May 1, 2023 Report Posted May 1, 2023 Yeah, it would be downloading all depots even if you aren't opted into a beta. maxsize is, as far as I'm aware, the size of the biggest build of that depot. Steam just assumes the worst and shows you the size of the largest build in a depot when you're downloading. Quote
BattleMaster Posted May 1, 2023 Author Report Posted May 1, 2023 So is the download size that the steam desktop client shows also based on that "maxsize"? Dr. McKay 1 Quote
BattleMaster Posted May 2, 2023 Author Report Posted May 2, 2023 I found something strange: For the game Fallout: New Vegas, "depots" isn't located at appinfo.depots, but instead at appinfo.install.registry.hkey_local_machine\\\\software\\\\bethesda softworks\\\\falloutnv.depots Why are the depots part of this object relating to the registry? Quote
BattleMaster Posted May 2, 2023 Author Report Posted May 2, 2023 Similar situation with "Tomb Raider (VI) The Angel of Darkness" and for "Don't Starve Together" there arent any depots in the json I got Quote
Dr. McKay Posted May 2, 2023 Report Posted May 2, 2023 This is a bug; update to 4.28.3 and it should be fixed. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.