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.71k stars 1.47k forks source link

"Checkpoint challenge required..." logger line not working in self.api.send_request() #1140

Closed leoccyao closed 4 years ago

leoccyao commented 4 years ago

Please follow the guide below


Before submitting an issue, make sure you have:

Purpose of your issue?


The following sections requests more details for particular types of issues, you can remove any section (the contents between the triple ---) not applicable to your issue.


For a bug report, you must include the Python version used, code that will reproduce the error, and the error log/traceback.

Paste the output of python -V here:

Python 3.7.4 Running Instabot 0.73.0 in pipenv 2018.11.26

Code:

# Lines 271-277 of api.py (in method send_request_

            elif self.last_json.get(
                "error_type",
                ""
            ) == "checkpoint_challenge_required":
                self.logger.info("Checkpoint challenge required...")
                if ask_for_code is True:
                    solved = self.solve_challenge()

Error/Debug Log:

Connected to pydev debugger (build 192.6817.19)
2019-11-25 17:38:53,849 - INFO - Instabot Started
Request returns 400 error!
Checkpoint challenge received
0 - Phone
1 - Email

Describe your issue

The line "Checkpoint challenge required" was expected to print to console, but did not print.

This is an issue because: those receiving 400 errors when logging in and therefore "ds_user_id" errors (I received one upon failed login) may not realize that the error is due to a failure to log in.

Can confirm though that checkpoint solving functionality works perfectly (went through it with a successful login!)

Expected output:

Request returns 400 error!
Checkpoint challenge required...
negswell commented 4 years ago

i think it depends on the logging level that is being set , change logging level to debug in order to get all the logging info .

fighterii commented 4 years ago

I'm facing the same issue. As far as I can see, none of the log messages from API.py are logged.

Hmm. logger.warning(and greater: error/critical) are logged (but not in the specified Logger Format with debugLevel) to stdout, but no logger.info messages. Very Strange behavior.

@negswell as you can see in @leoccyao code example the line is logger.info, so it has nothing to do with log level.

fighterii commented 4 years ago

@ohld : Something is inconsistent in the code:

You think it is really necessary to have the logger name including the user_id/username? What about one Logger "[instabot]"?

fighterii commented 4 years ago

Logging is fixed with PR #1205 so we could close this issue @ohld