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] =>
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.
Most helpful comment
I did: