Update downloader.py from pymodules

This commit is contained in:
CorpNewt 2019-03-26 14:18:36 -05:00
parent 4e531466f2
commit 3ad4aa912c
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,7 @@ class Downloader:
# Py2 and a Cert verify error - let's set the unverified context
context = ssl._create_unverified_context()
try:
response = urlopen(Request(url, headers=headers), context=context)
response = urlopen(Request(url, headers=headers))
except:
# No fixing this - bail
return None
@ -70,6 +70,7 @@ class Downloader:
b_s = self.get_size(bytes_so_far)
sys.stdout.write("Downloaded {} of {} ({:.2f}%)\r".format(b_s, t_s, percent))
else:
b_s = self.get_size(bytes_so_far)
sys.stdout.write("Downloaded {}\r".format(b_s))
def get_string(self, url, progress = True, headers = None):