fix raw scan

This commit is contained in:
Mateusz Gruszczyński
2026-03-02 14:01:20 +01:00
parent 0d9dcecda7
commit b3a16303d2

View File

@@ -175,19 +175,24 @@ def process_country(country, networks_count, force=False):
if app_type.startswith('raw-'):
format_type = app_type.split('-')[1]
if aggregate:
nets_out = ConfigGenerator._aggregate_networks(networks)
else:
nets_out = sorted(set(networks))
if format_type == 'cidr_txt':
config_text = '\n'.join(networks)
config_text = '\n'.join(nets_out)
elif format_type == 'newline_txt':
config_text = '\n'.join(networks)
config_text = '\n'.join(nets_out)
elif format_type == 'json':
config_text = json.dumps({
'country': country,
'networks': networks,
'count': len(networks)
'networks': nets_out,
'count': len(nets_out)
}, indent=2)
elif format_type == 'csv':
config_text = 'network\n' + '\n'.join(networks)
config_text = 'network\n' + '\n'.join(nets_out)
else:
errors += 1
continue