Closed bijanzd closed 5 years ago
Anybody help !
Do you use proxy ? It seems to me to work with proxy!!! I got the same error before I used proxyyy..
Do you use proxy ? It seems to me to work with proxy!!! I got the same error before I used proxyyy..
No i'am not use proxy ! every 4 or 5 comment, bot has crash !
Mine seems to me back to work after I defined proxy like this in the configuration file : proxies: http: '{{ proxy_http_string if (proxy_ip and proxy_port)}}' https: '{{ proxy_http_string if (proxy_ip and proxy_port)}}'
But the question is how long will it work with proxy...
crashed again with error ... json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 6815 (char 6814)
doesn't work correctly !!!!
So! After digging into code I figured out that it could not retrieve json in verify_media_before_comment function where I added simple try and catch
in line 1060
bot.py file
try: all_data = json.loads(raw_data)["entry_data"]["PostPage"][0] except Exception as exc: self.logger.warning("Cannot retrieve comments from media.(all_data) ") self.logger.exception(exc) return False
And my bot continued to run !!! This is the log (I define debug: 1 in confiuration file)
2019-08-27 16:34:11,665 - artyom.js - InstaBot - INFO - Followed: https://www.instagram.com/thevandalhour/ #1. 2019-08-27 16:34:12,135 - artyom.js - InstaBot - WARNING - Cannot retrieve comments from media.(all_data) 2019-08-27 16:34:12,136 - artyom.js - InstaBot - ERROR - Unterminated string starting at: line 1 column 2237 (char 2236) Traceback (most recent call last): File "c:\users\roey\appdata\local\programs\python\python37\lib\site-packages\instabot\bot.py", line 1062, in verify_media_before_comment all_data = json.loads(raw_data)["entry_data"]["PostPage"][0] File "c:\users\roey\appdata\local\programs\python\python37\lib\json__init__.py", line 348, in loads return _default_decoder.decode(s) File "c:\users\roey\appdata\local\programs\python\python37\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "c:\users\roey\appdata\local\programs\python\python37\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 2237 (char 2236) 2019-08-27 16:34:12,683 - artyom.js - InstaBot - INFO - Trying to comment: 2119724541454582423 https://www.instagram.com/p/B1qxj1bFAKX/ 2019-08-27 16:34:15,007 - artyom.js - InstaBot - INFO - Comment: The picture feels very cool... #1.
it work now ??
yep for more than 2 hours without exiting
Yes, where it tries to retrieve json all_data we put it in "try" "catch" so bot will continue to run...
evertime i use bot for commenting after 3 or 4 comment this error disappear !
2019-08-24 19:58:52,915 - username - InstaBot - DEBUG - Retrieved 71 medias 2019-08-24 19:58:52,953 - username - InstaBot - DEBUG - Select 486 medias to process. Increase max_like_for_one_tag value for more processing medias Traceback (most recent call last): File "/usr/bin/instabot-py", line 10, in
sys.exit(main())
File "/usr/lib/python3.7/site-packages/instabot/main.py", line 344, in main
bot.run()
File "/usr/lib/python3.7/site-packages/instabot/bot.py", line 740, in run
self.new_auto_mod_comments(media)
File "/usr/lib/python3.7/site-packages/instabot/bot.py", line 1008, in new_auto_mod_comments
if self.iteration_ready("comments") and self.verify_media_before_comment(media):
File "/usr/lib/python3.7/site-packages/instabot/bot.py", line 1060, in verify_media_before_comment
all_data = json.loads(raw_data)["entry_data"]["PostPage"][0]
File "/usr/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.7/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 82 (char 81)
thanks for your help !
CONFIG: