setup: fix url for urllib (#35958)

fix
pull/35959/head
Maxime Desroches 4 weeks ago committed by GitHub
parent e596704644
commit 4bb5986c14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      system/ui/setup.py

@ -4,6 +4,7 @@ import re
import threading import threading
import time import time
import urllib.request import urllib.request
from urllib.parse import urlparse
from enum import IntEnum from enum import IntEnum
import pyray as rl import pyray as rl
@ -303,7 +304,9 @@ class Setup(Widget):
if re.match("^([^/.]+)/([^/]+)$", url): if re.match("^([^/.]+)/([^/]+)$", url):
url = f"https://installer.comma.ai/{url}" url = f"https://installer.comma.ai/{url}"
self.download_url = url parsed = urlparse(url, scheme='https')
self.download_url = (urlparse(f"https://{url}") if not parsed.netloc else parsed).geturl()
self.state = SetupState.DOWNLOADING self.state = SetupState.DOWNLOADING
self.download_thread = threading.Thread(target=self._download_thread, daemon=True) self.download_thread = threading.Thread(target=self._download_thread, daemon=True)

Loading…
Cancel
Save