1010from torbot .modules .api import get_ip
1111from torbot .modules .color import color
1212from torbot .modules .updater import check_version
13- from torbot .modules .info import execute_all
13+ from torbot .modules .info import execute_all , fetch_html
1414from torbot .modules .linktree import LinkTree
1515
1616
@@ -35,9 +35,7 @@ def print_header(version: str) -> None:
3535 / __/ / / / /_/ / __ \/ __ \/ /
3636 / /_/ /_/ / _, _/ /_/ / /_/ / /
3737 \__/\____/_/ |_/_____/\____/_/ v{VERSION}
38- """ .format (
39- VERSION = version
40- )
38+ """ .format (VERSION = version )
4139 banner = color (banner , "red" )
4240
4341 title = r"""
@@ -101,6 +99,11 @@ def run(arg_parser: argparse.ArgumentParser, version: str) -> None:
10199 elif args .save == "json" :
102100 tree .saveJSON ()
103101
102+ if args .html == "display" :
103+ fetch_html (client , args .url , tree )
104+ elif args .html == "save" :
105+ fetch_html (client , args .url , tree , save_html = True )
106+
104107 # always print something, table is the default
105108 if args .visualize == "table" or not args .visualize :
106109 tree .showTable ()
@@ -158,14 +161,21 @@ def set_arguments() -> argparse.ArgumentParser:
158161 action = "store_true" ,
159162 help = "Executes HTTP requests without using SOCKS5 proxy" ,
160163 )
164+ parser .add_argument (
165+ "--html" ,
166+ choices = ["save" , "display" ],
167+ help = "Saves / Displays the html of the onion link" ,
168+ )
161169
162170 return parser
163171
164172
165173if __name__ == "__main__" :
166174 try :
167175 arg_parser = set_arguments ()
168- config_file_path = os .path .join (os .path .dirname (os .path .realpath (__file__ )), "pyproject.toml" )
176+ config_file_path = os .path .join (
177+ os .path .dirname (os .path .realpath (__file__ )), "pyproject.toml"
178+ )
169179 try :
170180 with open (config_file_path , "r" ) as f :
171181 data = toml .load (f )
0 commit comments