diff options
author | nlscc <66028747+nlscc@users.noreply.github.com> | 2022-02-22 01:17:58 +0100 |
---|---|---|
committer | nlscc <66028747+nlscc@users.noreply.github.com> | 2022-02-22 01:17:58 +0100 |
commit | 297108393a0fb5841208daf6edf909f1d1b57602 (patch) | |
tree | 4dcd32f455ae1c1a1f37e1fa9b8d7d0d861d79d4 | |
parent | remove funding info (diff) | |
download | samloader-297108393a0fb5841208daf6edf909f1d1b57602.tar samloader-297108393a0fb5841208daf6edf909f1d1b57602.tar.gz samloader-297108393a0fb5841208daf6edf909f1d1b57602.tar.bz2 samloader-297108393a0fb5841208daf6edf909f1d1b57602.tar.lz samloader-297108393a0fb5841208daf6edf909f1d1b57602.tar.xz samloader-297108393a0fb5841208daf6edf909f1d1b57602.tar.zst samloader-297108393a0fb5841208daf6edf909f1d1b57602.zip |
-rw-r--r-- | samloader/versionfetch.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/samloader/versionfetch.py b/samloader/versionfetch.py index e758867..58ea186 100644 --- a/samloader/versionfetch.py +++ b/samloader/versionfetch.py @@ -19,9 +19,11 @@ def getlatestver(model: str, region: str) -> str: """ Get the latest firmware version code for a model and region. """ req = requests.get("https://fota-cloud-dn.ospserver.net/firmware/" \ + region + "/" + model + "/version.xml") + if req.status_code == 403: + raise Exception("Model or region not found (403)") req.raise_for_status() root = ET.fromstring(req.text) vercode = root.find("./firmware/version/latest").text if vercode is None: - raise Exception("No latest firmware found") + raise Exception("No latest firmware available") return normalizevercode(vercode) |