-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
34 lines (29 loc) · 1020 Bytes
/
main.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
from src.file_handler import FileHandler
from src.config_handler import ConfigHandler
from src.proxy_handler import ProxyHandler
from src.argparser import parse_args
def main(input_file_path, output_file_path, json_file_path, proxy_scheme):
(
default_input_directory,
default_output_directory,
proxies,
) = ConfigHandler.handle_config(json_file_path)
full_input_path, full_output_path = FileHandler.handle_file_paths(
input_file_path,
output_file_path,
default_input_directory,
default_output_directory,
)
good_proxies = ProxyHandler.handle_proxies(full_input_path, proxies, proxy_scheme)
if output_file_path:
FileHandler.write_to_file(full_output_path, good_proxies)
else:
FileHandler.write_to_file(full_input_path, good_proxies)
if __name__ == "__main__":
args = parse_args()
main(
args.input_file_path,
args.output_file_path,
args.json_file_path,
args.proxy_scheme,
)