Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nord API problems with "server load", "all vpn servers", etc #6

Closed
ph202107 opened this issue Mar 5, 2024 · 4 comments
Closed

Nord API problems with "server load", "all vpn servers", etc #6

ph202107 opened this issue Mar 5, 2024 · 4 comments

Comments

@ph202107
Copy link
Owner

ph202107 commented Mar 5, 2024

Since 2024/03/05 there have been problems using the Nord Public API, for example "server load" is reporting "null%".
Unfortunately all the API functions used in this script may now be deprecated.
https://support.nordvpn.com/hc/en-us/articles/21586950310801-Discontinuation-of-the-legacy-API-endpoints-on-NordVPN
If anyone knows of a working method to find the load % of a connected server, to download a list of all available servers, etc, please respond or create a new issue with your solution(s). Thanks!

@ph202107
Copy link
Owner Author

ph202107 commented Mar 8, 2024

@ph202107
Copy link
Owner Author

ph202107 commented Mar 8, 2024

May be able to use: https://api.nordvpn.com/v1/servers?limit=0

@ph202107
Copy link
Owner Author

ph202107 commented Mar 9, 2024

To produce a simple list of hostnames this seems to work OK:

curl --silent "https://api.nordvpn.com/v1/servers?limit=9999999" > "nord_allservers.json"

jq '.[].hostname' "nord_allservers.json" | sort | sed 's/"//g' > "nord_allservers.txt"

I haven't yet found a way to query the active server load (without downloading the 20MB json).

ph202107 added a commit that referenced this issue Mar 11, 2024
API problems.  Since 2024/03/05 there have been problems using the (now deprecated) Nord Public API, for example "server load" is reporting "null%".  #6
If anyone knows how to query the active server load please add your comments.  Thanks!

function nordapi_menu - some functions are not working.
function allservers_menu - all functions should be working again. 
"nordserversfile" is now the 20MB .json of all the NordVPN servers.  An additional .txt file with just the server hostnames will be created in the same directory.

function group_connect - added the "Dedicated_IP" server group. Can be used to test the group in a particular region before purchasing a Dedicated IP.  If you already have a Dedicated IP you can specify your server to automatically change settings and connect to it via the "Group" menu.  
function country_names - Shorten some country names so the menu fits better in the terminal window.  Can skip this function if preferred.
function heading - better handling of ascii fonts based on current terminal width.

NordVPN has added virtual servers: https://nordvpn.com/blog/new-nordvpn-virtual-servers/ 
Countries listed in the "nordvirtual" array will be labelled as (Virtual).  This list is subject to change and the array must be updated manually.
function city_count - mark virtual countries with an asterix (*).
ph202107 added a commit that referenced this issue Mar 19, 2024
"Server load" is still broken.  If anyone knows how to query https://api.nordvpn.com/v1/servers  by the VPN hostname and retrieve the server load please add your comments to this issue: #6  Thanks!

Added customization option 'shortcountries' = Abbreviate long country names so the 'Countries' menu fits better in the terminal window.  Choose "y" or "n", default is "y".
function city_count - (Tools - NordVPN API - All Cities) added a list of "Virtual Countries and Cities" for the countries in the "nordvirtual" array.
function ascii_custom - use figlet with "-t" for longer text in wide terminals.
function heading - also use "standard" and "smslant" figlet fonts depending on terminal width.
function country_names - updated names and spelling.
Compacted some functions.
ph202107 added a commit that referenced this issue Mar 28, 2024
No major changes.

"Server load" is not working.  If anyone knows how to query https://api.nordvpn.com/v1/servers  by the VPN hostname and retrieve the current server load (without downloading the entire 20MB json) please add a comment to this issue: #6  Thanks!
ph202107 added a commit that referenced this issue Apr 5, 2024
function server_load - have not found a way to query the api directly by hostname, but "server id" will work.  As a workaround will search the local "nordserversfile" to find the server id, and use that to query the api for the current server load.  See customization option "nordserversfile" to create the file.

#6
@ph202107
Copy link
Owner Author

ph202107 commented Apr 6, 2024

There does not seem to be a "hostname" or "ip" filter that can be used to query the api without downloading the entire json.
Implemented a workaround for "function server_load" to search a local json for the server "id", then query the api with an "id" filter to retrieve the current server load. This method downloads about 3KB instead of 20MB every time the load is queried.
Use the same local json for the other queries in "function allservers_menu".
Closing issue.

@ph202107 ph202107 closed this as completed Apr 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant