diff --git a/nodes.json b/nodes.json index 7e90b06..0852016 100644 --- a/nodes.json +++ b/nodes.json @@ -194,7 +194,7 @@ "identifier": "GlassHost - NY1", "password": "glasshost1984", "port": 2269, - "restVersion": "v3", + "restVersion": "v4", "secure": false }, { @@ -266,7 +266,7 @@ "port": 8028, "password": "hanmetaforce", "secure": false, - "restVersion": "v4", - "authorId": "917913229668274186" + "authorId": "917913229668274186", + "restVersion": "v4" } -] +] \ No newline at end of file diff --git a/remove_duplicates.py b/remove_duplicates.py index d22f0e6..7a0b083 100644 --- a/remove_duplicates.py +++ b/remove_duplicates.py @@ -1,9 +1,5 @@ import json -# Load data from nodes.json -with open('nodes.json') as f: - data = json.load(f) - # Function to remove duplicate nodes def remove_duplicates(data): seen_identifiers = set() @@ -15,6 +11,20 @@ def remove_duplicates(data): unique_data.append(node) return unique_data +# Function to add restVersion if it is missing +def add_restVersion(data): + for node in data: + if 'restVersion' not in node: + node['restVersion'] = 'v4' + return data + +# Load data from nodes.json +with open('nodes.json') as f: + data = json.load(f) + +# Add restVersion if it is missing +data = add_restVersion(data) + # Remove duplicates unique_data = remove_duplicates(data) @@ -28,3 +38,6 @@ def remove_duplicates(data): else: print("No duplicate nodes found.") +# Save data with restVersion added +with open('nodes.json', 'w') as f: + json.dump(data, f, indent=4)