fix: check for output directory

This commit is contained in:
agatha 2024-09-21 17:36:01 -04:00
parent 24d6880a81
commit 980eadf588

View File

@ -4,6 +4,7 @@ Inspired by https://github.com/acidvegas/proxytools
import time import time
import concurrent.futures import concurrent.futures
import logging import logging
import os
from harvester.proxy import fetch_all, validate_socks from harvester.proxy import fetch_all, validate_socks
@ -47,6 +48,10 @@ def main():
valid.append(proxy) valid.append(proxy)
print(f'{proxy} -> {ip}') print(f'{proxy} -> {ip}')
# Create output directory if it does not exist
if not os.path.exists('proxies'):
os.makedirs('proxies')
# Write to file with timestamp # Write to file with timestamp
write_file( write_file(
path=f'proxies/valid-socks-{time.strftime("%Y%m%d%H%M%S")}.txt', path=f'proxies/valid-socks-{time.strftime("%Y%m%d%H%M%S")}.txt',