Incredibly fast crawler designed for OSINT.
RE:Adding code to detect and report broken links.
sneh-m2e873f464c29
diff --git a/photon.py b/photon.pyindex 77cce6b..4ee2f1c 100644--- a/photon.py+++ b/photon.py@@ -10,7 +10,7 @@ import randomimport urllib3import argparseimport threading-from requests import get, post+from requests import get, post, codesfrom re import search, findalltry:from urllib.parse import urlparse # for python3@@ -170,20 +170,21 @@ def requester(url):response = random.choice([photopea, normal, pixlr, code_beautify])(url)#check if link is not broken- if(response.status_code != 200):- raise Exception("broken link!")+ if(response.status_code == codes.ok):+ return response.text; # return response body++ else:+ failed.add(url) # add it to the failed list- #if response is Ok, return response body- return response.text;else:response = normal(url)#check if link is not broken- if(response.status_code != 200):- raise Exception("broken link!")-- #if response is Ok, return response body- return response.text;+ if(response.status_code == codes.ok):+ return response.text; # return response body++ else:+ failed.add(url) # add it to the failed listexcept: # if photon fails to connect to the urlfailed.add(url) # add it to the failed list