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

@@ -176,18 +176,23 @@ def process_country(country, networks_count, force=False):
if app_type.startswith('raw-'): if app_type.startswith('raw-'):
format_type = app_type.split('-')[1] 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': if format_type == 'cidr_txt':
config_text = '\n'.join(networks) config_text = '\n'.join(nets_out)
elif format_type == 'newline_txt': elif format_type == 'newline_txt':
config_text = '\n'.join(networks) config_text = '\n'.join(nets_out)
elif format_type == 'json': elif format_type == 'json':
config_text = json.dumps({ config_text = json.dumps({
'country': country, 'country': country,
'networks': networks, 'networks': nets_out,
'count': len(networks) 'count': len(nets_out)
}, indent=2) }, indent=2)
elif format_type == 'csv': elif format_type == 'csv':
config_text = 'network\n' + '\n'.join(networks) config_text = 'network\n' + '\n'.join(nets_out)
else: else:
errors += 1 errors += 1
continue continue