postaddictme / instagram-php-scraper

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

Handle new album post #64

Closed fabianoroberto closed 6 years ago

fabianoroberto commented 7 years ago

After last update of instagram (more photos into one post), scraper fail during take post. Eg. in https://www.instagram.com/acmilanlive/media/ the first item is a new album post, but type is video and scraper fail here:

if ($instance->type === 'video') {
       if (isset($mediaArray['video_views'])) {
           $instance->videoViews = $mediaArray['video_views'];
        }
        $instance->videoLowResolutionUrl = $mediaArray['videos']['low_resolution']['url'];
        $instance->videoStandardResolutionUrl = $mediaArray['videos']['standard_resolution']['url'];
        $instance->videoLowBandwidthUrl = $mediaArray['videos']['low_bandwidth']['url'];
}

Someone know a valid solution/new url?

fabianoroberto commented 7 years ago

Same problem with official API

raiym commented 7 years ago

@fabianoroberto Thank you for PR. Let's wait for some time, maybe Instagram will fix it soon

superyarik commented 7 years ago

how handle "carousel" types? if i get images of user, i see megias with types "carousel", but i can see only first image in album. Can you handle this moment in docs?

fabianoroberto commented 7 years ago

I see now there use a new type

"type": "carousel",

and related field:

"carousel_media": []

karatemaccie commented 7 years ago

I added a pull request #134 to implement this feature.