Code Monkey home page Code Monkey logo

instagram-bot's Introduction

Instagram Bot

Instagram Bot

📚 Documentation

       🔹 For Turkish documentation
       🔹 English translation of the documentation was made by Can Mıhcı.

Introduction

An Instagram bot developed using the Selenium Framework

Features

🔵 Download all posts of a single user
🔵 Like or unlike all posts of a single user
🔵 Bulk unfollow
🔵 Bulk comments on a single post
🔵 Bulk unfollow all users that do not follow back
🔵 Delete messages in bulk
🔵 Download highlighted stories
🔵 Download stories
🔵 Download a single post
🔵 Download an IG TV Video
🔵 Follow all the followers of a single user
🔵 Follow all listed users in a file
🔵 Follow all users that have liked a single post
🔵 Follow users based on tag
🔵 Like posts based on tag
🔵 Like or unlike a single post
🔵 Comment on a single post
🔵 Follow or unfollow a user
🔵 Block or unblock a user

Other Features

🔵 Support for two languages: English and Turkish.
🔵 Option of running browser window in normal or incognito modes has been granted.
🔵 A settings menu has been included. Settings menu features language and browser settings.

Details

🔷 You may use the features above by logging into your Instagram account.
🔷 Instagram login for accounts with 2-factor authentication is also possible.
🔷 As the project is currently under development, the 2-factor authentication feature has been set to assume that the 2Fa code is sent to the user's phone number.
🔷 Default language has been set as English.

Configuration Settings

⚙️ Project utilizes Firefox browser as webdriver. This requires Firefox to be installed for the application to work properly.
⚙️ In order to use Firefox webdriver needs to be downloaded and the directory path for the downloaded webdriver needs to be set within config.json.

  • Config Options

⚙️ driver_path: Denotes the Webdriver directory path.
⚙️ headless: Denotes if the browser is visible or not. Default value:true
⚙️ language: Denotes the language of the application.
⚙️ languages: Includes the settings, menu and warning messages for all language options.
⚙️ time: denotes the operation waiting times for all the operations where time.sleep() has been used.

  • Package installation for Windows users

python -m pip install -r .\requirements.txt

Usage

🔹 'menu' commands needs to be used for returning to the main menu from any prompt that asks the user for input.

python instagram.py

Notes

🔹 Operation intervals has been set for a length of time that prevents your account from getting banned for bulk operations of post-likes, user-follows or commenting.
🔹 The operation intervals may be changed from within config.json.
🔹 Has been tested only under Windows.
🔹 Python version: 3.8.1

Technologies used

🔹 Python
🔹 Selenium
🔹 Javascript

Screenshots

🔹 Main menu

Main menu

🔹 Download posts

Download posts

🔹 Like posts

Like posts

🔹 Bulk unfollow

Bulk unfollow

🔹 Bulk commenting

Bulk commenting

🔹 Bulk comment deletion

Bulk comment deletion

License

License

instagram-bot's People

Contributors

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

instagram-bot's Issues

where's output data

I complete extract data from Instagram, but I can't find my output result data

Açmakta zorluk çekiyorum

Merhabalar, ben bu uygulamanın kullanılmasında zorluk çekiyorum. Mozillayı indirdim ama yine de açamadım. Yardımcı olma imkanınız var mı? Bir video tutorial hazırlayabilirseniz çok sevinirim.

Error during user login:'Instagram' object has no attribute 'driver'

Hello thanks for your repository.

I'm having issues running this bot on Linux terminal

Error during user login:'Instagram' object has no attribute 'driver'

[*] Logging in user ...
[-] Error during user login:'Instagram' object has no attribute 'driver'

Downloaded geckodriver from Geckodriver for Linux

My driver path

"driver_path": "/root/musta/Instagram-Bot/geckodriver",

Geckodriver log

1614686070254	geckodriver	INFO	Listening on 127.0.0.1:44525
1614686071265	mozrunner::runner	INFO	Running command: "/usr/bin/firefox" "--marionette" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofileKfVL7v"
Error: no DISPLAY environment variable specified

Liking a deleted post stops the whole process of liking by tag

During liking by tag process, bot sometimes stops the process, because it fails to locate the like button for the post. The only possible reason why the button is not visible is when the post has been deleted shortly after the page with post for given hashtag has been loaded. When the selected hashtag is very popular, then this situation can happen just after 10-20 posts, which is very annoying, because you have to manually restart the process.

In my opinion, this scenario shouldn't stop the liking by tag process. I think that logging the error to the console and moving on to the next post is absolutely fine.

Unfortunately does not work


pip3 install -r requirements.txt

