From 117d88b92d85221ec9542ca6291ead15ea2a785b Mon Sep 17 00:00:00 2001 From: agatha Date: Sun, 22 Sep 2024 15:25:13 -0400 Subject: [PATCH] chore: refactor proxy gathering into dedicated function --- main.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 678962a..4492108 100644 --- a/main.py +++ b/main.py @@ -29,10 +29,7 @@ def write_file(path, data): file.write(data) -def main(): - """Main entry point.""" - logging.basicConfig(level=logging.WARN) - +def gather_proxies(): # Load proxy source list and fetch proxies urls = read_file('data/proxy-sources.txt') proxies = fetch_all(urls) @@ -95,5 +92,11 @@ def main(): ) +def main(): + """Main entry point.""" + logging.basicConfig(level=logging.WARN) + gather_proxies() + + if __name__ == '__main__': main()