diff --git a/nordvpn-autoconfigure.jenkins b/nordvpn-autoconfigure.jenkins index 736158c..5b7faf1 100644 --- a/nordvpn-autoconfigure.jenkins +++ b/nordvpn-autoconfigure.jenkins @@ -48,29 +48,29 @@ pipeline { // list of urls that return different nordVPN servers def nordURLs = [ // canada - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:38,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=38&filters\\[servers_technologies\\]=5" // denmark - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:58,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=58&filters\\[servers_technologies\\]=5", // france - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:74,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", - // gremany - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:81,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=74&filters\\[servers_technologies\\]=5", + // germany + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=81&filters\\[servers_technologies\\]=5", // ireland - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:104,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=10&filters\\[servers_technologies\\]=5", // japan - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:108,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=108&filters\\[servers_technologies\\]=5", // sweden - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:208,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=208&filters\\[servers_technologies\\]=5", // switzerland - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:209,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=209&filters\\[servers_technologies\\]=5", // mexico - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:140,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=140&filters\\[servers_technologies\\]=5", // netherlands - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:153,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=153&filters\\[servers_technologies\\]=5", // united kingdom - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:38,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}", + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=38&filters\\[servers_technologies\\]=5", // united states - "https://nordvpn.com/wp-admin/admin-ajax.php?action=servers_recommendations&filters=\\{%22country_id%22:228,%22servers_groups%22:\\[15\\],%22servers_technologies%22:\\[5\\]\\}" + "https://api.nordvpn.com/v2/servers?limit=5&filters\\[country_id\\]=228&filters\\[servers_technologies\\]=5", ] // randomly select one from the list nordURL = nordURLs[Math.abs(new Random().nextInt() % [8])] @@ -106,7 +106,7 @@ pipeline { '""" + nordURL + """' \ | jq \ --raw-output \ - '[.[] | select(.technologies[] | .identifier == "openvpn_tcp")][0] | .hostname' \ + '.servers | ([ .[].load ] | min) as \$m | first(.[] | select(.load == \$m)) | .hostname' \ ).tcp.ovpn" \ | sed \ --regexp-extended \