I am trying to make a small bot that publishes a photo on Instagram once a day at the same time, the problem is that the script stops at login and gives this error:
2023-03-31 10:51:48,466 - INFO - Instabot version: 0.117.0 Started
2023-03-31 10:51:48,466 - INFO - Not yet logged in starting: PRE-LOGIN FLOW!
2023-03-31 10:51:48,783 - ERROR - Request returns 429 error!
2023-03-31 10:51:48,783 - WARNING - That means 'too many requests'. I'll go to sleep for 5 minutes.
the code:
# Delete config file
os.popen("rm -rf config")
# Instagram login
bot = instabot.Bot()
bot.login(username = username , password = password)
while loop:
# Calculation of waiting time until publication time
now = datetime.now()
scheduled_time = datetime(now.year, now.month, now.day, post_hour, post_minute)
time_to_wait = scheduled_time - now
seconds_to_wait = time_to_wait.total_seconds()
if seconds_to_wait < 0:
seconds_to_wait = (86400 + seconds_to_wait)
print("Waiting for {} hours...".format(seconds_to_wait/(60*60)))
if not(testing):
time.sleep(seconds_to_wait)
.
.
.
.
# Publication post
time.sleep(5)
bot.upload_photo(image_path, caption=caption)
# Date increment for next post
scheduled_time += timedelta(days=1)
if (testing):
loop = False
i tried waiting but it keeps adding 5 minutes endlessly, i also tried commenting in intabot's api.py file the part about that error (i thought it was an error in instabot version 0.117.0) but it wasn't. the error is from the http protocol from what i understand but it seems strange to me that it made too many requests since it freezes at login