<?php
if (isset($_POST[‘ivd_download’])) {
$instagram_url = $_POST[‘instagram_url’];
$html = file_get_contents($instagram_url);
preg_match(‘/<meta property=”og:video” content=”(.*?)”/’, $html, $video_url);
$video_url = $video_url[1];
header(“Content-Type: video/mp4”);
header(“Content-Disposition: attachment; filename=instagram-video.mp4”);
readfile($video_url);
exit;
}