mirror of
https://github.com/kuhyx/steam-backlog-enforcer.git
synced 2026-11-26 19:27:17 +01:00
Wraps depotdownloader for the bulk content pull (bypasses Steam's own capped download speed) and steamcmd's app_update --validate to make Steam recognize the result, with a manual-manifest fallback for the confirmed steamcmd install-script segfault bug when no fix is available. Name search via store.steampowered.com is best-effort since that endpoint TLS-rejects scripted clients on this network; --appid plus steamcmd's own app_info_print is the reliable primary path. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
47 lines
1.3 KiB
Python
47 lines
1.3 KiB
Python
"""Wraps depotdownloader for the bulk content pull -- this is the fast path.
|
|
|
|
No `-depot` filter is passed: depotdownloader's own per-depot ownership check
|
|
(AccountHasAccess, checked before any key fetch) already skips depots the
|
|
account doesn't own and continues with the rest, as long as `-os` is set
|
|
correctly. Without `-os`, it defaults to the host OS and can filter out every
|
|
real (Windows-tagged) depot, leaving only stray OS-agnostic ones -- that's
|
|
what caused the very first "0 bytes from 0 depots" failure this project was
|
|
built to avoid.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
DEFAULT_MAX_DOWNLOADS = 32
|
|
|
|
|
|
def download(
|
|
appid: int,
|
|
install_dir: Path,
|
|
username: str,
|
|
language: str = "english",
|
|
os_name: str = "windows",
|
|
max_downloads: int = DEFAULT_MAX_DOWNLOADS,
|
|
) -> None:
|
|
"""Run depotdownloader against `install_dir`, streaming its own progress output live."""
|
|
install_dir.mkdir(parents=True, exist_ok=True)
|
|
cmd = [
|
|
"depotdownloader",
|
|
"-app",
|
|
str(appid),
|
|
"-os",
|
|
os_name,
|
|
"-language",
|
|
language,
|
|
"-max-downloads",
|
|
str(max_downloads),
|
|
"-username",
|
|
username,
|
|
"-remember-password",
|
|
"-dir",
|
|
str(install_dir),
|
|
]
|
|
subprocess.run(cmd, check=True)
|