-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPyWaybackurls.py
50 lines (40 loc) · 1.11 KB
/
PyWaybackurls.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from core import requester
from urllib.parse import unquote
import os
import sys
def main(domain):
if os.name == 'nt':
os.system('cls')
target = domain
results = []
url = f"http://web.archive.org/cdx/search/cdx?url=*.{target}/*&output=txt&fl=original&collapse=urlkey&page=/"
response = requester.connector(url)
if response == False:
return
response = unquote(response)
final_uris = response
print(final_uris)
file = open("temp.txt","w")
file.write(final_uris)
file.close
file = open("temp.txt","r")
uris = file.read().splitlines()
for uri in uris:
results.append(uri)
if len(results) > 0:
print("Found: %s matches." % (len(results)))
print()
return {
"matches": len(results),
"result": results,
}
else:
return {"matches": 0, "result": []}
os.system('rm temp.txt')
if __name__ == "__main__":
try:
domain = sys.argv[1]
except:
print("Eg. ./PyWaybackurls <domain>")
sys.exit()
main(f"{domain}")