Instagram-php-scraper: Video media not returning an URL

Created on 14 Nov 2017  路  5Comments  路  Source: postaddictme/instagram-php-scraper

Videos are not returning an URL to the video anymore. See example below.

[type:protected] => video
[link:protected] => https://www.instagram.com/p/BbVOUCvHSnY
[imageLowResolutionUrl:protected] => https://scontent.cdninstagram.com/t/s320x320/23498942_1896518027320877_1615031175015825408_n.jpg
[imageThumbnailUrl:protected] => https://scontent.cdninstagram.com/t/s150x150/23498942_1896518027320877_1615031175015825408_n.jpg
[imageStandardResolutionUrl:protected] => https://scontent.cdninstagram.com/t/s640x640/23498942_1896518027320877_1615031175015825408_n.jpg
[imageHighResolutionUrl:protected] => https://scontent.cdninstagram.com/t/23498942_1896518027320877_1615031175015825408_n.jpg
[videoLowResolutionUrl:protected] =>
[videoStandardResolutionUrl:protected] =>
[videoLowBandwidthUrl:protected] =>

wontfix

Most helpful comment

I did:

$midias = $instagram->getMedias($username,10);

            for ($i=0; $i<count($midias); $i++) {               
                if($midias[$i]->getType() == 'video'){
                    $link = $midias[$i]->getLink();
                    $json_media_by_url = $instagram->getMediaByUrl($link);
                    $video_url = $json_media_by_url['videoStandardResolutionUrl'];                  
                }

All 5 comments

It looks like the Instagram web-video player downloads video and audio tracks separately in 2-second chunks, and the track URLs aren't published in graphql responses. You can fetch the HTML player view for a video item from https://www.instagram.com/p/{{shortcode}} and you can scrape this for the meta tag with property="og:video" content="{{video_url}}" to get the URL for the full video.

I did:

$midias = $instagram->getMedias($username,10);

            for ($i=0; $i<count($midias); $i++) {               
                if($midias[$i]->getType() == 'video'){
                    $link = $midias[$i]->getLink();
                    $json_media_by_url = $instagram->getMediaByUrl($link);
                    $video_url = $json_media_by_url['videoStandardResolutionUrl'];                  
                }

this is works for me 馃憤

$media = $instagram->getMediaByUrl('https://www.instagram.com/p/BGuQBXrDH_b/');             
                if($media->getType() == 'video'){
                    $link = $media->getLink();
                    $json_media_by_url = $instagram->getMediaByUrl($link);
                    $video_url = $json_media_by_url['videoStandardResolutionUrl'];                  
                }
                echo $video_url;

I did:

$midias = $instagram->getMedias($username,10);

          for ($i=0; $i<count($midias); $i++) {               
              if($midias[$i]->getType() == 'video'){
                  $link = $midias[$i]->getLink();
                  $json_media_by_url = $instagram->getMediaByUrl($link);
                  $video_url = $json_media_by_url['videoStandardResolutionUrl'];                  
              }

greeattt!!!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luengwaiban picture luengwaiban  路  5Comments

phoenixh picture phoenixh  路  5Comments

juangrimm picture juangrimm  路  8Comments

Tripoli96 picture Tripoli96  路  5Comments

kiskaserver picture kiskaserver  路  4Comments