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

Can't do any function after initializing the session #9

Open jackaru opened 5 years ago

jackaru commented 5 years ago

After saving and initialize it for example:

$instagram->initFromSavedSession($user);

I can't like, comment or follow except searching hashtags! and if I check the login it's not even logged in. I missed something?

Verification form code:

 include("vendor/autoload.php");

    use \Instagram\Instagram;

    $callback = array();

    try{

      $instagram = new \Instagram\Instagram();

      $method = json_decode($_POST['method_obj']);
      $session = $_POST['session'];

      $instagram->initFromSavedSession($session);
      $response = $instagram->ConfirmVerificationCode($_POST['url'], $_POST['code']);

      if($response->status == "ok"){

        $user = json_decode($instagram->saveSession());
        $userId  = $user->cookies->ds_user_id;
        $user->loggedInUser['pk'] = $userId; //<---------- Saved session

        //Code for callback on android app
    $code = "checkpoint_success";
        array_push($callback, array("code"=>$code,"session"=>$user));
        echo json_encode($callback);

        exit();
      }

     }catch(\Exception $e){
         $message = "Wrong code";
        $code = "checkpoint_failed";
            array_push($callback, array("code"=>$code,"message"=>$message));
            echo json_encode($callback);

         exit();
    }
adiv-phpian commented 5 years ago

use https://github.com/muthu-kc/instagram-checkpoint-and-rate-limit