Coder Social home page Coder Social logo

shine-jayakumar / insta-likecom-bot Goto Github PK

View Code? Open in Web Editor NEW
119.0 9.0 29.0 33.72 MB

Automates likes and comments on an instagram account or tag

License: MIT License

Python 98.92% Shell 1.08%
instabot instagram-bot instagram-like-app instagram-liker instabot-py instagram-commenter insta-liker insta-likecom-bot instagram-post-liker insta-bot

insta-likecom-bot's Introduction

insta-likecom-bot

License Open Source Version Issues ClosedIssues Contributors LastCommit TotalCommits contributions welcome

Automates likes and comments on an instagram account or tag

insta-likecom-bot is an instagram bot written in python to automatically like and comment on an account or tag.

Table of Contents

Features

  • Interact with Posts (like, comment, like user comments)
  • Interact with Stories (like, comment)
  • Interact with Reels (like, comment, like user comments) [NEW] [version >= 3.0.4]
  • Like and Comment on posts from followers of an account
  • Softban limit check [NEW] [version >= 3.0.4]
  • Skip posts/reels already commented [NEW] [version >= 3.0.4]
  • Target only stories or reels (skip posts)
  • Specify the number of posts to like
  • Filter post based on tags
  • Filter posts within last n years, months, days, hours, mins, secs
  • Comes loaded with generic comments
  • Load your own comments
  • Comments supports emojis (full support with Firefox; only bmp characters with Chrome)
  • Add a PS to the comments (postscript)
  • Supports Chrome and Firefox
  • Headless mode
  • Supports profile - load parameters from a json file
  • Supports browser profile - save credentials to skip login
  • Target Most Recent posts (Deprecated)
  • Reloading target to view latest posts (Deprecated)

Requirements

  • Python 3
  • Chrome Browser / Firefox

View the requirements.txt

Installation

pip install -r requirements.txt

Options

Required arguments

Argument Description
username Instagram username
password Instagram password
target An instagram account or tag
limits json file defining daily/hourly limits

Optional Arguments

Option Description
-np , --numofposts number of posts to like
-ps , --postscript additional text to add after every comment
-c , --comments file containing comments (one comment per line)
-oc , --onecomment specify only one comment
-nc , --nocomments turn off comments
-sc, --skipcommented skip posts already commented
-lc, --likecomments like top n user comments per post
-ff, --findfollowers like/comment on posts from target's followers
-fa, --followersamount number of followers to process (default=all)
-il, --inlast target post within last n days (default=all) ex. 1y, 2M, 3d, 4h, 53m, 10s
-vs, --viewstory view stories
-ls, --likestory like stories (default=all)
-cs, --commentstory comments on stories (no comments if option not used)
-os, --onlystory target only stories and not posts
-nr, --numofreels number of reels to like
-nrc, --noreelcomments turn off reel comments
-lrc, --likereelcomments like top n user comments per reel
-or, --onlyreels target only reels and not posts
-mr, --mostrecent target most recent posts
-rr, --reloadrepeat reload the target n times (used with -mr)
-mt, --matchtags read tags to match from a file
-mn, --matchtagnum minimum tag match count for post to be qualified
-ma, --matchalltags match all tags in matchtags
-lm, --limits json file with limits configuration
-et , --eltimeout max time to wait for elements to be loaded (default=30)
-d , --delay time to wait while moving from one post to another
-br, --browser browser to use [chrome or firefox] (default=chrome)
-pr, --profile loads profile from a json file
-bp, --brprofile loads chrome profile from a path

Usage

To like and comment every post

ilcbot.py -u yourusername -p yourpassword -t thetarget --limits limits.json

To like and comment on stories

ilcbot.py -u yourusername -p yourpassword -t thetarget -ls -cs 20 -lm limits.json

To like and comment on reels

ilcbot.py -u yourusername -p yourpassword -t thetarget -nr 10 -lm limits.json

To specify number of posts to like

ilcbot.py -u yourusername -p yourpassword -t thetarget -np NOOFPOSTS -lm limits.json

To like and comment on posts from target's followers

ilcbot.py -u yourusername -p yourpassword -t thetarget -np NOOFPOSTS -ff -lm limits.json

To specify a delay

ilcbot.py -u yourusername -p yourpassword -t thetarget -d DELAY -lm limits.json
ilcbot.py -u yourusername -p yourpassword -t thetarget -d start,end -lm limits.json

To specify a file with comments