Requirement already satisfied: selenium==3.141.0 in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 1)) (3.141.0)
Requirement already satisfied: termcolor==1.1.0 in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 2)) (1.1.0)
Requirement already satisfied: colorama==0.3.9 in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 3)) (0.3.9)
Requirement already satisfied: urllib3==1.25.3 in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (1.25.3)
Collecting requests==2.22.0
  Downloading requests-2.22.0-py2.py3-none-any.whl (57 kB)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in /Users/UnixCro/Library/Python/3.9/lib/python/site-packages (from requests==2.22.0->-r requirements.txt (line 4)) (3.0.4)
Requirement already satisfied: urllib3==1.25.3 in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (1.25.3)
Requirement already satisfied: idna<2.9,>=2.5 in /usr/local/lib/python3.9/site-packages (from requests==2.22.0->-r requirements.txt (line 4)) (2.8)
Requirement already satisfied: certifi>=2017.4.17 in /Users/UnixCro/Library/Python/3.9/lib/python/site-packages (from requests==2.22.0->-r requirements.txt (line 4)) (2020.6.20)
Requirement already satisfied: urllib3==1.25.3 in /usr/local/lib/python3.9/site-packages (from -r requirements.txt (line 5)) (1.25.3)
Installing collected packages: requests
  Attempting uninstall: requests
    Found existing installation: requests 2.25.1
    Uninstalling requests-2.25.1:
      Successfully uninstalled requests-2.25.1
Successfully installed requests-2.22.0


python3 instagram.py

Traceback (most recent call last):
  File "instagram.py", line 3, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'

python3 -V 
Python 3.8.2

macOS Catalina 10.15.7

Upload photo

Hi This library is so awesome, can you add an ability to upload photos?

json.decoder.JSONDecodeError:

