instauto.bot package
- class instauto.bot.Bot(username: Optional[str] = None, password: Optional[str] = None, client: Optional[ApiClient] = None, delay_between_action: float = 2.0, delay_variance: float = 0.0)
- __init__(username: Optional[str] = None, password: Optional[str] = None, client: Optional[ApiClient] = None, delay_between_action: float = 2.0, delay_variance: float = 0.0) None
Initiate a new Bot instance.
- Parameters
username – the username of the account
password – the password of the account
client – the ApiClient instance the Bot communicates with. If given, it will take precedence over credentials.
delay_between_action – the amount of seconds to wait between actions (each like, follow, etc. is an action)
delay_variance – the amount of variance to add to the delay. Delay will be random number between (delay - variance) - (delay + variance).
- comment(chance: int, amount: int, comments: List[str]) Bot
Comment on posts of users retrieved with the Input pipeline.
- Parameters
chance – integer between 0 and 100, represents a percentage between 0 and 100%. Defines the chance of this action being called for an account. Set to 25 to call on 1/4 of all accounts, 50 for 1/2 of all accounts, etc.
amount – The amount of posts to comment on, if this action is being called for an account.
comments – A random selected entry out of this list will be used as text to comment.
- follow(chance: int) Bot
Follow users retrieved with the Input pipeline.
- Parameters
chance – integer between 0 and 100, represents a percentage between 0 and 100%. Defines the chance of this action being called for an account. Set to 25 to call on 1/4 of all accounts, 50 for 1/2 of all accounts, etc.
- classmethod from_client(client: ApiClient, delay_between_action: float = 2.0, delay_variance: float = 0.0) Bot
- like(chance: int, amount: int) Bot
Like posts of users retrieved with the Input pipeline.
- Parameters
chance – integer between 0 and 100, represents a percentage between 0 and 100%. Defines the chance of this action being called for an account. Set to 25 to call on 1/4 of all accounts, 50 for 1/2 of all accounts, etc.
amount – The amount of posts to like, if this action is being called for an account.
- start()
Start the bot.
Once the bot is started, it will run until it went through all retrieved accounts, or if the stop attribute is set to True.
- class instauto.bot.Input(client: ApiClient)
- from_commenters_of(account_name: str, limit: int) Input
Retrieves accounts that have commented on recent posts of account_name.
- Parameters
account_name – the account to retrieve from
limit – the amount of accounts to retrieve
- from_followers_of(account_name: str, limit: int) Input
Retrieves accounts that follow account_name.
- Parameters
account_name – the account to retrieve from
limit – the amount of accounts to retrieve
- from_following_of(account_name: str, limit: int) Input
Retrieves accounts that account_name follows.
- Parameters
account_name – the account to retrieve from
limit – the amount of accounts to retrieve
- from_likers_of(account_name: str, limit: int) Input
Retrieves accounts that have liked recent posts of account_name.
- Parameters
account_name – the account to retrieve from
limit – the amount of accounts to retrieve
- from_user_list(accounts: List[User]) Input
Add supplied accounts to input
- Parameters
accounts – List of account objects (objects/user.json)
- get_posts(account_name: str, force: bool = False) List[Post]