ilcbot.py -u yourusername -p yourpassword -t thetarget -c FILE -lm limits.json

To specify only one comment

ilcbot.py -u yourusername -p yourpassword -t thetarget -oc TEXT -lm limits.json

To add a text to the end of every comment

ilcbot.py -u yourusername -p yourpassword -t thetarget -ps TEXT -lm limits.json

To leave no comments

ilcbot.py -u yourusername -p yourpassword -t thetarget -nc -lm limits.json

To like comments from other users

ilcbot.py -u yourusername -p yourpassword -t thetarget -ls 5 -lm limits.json

To filter posts within last 2 days

ilcbot.py -u yourusername -p yourpassword -t thetarget -il 2d -lm limits.json

To filter posts within last 5 months

ilcbot.py -u yourusername -p yourpassword -t thetarget -il 5M -lm limits.json

To filter posts within last 3 years

ilcbot.py -u yourusername -p yourpassword -t thetarget -il 3y -lm limits.json

To target most recent posts

ilcbot.py -u yourusername -p yourpassword -t thetarget -mr -lm limits.json

To reload target 5 times with most recent posts

ilcbot.py -u yourusername -p yourpassword -t thetarget -mr -rr 5 -lm limits.json

To filter posts based on tags

ilcbot.py -u yourusername -p yourpassword -t thetarget --matchtags tags.txt -lm limits.json

To specify a browser

ilcbot.py -u yourusername -p yourpassword -t thetarget -br firefox -lm limits.json

To specify a profile

ilcbot.py -pr profile1.json -lm limits.json

To specify a browser profile

ilcbot.py -u yourusername -p yourpassword -t thetarget -bp '/path/to/Profile 1' -lm limits.json

Examples

ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk -np 5 -ff -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk -np 20 -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t "#haiku" -ps "Follow me @bob101" -c mycomments.txt -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t "#haiku" -oc "Hello there" -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk --delay 5 --numofposts 30 -lm limits.json
ilcbot.py -u 'bob101' -p 'b@bpassw0rd1' -t "#haiku" --delay 2,20 -lm limits.json
ilcbot.py --loadenv --delay 5 --numofposts 10 --headless --nocomments -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk -d 5 -np 30 -lc 5 -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk -np 30 -il 3h -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk -np 30 --matchtags tags.txt --ignoretags ignoretags.txt -lm limits.json
ilcbot.py -pr profile1.json -lm limits.json
ilcbot.py -u bob101 -p b@bpassw0rd1 -t elonmusk -np 30 --brprofile '/path/to/Profile 1' -lm limits.json

