]> git.lizzy.rs Git - torbrowser-launcher.git/blobdiff - torbrowser_launcher/launcher.py
Merge pull request #586 from micahflee/wkd-requests
[torbrowser-launcher.git] / torbrowser_launcher / launcher.py
index 70f309eea8971b9e2157521b82600f5f1f9a8b28..55e5263b8516800293eea74e5b7f62cf09b7300d 100644 (file)
@@ -549,16 +549,6 @@ class DownloadThread(QtCore.QThread):
         self.common = common
         self.url = url
         self.path = path
-
-        # Use tor socks5 proxy, if enabled
-        if self.common.settings["download_over_tor"]:
-            socks5_address = "socks5h://{}".format(
-                self.common.settings["tor_socks_address"]
-            )
-            self.proxies = {"https": socks5_address, "http": socks5_address}
-        else:
-            self.proxies = None
-
     def run(self):
         with open(self.path, "wb") as f:
             try:
@@ -567,7 +557,7 @@ class DownloadThread(QtCore.QThread):
                     self.url,
                     headers={"User-Agent": "torbrowser-launcher"},
                     stream=True,
-                    proxies=self.proxies,
+                    proxies=self.common.proxies(),
                 )
 
                 # If status code isn't 200, something went wrong