Fix annoying bug

This commit is contained in:
Arinerron 2018-08-03 20:47:22 -07:00
parent 0b77a88e72
commit 31f8d92af7

View File

@ -539,7 +539,7 @@ class OnionrUtils:
return return
headers = {'user-agent': 'PyOnionr'} headers = {'user-agent': 'PyOnionr'}
try: try:
proxies = {'http': 'socks5h://127.0.0.1:' + str(port), 'https': 'socks5h://127.0.0.1:' + str(port)} proxies = {'http': 'socks5://127.0.0.1:' + str(port), 'https': 'socks5://127.0.0.1:' + str(port)}
r = requests.post(url, data=data, headers=headers, proxies=proxies, allow_redirects=False, timeout=(15, 30)) r = requests.post(url, data=data, headers=headers, proxies=proxies, allow_redirects=False, timeout=(15, 30))
retData = r.text retData = r.text
except KeyboardInterrupt: except KeyboardInterrupt:
@ -563,11 +563,13 @@ class OnionrUtils:
return return
headers = {'user-agent': 'PyOnionr'} headers = {'user-agent': 'PyOnionr'}
try: try:
proxies = {'http': 'socks5h://127.0.0.1:' + str(port), 'https': 'socks5h://127.0.0.1:' + str(port)} proxies = {'http': 'socks5://127.0.0.1:' + str(port), 'https': 'socks5://127.0.0.1:' + str(port)}
r = requests.get(url, headers=headers, proxies=proxies, allow_redirects=False, timeout=(15, 30)) r = requests.get(url, headers=headers, proxies=proxies, allow_redirects=False, timeout=(15, 30))
retData = r.text retData = r.text
except KeyboardInterrupt: except KeyboardInterrupt:
raise KeyboardInterrupt raise KeyboardInterrupt
except ValueError as e:
logger.debug('Failed to make request', error = e)
except requests.exceptions.RequestException as e: except requests.exceptions.RequestException as e:
logger.debug('Error: %s' % str(e)) logger.debug('Error: %s' % str(e))
retData = False retData = False