ValvePython / steamctl

🤸 Take control of Steam from your terminal
https://pypi.org/project/steamctl/
MIT License
311 stars 16 forks source link

Get information for specific branch #26

Closed strafe closed 3 years ago

strafe commented 3 years ago

When using $ steamcmd [..] +app_info_print <appid> the output includes branch information, e.g.

{
  "740": {
    "common": {
      "name": "Counter-Strike Global Offensive - Dedicated Server",
      "type": "Tool",
      "oslist": "windows,linux",
      "gameid": "740"
    },
    [...]
    "depots": {
      [...]
      "branches": {
        "public": {
          "buildid": "6185846",
          "timeupdated": "1612401231"
        },
        "1.37.7.7": {
          "buildid": "6114110",
          "description": "1.37.7.7",
          "timeupdated": "1611875026"
        },
        "1.37.7.8": {
          "buildid": "6148700",
          "description": "1.37.7.8",
          "timeupdated": "1611874917"
        },
        [...]
      }
    }
  }
}

Is it currently possible to retrieve the buildid for a specific branch currently using steamctl?

rossengeorgiev commented 3 years ago

Yes. You need to install the version from repo.

# steamctl apps product_info 730 | jq -r .depots.branches.pubic.buildid
6193619
# steamctl apps product_info 730 | jq .depots.branches
{
  "1.21.3.1": {
    "buildid": "611429",
    "description": "Game version 1.21.3.1 (16-Nov-2012)",
    "pwdrequired": "1"
  },
  "1.37.7.4": {
    "buildid": "5957466",
    "description": "1.37.7.4",
    "sc_schinese": "1.37.7.4",
    "timeupdated": "1607981936"
  },
....
strafe commented 3 years ago

@rossengeorgiev that's really cool thank you! Just curious, do I have to authenticate to get this information. Steam CMD is able to do it without so I'm just wondering.

rossengeorgiev commented 3 years ago

Depends on the app, for dedicated servers you can login anonymously.

# steamctl --anonymous apps product_info 740 | jq -r .depots.branches.public.buildid
6185846
strafe commented 3 years ago

@rossengeorgiev this was working... but now isn't.

$ steamctl --anonymous apps product_info 740 | jq -r .depots.branches.public.buildid
[INFO] Attempting anonymous login
parse error: Invalid numeric literal at line 1, column 8

Seems there's some weird invalid JSON at the very top of the output:

{
    'apps': {},
    'packages': {
        17906: 1287127259708702574
    }
}, {
    'apps': {},
    'packages': {
        17906: 1287127259708702574
    }
}, {
    "_missing_token": false,
    "appid": "740",
    "common": {
        "gameid": "740",
        "name": "Counter-Strike Global Offensive - Dedicated Server",
[...]
rossengeorgiev commented 3 years ago

Looks like I missed to update the steam required version. Just do:

pip install -U git+https://github.com/ValvePython/steamctl#egg=steamctl

Please close this if your original issue was resolved

strafe commented 3 years ago

Thanks!