Note: Enclose tagnames (#haiku) in double-quotes/single-quotes when running the script in PowerShell/Bash.

ilcbot.py -u bob101 -p b@bpassw0rd1 -t "#haiku" -ps "Follow me @bob101" -c mycomments.txt
ilcbot.py -u 'bob101' -p 'b@bpassw0rd1' -t "#haiku" -ps "Follow me @bob101" -c mycomments.txt

Sample profiles

{   
    "username": "bob01",
    "password":"passw0rd",
    "target": "targets.txt",
    "numofposts": "3",
    "matchtags": "tags.txt",
    "ignoretags": "ignore.txt",
    "comments": "comments.txt",
    "viewstory": true,
    "likestory": 1,
    "inlast": "3d",
    "delay": "5",
    "likecomments": 2,
    "nocomments": true
}
{   
    "username": "bob01",
    "password":"passw0rd",
    "target": ["#haikus", "#photography"],
    "numofposts": "3",
    "matchtags": ["#haiku", "#haikus", "#haikupoetry"],
    "ignoretags": ["#shorts"],
    "comments": "comments.txt",
    "viewstory": true,
    "likestory": 1,
    "inlast": "3d",
    "delay": "5",
    "likecomments": 2,
    "nocomments": true,
    "brprofile" : "/dir/dir1/Profile 1"
}
{   
    "username": "bob01",
    "password":"passw0rd",
    "target": "#photography",
    "numofposts": 2,
    "comments": ["Beautiful!", "Amazing!", "I can relate to this"],
    "delay": "5,20"
}

Sample target files
targets.txt

#haiku
#photography
bob01
elonmusk

Sample file with tags
tagstomatch.txt

#gym
#fitness
#stayfit
#healthylife
#workout

Sample file with comments
comments.txt

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ
๐Ÿ‘๐Ÿ‘
Beyond amazing ๐Ÿ˜
Youโ€™re the goat
This is fire ๐Ÿ”ฅ
Keep grinding ๐Ÿ’ช
Insane bro ๐Ÿ”ฅ
The shocker! ๐Ÿ˜ฎ
Such a beauty ๐Ÿ˜โค๏ธ

Sample limits configuration file
instalimits.json

{
    "daily": {
        "likes": 1000,
        "stories": 1000,
        "story_likes": 600,
        "comment_likes": 1500,
        "accounts": 800,
        "comments": 1000
    },
    "hourly": {
        "likes": 350,
        "accounts": 120,
        "comments": 200
    }
}

Version Updates

Version v.3.0.7 (latest)

Bug Fixes:

  • issue # 119 and issue # 118 (dataclass initiation error while assigining another dataclass as default value)
  • updated locators.py
  • updated locators.json
  • updated is_story_present() method

Version v.3.0.6

Bug Fixes:

  • DOM locators for like, comment, comment disabled updated
  • Issues #118, #119 fixed

Version v.3.0.5

Changes:

  • DOM locators isolated to a .json file
  • Fetches latest version of locators from repo

Bug Fixes:

  • Updated DOM locators for Instagram elements
  • Issue fixed: Skip posts/reels already commented - Doesn't work #113
  • Issue fixed: Unable to interact with Reels #105
  • Issue fixed: Unable To Like And Comment On Stories #104
  • Issue fixed: Error when story comment is disabled #101

Version v.3.0.4

Feature addition:

  • Reels interaction added
  • Softban limit check added
  • Skip already commented posts/reels
  • Persistent stats

Changes:

  • Introduced InstaWorkFlow class
  • Added unit testing
  • Updated Stats class - Auto exit on exceeding limits

Bug Fixes:

  • auto creation of logs directory
  • xpaths for like, Save info buttons updated

Version v.3.0.3

Bug Fixes:

  • Webdriver manager upgraded, enabling script to find latest Chrome drivers
  • XPATH for 'like' button updated

Changes:

  • Using selenium Service class

Version v.3.0.2

Feature addition:

  • Supports Chrome browser profile - saves credentials
  • Supports profiles - loads arguments from a json file
  • Supports multiple targets - accepts file, list, or single value
  • Delay parameter can accept a range (2-20) or single value (20)
  • Ignoretags parameter - skip posts with specific tags present
  • Matchtags, Ignoretags parameter accepts tags from a file, list, or as a single value

Changes:

  • Script renamed to 'ilcbot.py'
  • loadenv parameter deprecated

Version v.2.8

Feature addition:

  • added option -os, --onlystory - target only stories

Bug Fixes:

  • Private account check before opening stories
  • Check if story is present

Version v.2.7

Feature addition:

  • added option -ls, --likestory - to like stories
  • added option -cs, --commentstory - to comment on stories
  • added option -rr, --reloadrepeat - to reload target n times

FAQs


Issue

Report a bug or an issue

LICENSE

MIT

Donations

Buy Me A Coffee

insta-likecom-bot's People

Contributors

m345054 avatar shine-jayakumar avatar shinejayakumar108 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

insta-likecom-bot's Issues

[Feature Request] Engage only with Verified Accounts

Doing some tests I realized that verified accounts are not that hard to engange and get as followers. I saw on the console that the script can detect if the post or comment is made by a verified account.

Implementing something like -ov (Engage only with verified accounts) and the script will detect if the post or comment is liking is made by a verified account.

EDIT:

Another option to get this done without complicating it is with the -ff option, for example:

-t "targetuser" -ov -ff -fa 600 -ls -nc -np 1

The list of username will start collecting the users but only the ones with verified badge that follow that account and then engage with those accounts.

=> Getting updated list of username divs
[] => Processing userdiv range: 426 - 444
[
] => Total username count: 250

[Feature Request] Most Recent Filter for Explore/Tags Page (crazy hack)

Hi, doing tests with your script and manual tests I realized a hidden hack to get massive followers. Your previous build allows to filter post not older than X days but there is a better way to this done and also has like 400% increase in followers because the users are online at the moment of the action.

The steps to get this done are as follow:

New parameter (-rp "Engage with recent posts only")

  1. Script visits https://www.instagram.com/explore/tags/travel/ (#travel will be the tag in this case)
  2. It ignores the "Top Posts" and scrolls down to where it says "Most Recent"
  3. It stars engaging with those recent posts. The big difference and the magic is that if you check all the posts have "created seconds ago". I manually did like a few of them and the results were incredible because most of those users just posted the content and follow back since they are online while we do the engagement.
  4. After 10-20 posts processed refresh the page and start from the "Most Recent" again. This step is very important, because it will be engaging always with the latest posts which are created "seconds/minutes ago"

image

image

[BUG] Option to like stories shows error

[*] => [pause_story] Error: TimeoutException
[*] => [get_total_stories] Error: TimeoutException

Am I putting the command wrong? I can't find a way to make this feature work, I am checking the browser and some users have stories but it doesn't open the stories.

This is the command I am using:

python3 instalikecombot.py -u myuser -p mypass -t "komodoloungemiami" -ff -ls -nc -fa 600 -np 1

EDIT:
It likes some stories, but not sure why others it wont detect it. Can you add in the console when it views and also when it likes a story successfully?

Won't go past "Save your login info?"

Hi,

Thanks for making this.
It's been working flawlessly since I started using it a few weeks ago.
This morning when I tried using it, it can not seem to get past the save your login info screen "popup".

I get this error in the command prompt.

[*] => Script ended with error : Failed to login. Incorrect username/password, or 2 factor verification is active. Traceback (most recent call last):

And here is a screenshot of the popup at login.

I have not changed anything account wise.

Screenshot 2022-10-28 121912

Any ideas on how to fix this on my end?

Thanks!

[Question] Script automation

Hello,

Has anyone been able to automate this script? Let's say to run automatically everyday at 10 PM with X parameters?

Read Comments and Repost ?

Is it working to read a comment were i was linked or tagged and then repost to it with a comment from this post? the bot have to read the comments section and use the same what the other users writes and tag a friend of mine

structure

see i got a comment from user xy he writes inside a post

i think it is .... @Myname

bot go to this post and wirte the same
i think it is .... @nameof a friend

Emojis do not work in comments | Two feature requests

Hello, loving all the new updates. The bot works flawlessly! I have one issue and two feature suggestions.

I've noticed that the bot throws an error when a comment from the list is only emojis. For example "๐Ÿ˜๐Ÿ‘Œ".

Here's the error:

Traceback (most recent call last):
  File "C:\Users\Legion\AppData\Local\Programs\Python\Python310\lib\logging\__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
  File "C:\Users\Legion\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 92-94: character maps to <undefined>
Call stack:
  File "D:\InstaBot 2\insta-likecom-bot\instalikecombot.py", line 418, in <module>
    logger.info(f'[target: {target}] Commented: {random_comment}')
Message: '[target: #midjourney] Commented: ๐Ÿ˜๐Ÿ‘Œ๐Ÿ‘Œ'
Arguments: ()

Can this be fixed?

Suggestions:

  • Is there a way to prevent the bot from commenting on the same user more than once when exploring hashtags? Or does it already do this?
  • This may seem weird but I would like the bot to avoid interacting with posts with certain hashtags that can be defined in a text file.

I will keep this same thread to add other feature requests if I can think of any.

Keep up the amazing work on this!

Is it possible to like&comment on followers of a target?

Hey there! First of all i want to thank you for this amazing bot! I think right now this is the only one that works, well done!

However, I was wondering if it is possible to target followers of lets say "Elon Musk" and like&comment on their content.
I'm sure that it would increase the effectivity of the bot tremendously.

I hope to hear from you soon :)

