Skip to content

Commit

Permalink
Fixes #197. Fix error when media type is image for videos
Browse files Browse the repository at this point in the history
  • Loading branch information
raiym committed Nov 8, 2017
1 parent 56294f4 commit 561f381
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/InstagramScraper/Model/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,15 @@ protected function initPropertiesCustom($value, $prop, $arr)
$this->imageThumbnailUrl = $images['thumbnail'];
$this->type = self::TYPE_IMAGE;
break;
case '__typename':
if ($value === 'GraphImage') {
$this->type = static::TYPE_IMAGE;
} else if ($value === 'GraphVideo') {
$this->type = static::TYPE_VIDEO;
} else if ($value === 'GraphSidecar') {
$this->type = static::TYPE_SIDECAR;
}
break;
}
if (!$this->ownerId && !is_null($this->owner)) {
$this->ownerId = $this->getOwner()->getId();
Expand Down

1 comment on commit 561f381

@faiq-naseem
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raiym still same issue.

Please sign in to comment.