ohld / igbot

🐙 Free scripts, bots and Python API wrapper. Get free followers with our auto like, auto follow and other scripts!
https://hikerapi.com/p/N2P6iqiM
Apache License 2.0
4.72k stars 1.47k forks source link

[QUESTION] CHANGE THIS TITLE TO YOUR QUESTION #1298

Closed SiavashJafari closed 4 years ago

SiavashJafari commented 4 years ago

Before submitting an issue, make sure you have:

Which example file are you using?

like_users.py


Describe your Question/Issue:

while using "ask_for_code=True" after inputing the sent code (from instagram) to email, below (provided) error shows up!


Paste the output of python -V here: Python 2.7.17

Code you are using:


"""
    instabot example
    Workflow:
        Like last medias by users.
"""
import argparse
import os
import sys

sys.path.append(os.path.join(sys.path[0], "../"))
from instabot import Bot  # noqa: E402

parser = argparse.ArgumentParser(add_help=True)
parser.add_argument("-u", type=str, help="username")
parser.add_argument("-p", type=str, help="password")
parser.add_argument("-l", type=int, help="limit")
parser.add_argument("-proxy", type=str, help="proxy")
parser.add_argument("users", type=str, nargs="+", help="users")
args = parser.parse_args()

bot = Bot()
bot.login(username=args.u, password=args.p, proxy=args.proxy, ask_for_code=True)

for username in args.users:
    bot.like_user(username, amount=args.l, filtration=False)

Error/Debug Log:

2020-02-18 18:02:31,500 - INFO - PRE-LOGIN FLOW!... 
2020-02-18 18:02:32,732 - DEBUG - POST to endpoint: accounts/read_msisdn_header/ returned response: <Response [200]>
2020-02-18 18:02:34,924 - DEBUG - POST to endpoint: launcher/sync/ returned response: <Response [200]>
2020-02-18 18:02:36,097 - DEBUG - POST to endpoint: qe/sync/ returned response: <Response [200]>
2020-02-18 18:02:38,247 - DEBUG - POST to endpoint: attribution/log_attribution/ returned response: <Response [200]>
2020-02-18 18:02:39,555 - DEBUG - POST to endpoint: accounts/contact_point_prefill/ returned response: <Response [200]>
2020-02-18 18:02:43,306 - DEBUG - POST to endpoint: accounts/login/ returned response: <Response [400]>
2020-02-18 18:02:43,307 - DEBUG - Responsecode indicates error; response content: {"message": "challenge_required", "challenge": {"url": "https://i.instagram.com/challenge/17911302241/6aT0cwNQEu/", "api_path": "/challenge/17911302241/6aT0cwNQEu/", "hide_webview_header": true, "lock": true, "logout": false, "native_flow": true}, "status": "fail", "error_type": "checkpoint_challenge_required"}
2020-02-18 18:02:43,307 - ERROR - Request returns 400 error!
2020-02-18 18:02:43,307 - INFO - Instagram's error message: challenge_required
2020-02-18 18:02:43,307 - INFO - Error type: checkpoint_challenge_required
2020-02-18 18:02:43,307 - INFO - Checkpoint challenge required...
2020-02-18 18:02:46,150 - DEBUG - GET to endpoint: challenge/17911302241/6aT0cwNQEu/ returned response: <Response [200]>
Checkpoint challenge received
0 - Phone
1 - Email
Insert choice: 1
2020-02-18 18:03:04,786 - DEBUG - POST to endpoint: challenge/17911302241/6aT0cwNQEu/ returned response: <Response [200]>
A code has been sent to the method selected, please check.
Insert code: 530286
Traceback (most recent call last):
  File "./like_users.py", line 23, in <module>
    bot.login(username=args.u, password=args.p, proxy=args.proxy, ask_for_code=True)
  File "/home/user/Downloads/instabot/instabot/bot/bot.py", line 443, in login
    if self.api.login(**args) is False:
  File "/home/user/Downloads/instabot/instabot/api/api.py", line 273, in login
    solved = self.solve_challenge()
  File "/home/user/Downloads/instabot/instabot/api/api.py", line 369, in solve_challenge
    code = input("Insert code: ").replace(" ", "")
AttributeError: 'int' object has no attribute 'replace'
duplicate-issues[bot] commented 4 years ago

Hey @SiavashJafari,

We did a quick check and this issue looks very darn similar to

This could be a coincidence, but if any of these issues solves your problem then I did a good job :smile:

If not, the maintainers will get to this issue shortly.

Cheers, Your Friendly Neighborhood ProBot

bruvv commented 4 years ago

Please reopen this as a bug report and not a question.