postaddictme / instagram-php-scraper

Get account information, photos, videos, stories and comments.
https://packagist.org/packages/raiym/instagram-php-scraper
MIT License
3.1k stars 800 forks source link

Undefined index: mid #512

Closed sergeizhukov closed 5 years ago

sergeizhukov commented 5 years ago

Hello. Version is "^0.8.31" After install wrote the example code.


        $instagram = Instagram::withCredentials('login', 'password');

        $instagram->login();

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

        var_dump($account); exit;

Received:

Undefined index: mid

yii\base\ErrorException: Undefined index: mid in /vendor/raiym/instagram-php-scraper/src/InstagramScraper/Instagram.php:1359

Any ideas for resolve?

lukaspicha commented 5 years ago

I have same problem, but I use login method for getting list of followers, for getting account info you musn't be logged.

adisazhar123 commented 5 years ago

I'm getting this problem on a live server. Logging in on my local machine works though. My live server is hosted overseas. The problem may be because IG identifies a different login location, thus causing it not to login properly and returning incomplete response headers.

Does anyone have a solution for this?

lukaspicha commented 5 years ago

In InstagramScraper/Instagram.php class I remove all variables $mid and now it works for me.

adisazhar123 commented 5 years ago

@lukaspicha does it work if you're calling a function that requires a user to be logged in?

lukaspicha commented 5 years ago

@lukaspicha does it work if you're calling a function that requires a user to be logged in?

yes

timmoh commented 5 years ago

see #501 @raiym

raiym commented 5 years ago

thank you