Match at least 2 or 3 hashtags from a list

Hi there, is it possible to make this tool interact (like/comment) with posts that match a minimum of 2 or 3 tags from a pre-defined list? This is to narrow down the content that would be more relevant to me.

[Question] List by Recent instead of Top tags

Testing the script it looks like it always loads the "top" filter for tags. Is there a way to filter by "recent" instead since engagement is way higher there since posts are more fresh.

image

Post Date constraint for like/comment

It would be great if the bot has the ability to limit likes/comments to posts of a certain age. Example: Only like 1 post per account if it was posted in the last 7 days. No one wants to like the last post from 2019 ๐Ÿคฃ

[Feature Request] Target "Related" Accounts

The user provide the target of an account example: -t cristiano and the bot will interact with related accounts. This method is more safe than the "-ff" which causes almost certantly a softban after 110 requests.

The related accounts can be seen once you open a profile and click on:
image

The main benefit of "related accounts" is that it shows relatable accounts to the audience you are looking for without risking a softban since is a natural navigation.

The command could be something like:

-ra (Target related accounts)
python3 instalikecombot.py -u user -p pass -t "cristianoronald" -ra 

after deployed on heroku get error

Hi Shine J,
I'm trying to deploy this project to heroku ,
after done with app.json schema as below :
{
"name": "insta-likecom-bot",
"description": "Automates likes and comments on an instagram account or tag",
"repository": "https://github.com/elmirarokni/insta-likecom-bot",
"buildpacks": [
{
"url": "heroku/python"
},
{
"url": "https://github.com/heroku/heroku-buildpack-chromedriver"
},
{
"url": "https://github.com/heroku/heroku-buildpack-google-chrome"
}
],
"env": {
"CHROMEDRIVER_PATH": {
"description": "DON'T CHANGE 'Chromedriver path' DON'T CHANGE",
"value": "/app/.chromedriver/bin/chromedriver",
"required": true
},
"GOOGLE_CHROME_BIN": {
"description": "DON'T CHANGE 'Google Chrome path' DON'T CHANGE",
"value": "/app/.apt/usr/bin/google-chrome",
"required": true
}
}
}

