GithubHelp home page GithubHelp logo

b31ngd3v / myigbot Goto Github PK

View Code? Open in Web Editor NEW
168.0 12.0 40.0 258 KB

MyIGBot is a Private API for Instagram to like, follow, comment, view & intaract with stories, upload post & stories, get all information about a user/posts and get posts based on locations/hashtags. It also supports proxy.

Home Page: https://pypi.org/project/myigbot/

License: MIT License

Python 100.00%
instagram instagram-bot ig-bot api instagram-api private-api ig-private-api story ig-story python

myigbot's People

Contributors

animemoeus avatar b31ngd3v avatar el-pr0f3ss0r avatar gupta-anubhav12 avatar miguelo981 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

myigbot's Issues

Suspicious login attempt

Even the simplest bot would not work as the login would fail due to instagram detecting a suspicious login attempt and requiring verification. Even after verifying the warning, it would still block out the bot every time. What should I do? I have tried logging in using incognito, verifying, and starting up the bot, but this did not fix the issue. Does the bot not work anymore?

from myigbot import MyIGBot

bot = MyIGBot( "", "")

response = bot.upload_post('testing.png', caption='Image 1')
print(response) 

EDIT: I tried adding a 2 Factor Authentication to my account, but it still raises the suspi cious login warning, and gives me this error now:


Traceback (most recent call last):
  File "C:\Users\\Desktop\Personal Work\\.....\\", line 4, in <module>
    bot = MyIGBot('', '')
  File "C:\Users\...\AppData\Local\Programs\Python\Python38\lib\site-packages\myigbot\__init__.py", line 178, in __init__
    self.sessionid = login_response.headers['Set-Cookie'].split('sessionid=')[1].split(';')[0]
IndexError: list index out of range

Add a function to post videos

Just a suggestion, it would be greatly appreciated and separate this repo from the other ones aside from how easy it is to use :)

Login Failed !

