Coder Social home page Coder Social logo

adiv-phpian / php-instagram-private-api-with-checkpoint-feature Goto Github PK

View Code? Open in Web Editor NEW
12.0 4.0 8.0 215 KB

This is a liam cottle instagram private library with checkpoint issue solved. Checkpoint required error solved and can be found at examples folder.

License: MIT License

PHP 100.00%
mgp25 instagram api checkpoint liam-cottle-library checkpoint-issue-solved instagram-checkpoint-problem

php-instagram-private-api-with-checkpoint-feature's People

Contributors

adiv-phpian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

php-instagram-private-api-with-checkpoint-feature's Issues

Cant continue login

Hello. From verification.php i get "if($response->status == "ok"){" but after that how can i use $myUser = $instagram->getUserByUsername('username'); ? How can I continue using?

Example:

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

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

	print_R($user);
	$instagram->initFromSavedSession($user);
	$user = $instagram->getUserByUsername('instaluxuriousgirls');
    var_dump($user);
   // header('Location: stats.php');
    exit();

  }

Second question:
sometimes i return to login_from.php with error = null?

Login required for the logged in user

Hi, @muthu-kc

I've followed your sample project and successfully implemented the checkpoint feature.
Right now I can use most of the functions without any issue with the logged in instagram user instance.
Btw, I have some problems though.
When I call $instagram->followUser('111...'); , it says me "login required". This issue is happening on the commentOnMedia(), likeMedia() functions, too.
FYI, getUserInfo(), getMediaComments(), getUserByUsername() functions are working well though.

Could you let me know why this issue is happening, please?

Thanks in advance.

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

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.

checkpoint problems

hi
i want login to my instagram page . when call login function and checkpoint returns this array to output :
{"loggedInUser":[],"cookies":{"rur":"FTW","csrftoken":"Rp8Zdp64RA","mid":"WxbPwAABBEuyTmA","urlgen":""{\"time\": 1528221630}:1fQGFz:ZWzgsJQQyWANLsmzxaGFsQUCsn8"","mcd":"3","ds_user_id":"5775151683","sessionid":"IGSC260f721945f*****************************7XLh5cbQ3FA19JirmfISb3O87fzy3IA0%3A%7B%22_auth_user_id%22%3A5775151683%2C%22_auth_user_backend%22%3A%22accounts.backends.CaseInsensitiveModelBackend%22%2C%22_auth_user_hash%22%3A%22%22%2C%22_platform%22%3A4%2C%22_token_ver%22%3A2%2C%22_token%22%3A%225775151683%3A1aeGFJvqaQzkFY6YgGYffbjrIdVnVzmu%3A0e78408a85901dd7bbc532a6bbf008a539c561c69360a50ca0b3c2563b1ba2df%22%2C%22last_refreshed%22%3A1528221762.3165283203%7D"},"csrfToken":"Rp8ZdpkROc64RA","rankToken":"7c59ddac-b81d-4d54-8f51-42b438578650","phoneId":"be9661d9-1339-45e8-b85e-8cbb55a6c627","deviceId":"android-1e074b6e12573dc6","guid":"98c202d7-2c81-41cc-a841-4b57f39f5271","uuid":"98c202d7-2c81-41cc-a841-4b57f39f5271","googleAdId":"70ebb707-e368-44c0-aeec-19ecdfd53f2e"}

when call follow request my output is :
Failed to followUser: [fail] login_required

sorry for my bad endglish
best regards

Can't do any function after initializing the session

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();
 }

Not getting verification code

I have tested more than 10-15 accounts which are added successfully without verification code. But at the time of challenge, it's not adding any accounts.

it's throwing error : - ( phone and email both are attached ) and accounts are older too.

Notice: Undefined offset: 1 in /var/www/html/checkpoint/example/login.php on line 35

Notice: Trying to get property of non-object in /var/www/html/checkpoint/example/login.php on line 35

Notice: Trying to get property of non-object in /var/www/html/checkpoint/example/login.php on line 35

Notice: Trying to get property of non-object in /var/www/html/checkpoint/example/login.php on line 35

Notice: Trying to get property of non-object in /var/www/html/checkpoint/example/login.php on line 35

Notice: Trying to get property of non-object in /var/www/html/checkpoint/example/login.php on line 37
verification code sent to
Notice: Trying to get property of non-object in /var/www/html/checkpoint/example/verification_form.php on line 20
check and enter the verification code.

Can Verification but not get full cookie.

i check after login redirect from verification
code $insta = $instagram->saveSession(); at login.php
just save
{"cookies":{"rur":"FRC","mid":"XCeYPQABAAE50aWZygbXBGJYS_Gj","urlgen":""{\"103.28.149.106\": 58477}:1gdGub:SiLuw4ThkDPZzwoLoLfB8RhddBY"","mcd":"3","csrftoken":"5o3NaUgGxQu5sT0yrHdiUMqHkXPozkir"},"csrfToken":"5o3NaUgGxQu5sT0yrHdiUMqHkXPozkir","rankToken":"71656d1a-7350-4eaa-ade7-aacde0ab18a0","phoneId":"87b4127c-5681-482b-b898-a319032ba270","deviceId":"android-c32f524994678284","guid":"04691383-e914-401b-805a-0bb395e63d70","uuid":"04691383-e914-401b-805a-0bb395e63d70","googleAdId":"e67dc0ab-37c0-48a2-ba7a-f9d84a7d4144"}

why not full cookies ??

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.