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/
193 stars 55 forks source link

fake_useragent is down and even if it is not actively being used in project nordvpn switcher doesn't work #14

Closed belfortf closed 3 years ago

belfortf commented 3 years ago

Hi, just to let you know, as it seems fake_useragent is not fully functional at the moment and even though I'm not directly using it in my project, nordvpn switcher fails to even start. Can one switch it off ? Thanks

EduardoSantos7 commented 3 years ago

Same here, this is my trace:

Error occurred during loading data. Trying to use cache server https://fake-useragent.herokuapp.com/browsers/0.1.11
Traceback (most recent call last):
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 64, in get
    with contextlib.closing(urlopen(
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1379, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.8/urllib/request.py", line 1354, in do_open
    r = h.getresponse()
  File "/usr/lib/python3.8/http/client.py", line 1347, in getresponse
    response.begin()
  File "/usr/lib/python3.8/http/client.py", line 307, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python3.8/http/client.py", line 268, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
socket.timeout: timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 164, in load
    browsers_dict[browser_key] = get_browser_versions(
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 120, in get_browser_versions
    html = get(
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 84, in get
    raise FakeUserAgentError('Maximum amount of retries reached')
fake_useragent.errors.FakeUserAgentError: Maximum amount of retries reached
Error occurred during loading data. Trying to use cache server https://fake-useragent.herokuapp.com/browsers/0.1.11
Traceback (most recent call last):
  File "/usr/lib/python3.8/urllib/request.py", line 1350, in do_open
    h.request(req.get_method(), req.selector, req.data, headers,
  File "/usr/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1301, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1250, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.8/http/client.py", line 1010, in _send_output
    self.send(msg)
  File "/usr/lib/python3.8/http/client.py", line 950, in send
  File "/usr/lib/python3.8/http/client.py", line 921, in connect
    self.sock = self._create_connection(
  File "/usr/lib/python3.8/socket.py", line 808, in create_connection
    raise err
  File "/usr/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
socket.timeout: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 64, in get
    with contextlib.closing(urlopen(
  File "/usr/lib/python3.8/urllib/request.py", line 222, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.8/urllib/request.py", line 525, in open
    response = self._open(req, data)
  File "/usr/lib/python3.8/urllib/request.py", line 542, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 1379, in http_open
    return self.do_open(http.client.HTTPConnection, req)
  File "/usr/lib/python3.8/urllib/request.py", line 1353, in do_open
    raise URLError(err)
urllib.error.URLError: <urlopen error timed out>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 164, in load
    browsers_dict[browser_key] = get_browser_versions(
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 120, in get_browser_versions
    html = get(
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/fake_useragent/utils.py", line 84, in get
    raise FakeUserAgentError('Maximum amount of retries reached')
fake_useragent.errors.FakeUserAgentError: Maximum amount of retries reached

You're using Linux.
Performing system check...
###########################

NordVPN installation check: ✓
Traceback (most recent call last):
  File "demo.py", line 10, in <module>
    instructions = initialize_VPN() #this will guide you through a step-by-step guide, including a help-menu with connection options
  File "/home/eduardo_santos_housecallprosolut/.local/lib/python3.8/site-packages/nordvpn_switcher/nordvpn_switch.py", line 162, in initialize_VPN
    check_nord_linux_acc = str(check_output(["nordvpn","account"]))
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 512, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['nordvpn', 'account']' returned non-zero exit status 1.
kboghe commented 3 years ago

Looks like efthymew's issue (the one I recently closed) is a real issue after all! Don't worry fellas, I'll fix this one today and keep you up to date when I updated the version on pip.

kboghe commented 3 years ago

Alright, my Windows machine crashed just after uploading the newest version to pip (sigh...), but it should work fine now. Could you try by installing the newest version through pip (version 0.2.5) and report back to me? Thanks a bunch!

belfortf commented 3 years ago

Hi kboghe, I've installed the new version and all is working fine now. Thank you very much for the great work, nordvpn_swticher is awesome !

kboghe commented 3 years ago

Hooray! Thank you so much for your kind words. Closing this issue now. Have a great day everyone. :)