ccozkan/instagram-unfollowers

OSError: [Errno 101] Network is unreachable

Opened this issue · 2 comments

python main.py 3322513531
~ Connecting to Instagram
~ Sending request to Instagram , fetching your feeds
~ Sending request to Instagram , fetching followers
Traceback (most recent call last):
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/connection.py", line 159, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw)
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/util/connection.py", line 80, in create_connection
raise err
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/util/connection.py", line 70, in create_connection
sock.connect(sa)
OSError: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
conn.connect()
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/connection.py", line 301, in connect
conn = self._new_conn()
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/connection.py", line 168, in _new_conn
self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7fb22b063eb8>: Failed to establish a new connection: [Errno 101] Network is unreachable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/urllib3/util/retry.py", line 399, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='i.instagram.com', port=443): Max retries exceeded with url: /api/v1/friendships/3322513531/followers/?max_id=400&ig_sig_key_version=4&rank_token=49039929928_bcaf0f5b-f2eb-4626-903b-dc9ed3be2345 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb22b063eb8>: Failed to establish a new connection: [Errno 101] Network is unreachable',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "main.py", line 40, in
followers = insta.getTotalFollowers(numer)
File "/home/hadoop/Desktop/instagram-unfollowers/insta.py", line 119, in getTotalFollowers
self.getUserFollowers(usernameId,next_max_id)
File "/home/hadoop/Desktop/instagram-unfollowers/insta.py", line 110, in getUserFollowers
+'&ig_sig_key_version='+ self.SIG_KEY_VERSION +'&rank_token='+ self.rank_token)
File "/home/hadoop/Desktop/instagram-unfollowers/insta.py", line 91, in SendRequest
response = self.s.get(self.API_URL + endpoint) # , verify=False
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/requests/sessions.py", line 546, in get
return self.request('GET', url, **kwargs)
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/home/hadoop/Desktop/instagram-unfollowers/env/lib/python3.6/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='i.instagram.com', port=443): Max retries exceeded with url: /api/v1/friendships/3322513531/followers/?max_id=400&ig_sig_key_version=4&rank_token=49039929928_bcaf0f5b-f2eb-4626-903b-dc9ed3be2345 (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7fb22b063eb8>: Failed to establish a new connection: [Errno 101] Network is unreachable',))
(env) [hadoop@bd instagram-unfollowers]$

  1. You need to run python 2.0
  2. are you connected to the internet...?