I'm Shine, a self-taught programmer.
What's cooking
- π Python Cookbook by Brian Jones and David M. Beazley
- π SOLID principles and Design Patterns
- AdiΓ³s ΒΏQuΓ© pasa
Automates likes and comments on an instagram account or tag
License: MIT License
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
Bot is not able to click on the first post once the target (account/tagname) has been opened.
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")
https://www.instagram.com/explore/tags/travel/
(#travel will be the tag in this case)Hello,
Has anyone been able to automate this script? Let's say to run automatically everyday at 10 PM with X parameters?
There was a problem with logging you in to Instagram. Please try again soon..
It is working in normal browser.
how to run multiple account in file .env
thanks
[*] => [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?
[] => 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
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 :)
Once logged in, Save Login Information dialogue box stays and not getting skipped automatically.
Possibly, the xpath got changed.
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:
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.
Script ends with error while retrieving posts for tags (ex: #netgeo)
It would be great if we could like/comment on accounts that we're following, not just accounts who follow us.
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?
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
[] => 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
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:
I will keep this same thread to add other feature requests if I can think of any.
Keep up the amazing work on this!
telegram info for dev?
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?
Comment appears in the comment box, however, unable to click post.
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.
[*] => 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.
Is it possible to comment from different accounts on the same post?
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 :/
Is there a way to like/view stories and also like first top 1-5 comments from posts on a tag?
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
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>
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.
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 π€£
Bot unable to like posts
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!
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:
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
just trys 4 times and skips
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.
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
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.
Any ideas on how to fix this on my end?
Thanks!
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:
@shine-jayakumar just adding another screenshot of a different softban message, this appears after opening too many profiles (specially using -ff):
<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>
-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
A
A wonderful Script and thanks for your work.
is there a way to add multiple Targets like a list of hashtags or profiles?
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
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'
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:
It shows also this error even when -nc is enabled:
[] => [comment_on_story] Error: WebDriverException
[] => [comment_on_story] Error: WebDriverException
Seems to be ignoring this value too:
"likestory": 2,
It likes all the stories instead of just 2
"viewstory": true, "likestory": 2, "likecomments": 2,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.