Skip to content

Commit 8b4978b

Browse files
CopilotNightbot007
andcommitted
Fix: send steamid in POST body for Steam subscribe API (was causing HTTP 400)
Co-authored-by: Nightbot007 <173414804+Nightbot007@users.noreply.github.com>
1 parent b976bd6 commit 8b4978b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

scripts/teardown-workshop-transfer/RUN_ME.bat

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ def subscribe_to_mod(
209209
session: requests.Session,
210210
mod_id: str,
211211
session_id: str,
212+
steam_id: str,
212213
access_token: str,
213214
) -> bool:
214215
"""Send a subscribe request to the Steam Web API for a single Workshop mod.
@@ -220,6 +221,7 @@ def subscribe_to_mod(
220221
"""
221222
data = {
222223
"sessionid": session_id,
224+
"steamid": steam_id,
223225
"publishedfileid": mod_id,
224226
"appid": APP_ID,
225227
}
@@ -325,7 +327,7 @@ def main() -> None:
325327
# ── Extract the JWT access token from the steamLoginSecure cookie value ──
326328
# steamLoginSecure format (after URL-decoding): STEAMID||JWT
327329
try:
328-
_steam_id, access_token = parse_steam_login_secure(args.steam_login_secure)
330+
steam_id, access_token = parse_steam_login_secure(args.steam_login_secure)
329331
except ValueError as exc:
330332
print(f"ERROR: {exc}", file=sys.stderr)
331333
sys.exit(1)
@@ -361,7 +363,7 @@ def main() -> None:
361363

362364
for i, mod_id in enumerate(MOD_IDS, start=1):
363365
print(f"[{i:>3}/{total}] Mod {mod_id} ... ", end="", flush=True)
364-
success = subscribe_to_mod(session, mod_id, args.session_id, access_token)
366+
success = subscribe_to_mod(session, mod_id, args.session_id, steam_id, access_token)
365367
if success:
366368
print("OK")
367369
ok_count += 1

scripts/teardown-workshop-transfer/subscribe_mods.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ def subscribe_to_mod(
138138
session: requests.Session,
139139
mod_id: str,
140140
session_id: str,
141+
steam_id: str,
141142
access_token: str,
142143
) -> bool:
143144
"""Send a subscribe request to the Steam Web API for a single Workshop mod.
@@ -149,6 +150,7 @@ def subscribe_to_mod(
149150
"""
150151
data = {
151152
"sessionid": session_id,
153+
"steamid": steam_id,
152154
"publishedfileid": mod_id,
153155
"appid": APP_ID,
154156
}
@@ -254,7 +256,7 @@ def main() -> None:
254256
# ── Extract the JWT access token from the steamLoginSecure cookie value ──
255257
# steamLoginSecure format (after URL-decoding): STEAMID||JWT
256258
try:
257-
_steam_id, access_token = parse_steam_login_secure(args.steam_login_secure)
259+
steam_id, access_token = parse_steam_login_secure(args.steam_login_secure)
258260
except ValueError as exc:
259261
print(f"ERROR: {exc}", file=sys.stderr)
260262
sys.exit(1)
@@ -290,7 +292,7 @@ def main() -> None:
290292

291293
for i, mod_id in enumerate(MOD_IDS, start=1):
292294
print(f"[{i:>3}/{total}] Mod {mod_id} ... ", end="", flush=True)
293-
success = subscribe_to_mod(session, mod_id, args.session_id, access_token)
295+
success = subscribe_to_mod(session, mod_id, args.session_id, steam_id, access_token)
294296
if success:
295297
print("OK")
296298
ok_count += 1

0 commit comments

Comments
 (0)