mirror of
https://github.com/onionshare/onionshare.git
synced 2025-06-24 06:24:19 -04:00
Add requests build dependency, and use requests to download Tor Browser in get-tor-osx.py and get-tor-windows.py, because I was running into SSL certificate verification issues downloading using urllib
This commit is contained in:
parent
97acfccf09
commit
19c2193a49
4 changed files with 24 additions and 12 deletions
|
@ -24,8 +24,15 @@ In order to avoid a Mac gnupg dependency, I manually verify the signature
|
|||
and hard-code the sha256 hash.
|
||||
"""
|
||||
|
||||
import inspect, os, sys, hashlib, zipfile, io, shutil, subprocess
|
||||
import urllib.request
|
||||
import inspect
|
||||
import os
|
||||
import sys
|
||||
import hashlib
|
||||
import zipfile
|
||||
import io
|
||||
import shutil
|
||||
import subprocess
|
||||
import requests
|
||||
|
||||
def main():
|
||||
dmg_url = 'https://archive.torproject.org/tor-package-archive/torbrowser/7.5.5/TorBrowser-7.5.5-osx64_en-US.dmg'
|
||||
|
@ -46,10 +53,9 @@ def main():
|
|||
# Make sure the zip is downloaded
|
||||
if not os.path.exists(dmg_path):
|
||||
print("Downloading {}".format(dmg_url))
|
||||
response = urllib.request.urlopen(dmg_url)
|
||||
dmg_data = response.read()
|
||||
open(dmg_path, 'wb').write(dmg_data)
|
||||
dmg_sha256 = hashlib.sha256(dmg_data).hexdigest()
|
||||
r = requests.get(dmg_url)
|
||||
open(dmg_path, 'wb').write(r.content)
|
||||
dmg_sha256 = hashlib.sha256(r.content).hexdigest()
|
||||
else:
|
||||
dmg_data = open(dmg_path, 'rb').read()
|
||||
dmg_sha256 = hashlib.sha256(dmg_data).hexdigest()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue