Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions photon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down