diff --git a/photon.py b/photon.py index 455999e..ec4eeb9 100644 --- a/photon.py +++ b/photon.py @@ -175,8 +175,13 @@ try: requests.get('https://' + main_inp, proxies=random.choice(proxies)) main_url = 'https://' + main_inp - except: - main_url = 'http://' + main_inp + except requests.ConnectionError: + try: + requests.get('http://' + main_inp, proxies=random.choice(proxies)) + main_url = 'http://' + main_inp + except requests.ConnectionError: + sys.stdout.write("Host not found.\n") + sys.exit(0) schema = main_url.split('//')[0] # https: or http:? # Adding the root URL to internal for crawling