Traceback (most recent call last):
File "C:\Users\BT\instagram.py", line 2031, in
instagram = Instagram()
File "C:\Users\BT\instagram.py", line 21, in init
self.ayarlarYukle()
File "C:\Users\BT\instagram.py", line 1040, in ayarlarYukle
self.config = json.load(dosya)
File "C:\Users\BT\AppData\Local\Programs\Python\Python39\lib\json_init_.py", line 293, in load
return loads(fp.read(),
File "C:\Users\BT\AppData\Local\Programs\Python\Python39\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Users\BT\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\BT\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 3 column 23 (char 87)

Like by tagged posts

First of all great app, but one question/request. Is there a way to like posts where the user is tagged in? Not by hashtag, I mean where an account is tagged in a post of someone else. The posts you see under the "Tagged" tab in a profile. I've tried option 16 but that's actually by hashtag.

json.decoder.JSONDecodeError: Invalid \escape: line 3 column 23 (char 87)

Hey there, I have this Problem before starting your bot:

Traceback (most recent call last): File "C:\Python\Instagram-Bot-master\instagram.py", line 2031, in <module> instagram = Instagram() File "C:\Python\Instagram-Bot-master\instagram.py", line 21, in __init__ self.ayarlarYukle() File "C:\Python\Instagram-Bot-master\instagram.py", line 1040, in ayarlarYukle self.config = json.load(dosya) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 293, in load return loads(fp.read(), File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads return _default_decoder.decode(s) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 353, in raw_decode obj, end = self.scan_once(s, idx) json.decoder.JSONDecodeError: Invalid \escape: line 3 column 23 (char 87)

Maybe you can help me? Thanks in advance

Çok kullanışlı ve başarılı!

Geliştirmiş olduğunuz bot için teşekkürler incileme fırsatım oldu ve çok beğendim. Yeni güncellemeleri bekliyorum. 👌👌

Config file is missing - Config dosyası eksik !

Hi I'm new in the programming world, I was trying to run your code but I'm getting the error "Config file is missing - Config dosyası eksik !" the config file is in the same directory of the code, do you know what could be the issue?

extract post for mass comments

Hello, it is not a mistake, I would just like to make a suggestion, the bot is incredible and congratulations are in order, but I would like to extract post by hashtag or user and save it in a list of then program to send pre-added comments in a file text for example?

Because by 1 by 1 the post link to comment is the same job as doing it manually.

Txt den kullanıcı takip listesi çekme

Merhaba, öncelikle kusursuz çalışıyor emeğiniz için teşekkür ederim.
bildiğiniz gibi takipçi arttrımak için instagramda takip ve takipten çıkma büyük ihtiyaç program başarılı şekilde takip ediyor ama her kullanıcı adını tek tek girmek gerekli bunu otomatikleştirebilir miyiz
a- şu kullanıcının takipçilerini takip et şu random zaman aralığında takip etsin örneğin 2 ile 3 dk arası
b- txt den takip edilecek kullanıcı adlarını çekip şu random zaman aralığında takip etsin örneğin 2 ile 3 dk arası

bu iki seçenekten biri modül olarak eklenirse süper olur
tekrar elinize sağlık böyle konuda Türkçe içerik ve geliştirici bulmak memnun etti
başarılar

Kodriver hatasi

Merhabalar her şeyi yaptım fakat calistirdigimda Kodriver hatası alıyorum.Yardım eder misin?

Error after I run instagram.py

C:\Users\royal\Instagram-Bot>python -m instagram.py
Traceback (most recent call last):
File "C:\Users\royal\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, Error)
File "C:\Users\royal\AppData\Local\Programs\Python\Python37\lib\runpy.py", line 109, in get_module_details
import(pkg_name)
File "C:\Users\royal\Instagram-Bot\instagram.py", line 2036, in
instagram = Instagram()
File "C:\Users\royal\Instagram-Bot\instagram.py", line 23, in init
self.ayarlarYukle()
File "C:\Users\royal\Instagram-Bot\instagram.py", line 1042, in ayarlarYukle
self.config = json.load(dosya)
File "C:\Users\royal\AppData\Local\Programs\Python\Python37\lib\json_init
.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "C:\Users\royal\AppData\Local\Programs\Python\Python37\lib\json_init
.py", line 348, in loads
return _default_decoder.decode(s)
File "C:\Users\royal\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Users\royal\AppData\Local\Programs\Python\Python37\lib\json\decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 3 column 23 (char 87)

This is the best bot I have ever seen in GitHub. Thank you for your time and effort.

Hi Mustafa,
First of all your code is very clear, understandable and perfectly working. I hope you will update whenever IG change the HTML codes. Thank you for your time and appreciate to share this code with the community.

I have some comments and suggestions for your review:

  1. We should see all the accounts in CSV or TXT file which are not following us even we followed them. You did a great job to found them before unfollow, but Bot is continuously unfollowing them without any schedule. This will cause very quick ban by IG. You should consider to put a adjustable schedule to start unfollowing option.
  2. We should have a list of accounts which we followed and which users followed us in CSV or TXT file for the accounts.
  3. You should find the accounts which we followed but not followed us and print it to the screen one by one asking below options:
    • just unfollow
    • add to blacklist
    • add to whitelist
      We shouldn't unfollow any account which is in whitelist.
  4. Bot is not working if the account has lots of followers like 56K. The letter "K" cause a problem to start the code.

Please let us know what you think.

UNFOLLOW - Feature not working

Un-following people who don't follow back is not working, it is adding all the current followers to a list and that process stops before adding the last person to the list and just the cursor blinks.

Error when launching the bot

Hi, thanks for the bot. I however ran into some issues on windows:

python -m pip install -r .\requirements.txt -->

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
requests 2.22.0 requires urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1, but you have urllib3 1.26.2 which is incompatible.
Successfully installed urllib3-1.26.2

And then, when launching the bot:

C:\Users\xxx\Desktop\C19TEST\Instagram-Bot-master>python instagram.py
Traceback (most recent call last):
  File "C:\Users\xxx\Desktop\bot\Instagram-Bot-master\instagram.py", line 2031, in <module>
    instagram = Instagram()
  File "C:\Users\xxx\Desktop\bot\Instagram-Bot-master\instagram.py", line 21, in __init__
    self.ayarlarYukle()
  File "C:\Users\xxx\Desktop\bot\Instagram-Bot-master\instagram.py", line 1040, in ayarlarYukle
    self.config = json.load(dosya)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python39\lib\json\decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 3 column 23 (char 87)


json.decoder.JSONDecodeError: Unexpected UTF-8 BOM

getting this error

Traceback (most recent call last): File "C:\Users\ASrosTOS\Desktop\Instagram-Bot-master\instagram.py", line 2031, in <module> instagram = Instagram() File "C:\Users\ASrosTOS\Desktop\Instagram-Bot-master\instagram.py", line 21, in __init__ self.ayarlarYukle() File "C:\Users\ASrosTOS\Desktop\Instagram-Bot-master\instagram.py", line 1040, in ayarlarYukle self.config = json.load(dosya) File "C:\Users\ASrosTOS\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 293, in load return loads(fp.read(), File "C:\Users\ASrosTOS\AppData\Local\Programs\Python\Python39\lib\json\__init__.py", line 335, in loads raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)", json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

Automatize DM by username or publication

Hi, a suggestion:

You could add an option to send private messages automatically to the followers of an account/post.

The functionality would be divided into two parts:

1-Send md to users with a public account.

2-Follow X users with a private account and store them in a json or as you prefer. Auxiliary function that you can run in the future to recover those users and check if they have accepted the request. In that case send them MD.

Actually automating this functionality is highly demanded and is not something that other bots do correctly

Great job, one of the best bots I've seen on github, I was currently working on my own, but this far exceeds it

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.