Closed 0x366 closed 5 years ago
We've already had all the required functionality to view stories.
https://github.com/instagrambot/instabot/blob/master/instabot/api/api.py#L895
Is it possible to create an example of how this would be done in example files?
In the same vein of infinity_hashtag_liker.py ... perhaps infinity_story_viewer.py ? @EightShift
This code is must working... But, it does not work... I need help... Maybe you guys know whats wrong? @heyt0ny @ohld @elmissouri16
Similar issue: https://github.com/instagrambot/instabot/issues/938
@reslus, example is ⬇
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import time
sys.path.append(os.path.join(sys.path[0], '../../'))
from instabot import Bot, utils
HASHTAGS_FILE = "hashtag_database.txt".encode('utf-8')
username="INSTA_USERNAME"
password="INSTA_PASSWORD"
bot = Bot()
bot.login(username=username,
password=password")
random_hashtag_file = utils.file(HASHTAGS_FILE)
while True:
random_hashtag = random_hashtag_file.random()
users_list = bot.get_hashtag_users(random_hashtag)
reels = bot.api.get_users_reel(users_list)
bot.api.see_reels(reels)
time.sleep(1)
@EightShift same I don't know what problem I will try to debug it to see what causing this error when I get time
@EightShift @elmissouri16 also getting the same error...
We've already had all the required functionality to view stories.
https://github.com/instagrambot/instabot/blob/master/instabot/api/api.py#L895
Anyone else manage to get this working?
Something like this works:
from instabot import Bot
bot = Bot()
bot.login(**credentials)
def watch_story(uid):
reels = bot.get_user_reel(uid)
watched = False
if 'items' in reels.keys():
if len(reels['items']) > 0:
watched = True
bot.api.see_reels(reels=reels['items'])
return watched
def main():
# implement function that gets ids of users
uids = function_that_gets_user_ids()
for uid in uids:
_ = watch_story(uid)
if __name__ == "__main__":
main()
@heyt0ny thanks for sharing its working great I was wondering of limitation of how much you see of story per hour/ day if any idea from your experience
@heyt0ny thanks for sharing its working great I was wondering of limitation of how much you see of story per hour/ day if any idea from your experience
@elmissouri16 what function did you use?
@callum8004 the code thats share heyt0ny simply provide of list of users ids thats one on the main function and it should be working the only thing is suggesting uses a timer or implement your own way to delay watch each story
@elmissouri16 I keep getting the error:
NameError: global name 'function_that_gets_user_ids' is not defined
@callum8004 of course its well give error thats just example of function for getting users ids you have to implement your own to pull users ids
@callum8004 of course its well give error thats just example of function for getting users ids you have to implement your own to pull users ids
That's where I am stuck - do you have a complete example script for viewing stories? I'm not too sure how I will pull the user ID's.
@elmissouri16 seems like limitation is around 500k-800k story views per day. But be careful - I got banned within one day. I'm not sure why - but maybe because I was scrapping the uids and viewing stories from the same server.. Soo better to try with dummy account
@callum8004 You can get uids as all followers of user you like.
def get_followers(user_name):
user_id = bot.get_user_id_from_username(user_name)
_ = bot.api.get_total_followers_or_followings(user_id=user_id,
amount=1000,
which='followers',
to_file='followers_list.txt')
For example you want to view stories of all people, who follow gopro -> 1) get_followers('gopro') -> it will create 'followers_list.txt' with all the user_names 2) use these names as uids in the script in previous message
Be careful about instagram limits - you may be banned for that.
@heyt0ny yes got it thanks for the info
@elmissouri16 seems like limitation is around 500k-800k story views per day. But be careful - I got banned within one day. I'm not sure why - but maybe because I was scrapping the uids and viewing stories from the same server.. Soo better to try with dummy account
@callum8004 You can get uids as all followers of user you like.
def get_followers(user_name): user_id = bot.get_user_id_from_username(user_name) _ = bot.api.get_total_followers_or_followings(user_id=user_id, amount=1000, which='followers', to_file='followers_list.txt')
For example you want to view stories of all people, who follow gopro ->
- get_followers('gopro') -> it will create 'followers_list.txt' with all the user_names
- use these names as uids in the script in previous message
Be careful about instagram limits - you may be banned for that.
1) Thanks for your response @heyt0ny - is it possible you can paste your full script (obviously no credentials). I'm new to programming, have most of the basics down but seeing the full script will allow me to understand the logic of how this works a little more.
2) You mention a limitation of 500-800k would it be safe to limit this to say 200k and then my account will be potentially safer or because I'm scraping and viewing them on the same raspberry pi will I still receive a ban?
Have anybody example script "View Stories by Hashtags" ?
@heyt0ny i got error
`import os import sys import time import random
sys.path.append(os.path.join(sys.path[0], '../../')) from instabot import Bot
bot = Bot() bot.login()
def watch_story(uid): reels = bot.get_user_reel(uid) watched = False
if 'items' in reels.keys():
if len(reels['items']) > 0:
watched = True
bot.api.see_reels(reels=reels['items'])
return watched
def get_followers('gopro'): user_id = bot.get_user_id_from_username('gopro')
_ = bot.api.get_total_followers_or_followings(user_id=user_id,
amount=1000,
which='followers',
to_file='followers_list.txt')
def main():
uids = get_followers('aipmy')
for uid in user_id:
_ = watch_story(uid)
if name == "main": main()`
and i getting error : File "beta.py", line 26 def get_followers('gopro'): ^ SyntaxError: invalid syntax
Has someone noticed that after using for a while see_reels
it starts to return false and therefore not working anymore? Do you have any solution for this problem?
Hello!
How to mark insta stories as seen ? I found a lot of implementations of downloading stories on github. But there is no implementation of "viewing" story.
May be someone knows the url of such request?
I found such code on php - https://github.com/mgp25/Instagram-API/blob/849f81b3032c0c495ef4619aa8e6c9332b228502/src/Request/Internal.php#L1372