ping / instagram_private_api

A Python library to access Instagram's private API.
MIT License
2.99k stars 618 forks source link

'ascii' codec can't encode character when fetching posts for hashtag #327

Open mavris opened 3 years ago

mavris commented 3 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Which client are you using?


Describe the Bug/Error:

When I try to fetch posts with any hashtag I am getting this error. This was working fine until recently.

Paste the output of python -V here: Python 2.7.11 Code:

    try:
        rank_token = Client.generate_uuid()
        tag_results = []
        results = api.feed_tag('blinds', rank_token)
    except Exception as e:
        print(e)
        if hasattr(e, 'message'):
            print(e.message)
        else:
            print(e)

Error/Debug

'ascii' codec can't encode character u'\u2728' in position 1213: ordinal not in range(128)
ymgsmz commented 3 years ago

I got the same issue while trying to fetch post_info, the issue was related to logging string that contains CJK characters. There's a fix PR at #331