From 31f8d92af7fac7278e02985d6f8d8c03d545b49c Mon Sep 17 00:00:00 2001 From: Arinerron Date: Fri, 3 Aug 2018 20:47:22 -0700 Subject: [PATCH] Fix annoying bug --- onionr/onionrutils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index 1bb11b36..1d402bef 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -539,7 +539,7 @@ class OnionrUtils: return headers = {'user-agent': 'PyOnionr'} 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)) retData = r.text except KeyboardInterrupt: @@ -563,11 +563,13 @@ class OnionrUtils: return headers = {'user-agent': 'PyOnionr'} 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)) retData = r.text except KeyboardInterrupt: raise KeyboardInterrupt + except ValueError as e: + logger.debug('Failed to make request', error = e) except requests.exceptions.RequestException as e: logger.debug('Error: %s' % str(e)) retData = False