my dyno runtime error log is :
2022-05-30T10:37:01.754636+00:00 app[api]: Initial release by user [email protected]
2022-05-30T10:37:02.302430+00:00 app[api]: Release v2 created by user [email protected]
2022-05-30T10:37:02.302430+00:00 app[api]: Set CHROMEDRIVER_PATH, GOOGLE_CHROME_BIN config vars by user [email protected]
2022-05-30T10:37:02.937647+00:00 app[api]: Release v3 created by user [email protected]
2022-05-30T10:37:02.937647+00:00 app[api]: Enable Logplex by user [email protected]
2022-05-30T10:37:03.000000+00:00 app[api]: Build started by user [email protected]
2022-05-30T10:38:25.303891+00:00 app[api]: Deploy by user [email protected]
2022-05-30T10:38:25.303891+00:00 app[api]: Release v4 created by user [email protected]
2022-05-30T10:38:40.000000+00:00 app[api]: Build succeeded
2022-05-30T10:38:52.194243+00:00 app[api]: Scaled to worker@1:Free by user [email protected]
2022-05-30T10:39:02.219480+00:00 heroku[worker.1]: Starting process with command python instalikecombot.py postperpet UPryZD3SVizGF9x manotoofficial -br firefox -ps "test" -c mycomments.txt
2022-05-30T10:39:02.832430+00:00 heroku[worker.1]: State changed from starting to up
2022-05-30T10:39:03.195401+00:00 app[worker.1]:
2022-05-30T10:39:03.195417+00:00 app[worker.1]: ___ _ _ ___ _____ _ _ ___ _ _____ ___ ___ __ __ ___ ___ _____
2022-05-30T10:39:03.195417+00:00 app[worker.1]: |_ | | / | /\ | | | | |/ | / / _ | / || _ )/ _ | |
2022-05-30T10:39:03.195417+00:00 app[worker.1]: | || .` _
\ | |/ _ |
| |
| || ' <| | (| () | |/| || _ | () || |
2022-05-30T10:39:03.195417+00:00 app[worker.1]: |
||_|/ |// _\ ||||_|__/|| || |/_/ |_|
2022-05-30T10:39:03.195418+00:00 app[worker.1]:
2022-05-30T10:39:03.195418+00:00 app[worker.1]: insta-likecom-bot v.1.4
2022-05-30T10:39:03.195419+00:00 app[worker.1]: Automates likes and comments on an instagram account or tag
2022-05-30T10:39:03.195419+00:00 app[worker.1]:
2022-05-30T10:39:03.195419+00:00 app[worker.1]: Author: Shine Jayakumar
2022-05-30T10:39:03.195419+00:00 app[worker.1]: Github: https://github.com/shine-jayakumar
2022-05-30T10:39:03.195420+00:00 app[worker.1]:
2022-05-30T10:39:03.195431+00:00 app[worker.1]:
2022-05-30T10:39:03.195511+00:00 app[worker.1]: [] => Script started
2022-05-30T10:39:03.195621+00:00 app[worker.1]: [
] => Loaded comments from mycomments.txt
2022-05-30T10:39:03.195666+00:00 app[worker.1]: [] => Downloading webdriver for your version of Firefox
2022-05-30T10:39:03.195705+00:00 app[worker.1]: [
] => Initializing instagram user
2022-05-30T10:39:04.425421+00:00 app[worker.1]: [*] => Script ended with error : Message: Expected browser binary location, but unable to find binary in default location, no 'moz:firefoxOptions.binary' capability provided, and no binary flag set on the command line
2022-05-30T10:39:04.425441+00:00 app[worker.1]:
2022-05-30T10:39:04.426431+00:00 app[worker.1]: Traceback (most recent call last):
2022-05-30T10:39:04.426434+00:00 app[worker.1]: File "/app/instalikecombot.py", line 211, in
2022-05-30T10:39:04.426639+00:00 app[worker.1]: insta.quit()
2022-05-30T10:39:04.426677+00:00 app[worker.1]: NameError: name 'insta' is not defined. Did you mean: 'Insta'?
2022-05-30T10:39:04.561341+00:00 heroku[worker.1]: Process exited with status 1
2022-05-30T10:39:05.008277+00:00 heroku[worker.1]: State changed from up to crashed

please make changes on code to work fine with heroku buildpacks :
https://github.com/heroku/heroku-buildpack-chromedriver
https://github.com/heroku/heroku-buildpack-google-chrome

waiting for your response
finest regards

Attempting to Login

Why i receive the error "Failed to login. Incorrect username/password, or 2 factor verification is active.", even i can login sucessfully ?

The error is shown after my feed appear in the screen.

Bellow there's my error message and script.

Script: py instalikecombot.py myusername mypassword "#netgeo" -np 20

Error: Script ended with error : Failed to login. Incorrect username/password, or 2 factor verification is active.
[*] => Total time taken: 37.839 seconds

next_post(self): not working on firefox.

self.driver.find_element(By.TAG_NAME, 'body').send_keys(Keys.RIGHT)

is not working in the next_post(self) function. I have tried playing around with it to get a fix and still doesn't work at all, the function is being called but it seems Firefox driver doesn't response to arrow key press?

[Account Control] Count and Limit the amount of events from the script

I am currently talking with Facebook Creator Team (my account is legacy verified) and I am discussing the reason my account was restricted from "liking posts". The reason is obvious, this script was overused by me, so I am wondering if we can add a way to control this โ€”ย here are some suggestions:

image

  1. Make the script count all actions, so far IG seems to treat the restrictions differently based on the action for example:
  • View Profile (~800-1000 a day for my account, other might differ)
  • Like Post (~400-600)
  • Like Comments (~600-800)
  • View Story (no idea)
  • Like Story (no idea)
  1. Stop the script as soon as the Block alert is shown by Instagram:

image

@shine-jayakumar just adding another screenshot of a different softban message, this appears after opening too many profiles (specially using -ff):

image

<div class="_a9-v"><div class="_a9-y"><span class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x x1i0vuye x1ms8i2q xo1l8bm x5n08af x4zkp8e xw06pyt x10wh9bi x1wdrske x8viiok x18hxmgj" style="line-height: var(--base-line-clamp-line-height); --base-line-clamp-line-height:25px;">Try Again Later</span><span class="x1lliihq x1plvlek xryxfnj x1n2onr6 x193iq5w xeuugli x1fj9vlw x13faqbe x1vvkbs x1s928wv xhkezso x1gmr53x x1cpjm7i x1fgarty x1943h6x x1i0vuye xvs91rp xo1l8bm x1roi4f4 x1tu3fi x3x7a5m x10wh9bi x1wdrske x8viiok x18hxmgj" style="line-height: var(--base-line-clamp-line-height); --base-line-clamp-line-height:18px;">We restrict certain activity to protect our community.</span></div><div class="_a9-z"><button class="_a9-- _a9_0" tabindex="0">Report a problem</button><button class="_a9-- _a9_1" tabindex="0">OK</button></div></div>

  1. Rework the --delay option , for example by default it selects a random number of seconds but if you add -d 15 then it waits exact 15 seconds to perform next action. The most "human-like" solution I believe should be to change delay like this:

-d 15 = Wait 15 seconds (like it is now)
-d 0-15 = Wait randomly seconds between 0 and 15
-d 10-40 = Wait randomly between 10 to 40 seconds

This way the script will act less exact and more human-like

  1. Make the script share the total actions performed as it works, like a "status" so we can see if we are going over the limit and stop it.

[New Feature] Implement "Interact with Following"

Hi, the option to interact with followers is very good "-ff" but it causes a softban very quickly. another awesome feature that is almost the same should be the Interact with Following "-if" , which basically instead of looking at the "followers" of the account will look at the "following".

This is how the softban looks and it lasts 24 hours:

image

Fresh ubuntu install, all installed, still not working

Hello. That is what I have. Ubuntu 20.04 with all updates. Can you tell me where the problem is?

 ___ _  _ ___ _____ _      _    ___ _  _____ ___ ___  __  __     ___  ___ _____ 
|_ _| \| / __|_   _/_\ ___| |  |_ _| |/ | __/ __/ _ \|  \/  |___| _ )/ _ |_   _|
 | || .` \__ \ | |/ _ |___| |__ | || ' <| _| (_| (_) | |\/| |___| _ | (_) || |  
