Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bypass instagram challenge #11

Open
ozkcs opened this issue Nov 17, 2020 · 3 comments
Open

bypass instagram challenge #11

ozkcs opened this issue Nov 17, 2020 · 3 comments

Comments

@ozkcs
Copy link

ozkcs commented Nov 17, 2020

make a feature to bypass instagram challenge login attempt

@M1n007
Copy link
Owner

M1n007 commented Dec 27, 2020

otw

@xiguayizu
Copy link

can i fix it?

@xiguayizu
Copy link

xiguayizu commented Jan 7, 2022

\node-insta-web-api\lib\index.js
change code:

    async _getSharedData(url = this.baseUrl) {
        try{
            var getText = await this.requestNodeFetch.getText(url, this.headers);
            if( getText.res != undefined ){
                // 如果被风控
                var res_text = JSON.parse(getText.res.text)
                var challenge = await this.requestNodeFetch.post("https://www.instagram.com/challenge/", "choice=0&next=%2Faccounts%2Fedit%2F", this.headers)
                console.log( challenge )
                console.log("challenge is coming... and pass")
                // 重新获取
                getText = await this.requestNodeFetch.getText(url, this.headers);
            }
            const _sharedData = helpers.getString('<script type="text/javascript">window._sharedData =', '};</script>', getText);
            const resultJsonStringData = `${_sharedData[1]}}`;
            const resultJson = JSON.parse(resultJsonStringData);
            return resultJson;
        }catch(e){
            throw new Error(e)
        }
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants