Git Product home page Git Product logo

auto-instagram-posting-bot's Introduction

Auto Instagram Posting Bot (AIPB)

AIPB automates your Instagram posts by taking images from sites like 9gag or other Instagram accounts and posting it onto your page.

⭐️ Star this project on GitHub — it helps!

Features

  • Adjustable interval between posts
  • Original captions/title as post captions
  • Multiple 9gag categories
  • Log into Instagram with Facebook credentials
  • Duplicate post prevention
  • Get Instagram users past photos and add to queue
  • Max post limit
  • Listens for new images
  • Automatically resizes images to fit Instagram
  • Simulates real clicking

Installation

Clone or download this repo: git clone https://github.com/HenryAlbu/auto-Instagram-posting-bot.git

Go to the project directory cd auto-Instagram-posting-bot

Install the requirements: pip install -r requirements.txt

This project is Selenium based and requires a chromedriver. I have already included one in the project files for Chrome 81/Windows. If you want to get a newer version or for a different OS, download it here and drag and drop it into the directory.

Running

Just run: python app.py

File structure

Files/Folders Description
app.py The main file for the project contains the UI and connections calls the other files. (Run this file)
insta.py Contains the functions and steps that sign you into Instagram. Also contains the Selenium driver options
ninegag.py Contains the functions to download and queue up 9gag posts
settings.py Contains the global variables
insta_scraper.py Contains the functions to download and queue up scrapped Instagram posts from selected user
filesCheck.txt (created on initial run) Contains the id's of images that have been downloaded to prevent duplicate uploads (keeps the last 50 id's)
filesDict.json (created on initial run) When images are downloaded they are given an id's and put into this JSON file that acts as the queue
images (folder) (created on initial run) Where the images are downloaded to.

UI (PySimpleGUI)

https://github.com/PySimpleGUI/PySimpleGUI

Limitations

Currently, the bot only uploads images. This is due to the fact that it is using Selenium to interact with the Instagram web interface. The Instagram interface only allows for uploads of images. (currently looking into a way around this)

Caution

This project uses Selenium. What this means is that it does not use the Instagram API for posting, making Instagram think that it's a real user posting, BUT You should still be cautious by setting a reasonable wait times before posts. By default, this is set at 50 seconds. If you set it to something like 10 seconds, there is a chance that Instagram will notice bot activity.

TODOs

  • Adding Imgur.com to the list of options to take images from

  • Ability to add your own files to queue. Kind of like those sites that charge you to schedule Instagram posts.

  • Figuring out how to get videos to upload

If you want to contribute to the project, I would greatly appreciate it :)

License

This code is in no way affiliated with, authorized, maintained, sponsored, or endorsed by Instagram, Facebook inc. or any of its affiliates or subsidiaries. This is an independent and unofficial API. Use it at your own risk.

auto-instagram-posting-bot's People

Contributors

henryalbu 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

auto-instagram-posting-bot's Issues

Video support

Instagram web only allows for image upload. Would be nice to figure out how to get .mp4 uploaded

Add Imgur

Add ability to choose Imgur as an option for post content

Chrome driver set

Hi, I am really excited to run this bot and congrats on creating something that looks so amazing. I have got the the stage where I click run however I get this error

self.error_handler.check_response(response)
File "C:\Users\vincent benson\AppData\Local\Programs\Python\Python38\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81

This makes it seem as if I just need to replace the chrome driver with the one that matches my chrome but I have done this multiple times and I keep on getting this error.

Let me know if you have any ways you think i could fix this

(I saw the warning on the bot, is it generally working at the moment?)

Also feel free to message me on Instagram @vincentbenson_ , id love to talk more

Thanks

Filter by word

Let users define keywords so that if the original posts caption/title contains those keywords, it would not be added to queue

Emojis support

Currently it removes emojis from titles and captions because it was causing an error on chromdriver.

only keep 10 id's in filesCheck.txt

On program run clear all id's after the 10th. This will still guarantee not to repeat images and will reduce the number of items to check through.

Add your own images

Implement a way for users to queue up their own images with captions. The bot would then post those periodically

ModuleNotFoundError: No module named '_tkinter'

Hello I am facing an issue running app

pip3 install -r requirements.txt works just fine without error
but after that when I try to run app I ger the error below

auto-Instagram-posting-bot % python app.py Traceback (most recent call last): File "app.py", line 2, in <module> import PySimpleGUI as sg ImportError: No module named PySimpleGUI ekingunoncu@Ekin-MacBook-Air auto-Instagram-posting-bot % python3 app.py Traceback (most recent call last): File "app.py", line 2, in <module> import PySimpleGUI as sg File "/Library/Python/3.7/site-packages/PySimpleGUI/__init__.py", line 2, in <module> from .PySimpleGUI import * File "/Library/Python/3.7/site-packages/PySimpleGUI/PySimpleGUI.py", line 103, in <module> import tkinter as tk File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 36, in <module> import _tkinter # If this fails your Python may not be configured for Tk ModuleNotFoundError: No module named '_tkinter'

This is my environment:
Python 3.7.3
pip 19.0.3
macos catalina

Errors pls help

Starting... Opening instagram Exception in thread Thread-1: Traceback (most recent call last): File "C:\Users\jitka\AppData\Local\Programs\Python\Python39\lib\threading.py", line 954, in _bootstrap_inner self.run() File "C:\Users\jitka\AppData\Local\Programs\Python\Python39\lib\threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "C:\Users\jitka\auto-Instagram-posting-bot\app.py", line 11, in long_operation_thread insta.launch_inst() File "C:\Users\jitka\auto-Instagram-posting-bot\insta.py", line 25, in launch_inst driver = webdriver.Chrome(executable_path=r"chromedriver.exe", options=opts) File "C:\Users\jitka\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\chrome\webdriver.py", line 76, in init RemoteWebDriver.init( File "C:\Users\jitka\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 157, in init self.start_session(capabilities, browser_profile) File "C:\Users\jitka\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 252, in start_session response = self.execute(Command.NEW_SESSION, parameters) File "C:\Users\jitka\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\jitka\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: cannot find Chrome binary

json not found

FileNotFoundError: [Errno 2] No such file or directory: 'images/account_srapped.json'

Liking this!

Hey, nice GUI!

I'm THRILLED to see you've got images posted in your readme. I've made dozens of requests from projects to do this. It's SO rare for Python programs to have a GUI anyway, and when they do, they're fun to see. They grab people's attention right away and I think generate interest.

It's quite a complex GUI you've made with lots of options and a good layout. Congrats on making it!

ERROR WITH INSTALLING REQUIREMENTS

┌──(nyenv)─(kali㉿kali)-[~/auto-Instagram-posting-bot]
└─$ pip install -r requirements.txt