|___|_|\_|___/ |_/_/ \_\  |____|___|_|\_|___\___\___/|_|  |_|   |___/\___/ |_|  

insta-likecom-bot v.1.4
Automates likes and comments on an instagram account or tag

Author: Shine Jayakumar
Github: https://github.com/shine-jayakumar

[] => Script started
[
] => Downloading webdriver for your version of Chrome
[] => Initializing instagram user
[
] => Script ended with error : Message: unknown error: Chrome failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Stacktrace:
#0 0x5638624ed403
#1 0x5638622f3778
#2 0x563862317fa9
#3 0x56386231312b
#4 0x56386234e83a
#5 0x5638623488f3
#6 0x56386231e0d8
#7 0x56386231f205
#8 0x563862534e3d
#9 0x563862537db6
#10 0x56386251e13e
#11 0x5638625389b5
#12 0x563862512970
#13 0x563862555228
#14 0x5638625553bf
#15 0x56386256fabe
#16 0x7faa164c6609

Traceback (most recent call last):
File "instalikecombot.py", line 274, in
insta.quit()
AttributeError: 'NoneType' object has no attribute 'quit'

cant login

[] => Validating login with xpath: //img[contains(@alt, " profile picture")]
[
] => Could not find user's profile with xpath: //img[contains(@alt, " profile picture")]
[] => Validating login with xpath: //div[@Class="_acut"]/div/span/img
[
] => Could not find user's profile with xpath: //div[@Class="_acut"]/div/span/img
[] => Validating login with xpath: //img[@data-testid="user-avatar"]
[
] => Could not find user's profile with xpath: //img[@data-testid="user-avatar"]
[] => Script ended with error : Failed to login. Incorrect username/password, or 2 factor verification is active.
[
] => Total time taken: 94.316 seconds

