Spaces:
Paused
Paused
Peng Ding commited on
Commit ·
47d1598
1
Parent(s): 9711d04
style: format download-cloakbrowser.py
Browse files
scripts/download-cloakbrowser.py
CHANGED
|
@@ -24,12 +24,8 @@ CACHE_DIR = os.environ.get(
|
|
| 24 |
|
| 25 |
def _get_chromium_version(pip_version: str | None = None) -> str:
|
| 26 |
"""Get CloakBrowser's Chromium version from PyPI wheel metadata."""
|
| 27 |
-
pypi = json.loads(
|
| 28 |
-
|
| 29 |
-
)
|
| 30 |
-
whl_url = next(
|
| 31 |
-
u["url"] for u in pypi["urls"] if u["filename"].endswith(".whl")
|
| 32 |
-
)
|
| 33 |
whl_data = urllib.request.urlopen(whl_url, timeout=60).read()
|
| 34 |
with zipfile.ZipFile(BytesIO(whl_data)) as zf:
|
| 35 |
for name in zf.namelist():
|
|
|
|
| 24 |
|
| 25 |
def _get_chromium_version(pip_version: str | None = None) -> str:
|
| 26 |
"""Get CloakBrowser's Chromium version from PyPI wheel metadata."""
|
| 27 |
+
pypi = json.loads(urllib.request.urlopen(PYPI_JSON, timeout=30).read())
|
| 28 |
+
whl_url = next(u["url"] for u in pypi["urls"] if u["filename"].endswith(".whl"))
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
whl_data = urllib.request.urlopen(whl_url, timeout=60).read()
|
| 30 |
with zipfile.ZipFile(BytesIO(whl_data)) as zf:
|
| 31 |
for name in zf.namelist():
|