Support anonymous Gitea asset downloads

This commit is contained in:
2026-09-02 15:16:42 -05:00
parent e4d9897096
commit 388722e356
2 changed files with 3 additions and 3 deletions

View File

@@ -16,5 +16,5 @@ pyzbar = ["install/**/*", "*.so"]
[tool.shim]
repo_url = "https://gitlvb.teallvbs.xyz/IQ.Lvbs/op-dependencies"
tag = "pyzbar-v0.1.9"
tag = "pyzbar-v0.1.9-iq1"
datadir = "install"

View File

@@ -5,7 +5,7 @@ import time
import zipfile
from io import BytesIO
from urllib.error import URLError
from urllib.request import urlopen
from urllib.request import Request, urlopen
try:
import tomllib
@@ -49,7 +49,7 @@ class InstallPrebuilt(build_py):
print(f"Downloading {url} ...")
for attempt in range(3):
try:
raw = urlopen(url, timeout=60).read()
raw = urlopen(Request(url, headers={"User-Agent": "IQ.Pilot package installer"}), timeout=60).read()
break
except (URLError, OSError) as e:
if attempt == 2: