Files
climperor/web/_steam_key_check.py
vosonandCursor f5b7011c45 Ship Steam login, D1 player sync, and cached「我」dashboard.
Players get a fast TTL-backed homepage (local profile / Cloudflare D1) with dense UI polish; login unlocks /home without blocking on every OpenDota refresh.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-01 01:24:30 +08:00

18 lines
608 B
Python

"""Smoke-check STEAM_API_KEY / KEYZOO_ASSET_SECRET_WEB_API_KEY (no secret echo)."""
from __future__ import annotations
import json
import os
import urllib.request
k = (os.environ.get("STEAM_API_KEY") or os.environ.get("KEYZOO_ASSET_SECRET_WEB_API_KEY") or "").strip()
if not k:
raise SystemExit("missing key")
url = (
"https://api.steampowered.com/ISteamUser/GetPlayerSummaries/v2/"
f"?key={k}&steamids=76561198000000000"
)
with urllib.request.urlopen(url, timeout=20) as resp:
data = json.loads(resp.read().decode())
print("ok" if isinstance(data, dict) and "response" in data else "bad")