onegram
onegram copied to clipboard
Following a non existing user will crash onegram
https://www.instagram.com/audrey/
INFO:onegram.session:(xxxxxx) queries.user_info: GET "https://www.instagram.com/audrey/"
Traceback (most recent call last):
File "C:\Program Files (x86)\Python36-32\lib\site-packages\sessionlib-0.2.1-py3.6.egg\sessionlib\sessionlib.py", line 157, in wrapped
response = func(*args, **kwargs)
File "D:\Codez\onegram\onegram\actions.py", line 8, in follow
return _user_action(session, user)
File "D:\Codez\onegram\onegram\actions.py", line 52, in _user_action
user_id = _user_id(session, user)
File "D:\Codez\onegram\onegram\queries.py", line 84, in _user_id
return user_info(session, user)['id']
File "C:\Program Files (x86)\Python36-32\lib\site-packages\sessionlib-0.2.1-py3.6.egg\sessionlib\sessionlib.py", line 157, in wrapped
response = func(*args, **kwargs)
File "D:\Codez\onegram\onegram\queries.py", line 14, in user_info
return _info(session, username=username or session.username)
File "D:\Codez\onegram\onegram\queries.py", line 101, in _info
return jsearch(JSPATHS[query], response)
File "D:\Codez\onegram\onegram\utils\__init__.py", line 22, in jsearch
raise TypeError()
TypeError
Thanks for reporting the issue. What would you think that could be the default approach: to simply ignore or to raise a specific exception?
Print "user does not exist"..
On Sat, 19 May 2018, 3:01 am Paulo Romeira, [email protected] wrote:
Thanks for reporting the issue. What would you think that could be the default approach: to simply ignore or to raise a specific exception?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pauloromeira/onegram/issues/7#issuecomment-390370618, or mute the thread https://github.com/notifications/unsubscribe-auth/AUPGkkQ0TSaCSyo0x5CRipNBVoShgyxkks5tz30GgaJpZM4UFOPc .
I would say: ignore it and print some warning message
can you give a look at this commit? https://github.com/pauloromeira/onegram/compare/master...neFAST:34e7f348f583c99abb74308d554c7ade4a9f6b1d#diff-97323fbaa4abdcae6b08f8df4c581b41
How did you fix this @neFAST nefast