|
@@ -5,14 +5,26 @@ import csv
|
|
|
import urllib.request
|
|
|
import base64
|
|
|
|
|
|
-serversnum = 20
|
|
|
+serversnum = 30
|
|
|
profiles = []
|
|
|
choice = -1
|
|
|
-listurl = "http://www.vpngate.net/api/iphone/"
|
|
|
+mirrorlist = [ "https://www.vpngate.net", "http://5.181.235.14:29916", "http://88.218.17.24:20261", "http://138.199.46.86:36667", "http://109.111.243.206:17579", "http://78.142.193.246:33304", "http://163.182.174.159:18358", "http://91.193.75.5:45082"]
|
|
|
+reqpart = "/api/iphone/"
|
|
|
+# listurl = "http://www.vpngate.net/api/iphone/"
|
|
|
ovpnpath = "/tmp/profile.ovpn"
|
|
|
fmtstrhead = "{:^4} | {:^4} | {:^4} | {:^30} | {:^10}"
|
|
|
fmtstr = "[{:>2}] | {} | {:>4} | {:<30} | {:^10}"
|
|
|
|
|
|
+## Mirror selection
|
|
|
+mirchoice = -1
|
|
|
+fmtmirr = "[{:3}] | {:>40}"
|
|
|
+for i in range(len(mirrorlist)):
|
|
|
+ print(fmtmirr.format( i, mirrorlist[i] ))
|
|
|
+
|
|
|
+while mirchoice < 0 or mirchoice > (len(mirrorlist) - 1):
|
|
|
+ mirchoice = int(input("Select a mirror:: "))
|
|
|
+
|
|
|
+listurl = mirrorlist[mirchoice] + reqpart
|
|
|
response = urllib.request.urlopen(listurl).read().decode('utf-8').split('\n')
|
|
|
reader = csv.reader(response, delimiter=',')
|
|
|
|