instagram-private-api icon indicating copy to clipboard operation
instagram-private-api copied to clipboard

Create account is outdated/doesn't work

Open Popesites opened this issue 3 years ago • 10 comments
trafficstars

Bug Report

I believe Instagram updated their account creation endpoint(s).

Form

Requirements

  • [X] I've searched the Issues
  • [X] I've read the basic concepts
  • [X] I'm using the latest version
  • [X] I've debugged my code using the DEBUG variable.

Platform

  • [X] I'm using Node.js version 14.16.0
  • [ ] I'm using electron

Description

Check the account creation functionality. Once the app constants are updated (Open MR here: https://github.com/dilame/instagram-private-api/pull/1572), and you attempt to create an account, you're given a 400 error:

Code

require('dotenv').config();
const { IgApiClient } = require('instagram-private-api');
const ig = new IgApiClient();
    
ig.state.generateDevice("TEST");
ig.state.proxyUrl = process.env.IG_PROXY;
    
(async () => {
    const username = "XXX",
        email = "[email protected]",
        password = "XXX",
        first_name = "XXX";
    
    ig.account.create({ username, password, email, first_name });
})()`

Error and Output

(node:29771) UnhandledPromiseRejectionWarning: IgResponseError: POST /api/v1/accounts/create/ - 400 Bad Request; 

Popesites avatar Feb 17 '22 20:02 Popesites

@Nerixyz any idea?

Popesites avatar Feb 18 '22 06:02 Popesites

I think API was changed by IG.

Their encoding of text is not support by this lib unless it has dict for decode. this lib does not support encoding for x-fb-dz I hope @Nerixyz will look into this.

kingbotss avatar Feb 25 '22 09:02 kingbotss

I hope @Nerixyz will look into this.

This is out of scope for me. I'm trying to make sure the library compiles but can't guarantee that everything will work. Creating accounts is heavily checked by Instagram to make sure only real people create accounts and I can respect that. If anyone opens a PR to fix/patch this, I'm totally fine with merging it.

Their encoding of text is not support by this lib unless it has dict for decode. this lib does not support encoding for x-fb-dz

That's another issue but I beleive you can set the appropriate headers to receive gzip/zstd in responses. Related: mitmproxy/mitmproxy#4394

Nerixyz avatar Feb 25 '22 10:02 Nerixyz

@Nerixyz Thanks

Read my comment in #1580

kingbotss avatar Feb 27 '22 08:02 kingbotss

I updated my private library, I am added zstd encode support, sn_nonce, sn_result. But still I am getting challenge_required error. @Nerixyz

kingbotss avatar May 01 '22 14:05 kingbotss

I updated my private library, I am added zstd encode support, sn_nonce, sn_result. But still I am getting challenge_required error. @Nerixyz

use this https://github.com/SaeidB/insta_create

SaeidB avatar Dec 21 '22 14:12 SaeidB

I updated my private library, I am added zstd encode support, sn_nonce, sn_result. But still I am getting challenge_required error. @Nerixyz

use this https://github.com/SaeidB/insta_create

It is using third-party API, we need direct API

kingbotss avatar Dec 21 '22 16:12 kingbotss

I updated my private library, I am added zstd encode support, sn_nonce, sn_result. But still I am getting challenge_required error. @Nerixyz

use this https://github.com/SaeidB/insta_create

It is using third-party API, we need direct API

it uses direct api in backend, do u need requests data directly?

SaeidB avatar Dec 21 '22 16:12 SaeidB

need direct api, no third-party please.

kingbotss avatar Dec 21 '22 16:12 kingbotss

need direct api, no third-party please.

Pm me on telegram

SaeidB avatar Dec 21 '22 16:12 SaeidB