Closed hexdex22 closed 3 years ago
Hi hexdex. Sorry for the wait, been busy the last couple of weeks. Anyway, if I'm understanding this correctly, the issue is simply resolved when implementing a sleep in the script, is this correct?
No need to apologize for bringing up this issue again; glad someone is stress-testing the package!
UPDATE
Your new ip-address reports real ip but it has actually changed - so not a 'leak' sleep(5) required after rotate_VPN allow access to the internet.
Hi,
Sorry to report the issue again. The software consistently fails under these circumstances:
Nordvpn already running with a VPN server selected. Reports real IP as VPN IP but cannot use requests to get another url.
Nordvpn running but disconnected. Hangs with no output.
Tested with pycharm community version. Please let me know if you need further details.
Best regards,
Raj
CODE:
`from nordvpn_switcher import initialize_VPN, rotate_VPN, terminate_VPN import requests
response = requests.get(r'https://www.uklcds.com/check_ip.php') print('STARTING IP:',response.text)
instructions = initialize_VPN(area_input=['europe'])
rotate_VPN(instructions)
response = requests.get(r'https://www.uklcds.com/check_ip.php') print('FINAL IP:',response.text)`
RESULTS:
`C:\Users\x\PycharmProjects\selenium\venv\Scripts\python.exe C:/Users/x/PycharmProjects/selenium/multibrowser.py STARTING IP: 185.99.3.32 You're using Windows. Performing system check... ###########################
NordVPN installation check: ✓ NordVPN service check: ✓ Opening NordVPN app and disconnecting if necessary... NordVPN app launched: ✓ #####################################
You've entered a list of connection options. Checking list...
Done!
Your current ip-address is: 185.99.3.32 <== VPN IP
Connecting you to Iceland ...
your new ip-address is: 82.30.117.28 <== REAL IP
Done! Enjoy your new server.
Traceback (most recent call last): File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn conn.connect() File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connection.py", line 411, in connect self.sock = ssl_wrapsocket( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\util\ssl.py", line 428, in ssl_wrap_socket ssl_sock = _ssl_wrap_socketimpl( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\util\ssl.py", line 472, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\x\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\Users\x\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1040, in _create self.do_handshake() File "C:\Users\x\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen retries = retries.increment( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\util\retry.py", line 531, in increment raise six.reraise(type(error), error, _stacktrace) File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\packages\six.py", line 734, in reraise raise value.with_traceback(tb) File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen httplib_response = self._make_request( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request self._validate_conn(conn) File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn conn.connect() File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\connection.py", line 411, in connect self.sock = ssl_wrapsocket( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\util\ssl.py", line 428, in ssl_wrap_socket ssl_sock = _ssl_wrap_socketimpl( File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\urllib3\util\ssl.py", line 472, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\x\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 500, in wrap_socket return self.sslsocket_class._create( File "C:\Users\x\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1040, in _create self.do_handshake() File "C:\Users\x\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1309, in do_handshake self._sslobj.do_handshake() urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\x\PycharmProjects\selenium\multibrowser.py", line 13, in
response = requests.get(r'https://www.uklcds.com/check_ip.php')
File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, kwargs)
File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, kwargs)
File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, send_kwargs)
File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, kwargs)
File "C:\Users\x\PycharmProjects\selenium\venv\lib\site-packages\requests\adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
Process finished with exit code 1 `