error

Invalid tag or account

Hi, what could be causing this issue and making the bot stop?

[*] => Script started
[*] => Loaded comments from mycomments.txt
[*] => Downloading webdriver for your version of Chrome
[*] => Initializing instagram user
[*] => Setting target to: #photography
[*] => Attempting to log in with username
[*] => Validating login with xpath: //img[contains(@alt, " profile picture")]
[*] => Login successful
[*] => Opening target #photography
[*] => [open_target]: Attempt - 1
[*] => Invalid tag or account: #photography
[*] => Script ended with error : Invalid tag or account : #photography
[*] => Total time taken: 42.8285 seconds

Here's the parameters
-u username -p password -t "#photography" -np 120 -mt tags.txt -mn 2 -c mycomments.txt

[Improvement] Save Session for Two-Factor Authentication

The script doesn't save the session or clicks on "Save Info" when two factor is enable so everytime there is a change on the script the SMS has to be validated:

image

After login it the first time I would select the "Save Info" but it doesn't work because it seems like the session is reset everytime the script runs.

proxy?

So im just experimenting around and i added a userlist/pasword list so i can have multiple accounts liking the same post. Problem is that im sure they will get banned if i keep doing it. Is there an easy way to use proxy and how would i go about implementing it ? Any resources i should look into?

