Files

9 lines
296 B
Python
Raw Permalink Normal View History

2026-08-28 18:52:27 +08:00
import json
from urllib.request import Request, urlopen
def get_json(url: str, timeout: float = 5.0):
request = Request(url, headers={"Accept": "application/json", "User-Agent": "big-qmt-python/1"})
with urlopen(request, timeout=timeout) as response:
return json.load(response)