Php 如何解决Instagram mgp25 API中所需的挑战?

Php 如何解决Instagram mgp25 API中所需的挑战?,php,instagramapi-mgp25,Php,Instagramapi Mgp25,我在我的网站上有一个名为的工作脚本,它工作得非常好。突然,几天前,我根本无法使用我的脚本。一切,它给出了一个“需要挑战”的错误。我在Instagram上确认是我,但在运行脚本时,我得到了相同的错误 我删除了会话文件夹,但没有成功 我在这里读到的问题是因为不同的IP。但我所有的设备都使用同一个互联网,我根本没有代理 我有以下错误 Fatal error: Uncaught InstagramAPI\Exception\ChallengeRequiredException: InstagramAPI

我在我的网站上有一个名为的工作脚本,它工作得非常好。突然,几天前,我根本无法使用我的脚本。一切,它给出了一个“需要挑战”的错误。我在Instagram上确认是我,但在运行脚本时,我得到了相同的错误

我删除了会话文件夹,但没有成功

我在这里读到的问题是因为不同的IP。但我所有的设备都使用同一个互联网,我根本没有代理

我有以下错误

Fatal error: Uncaught InstagramAPI\Exception\ChallengeRequiredException: InstagramAPI\Response\LoginResponse: Challenge required.uring import data.

您需要使用库提供的双因素身份验证方法。以下是一个例子:

<?php

set_time_limit(0);
date_default_timezone_set('UTC');

require __DIR__.'/../vendor/autoload.php';

/////// CONFIG ///////
$username = '';
$password = '';
$debug = true;
$truncatedDebug = false;
//////////////////////

$ig = new \InstagramAPI\Instagram($debug, $truncatedDebug);

try {
    $loginResponse = $ig->login($username, $password);

    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));
        $ig->finishTwoFactorLogin($username, $password, $twoFactorIdentifier, $verificationCode);
    }
} catch (\Exception $e) {
    echo 'Something went wrong: '.$e->getMessage()."\n";
}


composer要求adrifkat/instagram api下载@tblanks1980包(我不清楚你到底在问什么,但“IInstazood自动喜欢、关注、评论、取消关注和发布instagram”对我来说,这听起来很像垃圾邮件机器人的定义,所以我认为这里首先不应该支持这一点。)问题是,当我使用Instagram mgp25 API登录时,它会给我异常挑战RequiredException如何在Codeigniter中处理此异常。