chore: refactor proxy gathering into dedicated function
This commit is contained in:
parent
ed7757ab8f
commit
117d88b92d
11
main.py
11
main.py
@ -29,10 +29,7 @@ def write_file(path, data):
|
|||||||
file.write(data)
|
file.write(data)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def gather_proxies():
|
||||||
"""Main entry point."""
|
|
||||||
logging.basicConfig(level=logging.WARN)
|
|
||||||
|
|
||||||
# Load proxy source list and fetch proxies
|
# Load proxy source list and fetch proxies
|
||||||
urls = read_file('data/proxy-sources.txt')
|
urls = read_file('data/proxy-sources.txt')
|
||||||
proxies = fetch_all(urls)
|
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__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
Loading…
Reference in New Issue
Block a user