pgrimaud/instagram-user-feed

Error while getting profile data

d35k opened this issue · 3 comments

Version(s) affected: ^6.16

Description
We started to get error that shown before. I made little investigation and found that some of the nodes are not send or sent empty.

How to reproduce
This problem occurs while fetching the profile data

Screenshot 2023-12-20 at 20 03 29

image

Specifically, this line is failing:

foreach ($data->edge_felix_video_timeline->edges as $item) {

I can confirm that several accounts are missing that property in the $data object. Assuming this change only affects some accounts we'll need some isset() calls around it, until the lib can be upgraded to only allow 8.0.0 or higher and we can use the nullsafe operator


The related function hydrateMedias():

foreach ($data->edge_owner_to_timeline_media->edges as $item) {
...is not failing, but accounts are returning this:

    [edge_owner_to_timeline_media] => stdClass Object
        (
            [count] => 396
            [page_info] => stdClass Object
                (
                    [has_next_page] => 1
                    [end_cursor] =>
                )

            [edges] => Array
                (
                )

        )

So it looks like we're going to need to make more calls to retrieve data

@cookieguru, thank you for fast and detailed response.

First I got this error, I've updated with the nullsafe operator directly in the vendor, and I am happy to help to contribute this package about this issue with a pull request.

Do you have any suggestions in order to receive the account media?

Click around in the UI and see which actions get the data, and then incorporate those same calls into the library