I have this issue
←[91m[✗] Login Failed!←[0m {"user": true, "authenticated": false, "status": "ok"}
The first time is OK
but the second one I try and fail. I tried on change proxy but the issue still exists.

add return spam

please add error handling when returning json smap {"message": "", "spam": true, "status": "fail"}

eg try follow_count = json.loads (response) ['graphql'] ['user'] ['edge_follow'] ['count']
except

follow_count = json.loads (response) ['spam']

"post_likers" function returns incorrect amount of likers on a post

Hi there,

The post_likers function does not return the exact amount of likers on any post with more than 128 likes.

post = "https://www.instagram.com/p/CDbt2ikF2q9/"

like_count = bot.like_count(post)
print(like_count)
response = bot.post_likers(post, limit=like_count)
print(len(response))

returns:

841
504

Really enjoy the bot you've written so far - nice work!

Getting 403 error when login

Hello, I have been working with ur API, and when I am trying to log in with correct user credentials I am getting 403 error, what does it mean?

información perfiles privado o perfiles publicos que no aceptan que los etiqueten

Thanks, Thanks this app is very good

looking at myigbot.py there is the functions:
private_user
and verified_user

1.- to see if the private profile returns to me and it does not.

2.- there are public profiles that they configured not to be tagged ..

this can block us and the app

A function that returns users that do not allow to be tagged, do not allow to be commented

Login Not Working

KeyError: "name='csrftoken', domain=None, path=None"

just tried to login and this error came up

from myigbot import MyIGBot

bot = MyIGBot('xxx', 'xxx')

CSRF Token is missing when logging in

Traceback (most recent call last):
self.csrf_token = cookie_jar['csrftoken']
KeyError: 'csrftoken'

response.cookies is empty and therefore the csrftoken cannot be extracted.
I tried it with proxies, as well, but that still didn't solve it.

It seems like IG changed something on their end once again.
I have tried other active instagram libraries from github as well. Always same result.

Login Failed

I did this steps:

  1. pip install myigbot
  2. write this to a python file
from myigbot import MyIGBot
bot = MyIGBot('usrname', 'pass')  # Login Information (if you're account has 2 Factor Auth. The Bot Will Ask You The Code.)
a=bot.like('https://www.instagram.com/p/CHqtHbkB6KE/')
print(a)

but unfortunately

←[91m[✗] Login Failed!←[0m

this error occured.
What's wrong?

Upload multiple image posts

I couldn't find anything in the code that indicated it was possible. Maybe I'm doing something wrong?

Also couldn't find any possible documentation on doing this.

Thanks

suspicious login attempt blocked

Traceback (most recent call last):
  File "/Users/xxx/MyIGBot/usage.py", line 3, in <module>
    bot = MyIGBot('correct-username', 'correct-password')
  File "/Users/xxx/MyIGBot/myigbot.py", line 178, in __init__
    self.sessionid = login_response.headers['Set-Cookie'].split('sessionid=')[1].split(';')[0]                
IndexError: list index out of range

I get this error, I am not sure what to do. Help will be appreciated.

Update:
the error disappeared, now it says login failed. instagram sent me a mail saying suspicious login blocked. need a workaround on this,

Not working on the VPS

>>> from myigbot import MyIGBot
>>> bot = MyIGBot('username','password')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/tendean/repositories/animemoeus/telegram_bot/myigbot/myigbot.py", line 36, in __init__
    csrf = response.cookies['csrftoken']
  File "/home/tendean/virtualenv/repositories/animemoeus/3.7/lib/python3.7/site-packages/requests/cookies.py", line 328, in __getitem__
    return self._find_no_duplicates(name)
  File "/home/tendean/virtualenv/repositories/animemoeus/3.7/lib/python3.7/site-packages/requests/cookies.py", line 399, in _find_no_duplicates
    raise KeyError('name=%r, domain=%r, path=%r' % (name, domain, path))
KeyError: "name='csrftoken', domain=None, path=None"
>>> 

It's working on my computer, but not working on the server.

Login Failed

no matter wich account i use it says :
[✗] Login Failed!
i already tested three ig accounts and with or without proxies

Discussion about Instagram Rate limits (using story_view function)

First of all, thanks @b31ngd3v for building this API.
I recently built a quick script to view accounts' stories in loop. Here's the code

from myigbot import MyIGBot
import time
import random

bot = MyIGBot(username,pw)

storiesCount = 0

def getLastMediaLikers(account):

    # Try to get a list of users that liked the account's last post. If the account has no posts or it's private, return []

    try:
        getMedias = bot.user_posts(account)
        if getMedias == []: return []

        getLikers = bot.post_likers(getMedias[0])
        print(f"Got {len(getLikers)} media likers for the account {account}")
        return getLikers
    except:
        return [] # If anything goes wrong, return an empty list

def storyView(account):
    global storiesCount

    # Attempt to view the story of the account. If successful, increment storiesCount

    try:
        print("Attempting story view for",account)
        if bot.story_view(account) == 200: storiesCount += 1
        print(f"Current stories count: {storiesCount}")
        time.sleep(2.5)
    except:
        pass # In case something goes wrong
    return
  
currentAccount = input("Please provide an account to start from")
likers = getLastMediaLikers(currentAccount)

while True:

    # View the story of currentAccount and all the one of the first 50 likers of its last post. Then choose a random account and repeat.

    storyView(currentAccount)
    for a in likers:
        storyView(a)
    currentAccount = random.choice(likers)
    likers_sub = getLastMediaLikers(currentAccount)
    while likers_sub == []:
        currentAccount = random.choice(likers)
        likers_sub = getLastMediaLikers(currentAccount)
    likers = likers_sub
    print("Current account:",currentAccount,". Long Sleeping.")
    time.sleep(5)

After a few minutes, my script gets detected and I'm required to change my instagram password due to "a suspiscious login attempt". Does anyone know what IG's rate limits are & what my sleep times should be in order not to run into this?

csrftoken

Whenever i try to login to the account, it returns: 'csrftoken'

from myigbot import MyIGBot

bot = MyIGBot('random.dog.daily', 'Password')

Any Help? Sorry if im being dumb

Error 403 in Like

Hello, I am trying to like a post with my account and leave a comment, but I receive a 403 error.
my code:

from myigbot import MyIGBot
 
bot = MyIGBot('maryam85rr', '********')

a = bot.like('https://www.instagram.com/p/CUp8_KbNnDe/?utm_source=ig_web_copy_link')

b = bot.comment('https://www.instagram.com/p/CUp8_KbNnDe/?utm_source=ig_web_copy_link','nice')

print(b)

print(a)`

terminal:
403
403

KeyError: 'upload_id'

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/myigbot/init.py", line 696, in upload_post
upload_id = json_data['upload_id']
KeyError: 'upload_id'

ModuleNotFoundError: No module named 'cv2' (Details Below)

Traceback (most recent call last):
File "c:\Users\USERNAME\Desktop\MyIGBot-main\try1.py", line 1, in
from myigbot import MyIGBot
File "c:\Users\USERNAME\Desktop\MyIGBot-main\myigbot.py", line 10, in
from utils import get_media_duration
File "c:\Users\USERNAME\Desktop\MyIGBot-main\utils.py", line 1, in
import cv2
ModuleNotFoundError: No module named 'cv2'

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.