Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error: Uncaught InstagramScraper\Exception\InstagramException: Response code is 302. #823

Closed
kagandev opened this issue Dec 12, 2020 · 5 comments
Labels

Comments

@kagandev
Copy link

kagandev commented Dec 12, 2020

My code is:

`require __DIR__ . '/vendor/autoload.php';
ini_set('display_errors', 1);
error_reporting(E_ALL);

$instagram = new \InstagramScraper\Instagram(new \GuzzleHttp\Client());

// For getting information about account you don't need to auth:

$account = $instagram->getAccount('kevin');

// Available fields
echo "Account info:\n";
echo "Id: {$account->getId()}\n";
echo "Username: {$account->getUsername()}\n";
echo "Full name: {$account->getFullName()}\n";
echo "Biography: {$account->getBiography()}\n";
echo "Profile picture url: {$account->getProfilePicUrl()}\n";
echo "External link: {$account->getExternalUrl()}\n";
echo "Number of published posts: {$account->getMediaCount()}\n";
echo "Number of followers: {$account->getFollowsCount()}\n";
echo "Number of follows: {$account->getFollowedByCount()}\n";
echo "Is private: {$account->isPrivate()}\n";
echo "Is verified: {$account->isVerified()}\n";`

It was working until 30 minutes ago. I can't understand why.

@goldfischart
Copy link

We have the same issue. Nearly ever request end in a 302 Error

@restyler
Copy link

If you are trying to access public account, chances are your ip just got banned by Instagram, so it redirects you to /login page when you try to access profile page. Take a look at proxified version of this scaper to mitigate the issue. https://github.com/restyler/instagram-php-scraper

@nalin88
Copy link

nalin88 commented Feb 25, 2021

then how do we login on Instagram with server IP?? I tried to log in with this code

$instagram = \InstagramScraper\Instagram::withCredentials(new \GuzzleHttp\Client(), 'xxx', 'xxx', new Psr16Adapter('Files'));
$instagram->login();

but it gives an error because I need to verify it with server IP using opt or what so ever method... please guide us ... a lot of us are facing the same issue

@stale
Copy link

stale bot commented Jun 9, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jun 9, 2021
@stale stale bot closed this as completed Jun 16, 2021
@rangelrmorais
Copy link

Same here
`
Warning: Undefined property: stdClass::$authenticated in /home/xxx/public_html/wp-content/themes/Newspaper-child/includes/vendor/raiym/instagram-php-scraper/src/InstagramScraper/Instagram.php on line 2206

Fatal error: Uncaught InstagramScraper\Exception\InstagramAuthException: User credentials are wrong. in /home/xxx/public_html/wp-content/themes/Newspaper-child/includes/vendor/raiym/instagram-php-scraper/src/InstagramScraper/Instagram.php:2207 Stack trace: #0 /home/xxx/public_html/wp-content/themes/Newspaper-child/includes/get.php(13): InstagramScraper\Instagram->login() #1 {main} thrown in /home/xxx/public_html/wp-content/themes/Newspaper-child/includes/vendor/raiym/instagram-php-scraper/src/InstagramScraper/Instagram.php on line 2207`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants