13 lines
452 B
Python
13 lines
452 B
Python
import urllib.request
|
|
import json
|
|
|
|
url = "https://update.k3s.io/v1-release/channels"
|
|
try:
|
|
req = urllib.request.Request(url, headers={'User-Agent': 'Mozilla/5.0', 'Accept': 'application/json'})
|
|
with urllib.request.urlopen(req, timeout=10) as resp:
|
|
data = json.loads(resp.read().decode())
|
|
for item in data.get('data', []):
|
|
print(f"{item.get('id')}: {item.get('latest')}")
|
|
except Exception as e:
|
|
print("Error:", e)
|