GithubHelp home page GithubHelp logo

fytex / instagram-giveaways-winner Goto Github PK

View Code? Open in Web Editor NEW
114.0 10.0 22.0 12.4 MB

Instagram Bot which when given a post url will spam mentions to increase the chances of winning. Win Instagram Giveaways!

License: MIT License

Python 100.00%
instagram instagram-bot instagram-scraper instagram-script giveaways winning cheating macros selenium selenium-python

instagram-giveaways-winner's Introduction

Instagram-Giveaways-Winner

GitHub top language GitHub tag (latest by date) GitHub last commit

Instagram Bot which when given a post url will spam mentions to increase the chances of winning

How does this bot work?

It works as a browser simulator using selenium. [Only tested on Windows]

At the beginning there are four steps (It will save data and avoid wasting your time):

  1. Log in
  2. Find post's owner
  3. Find followers/followings
  4. Start spamming mentions in the post

Pre-Setup Warning

Before installing you need to be aware that this folder contains binary files (.exe, .etc) inside drivers' folder from an old ChromeDriver's release for a wider compatibility.

But don't worry... if you feel unsafe you can download these files by yourself (just put there because there are people who can't do these by themselves).

  1. Go to chrome://settings/help and find out which is your Chrome's version
  2. Go to https://chromedriver.chromium.org/downloads and find the latest version which supports your Chrome's version.
  3. Download the one for your O.S.
  4. Pick the executable and put in drivers' folder.
  5. Replace and rename the executable with one that was already inside driver's folder depending on your O.S. (You can get rid of the ones that were already inside the folder)