Collecting selenium==3.141.0
Downloading selenium-3.141.0-py2.py3-none-any.whl (904 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 904.6/904.6 kB 4.0 MB/s eta 0:00:00
Collecting Pillow==7.1.2
Downloading Pillow-7.1.2.tar.gz (38.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 38.9/38.9 MB 6.1 MB/s eta 0:00:00
Preparing metadata (setup.py) ... done
Collecting PySimpleGUI==4.19.0
Downloading PySimpleGUI-4.19.0-py3-none-any.whl (333 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 333.7/333.7 kB 5.8 MB/s eta 0:00:00
ERROR: Could not find a version that satisfies the requirement instagram-scraper==1.9.0 (from versions: 66.0.0, 66.0.2)
ERROR: No matching distribution found for instagram-scraper==1.9.0

Add hashtag

Add ability for users to add predefined hashtags to post caption

errors

Traceback (most recent call last): File "C:\Users\ASrosTOS\AppData\Local\Programs\Python\Python39\lib\threading.py", line 950, in _bootstrap_inner self.run() File "C:\Users\ASrosTOS\AppData\Local\Programs\Python\Python39\lib\threading.py", line 888, in run self._target(*self._args, **self._kwargs) File "C:\Users\ASrosTOS\Desktop\auto-Instagram-posting-bot-master\app.py", line 13, in long_operation_thread insta.loop_posting() File "C:\Users\ASrosTOS\Desktop\auto-Instagram-posting-bot-master\insta.py", line 160, in loop_posting post() File "C:\Users\ASrosTOS\Desktop\auto-Instagram-posting-bot-master\insta.py", line 108, in post autoit.control_set_text("Open", "Edit1", image_path) File "C:\Users\ASrosTOS\AppData\Local\Programs\Python\Python39\lib\site-packages\autoit\autoit.py", line 84, in wrapper raise AutoItError(err_msg) autoit.autoit.AutoItError: Window/Control could not be found

what should i do?
running on vps

Could not find a version that satisfies the requirement instagram-scraper==1.9.0 (from versions: none)

mymy@ser:/workspace/auto-Instagram-posting-bot $ sudo pip install -r requirements.txt
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting selenium==3.141.0
Using cached https://www.piwheels.org/simple/selenium/selenium-3.141.0-py2.py3-none-any.whl (904 kB)
Collecting Pillow==7.1.2
Using cached https://www.piwheels.org/simple/pillow/Pillow-7.1.2-cp39-cp39-linux_armv7l.whl (1.1 MB)
Collecting PySimpleGUI==4.19.0
Using cached https://www.piwheels.org/simple/pysimplegui/PySimpleGUI-4.19.0-py3-none-any.whl (333 kB)
ERROR: Could not find a version that satisfies the requirement instagram-scraper==1.9.0 (from versions: none)
ERROR: No matching distribution found for instagram-scraper==1.9.0
mymy@ser:
/workspace/auto-Instagram-posting-bot $ sudo python -m pip install instagram-scraper
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
ERROR: Could not find a version that satisfies the requirement instagram-scraper (from versions: none)
ERROR: No matching distribution found for instagram-scraper

mymy@ser:~/workspace/auto-Instagram-posting-bot $ dpkg -l | grep pip
ii python-pip-whl 20.3.4-4+rpt1+deb11u1 all Python package installer (pip wheels)
ii python3-pip 20.3.4-4+rpt1+deb11u1 all Python package installer

How can I solve this issue?

24/7 runtime?

Hey. Is it possible to run this bot 24/7 eg. on an VPS Server?

ValueError: _type_ 'v' not supported

Traceback (most recent call last): File "app.py", line 3, in <module> import insta File "/home/pc/instagramBot/instaautopost/auto-Instagram-posting-bot/insta.py", line 5, in <module> import autoit File "/home/pc/.local/lib/python3.6/site-packages/autoit/__init__.py", line 6, in <module> from .autoit import options, properties, commands File "/home/pc/.local/lib/python3.6/site-packages/autoit/autoit.py", line 7, in <module> from ctypes.wintypes import * File "/usr/lib/python3.6/ctypes/wintypes.py", line 20, in <module> class VARIANT_BOOL(ctypes._SimpleCData): ValueError: _type_ 'v' not supported

problem runing app.py file

add tag

is it possible to add tag?

no module named autoit

C:\Users\adana\OneDrive\Masaüstü\instatestr\auto-Instagram-posting-bot>python app.py
Traceback (most recent call last):
File "C:\Users\adana\OneDrive\Masaüstü\instatestr\auto-Instagram-posting-bot\app.py", line 3, in
import insta
File "C:\Users\adana\OneDrive\Masaüstü\instatestr\auto-Instagram-posting-bot\insta.py", line 5, in
import autoit
ModuleNotFoundError: No module named 'autoit'

module 'ctypes' has no attribute 'windll'

Traceback (most recent call last):
File "/Users/xx/Desktop/insta/auto-Instagram-posting-bot-master/app.py", line 3, in
import insta
File "/Users/xx/Desktop/insta/auto-Instagram-posting-bot-master/insta.py", line 5, in
import autoit
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autoit/init.py", line 6, in
from .autoit import options, properties, commands
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/autoit/autoit.py", line 28, in
AUTO_IT = ctypes.windll.LoadLibrary(dll_path)
AttributeError: module 'ctypes' has no attribute 'windll'

Note: I am using python3 in my mac os 12.0.1

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.