Git Product home page Git Product logo

instagram-php's People

Contributors

ammarbrohi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

instagram-php's Issues

getInfoByName "Too many API Request" Error

When using the command getInfoByName($username), "Throttled by Instagram because of too many API requests." I see the error. There is no blocking when I log into the account and do the same. Where is the problem?

Challenge Required in Instagram API?

There is a challenge problem with Instagram. I tried with many different proxy but nothing change.(In two factor authentication methods SMS, Backup Codes...) I deleted the session folder, but no luck. Everything, it gives an error of "Challenge required". I verify that it was me on my Instagram, but when running the script I get the same error.

Code

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use InstagramAPI\Instagram;
class HomeController extends Controller
{

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        $this->middleware('auth');
    }

    /**
     * Show the application dashboard.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        return view('home');
    }

    public function test(Request $request){

        if($request->get('code')){
            $code = $request->get('code');
        }


        $username = "*****";
        $password = "*****";

        // Set allow dangerous
        Instagram::$allowDangerousWebUsageAtMyOwnRisk = true;

        $debug = false;
        $ig = new Instagram($debug, false);

        // Set proxy
        $ig->setProxy('**PROXY ADRESS**');

        try {

            $loginResponse = $ig->login($username, $password);
            print_r($loginResponse);
                if ($loginResponse !== null && $loginResponse->isTwoFactorRequired()) {

                        $twoFactorIdentifier = $loginResponse->getTwoFactorInfo()->getTwoFactorIdentifier();
//
//                    // The "STDIN" lets you paste the code via terminal for testing.
//                    // You should replace this line with the logic you want.
//                    // The verification code will be sent by Instagram via SMS.
//                    $verificationCode = trim(fgets(STDIN));
//                    $verificationCode = trim($code);
                    print_r($ig->finishTwoFactorLogin($username, $password, $twoFactorIdentifier, strval($code), '2'));
                    
//                    }
                }
        } catch (\Exception $e) {
            echo $e->getMessage();
        }
}
}

Debug Log

InstagramAPI\Response\LoginResponse: Challenge required.User not logged in. Please call login() and then try again.

checkpoint challenge on different country host the project

codes works on my local computer but when i upload it in live vps in another country when the package try to login it catch the checkpoint error.im assume its because the instagram account is occasionally login from different country(ip) than login from vps ip.
anyway i searched and found the method
$ig->setProxy('');
can anybody help me how to use it if it is the solution?

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.