convert nord.sh to nord-checker.py

This commit is contained in:
2024-09-04 14:45:59 -05:00
parent f31cdda133
commit f1e5e81a7b
3 changed files with 156 additions and 4 deletions

View File

@@ -33,13 +33,21 @@ try:
# Read the file line by line
with open('vpnlist.txt', 'r') as f:
for line in f:
for line_number, line in enumerate(f, start=1):
if line.startswith('#'):
continue
parts = line.strip().split(' # ')
exit_ip = parts[0]
file_name = parts[1].strip()
if ' # ' not in line:
print(f"Skipping invalid line {line_number}: {line}")
continue
try:
parts = line.strip().split(' # ')
exit_ip = parts[0]
file_name = parts[1].strip()
except IndexError:
print(f"Error parsing line {line_number}: {line}")
continue
total_processed += 1