Error: [AttributeError] - 'list' object has no attribute 'startswith'`

[*] => Script started [*] => Downloading webdriver for your version of Chrome [*] => Loading Instagram [*] => Delay: 3-15 secs [*] => Max. comments to like: 2 [*] => Using profile: /Users/jaime/Library/Application Support/Google/Chrome/Default [*] => Launching Instagram [*] => [launch_insta]: Attempt - 1 [*] => Checking if user is already logged in [*] => [Attempt# 1] Validating login [*] => Setting target to: ['#haiku', '#photography', 'bob01', 'elonmusk'] [*] => Script ended with error [*] => Error: [AttributeError] - 'list' object has no attribute 'startswith'

Hi Getting this error, I used the sample targets you have.

This is how the profile looks:

{ "username": "asdad", "password":"asdasd", "target": "/Users/asdasd/Documents/ig-zerg/forbes-clean.json", "numofposts": "1", "viewstory": true, "likestory": 1, "likecomments": 2, "nocomments": true, "delay": "3,15", "brprofile" : "/Users/assda/Library/Application Support/Google/Chrome/Default" }

Also, the script is leaving comments on stories even with the "nocomment" set in true.

Tag!

Hi!

How can I enable the script to like and comment by tag?! I tried but it doesn't work:

python instalikecombot.py bob101 b@bpassw0rd1 #haiku -ps "Follow me @Bob101" -c mycomments.txt

PS C:\Users\aorek\Desktop\Python Bots\insta-likecom-bot-master\insta-likecom-bot-master> python instalikecombot.py bob101 b@bpassw0rd1 #haiku -ps "Follow me @Bob101" -c mycomments.txt
usage: instalikecombot.py [-h] [-np NOOFPOSTS] [-ps TEXT] [-c FILE | -nc] [-d DELAY | -cz] username password target
instalikecombot: error: the following arguments are required: target
PS C:\Users\aorek\Desktop\Python Bots\insta-likecom-bot-master\insta-likecom-bot-master>

Failed to login. Incorrect username/password

When I run the script, I get the error:
python3 instalikecombot.py --loadenv --delay 5 --numofposts 10 --headless --nocomments -br firefox
[:294]:[ERROR]:Script ended with error : Failed to login. Incorrect username/password, or 2 factor verification is active.

I have disabled the 2 factor authentication.
The access data are stored in the .env.
I tested it with two IG accounts.

If I use the command:
instalikecombot.py -u yourusername -p yourpassword -t thetarget
[1] 15967
-bash: yourpassword: command not found
root@insta:/home/insta-likecom-bot# Error: username, password, and target are required.

Do you have any delay on the code?

Even I cant go further from the first stage :/

[] => Script ended with error : Failed to login. Incorrect username/password, or 2 factor verification is active.
[
] => Total time taken: 4.4608 seconds

what I see in the Chrome is asking a question on the screen and dont allow me to answer that and it failed :/

Errow while running with hashtag

[] => Finding Not Now button with xpath: //button[text()="Not now"]
[
] => Do not save login info: True
[] => Opening target #koramangala
[
] => [open_target]: Attempt - 1
[] => [target: #koramangala] No. of posts found: 162638
[
] => [target: #koramangala] Checking if #koramangala is a private account
[] => Failed to find text: This account is private
[
] => Failed to find text: This Account is private
[] => Failed to find text: This Account is Private
[
] => [target: #koramangala] Account not private
[] => [target: #koramangala] Opening first post
[
] => [target: #koramangala] Number of posts to like: 10
[] => [target: #koramangala] Liking post: 1
[
] => [like]: Attempt - 1
[*] => [like]: Attempt - 2

Login failure with Chrom/Firefox/headless

Hey everyone,

I got issues while login.

[2023-03-28 09:19:15,800]:[main]:[:144]:[INFO]:Script started
[2023-03-28 09:19:15,800]:[main]:[:157]:[INFO]:Downloading webdriver for your version of Chrome
[2023-03-28 09:19:15,801]:[main]:[:159]:[INFO]:Initializing instagram user
[2023-03-28 09:19:18,123]:[main]:[:168]:[INFO]:Setting target to: 'target'
[2023-03-28 09:19:18,123]:[main]:[:182]:[INFO]:Attempting to log in with 'username'
[2023-03-28 09:19:20,097]:[main]:[:294]:[ERROR]:Script ended with error : Failed to login. Incorrect username/password, or 2 factor verification is active.
[2023-03-28 09:19:22,168]:[main]:[:300]:[INFO]:Total time taken: 6.3697 seconds


Command I used:
python instalikecombot.py --loadenv --delay 5 --numofposts 10 --nocomments

Also tried it with -u user -p password, headless, forcing firefox etc.

My Credentials are working, I logged in manual with both browsers, no 2FA.
Are you still working on this project and could help me?

Thanks!

change in the path to make comments

First I would like to praise your work, I spent the last few days researching and developing a solution similar to yours, but much less professional. I believe I have come across the same problem as you:
the use of SELENIUM and changes in function paths.
I believe that in the current version, he is not able to locate the comments field.
"
[] => [target: love] Commenting on the post
[
] => [comment]: Attempt - 1
[] => [comment]: Attempt - 2
[
] => [comment]: Attempt - 3
[] => [comment]: Attempt - 4
[
] => [target: love] Moving on to the next post
"

Is there any way to automate updating paths?

Again, congratulations on the job.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.