Instapy: Failed to load desired amount of users! (using Interact with User Followers)

Created on 3 Oct 2018  路  23Comments  路  Source: timgrossmann/InstaPy

Expected Behavior

To load 150 users from specified user list and interact/like 2 posts.

Current Behavior

Loads 10-19 users and then closes. Sometimes session afterward is bugged and needs to restarted

Possible Solution (optional)

InstaPy configuration

# settings
session.set_relationship_bounds(enabled=True,
                                  delimit_by_numbers=True,
                                   max_followers=3000,
                                    min_followers=45,
                                    min_following=77)

# actions
session.set_user_interact(amount=2, randomize=True, percentage=20, media='Photo')

session.set_do_like(enabled=True, percentage=100)

session.set_do_comment(enabled=False, percentage=0)

session.set_do_follow(enabled=False, percentage=0)

session.follow_user_followers(['letmewalkaway'], amount=100, randomize=False, interact=True, sleep_delay=300)

Most helpful comment

Hi @Banginpadr @mantou777

I want to jump up into your conversation 馃槑 too!

Easy to achieve it, @Banginpadr!

CNN_followers = session.grab_followers(username="CNN", amount="full", live_match=False, store_locally=True)
session.interact_user_followers(usernames=CNN_followers, amount=800, randomize=True)

Also, although I am not aware of your style but I think you should put those settings above interact_user_followers feature.

_Settings must be located before activity otherwise those settings will not have any effect_.

## code code

# settings 
session.set_user_interact(amount=2, randomize=True, percentage=100, media='Photo')
session.set_do_follow(enabled=False, percentage=100)
session.set_do_like(enabled=True, percentage=100)
session.set_do_comment(enabled=True, percentage=100)
session.set_comments([u'Mi piacciono le tue foto, belle! \U0001F929', u'belle foto, carina questa! \U0001F917', u'Troppo bella questa ;)! \U0001F60D'])
session.set_comments(['ummm.. si mi piace questa, bel profilo! @{}'], media='Photo')

# activity
CNN_followers = session.grab_followers(username="CNN", amount="full", live_match=False, store_locally=True)
session.interact_user_followers(usernames=CNN_followers, amount=800, randomize=True)

## bot ends here

One more thing:

You have started set_comments 2 times repeatedly.
You should know that only the last line of of that setting will be accepted and all other previous lines will not taken into account:

session.set_comments([u'Mi piacciono le tue foto, belle! \U0001F929', u'belle foto, carina questa! \U0001F917', u'Troppo bella questa ;)! \U0001F60D'])   # LINE 1
session.set_comments(['ummm.. si mi piace questa, bel profilo! @{}'], media='Photo')   # LINE 2

LINE 1 will be dismissed and LINE 2 will set your comments.

What can you do?
Concatenate them into one line:

comments1 = [u'Mi piacciono le tue foto, belle! \U0001F929', u'belle foto, carina questa! \U0001F917', u'Troppo bella questa ;)! \U0001F60D']
comments2 = ['ummm.. si mi piace questa, bel profilo! @{}']
session.set_comments(comments=comments1+comments2, media='Photo')

Extra Notes:

  • You can find all information about relationship tools (_grabbing and picking user(s) data_) in the README with lots of examples written by me 馃槢
  • Learn about return types in programming. So that you start to understand functions calls & return results and no more wonder how to put CNN_followers into your interaction feature 馃槈 馃挭馃徏

@mantou777 it's a bit strange, right 馃 but it depends on your use case..


Cheers 馃榿

All 23 comments

That still happens to me too.
Even though script scrolls through quite a few users in the browser window, it then loads 8 or 10 or 9...

And it looks like this got even worse with the latest pull:

"Grabbed 0 followers for interaction"... Even though there are plenty for grabbing :)

I am not really using this feature :() Only scrapped users. And I am bad at xpaths soory can't help here.

