Git Product home page Git Product logo

ipvanish's People

Contributors

vduseev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ipvanish's Issues

Add setup.py

Add proper setup.py that will turn the tool into a proper PyPi compatible package and command line tool.

Exception when Mac has no connection

Following traceback is observed:

Traceback (most recent call last):
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/Users/user/.pyenv/versions/3.6.5/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/connectionpool.py", line 850, in _validate_conn
    conn.connect()
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/connection.py", line 284, in connect
    conn = self._new_conn()
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x1044cdc88>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.ipvanish.com', port=443): Max retries exceeded with url: /api/servers.geojson (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x1044cdc88>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "ipvanish.py", line 204, in <module>
    process_command()
  File "ipvanish.py", line 22, in process_command
    data = get_data()
  File "ipvanish.py", line 64, in get_data
    data = call_api()
  File "ipvanish.py", line 180, in call_api
    r = requests.get(API_URL)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.ipvanish.com', port=443): Max retries exceeded with url: /api/servers.geojson (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x1044cdc88>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

Capture JSON Decoder error

Currently experiencing following issue due to the poor connection:

2018-05-15 22:28:16,639 INFO Requesting server status from IPVanish.
2018-05-15 22:28:16,647 DEBUG Starting new HTTPS connection (1): www.ipvanish.com
2018-05-15 22:28:17,345 DEBUG https://www.ipvanish.com:443 "GET /api/servers.geojson HTTP/1.1" 200 0
Traceback (most recent call last):
  File "ipvanish.py", line 186, in <module>
    process_command()
  File "ipvanish.py", line 14, in process_command
    data = get_data()
  File "ipvanish.py", line 51, in get_data
    data = call_api()
  File "ipvanish.py", line 159, in call_api
    return r.json()
  File "/Users/user/.local/share/virtualenvs/ipvanish-vyzF7bGH/lib/python3.6/site-packages/requests/models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "/Users/user/.pyenv/versions/3.6.5/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/Users/user/.pyenv/versions/3.6.5/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Users/user/.pyenv/versions/3.6.5/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.