pgrimaud / instagram-user-feed

This is a scrapper to easily fetch any feed and interact with Instagram (like, follow, etc.) without OAuth for PHP.
MIT License
882 stars 138 forks source link

Syntax error in must of methods #298

Open hossein-rp opened 2 years ago

hossein-rp commented 2 years ago

hi i have this problem can any body knows how to solve it?

show me this error in must of methods .

thank you.

PHP Fatal error: Uncaught Instagram\Exception\InstagramFetchException: Syntax error in C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Transport\AbstractDataFeed.php:61 Stack trace:

0 C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Transport\JsonMediaDetailedDataFeed.php(21): Instagram\Transport\AbstractDataFeed->fetchJsonDataFeed('https://www.ins...')

1 C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Api.php(361): Instagram\Transport\JsonMediaDetailedDataFeed->fetchData(Object(Instagram\Model\Media))

2 C:\xampp2\htdocs\instagram\instagram-user-feed\examples\media-detailed.php(24): Instagram\Api->getMediaDetailed(Object(Instagram\Model\Media))

3 {main}

thrown in C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Transport\AbstractDataFeed.php on line 61

Fatal error: Uncaught Instagram\Exception\InstagramFetchException: Syntax error in C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Transport\AbstractDataFeed.php:61 Stack trace:

0 C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Transport\JsonMediaDetailedDataFeed.php(21): Instagram\Transport\AbstractDataFeed->fetchJsonDataFeed('https://www.ins...')

1 C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Api.php(361): Instagram\Transport\JsonMediaDetailedDataFeed->fetchData(Object(Instagram\Model\Media))

2 C:\xampp2\htdocs\instagram\instagram-user-feed\examples\media-detailed.php(24): Instagram\Api->getMediaDetailed(Object(Instagram\Model\Media))

3 {main}

thrown in C:\xampp2\htdocs\instagram\instagram-user-feed\vendor\pgrimaud\instagram-user-feed\src\Instagram\Transport\AbstractDataFeed.php on line 61

WallisonBreno commented 2 years ago

I'm having the same problem, any results?

wailashraf71 commented 2 years ago

Same Here ....

brucekasinsky commented 2 years ago

same here

nestl1ng commented 2 years ago

same here

hossein-rp commented 2 years ago

i have found a solution for it but currently i am working on a project after finished it i will tell you how to fix it

Rubberg commented 2 years ago

Same here! The request returns a response with status 200 but with an empty body.

axelverdruye commented 2 years ago

Ive got the same issue since a couple of days ago. Is there a workaround for this because now my production site is down. Thanks!

peterjohnhunt commented 2 years ago

I have experienced this several times just in the last week or two and was able to fix it by deleting the cache folder, which forces it to re-login and then it works. Would be nice for it to auto handle that if possible! just started in the past couple of weeks.

pgrimaud commented 2 years ago

I have experienced this several times just in the last week or two and was able to fix it by deleting the cache folder, which forces it to re-login and then it works. Would be nice for it to auto handle that if possible! just started in the past couple of weeks.

This is a nice idea. Handle the issue and re-log the account automatically. šŸ”„

peterjohnhunt commented 2 years ago

just a quick update here. our cached logged in session seems to be getting quietly expired almost on the daily. For now i am continuing to delete the cache folder and re-login via the app which works for a day or so.

Rubberg commented 2 years ago

Still the same pb. Method getProfile() returns code 200 with some html as datas (probably the instagram login page) causing a Syntax error in json_decode().

There are many issues opened for the same error : https://github.com/pgrimaud/instagram-user-feed/issues/335 https://github.com/pgrimaud/instagram-user-feed/issues/318 https://github.com/pgrimaud/instagram-user-feed/issues/291

paulhennell commented 1 year ago

@peterjohnhunt Thanks for sharing! Just solved my issues with login by deleting the cache.

matinwd commented 1 year ago

Worked like charm! thank to everyone here. But still there is a question. If we have to clear the cache every time and re-login a lot of times does instagram ban us?