Heh :(

having the same issue..and always fetching same people...

Yeah, does not get better... Gets 7-12 max, really rarely - the requested amount

@Tachenz This is what I'm doing now :)

grab follower list using below:
popeye_followers = session.grab_followers(username="Popeye", amount="full", live_match=True, store_locally=True)

put user list into below:
session.set_do_follow(enabled=False, percentage=50)
session.set_comments(["Cool", "Super!"])
session.set_do_comment(enabled=True, percentage=80)
session.set_do_like(True, percentage=70)
session.interact_by_users(['user1', 'user2', 'user3'], amount=5, randomize=True, media='Photo')

Hi mantou777,

Can you please explain how you put user list into relevant function? ow do you load the list to interact? Can you please share your template?

Thank you,
George

@GGaitanis

What I did was just a workaround(I don't have technical knowledge) I split into 2 steps:
First I collect the user's list using:
popeye_followers = session.grab_followers(username="Popeye", amount="full", live_match=True, store_locally=True)

It will be saved inside the logs folder.

Then I just copy the list and paste into:
session.set_do_follow(enabled=False, percentage=50)
session.set_comments(["Cool", "Super!"])
session.set_do_comment(enabled=True, percentage=80)
session.set_do_like(True, percentage=70)
session.interact_by_users(['user1', 'user2', 'user3'], amount=5, randomize=True, media='Photo')

I find this even better as I have more control.
Hope it helps.

@GGaitanis

What I did was just a workaround(I don't have technical knowledge) I split into 2 steps:
First I collect the user's list using:
popeye_followers = session.grab_followers(username="Popeye", amount="full", live_match=True, store_locally=True)

It will be saved inside the logs folder.

Then I just copy the list and paste into:
session.set_do_follow(enabled=False, percentage=50)
session.set_comments(["Cool", "Super!"])
session.set_do_comment(enabled=True, percentage=80)
session.set_do_like(True, percentage=70)
session.interact_by_users(['user1', 'user2', 'user3'], amount=5, randomize=True, media='Photo')

I find this even better as I have more control.
Hope it helps.

Can you be more specific with the code. That doesn't look like it's gonna work the way it was written there.

@lyndon91
I am merely just running 2 separate sessions using instructions from below.
https://github.com/timgrossmann/InstaPy#grab-followers-of-a-user
https://github.com/timgrossmann/InstaPy#interact-with-specific-users

what do you mean? with this you download all user's followers than you can only comment and like those people post? because this is what i want to do. but for some reason my script is only following those people even thought i have it enabled to false

@Banginpadr Are you talking to me? Yes download all user 1st. This is my code for liking photos only. I'm not sure why yours don't work..

""" Quickstart script for InstaPy usage """
# imports
from instapy import InstaPy
from instapy.util import smart_run

# login credentials
insta_username = '******'
insta_password = '******'

# get an InstaPy session!
# set headless_browser=True to run InstaPy in the background
session = InstaPy(username=insta_username,
                  password=insta_password,
                  headless_browser=True,
                  bypass_suspicious_attempt=False)

with smart_run(session):
    """ Activity flow """
    # settings
    session.set_simulation(enabled=False)
    session.set_relationship_bounds(enabled=True,
                 potency_ratio=-1,
                  delimit_by_numbers=False,
                   max_followers=None,
                    max_following=None,
                     min_followers=None,
                      min_following=None,
                       min_posts=None,
                         max_posts=None)
    session.set_quota_supervisor(enabled=True, 
                                 peak_likes=(250, 1500),
                                 sleep_after=["likes"], 
                                 sleepyhead=True, stochastic_flow=True, notify_me=True,
                                )
    session.set_skip_users(skip_private=True,
                       private_percentage=100,
                       skip_no_profile_pic=False,
                       no_profile_pic_percentage=100,
                       skip_business=True,
                       business_percentage=100,)
    # actions
    session.set_do_follow(enabled=False, percentage=50)
    session.set_comments(["Cool", "Super!"])
    session.set_do_comment(enabled=False, percentage=80)
    session.set_do_like(True, percentage=100)
    session.interact_by_users(["user_1", "user_2", "user_3"], amount=1, randomize=False, media='Photo')

@mantou777 yeah bro im lost. my goal is to download "CNN" followers then comment and like their photos but isnt working.. this is my quickstart.py..

""" Quickstart script for InstaPy usage """

imports

import random
import os
from instapy import InstaPy
from instapy.util import smart_run
import time
from tempfile import gettempdir
from selenium.common.exceptions import NoSuchElementException

login credentials

insta_username = '*'
insta_password =
*'

get an InstaPy session!

set headless_browser=True to run InstaPy in the background

session = InstaPy(username=insta_username,
password=insta_password,
headless_browser=False,
multi_logs=True)

with smart_run(session):
""" Activity flow """
# general settings
session.set_simulation(enabled=True)
session.set_relationship_bounds(enabled=True,
potency_ratio=None,
delimit_by_numbers=True,
max_followers=3000,
max_following=2000,
min_followers=45,
min_following=10)

# activity

session.grab_followers(username="CNN", amount="full", live_match=False, store_locally=True)
session.interact_user_followers(['CNN'], amount=800, randomize=True)
session.set_user_interact(amount=2, randomize=True, percentage=100, media='Photo')
session.set_do_follow(enabled=False, percentage=100)
session.set_do_like(enabled=True, percentage=100)
session.set_do_comment(enabled=True, percentage=100)
session.set_comments([u'Mi piacciono le tue foto, belle! \U0001F929', u'belle foto, carina questa! \U0001F917', u'Troppo bella questa ;)! \U0001F60D'])
session.set_comments(['ummm.. si mi piace questa, bel profilo! @{}'], media='Photo')

# end the bot session
session.end()

@mantou777 you said something about downloading a list then using it. how do you do that? i already download cnn users using session.grab..... then how do you add it the script?

@Banginpadr you are combining grabbing followers + interact with followers which looks abit strange...

Yes look at my script above, copy all your cnn users and replace ["user_1", "user_2", "user_3"] here
session.interact_by_users(["user_1", "user_2", "user_3"], amount=1, randomize=False, media='Photo')

Hi @Banginpadr @mantou777

I want to jump up into your conversation 馃槑 too!

Easy to achieve it, @Banginpadr!

CNN_followers = session.grab_followers(username="CNN", amount="full", live_match=False, store_locally=True)
session.interact_user_followers(usernames=CNN_followers, amount=800, randomize=True)

Also, although I am not aware of your style but I think you should put those settings above interact_user_followers feature.

_Settings must be located before activity otherwise those settings will not have any effect_.

## code code

# settings 
session.set_user_interact(amount=2, randomize=True, percentage=100, media='Photo')
session.set_do_follow(enabled=False, percentage=100)
session.set_do_like(enabled=True, percentage=100)
session.set_do_comment(enabled=True, percentage=100)
session.set_comments([u'Mi piacciono le tue foto, belle! \U0001F929', u'belle foto, carina questa! \U0001F917', u'Troppo bella questa ;)! \U0001F60D'])
session.set_comments(['ummm.. si mi piace questa, bel profilo! @{}'], media='Photo')

# activity
CNN_followers = session.grab_followers(username="CNN", amount="full", live_match=False, store_locally=True)
session.interact_user_followers(usernames=CNN_followers, amount=800, randomize=True)

## bot ends here

One more thing:

You have started set_comments 2 times repeatedly.
You should know that only the last line of of that setting will be accepted and all other previous lines will not taken into account:

session.set_comments([u'Mi piacciono le tue foto, belle! \U0001F929', u'belle foto, carina questa! \U0001F917', u'Troppo bella questa ;)! \U0001F60D'])   # LINE 1
session.set_comments(['ummm.. si mi piace questa, bel profilo! @{}'], media='Photo')   # LINE 2

LINE 1 will be dismissed and LINE 2 will set your comments.

What can you do?
Concatenate them into one line:

comments1 = [u'Mi piacciono le tue foto, belle! \U0001F929', u'belle foto, carina questa! \U0001F917', u'Troppo bella questa ;)! \U0001F60D']
comments2 = ['ummm.. si mi piace questa, bel profilo! @{}']
session.set_comments(comments=comments1+comments2, media='Photo')

Extra Notes:

  • You can find all information about relationship tools (_grabbing and picking user(s) data_) in the README with lots of examples written by me 馃槢
  • Learn about return types in programming. So that you start to understand functions calls & return results and no more wonder how to put CNN_followers into your interaction feature 馃槈 馃挭馃徏

@mantou777 it's a bit strange, right 馃 but it depends on your use case..


Cheers 馃榿

@uluQulu i dont even know how to thank you bro.

@mantou777 i know it is, but i was just trying to find a way to interact with peoples followers by only liking and commenting their photos not following them

Getting this for some reason

_Sorry, an error occurred: '<' not supported between instances of 'int' and 'str'_

with the same activity

CNN_followers = session.grab_followers(username="CNN", amount="full", live_match=False, store_locally=True)
session.interact_user_followers(usernames=CNN_followers, amount=800, randomize=True)

As far as I understand this is some kind of Python3.x TypeError, but have no idea where to look to fix it so any help will be appreciated!

I still get that annoying "grabbed 0 users to interact" with the latest build...

Inactive issue, reopen if you need assistance.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CodeMaster1 picture CodeMaster1  路  3Comments

harrypython picture harrypython  路  3Comments

Naramsim picture Naramsim  路  3Comments

ingorichter picture ingorichter  路  3Comments

ghost picture ghost  路  3Comments