1#!/usr/bin/env python3
2import hashlib
3from pathlib import Path
4import urllib.request
5
6
7version = "4.0.0.4"
8digest = "c09f16ba31059a434ddd7f811e4f9608d4b4c4514cc80a5bf1ca33bee61e1107"
9name = f"sso-authentication_{version}.zip"
10url = f"https://github.com/9p4/jellyfin-plugin-sso/releases/download/v{version}/{name}"
11with urllib.request.urlopen(url, timeout=30) as response:
12 archive = response.read()
13if hashlib.sha256(archive).hexdigest() != digest:
14 raise ValueError("SSO plugin archive checksum mismatch")
15Path(__file__).with_name(name).write_bytes(archive)