Skip to content

Commit 249f122

Browse files
authored
Update StatusCode.py
1 parent ac67d69 commit 249f122

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

StatusCode.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,20 @@ def printer(url):
1616
sys.stdout.flush()
1717
return True
1818

19-
2019
def check(out, url):
2120
#print("hell")
2221
printer("Testing: " + url)
23-
link = 'https://' + url
22+
link = 'http://' + url
2423
try:
2524
req = requests.head(link, timeout=10)
2625
scode = str(req.status_code)
2726
if scode.startswith("2"):
2827
print(blue+"["+bold+green+str(scode)+end+blue+"]"+end+" | "+str(url))
2928
elif scode.startswith("3"):
30-
print(blue+"["+bold+yellow+str(scode)+end+blue+"]"+end+" | "+str(url))
29+
if req.headers['Location'].startswith("https://"+url):
30+
print(blue+"["+bold+yellow+str(scode)+end+blue+"]"+end+" | "+str(url)+" - HTTPS")
31+
else:
32+
print(blue+"["+bold+yellow+str(scode)+end+blue+"]"+end+" | "+str(url)+" | "+req.headers['Location'])
3133
elif scode.startswith("4"):
3234
print(blue+"["+bold+red+str(scode)+end+blue+"]"+end+" | "+str(url))
3335
else:
@@ -73,6 +75,5 @@ def main():
7375
with executor(max_workers=int(threads)) as exe:
7476
[exe.submit(check, out, url.strip('\n')) for url in urls]
7577

76-
7778
if __name__=='__main__':
7879
main()

0 commit comments

Comments
 (0)