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