dpgua04022 2018-10-31 01:17
浏览 571

“糟糕,发生错误”Instagram登录错误

For the last five months, my Instagram account won't open. My other accounts have been working fine. Whenever I try to refresh my Instagram account, it just doesn't refresh. When I try to login on a browser, it takes me to a blank page and says "Oops an error occurred".

enter image description here

  • 写回答

1条回答 默认 最新

  • doulei1965 2019-06-08 00:32
    关注

    It's an authentication problem, account need to validate but you can't give verification code in SMS or email, request verification code in SMS or email

    <?php
    set_time_limit(0);
    date_default_timezone_set('UTC');
    
    require __DIR__.'/../vendor/autoload.php';
    
    use InstagramAPI\Exception\ChallengeRequiredException;
    use InstagramAPI\Instagram;
    use InstagramAPI\Response\LoginResponse;
    
    //Enter these options
    $username            = 'username'; // your username
    $password            = 'password'; //your password
    $verification_method = 1; //0 = SMS, 1 = Email
    
    //Leave these
    $user_id      = '';
    $challenge_id = '';
    
    class ExtendedInstagram extends Instagram {
        public function changeUser( $username, $password ) {
            $this->_setUser( $username, $password );
        }
    }
    
    $instagram = new ExtendedInstagram();
    
        $loginResponse = $instagram->login( $username, $password );
        $user_id       = $instagram->account_id;
    
        if ( $loginResponse !== null && $loginResponse->isTwoFactorRequired() ) {
            echo '2FA not supported in this example';
            exit;
        }
    
        if ( $loginResponse instanceof LoginResponse || $loginResponse === null ) {
            echo "Not a challenge required exception...
    ";
        }
    
        echo 'Logged in!';
    ?>
    

    Instagram's private API Library

    展开全部

    评论
    编辑
    预览

    报告相同问题?

    手机看
    程序员都在用的中文IT技术交流社区

    程序员都在用的中文IT技术交流社区

    专业的中文 IT 技术社区,与千万技术人共成长

    专业的中文 IT 技术社区,与千万技术人共成长

    关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

    关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

    客服 返回
    顶部