diff --git a/src/InstagramScraper/Model/Media.php b/src/InstagramScraper/Model/Media.php index 6edc7886..74f18a5b 100644 --- a/src/InstagramScraper/Model/Media.php +++ b/src/InstagramScraper/Model/Media.php @@ -63,7 +63,7 @@ class Media extends AbstractModel /** * @var array */ - protected $squareThumbnailsUrl = []; + protected $squareImages = []; /** * @var array @@ -277,9 +277,9 @@ public function getImageHighResolutionUrl() /** * @return array */ - public function getSquareThumbnailsUrl() + public function getSquareImages() { - return $this->squareThumbnailsUrl; + return $this->squareImages; } @@ -449,23 +449,27 @@ protected function initPropertiesCustom($value, $prop, $arr) $this->likesCount = $arr[$prop]['count']; break; case 'display_resources': - foreach ($value as $thumbnail) { - $thumbnailsUrl[] = $thumbnail['src']; - switch ($thumbnail['config_width']) { + foreach ($value as $media) { + $mediasUrl[] = $media['src']; + switch ($media['config_width']) { case 640: - $this->imageThumbnailUrl = $thumbnail['src']; + $this->imageThumbnailUrl = $media['src']; break; case 750: - $this->imageLowResolutionUrl = $thumbnail['src']; + $this->imageLowResolutionUrl = $media['src']; break; case 1080: - $this->imageStandardResolutionUrl = $thumbnail['src']; + $this->imageStandardResolutionUrl = $media['src']; break; - default: - ; } } - $this->squareThumbnailsUrl = $thumbnailsUrl; + break; + case 'thumbnail_resources': + $squareImagesUrl = []; + foreach ($value as $squareImage) { + $squareImagesUrl[] = $squareImage['src']; + } + $this->squareImages = $squareImagesUrl; break; case 'display_url': $this->imageHighResolutionUrl = $value;