AbortDownloadException

Instagram asked for a checkpoint, a challenge, or feedback.

The error#

On HTTP 400, if the JSON message is one of feedback_required, checkpoint_required or challenge_required, instaloader raises AbortDownloadException. The text is _response_error:

400 {reason} - "{status}" status, message "{message}" when accessing {url}

AbortDownloadException is not a subclass of InstaloaderException. The class docstring says it is not caught by the download loop's error catchers, so it stops the loop.

A logged-in session that is sent back to the login page uses the same class:

Redirected to login page. You've been logged out, please wait some time, recreate the session and try again

A 400 that is not one of those three messages is QueryReturnedBadRequestException instead.

What triggers it#

resp.status_code == 400 and resp.json()["message"] in that set of three strings. The source comment says this is raised to stop producing more requests.

How to confirm#

Read the message field inside the exception text. checkpoint_required and challenge_required are Instagram's checkpoint. feedback_required is the feedback form. If the class is AbortDownloadException and the text starts with Redirected to login page, the session was dropped.

Fixes#

The login-redirect message tells you to wait, recreate the session, and try again. The checkpoint messages do not include a code path that solves the checkpoint. Completing it means opening Instagram as that user, outside the script, then loading the new session with --load-cookies or a new --login.

Sending more requests from the same session is what this exception is there to stop.

SocialScrape#

Instagram profile is GET /v1/instagram/profile. A private account comes back with is_private true. Posts are GET /v1/instagram/profile/posts, and one post is GET /v1/instagram/post.

Failed requests cost 0 credits. New accounts get 100 credits on signup, no card. Codes are on errors.

Questions

Why did except InstaloaderException miss it?

AbortDownloadException does not inherit from InstaloaderException.

Does SocialScrape return checkpoint_required?

No. A platform block is upstream_blocked, and it costs 0 credits.