ValvePython / steam

☁️ Python package for interacting with Steam
http://steam.readthedocs.io
MIT License
1.1k stars 137 forks source link

client/cdn: manifest returns dict, gid is a key #461

Closed StalkR closed 5 months ago

StalkR commented 5 months ago

Hello,

I got an exception on get_manifests:

from steam.client import SteamClient
from steam.client.cdn import CDNClient
s = SteamClient()
s.anonymous_login()
cdn = CDNClient(s)
cdn.get_manifests(730)

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/steam/client/cdn.py", line 785, in async_fetch_manifest
    app_id, depot_id, int(manifest_gid), branch_name, branch_pass
TypeError: int() argument must be a string, a bytes-like object or a number, not 'dict'

It's because the manifest object is a dict (I suppose steam must have changed it):

from steam.client import SteamClient
from steam.client.cdn import CDNClient
s = SteamClient()
s.anonymous_login()
cdn = CDNClient(s)
depot_info = cdn.get_app_depot_info(730)
print(depot_info[str(2347770)]['manifests']['public'])
{'gid': '2869365522094710973', 'size': '35004749517', 'download': '28894554320'}

This pull requests fixes it by adding .get('gid') in the relevant code.

Thanks for the project and library! I started using it and I like the API, very short, intuitive, easier to play with than SteamKit/C#.

StalkR commented 5 months ago

I now see this was reported in 2023 as #436 and there's already a PR (#437) for it.