You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.
First of all, thanks @b31ngd3v for building this API.
I recently built a quick script to view accounts' stories in loop. Here's the code
from myigbot import MyIGBot
import time
import random
bot = MyIGBot(username,pw)
storiesCount = 0
def getLastMediaLikers(account):
# Try to get a list of users that liked the account's last post. If the account has no posts or it's private, return []
try:
getMedias = bot.user_posts(account)
if getMedias == []: return []
getLikers = bot.post_likers(getMedias[0])
print(f"Got {len(getLikers)} media likers for the account {account}")
return getLikers
except:
return [] # If anything goes wrong, return an empty list
def storyView(account):
global storiesCount
# Attempt to view the story of the account. If successful, increment storiesCount
try:
print("Attempting story view for",account)
if bot.story_view(account) == 200: storiesCount += 1
print(f"Current stories count: {storiesCount}")
time.sleep(2.5)
except:
pass # In case something goes wrong
return
currentAccount = input("Please provide an account to start from")
likers = getLastMediaLikers(currentAccount)
while True:
# View the story of currentAccount and all the one of the first 50 likers of its last post. Then choose a random account and repeat.
storyView(currentAccount)
for a in likers:
storyView(a)
currentAccount = random.choice(likers)
likers_sub = getLastMediaLikers(currentAccount)
while likers_sub == []:
currentAccount = random.choice(likers)
likers_sub = getLastMediaLikers(currentAccount)
likers = likers_sub
print("Current account:",currentAccount,". Long Sleeping.")
time.sleep(5)
After a few minutes, my script gets detected and I'm required to change my instagram password due to "a suspiscious login attempt". Does anyone know what IG's rate limits are & what my sleep times should be in order not to run into this?
The text was updated successfully, but these errors were encountered:
Also, since I got this issue this morning, I'm unable to launch my script regardless of my account being fully functional, both on browser and phone. The API manages to log in correctly but it crashes due to
{"message": "feedback_required", "spam": true, "feedback_title": "Try Again Later", "feedback_message": "We limit how often you can do certain things on Instagram to protect our community. Tell us if you think we made a mistake.", "feedback_url": "repute/report_problem/scraping/", "feedback_appeal_label": "Tell us", "feedback_ignore_label": "OK", "feedback_action": "report_problem", "status": "fail"}
However, I'm able to visit this endpoint on browser even after loggin in so it looks like they flagged one of the headers maybe.
EDIT: I'm not sure why but for this specific issue, I had to include "ds_user_id" in the cookies jar. I fixed it by editing line 179 to the following:
That cookie is probably not necessary in most cases but apparently it was in mine, so I reckon it wouldn't hurt to edit the code to add it for everyone.
First of all, thanks @b31ngd3v for building this API.
I recently built a quick script to view accounts' stories in loop. Here's the code
After a few minutes, my script gets detected and I'm required to change my instagram password due to "a suspiscious login attempt". Does anyone know what IG's rate limits are & what my sleep times should be in order not to run into this?
The text was updated successfully, but these errors were encountered: