kboghe / NordVPN-switcher

Rotate between different NordVPN servers with ease. Works both on Linux and Windows without any required changes to your code!
https://pypi.org/project/nordvpn-switcher/
189 stars 51 forks source link

Dependency issue breaking initialize_VPN #40

Closed amitmadahar closed 2 years ago

amitmadahar commented 2 years ago

Output from http://ip4only.me/api/ now does not contain "Remaining" so regex search on line 83 breaks.

The output now looks like this: "IPv4,xxx.xxx.xxx.xxx,v1.1,,,See http://ip6.me/docs/ for api documentation"

Simple fix : used string split to fix the issue like so.

ip = re.search("IPv4,(.*?),", ip).group(1) or ip = ip.split(',')[1]

gourdhead commented 2 years ago

amitmadahar - thanks for quick post. I am an ignorant pythoner. I'm not sure what the string spit fix looks like so I modified line 83, deleting "Remaining" the line now reads:

 ip = re.search("IPv4,(.*?)", ip).group(1)

I have no idea what I'm doing, but this seems to have gotten my antiquated equipment back to running.

amitmadahar commented 2 years ago

@gourdhead - original comment updated.

kboghe commented 2 years ago

Thanks @amitmadahar! I'll try to update the version on pip later this week.

kboghe commented 2 years ago

Fixed in version 0.3.0!