When pull_source_feeds() is run on program start you may receive an error when connecting to BinaryDefense.com.
The list it creates works but when passed to format_ips() the request is made with urlopen() which uses the default python headers which most sites will block if used. So i have removed urlopen() and replaced it with Request, Session from the request module.
This has allowed me to add custom headers, allow for partial string cleanup and then i pass it all to sort_banlist() as a list with no file writes (until later).this has allowed me to remove a large part of code from format_ips() due to not being needed.
The sort_banlist() function has also been modified heavily to work with new method. most code was removed as not being needed. For now entire banlist is re-written each run along with additional string cleanup to achieve final file of unique entries.
Also where possible is_windows() and is_posix() checks were removed about 95% to make functions less dependent on those calls resulting in better runtime. Overall all functions involved have reduced in size, complexity and platform reliance while achieving the same results.
Description
The list it creates works but when passed to format_ips() the request is made with urlopen() which uses the default python headers which most sites will block if used. So i have removed urlopen() and replaced it with Request, Session from the request module.
This has allowed me to add custom headers, allow for partial string cleanup and then i pass it all to sort_banlist() as a list with no file writes (until later).this has allowed me to remove a large part of code from format_ips() due to not being needed.
The sort_banlist() function has also been modified heavily to work with new method. most code was removed as not being needed. For now entire banlist is re-written each run along with additional string cleanup to achieve final file of unique entries.
Also where possible is_windows() and is_posix() checks were removed about 95% to make functions less dependent on those calls resulting in better runtime. Overall all functions involved have reduced in size, complexity and platform reliance while achieving the same results.