Setup

  1. Install Google Chrome (Check Browser's category in config.ini if you want a different path) -> if you guys start complaining about this specific step I'll make some updates to have wider options
  2. Install Python 3.6+ (Don't forget to add in system variable PATH [You can tick the following checkbox Add Python 3.X to PATH while installing Python])
  3. Open terminal, change directory to Instagram-Giveaways-Winner's folder and type: pip install -r requirements.txt
  4. Edit config.ini (See next category)
  5. In the same terminal type: py script.py

Warning: Avoid resizing or touching the Browser opened. You can minimize if you want or if you want to get rid of it just change Window at Browser's category to False in config.ini

These commands can change depending on your configuration. Such as python/py/python3... or pip/pip3...

If you need help add me on discord or join the server and ask me (links in my profile's bio) :)

All settings/credentials can be changed in config.ini.

Browser's window can be invisible (in background) if Window's option is deactivated.

  • Login requires both username/email and password.

    • A cookie's data will be saved to login automatically in order to prevent repetitve actions.
  • Find post's owner will only occur if no User Target is specified in the file.

    • User Target is the user where the bot will search for followers/followings to mention.
    • The timeout is a way to prevent blocking while trying to log in by stopping the program.
  • Find followers/followings is where the bot searches and saves all followers/followings.

    • You can specify the limit of followers/followings (it will pick the lowest one between the limit and the number of followers/followings from the User Target).
    • First it will search if there are the limit number of followers/followings inside a file in a specific file in records (database)
    • If Force Search is disabled and there is no limit and a file was found then it uses that amount of followers/followings to mention.
    • If Force Search is enabled or there aren't enough followers/followers in the file or file doesn't exist it will search on Instagram (User Target's followers/followings) until it meets the limit. If no limit specified then searches for all of them.
    • In config.ini you can either choose to search for followers or followings.
    • The timeout is a way to prevent blocking while searching for followers/followings in case it gets stuck.
    • If you raise SIGNINT by pressing 'ctrl + c' in your keyboard. It will stop searching and will immediately save all followers/followings found into a file in records.
    • If you have a custom/specific file which you want to use just set the relative path at 'Specific File' in config.ini.
  • Start spamming mentions in the post is where all the fun begins. It starts spamming mentions in the post.

    • By enabling SaveOnly's option this step won't run. This option is used in case you only want to save the followers/followings and use them later.
    • You can edit the message and add as many mentions as you want (mentions will never be repeated).
      • Interval's category in config.ini file lets you choose how much time it waits before each comment. You have to find out by yourself the best interval that fits into your account. It has a min, max and weight so the number isn't always the same preventing Instagram finding out it is a bot. (The smaller the interval the higher the chance of having to wait to comment again because of Instagram's A.I.) (You have to play with these numbers until you find out the best interval range for you)
      • In case you have a char that doesn't belong to BMP (such as some emojis) it will appear a different message. But your message will still be sent. (Refresh when finished or open in another browser to check everything is fine)
    • By pressing 'ctrl+c' it raises SIGINT in order to stop the execution of the program.

How do the records (database) work?

There are two sections:

  • followers
  • followings

Depending on what you choose it will save in the respective directory. Then it will choose the file's name using the following format {User Target}.txt where User Target is the user where we got the followers/followings. By following the same pattern you see on the other records (@user in each line) you can create a custom file (E.g. custom.txt) and enable Specific File in config.ini (removing #) and changing the value to the path (E.g. records\custom.txt)

How do the cookies work (auto-login)?

When the program logs into your account it saves in a separated folder called cookies the correspondent cookie to use it in a next time. This prevents Instagram from blocking your account from suspicious activity because you logged in too many times.

Warnings:

I would recommend using an alternative account which you aren't afraid of losing because it could go wrong in the worst case. However I've never experienced any bad situations using this script.

Instagram has a comment's request rate-limit to avoid spamming. From my research it has an algorithm which varies from user to user. Since Instagram doesn't provide a time for reset we have to try every x seconds. In config.ini at Interval's category you can choose the range of the intervale by setting the minimum, maximum and the most probable number for the interval between comments (Better a range of numbers instead of always the same number in order to avoid being rate-limited). If a message pops up saying that it couldn't post the comment its because you hit that rate-limit so you just have to wait. (You don't have to do anything its all automatic but if this happens you should consider raising those intervals) If you want to be able to send more comments you have to make a good use of your account (following, commenting, liking, etc.). That's how Instagram's A.I.'s works.

Future Updates:

  • Add a followers/followings tracker so it won't repeat the count if we restart the bot
  • Find out the best interval between each comment for your account (This requires researching and planning by using a lot of my time. Don't see when this would release because I'm not being financially paid for this)
  • Compatibility with more browsers

Known Bugs:

	raise exception_class(message, screen, stacktrace)
		selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary
  • Since Chrome has updated their files' location, you need to keep Chrome's Driver updated in sync with Google Chrome. In this case just go back to Pre-Setup-Warning and follow the steps or alternately just check config.ini's Browser's Category to fix it.

instagram-giveaways-winner's People

Contributors

fytex 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  avatar

instagram-giveaways-winner's Issues

Issue

USB: usb_device_handle_win.cc:1054 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F)

And i think because of that cant post a comment.

Issue

Hi there wonderful script but i am facing a problem and i hope you can help me.
I want the script to go to a post and tag 2 accounts continuously.
I edited the config file and it works only if i put the accounts i want to be tagged with a "" in front of the "@"
So if i write the accounts like this "@randomaccount" it works but its posting also the ""
If i remove the "" so it will not be posted the bot closes as soon as it opens and sends 0 comments.
Do you know how i can fix it?
In my config file the 6th line where i put the expression is
" Expression = @account1 @account2 "
Thanks in advance.

Mentions

Can there be a range (int) of how manny mentions it should do in comments? Because some giveaways require like 3 mentions

Error after one comment

lambda x: x.find_element_by_css_selector('article[role='presentation'] form > button[disabled]'))
File "C:\Users\xxx\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\support\wait.py", line 96, in until_not
raise TimeoutException(message)
selenium.common.exceptions.TimeoutException: Message:

error trying to run the bot

i'm trying to run the bot first time and i get this error, how to fix ?

6 Getting Default Adapter failed.
Traceback (most recent call last):
File "script.py", line 95, in
bot.log_in(username, password)
File "F:\arquivos dudu\Script instagram 2\modules\instagram_bot.py", line 55, in log_in
self.driver.find_element_by_css_selector('div[role=dialog] button ').click()
File "C:\Users\Richard\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 598, in find_element_by_css_selector
return self.find_element(by=By.CSS_SELECTOR, value=css_selector)
File "C:\Users\Richard\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 978, in find_element
'value': value})['value']
File "C:\Users\Richard\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\Richard\AppData\Local\Programs\Python\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"div[role=dialog] button "}
(Session info: chrome=86.0.4240.111)
(Driver info: chromedriver=2.39.562718 (9a2698cba08cf5a471a29d30c8b3e12becabb0e9),platform=Windows NT 10.0.17763 x86_64)

early auto terminates

it all goes to plan but when it writes the comment when posting it,it hits the emoji button and do nothing and after a few seconds it will shut it self down and when i run it with cmd it says early termination, 0 comments so far.. could you please say what's the problem...?i don't know anything about coding just wanted to hook this and use it could you please help me out?

Getting banned by A.I ?

I used the bot for about 30 - 60 minutes and posted about 10 comments ( the max value was at 240 the min was at 120 and the weight was at 180 ) and I got "banned". The bot couldn't post a comment even if I pressed it by hand on the pop up window, although I could post a comment with both my browser ( from the same device, network and account ), and my phone ( again from the same network and account ). I restarted the bot with bigger values ( max min and weight), it posted 3 - 5 comments in about 20 - 30 minutes and I got "banned" again. I restarted the bot again with even bigger values ( specifically max = 500 min = 0 weight = 250 ). It posted 1 - 2 comments and then it got "banned". Even after both times that I restarted the bot I could still post a comment from my browser and my phone. I left it for about 17 hours but when I started the bot it couldn't post any comment ( again with my phone and browser I can still post ). The error that I get from the pop up window is ' Failed to post comment ' .I will also put the config that I used the last time I used the bot and a screenshot of my cmd ( the screenshot is after I
have closed the pop up window of the bot ) just in case that helps.
config.txt

Instagram Giveaway Bot (cmd ss)

Script hangs if faces the user that cannot be mentioned

Hi there! Using your script and facing the issue that if user in his privacy settings set that nobody can mention him so script hangs with "Could no post comment".

In this case my flow is following

  • manually edit follower list, deleting users that were mentioned including one who cannot be mentioned.
  • rerun script

I've seen that you're already thinking on mentions tracker, so not to mention twice. Please consider on checking if user can be mentioned.
Thanks

HELP US

add pause for comments or time, bro thks

some features ideas

first, this script is amazing. thanks you for doing this. i would like to add some features but i dont have that kind of skills.

add a comment counter everytime it post.

also, would be great if that counter has some details like the time it posted

and, somekind of spintax for customs comments using the same template you have like:

[i want this tv \@randomuser, im gonna win this \@randomuser #randonhashtag, another comment ]

or simple separate with comma every comment

to avoid posting te same every time

that would be awesome

get the users @ from the post itself

This is a feature request/sugestion

First of all, thank for the amazing software!

The most hard part of using this bot is the @ (users) extraction.

Since many giveaways don't allow fake, famous or comercial accounts. So then we have to mannualy remove then to generate a good records/custom.txt file.

So, where to obtain a good list of (mostly) valid comments?
the answer is from giveaways comments!!!!

additional to getting @ from the followers/following list, we could also have the option to get from a post comment. This also would balance itself for the chances of winning:

  • a post with MANY comments, need more comments to guarantee a win, but it also provide those
  • a post with little comments, wouldn't need to many @ on the database, so with the same logic, we wouldn't waste too much time extracting some users @ s.

tips for the code implementation:

the steps would be:

  • for each comment in post:
    • get the comment text content
    • extract the @ (users) from the comment text
    • save in records\postComments\<post's username+_+postlinkcode>.txt

bot i runnig ...

bot running but stops after 14 comments...
the the browser says ...Coulnt post...
and this keeps going for ever....

Emoji doesn't work

comment with emoji throws an error
selenium.common.exceptions.WebDriverException: Message: unknown error: ChromeDriver only supports characters in the BMP

HELP

it runs well, makes the first comment, but always on the second one instagram doesnt let the bot comment, and sometimes it crashes. :(

Help

Hello, i'm a mac user and i would like you to help me with this issue. When i run the script.py the following error shows in terminal:

" from selenium import webdriver # type: ignore
ModuleNotFoundError: No module named 'selenium' "

Can you tell me what causes this problem?

NEW FEATURE

Hey friend I am also a programmer and love your project.
You could add to your project a way to add multiple accounts, to be used in case of blockages, it would be a hand on the wheel.

doesnt correctly search for users

Hi, i've used the bot in the past perfectly, but i don't know what is happening now that when i run it and it searches for users it can only record the ones that show up directly (it doesnt scroll down to keep searching).

Also this message appears:

DevTools listening on ws://127.0.0.1:50327/devtools/browser/6414ae56-e103-4f89-86de-60e6242a9e50
Logging in...
[1028/222238.294:INFO:CONSOLE(0)] "The resource https://www.instagram.com/static/bundles/metro/LoginAndSignupPage.css/3ce984c47339.css was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.", source: https://www.instagram.com/accounts/login/ (0)
[1028/222238.295:INFO:CONSOLE(0)] "The resource https://www.instagram.com/static/bundles/metro/FBSignupPage.css/55ba8f05e763.css was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.", source: https://www.instagram.com/accounts/login/ (0)
Logged in successfully!
Searching for ibaillanos's followings in records
Searching for ibaillanos's followings on Instagram
[1028/222243.534:INFO:CONSOLE(0)] "The resource https://www.instagram.com/graphql/query/?query_hash=ed2e3ff5ae8b96717476b62ef06ed8cc&variables=%7B%22fetch_media_count%22%3A0%2C%22fetch_suggested_count%22%3A30%2C%22ignore_cache%22%3Atrue%2C%22filter_followed_friends%22%3Atrue%2C%22seen_ids%22%3A%5B%5D%2C%22include_reel%22%3Atrue%7D was preloaded using link preload but not used within a few seconds from the window's load event. Please make sure it has an appropriate as value and it is preloaded intentionally.", source: https://www.instagram.com/ (0)
12 found on Instagram. Having a total of 12 followings in records.Let's win this giveaway together! Spamming...
Early termination. Sent 4 comments so far!PS D:\OneDrive - Universitat de les Illes Balears\Otros\Instagram-Giveaways-Winner-master>

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.