Skip to content
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

fix cdn auth code #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from gevent.lock import Semaphore
from urllib.parse import urlparse
from steam.client import SteamClient
from steam.client.cdn import CDNClient
from steam.exceptions import SteamError
from requests.adapters import HTTPAdapter
from multiprocessing.pool import ThreadPool
Expand Down Expand Up @@ -421,7 +422,12 @@ def update_cdn_token(self, server_address):
cdn_auth_token.expiration_time = 0
cdn_auth_token.eresult = EResult.OK
else:
cdn_auth_token = self.client.get_cdn_auth_token(self.depot_id, hostname)
cdn = CDNClient(self.client)
cdn_auth_token = CMsgClientGetCDNAuthTokenResponse()
token = cdn.get_cdn_auth_token(0, self.depot_id, hostname)
cdn_auth_token.token = token
cdn_auth_token.expiration_time = cdn.cdn_auth_tokens[0][self.depot_id][hostname]['expiration_time']
cdn_auth_token.eresult = cdn.cdn_auth_tokens[0][self.depot_id][hostname]['eresult']
self.log.debug('Server: %s, Token: %s, expiration_time: %s, eresult: %s' % (
server_address,
cdn_auth_token.token,
Expand Down Expand Up @@ -453,7 +459,7 @@ def get_manifest_path_depot_key_dict(path):
if file.is_file():
if file.suffix == '.manifest':
manifest_path_list.append(file)
elif file.name == 'config.vdf':
elif file.suffix == '.vdf':
with file.open() as f:
d = vdf.load(f)
depots = d.get('depots')
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
steam[client]
steam[client] @ git+https://github.com/solsticegamestudios/steam@cc8310a9cd601949a5265cce5f03bf757f750682
requests
tqdm