Open marcularis04 opened 5 years ago
Same for me
Thank you for your interest Instagram sometimes returns non expected result. I will try to reproduce the error and fix it
Thank you very much!! This error literally destroys an excellent working bot, making it unusable. My question is, why it's an isolated case, when the problem is at Insgagram's part?
Thanks to everybody! Yesterday, right after my last answer I tried uninstalling instabot-py, and reinstalling it with python3 -m pip install instabot-py
, instead of pip install instabot-py
, like the Medium's article tutorial suggests. Now, it has been working like a charm all day :)
Edit: No, it was just good luck. It worked for 23-24 hours, then this error happened again. I don't know what to do.. . :( @yurilaaziz please try fixing this error, it's so frustrating.. :(
Have you found a solution? Should I try running it outside the venv?
Running it outside Venv doesn't help either. I've also updated python3 to version 3.7.4, it just doesn't help. Anyone else is facing this error? I literary can't run the bot all day, because at some point in time it just stops working.
Running it outside Venv doesn't help either. I've also updated python3 to version 3.7.4, it just doesn't help. Anyone else is facing this error? I literary can't run the bot all day, because at some point in time it just stops working.
Instead of running the bot directly, run this script instead. Whenever the bot crashes, the script starts a new process:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import signal
import sys
def signal_handler(sig, frame):
sys.exit(0)
signal.signal(signal.SIGINT, signal_handler)
myCmd = '/usr/local/bin/instabot-py -c _iamklaus.yml'
while True:
try:
os.system(myCmd)
except:
continue
print ("#################################################")
print ("Going to sleep for 10 seconds.")
print ("#################################################")
time.sleep(10)
Thanks! Right now I am experimenting with Instapy, because this project is officially shut down for an undetermined period of time, and also because it's easy for Instagram to detect it, even on 40 likes per day.
Do you use proxy ? It seems to me to work with proxy!!! I got the same error before I used proxyyy.. But the question is how long will proxy help.
No, I don't use a proxy. What is a proxy for? Does it prevent instagram from detecting the bot?
No, I don't use a proxy. What is a proxy for? Does it prevent instagram from detecting the bot?
◘ A proxy server acts as a gateway between you and the internet. ... Modern proxy servers do much more than forwarding web requests, all in the name of data security and network performance.
◘ it will not prevent but suppose to help.
Thank you for your interest Instagram sometimes returns non expected result. I will try to reproduce the error and fix it
Hi! I was getting the same error in verify_media_before_comment function
After digging into code I figured out it could not retrieve json data.
So I added simple try and catch and now bot continues to run.
Maby we can use it as "patch" untill now
bot.py line 1060
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
2019-08-27 16:34:06,496 - artyom.js - InstaBot - INFO - Saving cookies to session file artyom.js.session 2019-08-27 16:34:06,501 - artyom.js - InstaBot - INFO - Reading configuration (3 settings) from artconfig.yml 2019-08-27 16:34:06,501 - artyom.js - InstaBot - DEBUG - Get Media by tag: bgirl 2019-08-27 16:34:08,404 - artyom.js - InstaBot - DEBUG - Retrieved 69 medias 2019-08-27 16:34:08,476 - artyom.js - InstaBot - DEBUG - Select 13 medias to process. Increase max_like_for_one_tag value for more processing medias 2019-08-27 16:34:08,477 - artyom.js - InstaBot - DEBUG - Trying to like media: id: 2119722654127401344, url: https://www.instagram.com/p/B1qxIXtnKmA/ 2019-08-27 16:34:09,170 - artyom.js - InstaBot - INFO - Liked media #1: id: 2119722654127401344, url: https://www.instagram.com/p/B1qxIXtnKmA/ 2019-08-27 16:34:10,809 - artyom.js - InstaBot - DEBUG - Trying to follow: thevandalhour 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. 2019-08-27 16:56:56,472 - artyom.js - InstaBot - DEBUG - Trying to follow: frente_mulheres_hiphop_ba 2019-08-27 16:56:57,521 - artyom.js - InstaBot - INFO - Followed: https://www.instagram.com/frente_mulheres_hiphop_ba/ #2.
Running it outside Venv doesn't help either. I've also updated python3 to version 3.7.4, it just doesn't help. Anyone else is facing this error? I literary can't run the bot all day, because at some point in time it just stops working.
Instead of running the bot directly, run this script instead. Whenever the bot crashes, the script starts a new process:
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import time import signal import sys def signal_handler(sig, frame): sys.exit(0) signal.signal(signal.SIGINT, signal_handler) myCmd = '/usr/local/bin/instabot-py -c _iamklaus.yml' while True: try: os.system(myCmd) except: continue print ("#################################################") print ("Going to sleep for 10 seconds.") print ("#################################################") time.sleep(10)
Hi @iamklaus I'd like to try this one. But I have no experiance with Scripts. I am on MacOS Mojave. And have the Script Editor as tool. Could you help me which of the above lines I have to adjust to my setting / storage location of the bot? Thanks for your help.
Regards, Marc
Check this or we will delete your issue. (fill in the checkbox with an X like so: [x])
Select one:
Environment
Operating System? (include version)
Python Version Requirement
Exact Python Version?
Pip Version?
Instabot Version?
How you use the instabot
Description of your issue
I get this error randomly, while the bot is running:
It's the same format always, just the line numbers differ. It just appears randomy, while the bot is running REALLY well. Then, Instabot stops working. After the error, I can restart Instabot, run it for 3-4 hours, then when I return at the SSH terminal, it shows me this error. Sometimes, this error appears immediately after running. It's the same always, only the line numbers differ. I have installed the latest Instabot with this tutorial:
The source is
https://medium.com/@asker_amine/whats-new-in-the-instagram-bot-0-5-2-fe52154fdc8a