Created
December 6, 2021 15:24
-
-
Save ZacharyTalis/0c1e03dec951d2bb062a8d212981897c to your computer and use it in GitHub Desktop.
Python/SteamCMD Game Updater
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
with open("<json path>") as file: | |
secrets = json.load(file) | |
appsInstalled = ( | |
os.popen(f"steamcmd +login {secrets['login']['username']} +apps_installed +quit") | |
.read() | |
.split("\n") | |
) | |
appsInstalled = [ | |
appLine.split(" ")[1] for appLine in appsInstalled if appLine.startswith("AppID") | |
] | |
updateCommand = f"+app_update {' +app_update '.join(appsInstalled)}" | |
os.system(f"steamcmd +login {secrets['login']['username']} {updateCommand} +quit") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment