@@ -78,7 +78,7 @@ def clean_urls(urls, extensions):
7878 cleaned_urls .add (cleaned_url )
7979 return list (cleaned_urls )
8080
81- def fetch_and_clean_urls (domain , extensions , stream_output ):
81+ def fetch_and_clean_urls (domain , extensions , stream_output , proxy ):
8282 """
8383 Fetch and clean URLs related to a specific domain from the Wayback Machine.
8484
@@ -92,7 +92,7 @@ def fetch_and_clean_urls(domain, extensions, stream_output):
9292 """
9393 logging .info (f"{ Fore .YELLOW } [INFO]{ Style .RESET_ALL } Fetching URLs for { Fore .CYAN + domain + Style .RESET_ALL } " )
9494 wayback_uri = f"https://web.archive.org/cdx/search/cdx?url={ domain } /*&output=txt&collapse=urlkey&fl=original&page=/"
95- response = client .fetch_url_content (wayback_uri )
95+ response = client .fetch_url_content (wayback_uri , proxy )
9696 urls = response .text .split ()
9797
9898 logging .info (f"{ Fore .YELLOW } [INFO]{ Style .RESET_ALL } Found { Fore .GREEN + str (len (urls )) + Style .RESET_ALL } URLs for { Fore .CYAN + domain + Style .RESET_ALL } " )
@@ -134,6 +134,7 @@ def main():
134134 parser .add_argument ("-d" , "--domain" , help = "Domain name to fetch related URLs for." )
135135 parser .add_argument ("-l" , "--list" , help = "File containing a list of domain names." )
136136 parser .add_argument ("-s" , "--stream" , action = "store_true" , help = "Stream URLs on the terminal." )
137+ parser .add_argument ("-p" , "--proxy" , help = "Set the proxy address for web requests." ,default = None )
137138 args = parser .parse_args ()
138139
139140 if not args .domain and not args .list :
@@ -153,11 +154,11 @@ def main():
153154 extensions = HARDCODED_EXTENSIONS
154155
155156 if args .domain :
156- fetch_and_clean_urls (domain , extensions , args .stream )
157+ fetch_and_clean_urls (domain , extensions , args .stream , args . proxy )
157158
158159 if args .list :
159160 for domain in domains :
160- fetch_and_clean_urls (domain , extensions , args .stream )
161+ fetch_and_clean_urls (domain , extensions , args .stream , args . proxy )
161162
162163if __name__ == "__main__" :
163164 main ()
0 commit comments