ohld / igbot

🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
https://hikerapi.com/p/N2P6iqiM
Apache License 2.0
4.72k stars 1.47k forks source link

Can't using emoji in comments #624

Closed EightShift closed 6 years ago

EightShift commented 6 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Purpose of your issue?


Hello. For a long time no comments have been posted in which emoji is used. Already tried to use different encodings for the comment file but the result is two:

  1. Error
  2. Unknown symbols instead of emotions

Error:

Traceback (most recent call last): File "comment_hashtags.py", line 32, in bot.comment_hashtag(hashtag) File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\bot\bot.py", line 544, in comment_hashtag return comment_hashtag(self, hashtag, amount) File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\bot\bot_comment.py", line 47, in comment_hashtag return self.comment_medias(medias) File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\bot\bot.py", line 547, in comment_medias return comment_medias(self, medias) File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\bot\bot_comment.py", line 33, in comment_medias text = self.get_comment() File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\bot\bot.py", line 371, in get_comment return get_comment(self) File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\bot\bot_get.py", line 233, in get_comment return self.comments_file.random().strip() File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\utils.py", line 54, in random return random.choice(self.list) File "C:\Users*username\AppData\Local\Programs\Python\Python37-32\lib\site-packages\instabot\utils.py", line 17, in list lines = [x.strip('\n') for x in f.readlines()] File "C:\Users*username*\AppData\Local\Programs\Python\Python37-32\lib\encodings\cp1251.py", line 23, in decode return codecs.charmap_decode(input,self.errors,decoding_table)[0] UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 2: character maps to 2018-08-25 07:47:44,487 - INFO - Bot stopped. Worked: 2:47:18.835092 2018-08-25 07:47:44,488 - INFO - Total requests: 50

vladpoly90 commented 6 years ago

Can't post emoji in Windows (appears as random chars) but works just fine in Linux.

Reading comments for a file.

EightShift commented 6 years ago

@Tuplad, but... why? I installed Linux on my home server. And it really works well. Only, I'm a noob in Linux. And I do not understand why it works only with version 2.7. When I try to run from version 3.6, nothing happens. And I'm trying to figure out how to do bat-file like in windows, for a convenient bot launch.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.