Skip to content
This repository has been archived by the owner on Aug 30, 2019. It is now read-only.

user_info error #15

Open
lormayna opened this issue Aug 28, 2018 · 0 comments
Open

user_info error #15

lormayna opened this issue Aug 28, 2018 · 0 comments

Comments

@lormayna
Copy link

lormayna commented Aug 28, 2018

Hi, I'm trying to use user_info, but I'm getting this error:

`In [20]: from onegram import user_info

In [21]: user_info("chiaraferragni")
INFO:onegram.session:(visitcarmignano) queries.user_info: GET "https://www.instagram.com/chiaraferragni/"

CookieConflictError Traceback (most recent call last)
in ()
----> 1 user_info("chiaraferragni")

~/project/instabot/lib/python3.6/site-packages/sessionlib/sessionlib.py in wrapped(*args, **kwargs)
155 try:
156 if session is current_session:
--> 157 response = func(*args, **kwargs)
158 else:
159 with session:

~/project/instabot/lib/python3.6/site-packages/onegram/queries.py in user_info(session, username)
12 if session.unlogged and not username:
13 raise NotSupportedError('You must provide an user at Unlogged state')
---> 14 return _info(session, username=username or session.username)
15
16 @sessionaware

~/project/instabot/lib/python3.6/site-packages/onegram/queries.py in _info(session, **kw)
98 url = URLSquery
99 params = {'__a': '1'}
--> 100 response = session.query(url, params=params)
101 return jsearch(JSPATHS[query], response)
102

~/project/instabot/lib/python3.6/site-packages/onegram/session.py in query(self, url, *a, **kw)
98 signature = self._build_signature(url, kw.get('params'))
99 headers['X-Instagram-GIS'] = signature
--> 100 return self.request('GET', url, *a, **kw)
101
102

~/project/instabot/lib/python3.6/site-packages/onegram/session.py in request(self, method, url, *a, **kw)
124 return validate_response(self, response)
125
--> 126 return _request()
127
128

~/project/instabot/lib/python3.6/site-packages/tenacity/init.py in wrapped_f(*args, **kw)
237 @six.wraps(f)
238 def wrapped_f(*args, **kw):
--> 239 return self.call(f, *args, **kw)
240
241 def retry_with(*args, **kwargs):

~/project/instabot/lib/python3.6/site-packages/tenacity/init.py in call(self, fn, *args, **kwargs)
324 while True:
325 do = self.iter(result=result, exc_info=exc_info,
--> 326 start_time=start_time)
327 if isinstance(do, DoAttempt):
328 try:

~/project/instabot/lib/python3.6/site-packages/tenacity/init.py in iter(self, result, exc_info, start_time)
275
276 if not retry:
--> 277 return fut.result()
278
279 if self.after is not None:

/usr/lib/python3.6/concurrent/futures/_base.py in result(self, timeout)
423 raise CancelledError()
424 elif self._state == FINISHED:
--> 425 return self.__get_result()
426
427 self._condition.wait(timeout)

/usr/lib/python3.6/concurrent/futures/_base.py in __get_result(self)
382 def __get_result(self):
383 if self._exception:
--> 384 raise self._exception
385 else:
386 return self._result

~/project/instabot/lib/python3.6/site-packages/tenacity/init.py in call(self, fn, *args, **kwargs)
327 if isinstance(do, DoAttempt):
328 try:
--> 329 result = fn(*args, **kwargs)
330 continue
331 except BaseException:

~/project/instabot/lib/python3.6/site-packages/onegram/session.py in _request()
121 self.logger.info(f'{method} "{url}"')
122 response = self._requests.request(method, url, *a, **kw)
--> 123 self._update_csrftoken(response)
124 return validate_response(self, response)
125

~/project/instabot/lib/python3.6/site-packages/onegram/session.py in _update_csrftoken(self, response)
143
144 def _update_csrftoken(self, response=None):
--> 145 csrftoken = self.cookies.get('csrftoken', None)
146 if not csrftoken and response:
147 match = REGEXES['csrftoken'].search(response.text)

~/project/instabot/lib/python3.6/site-packages/requests/cookies.py in get(self, name, default, domain, path)
196 """
197 try:
--> 198 return self._find_no_duplicates(name, domain, path)
199 except KeyError:
200 return default

~/project/instabot/lib/python3.6/site-packages/requests/cookies.py in _find_no_duplicates(self, name, domain, path)
393 if path is None or cookie.path == path:
394 if toReturn is not None: # if there are multiple cookies that meet passed in criteria
--> 395 raise CookieConflictError('There are multiple cookies with name, %r' % (name))
396 toReturn = cookie.value # we will eventually return this as long as no cookie conflict
397

CookieConflictError: There are multiple cookies with name, 'csrftoken'`

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant