adiv-phpian / php-instagram-private-api-with-checkpoint-feature

This is a liam cottle instagram private library with checkpoint issue solved. Checkpoint required error solved and can be found at examples folder.
MIT License
12 stars 8 forks source link

Checkpoint issue : can't get $response object, just getting exception message $e. #4

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, @muthu-kc

I am trying to figure out the checkpoint issue. When I tried to login with one account, I received the following message

Login Failed: [fail] checkpoint_required Go to this URL in your web browser to continue:
https://i.instagram.com/challenge/3026133992/vILZd9bzqs/

I am getting this error in the following code snippet (in the example/login.php)

...
} catch(Exception $e) {
     $error = $e->getMessage();
     header("Location: ".$url_redirect."/login_form.php?error=".$error);
     exit();
}
...

It seems like the $response is being used to fix the checkpoint issue in your project. That is, in the following code snippet.

...
 if(!is_object($response) && isset($response['code']) && $response['code'] == 201) {
            $url = $response['url'];
            $res = $instagram->ChallengeCode($response['url']);
...

Unfortunately, I am getting Exception message $e at the moment instead of $response object. I am wondering how I should fix the checkpoint issue in this case. If you have any idea to fix the current issue, please help me.

Thanks.

ghost commented 6 years ago

Fixed myself.