Skip to content

Commit

Permalink
feat: Update proxy configuration and frequency from external source
Browse files Browse the repository at this point in the history
  • Loading branch information
Simatwa committed May 10, 2024
1 parent 2df3f93 commit 7f1b000
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pyfreeproxies/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
"https://raw.githubusercontent.com/Simatwa/free-proxies/master/files"
)

proxies_update_frequency_in_seconds: int = 30 * 60

requests_timeout: int = 10

session = requests.Session()
Expand All @@ -19,7 +17,6 @@
"Accept": "*/*",
}


url_map = {
"http_proxies": contents_url + "/http.json",
"socks4_proxies": contents_url + "/socks4.json",
Expand All @@ -29,8 +26,15 @@
"proxies_metadata": contents_url + "/metadata.json",
"last_proxies_updated_time": contents_url + "/timestamp.json",
"proxies_generation_logs": contents_url + "/proxies.log",
"config_file": contents_url + "/config.json",
}

proxies_hunter_config = session.get(url_map["config_file"]).json()

proxies_update_frequency_in_seconds: int = (
proxies_hunter_config["update_frequency_in_minutes"] * 60
)


def exception_handler(func):
"""Handle execptions accordingly"""
Expand Down

0 comments on commit 7f1b000

Please sign in to comment.