insta

fetchHTML($url); $media = $this->parseJSON($html) ?: $this->parseOGMeta($html); if (!$media) throw new Exception('Could not extract media. Post may be private or deleted.'); return $media; } private function fetchHTML(string $url): string { $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_TIMEOUT => self::TIMEOUT, CURLOPT_USERAGENT => self::USER_AGENT, CURLOPT_HTTPHEADER => ['Accept-Language: en-US,en;q=0.9'], CURLOPT_ENCODING => '', ]); $html = curl_exec($ch); $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($code !== 200 || !$html) throw new Exception('Instagram unreachable. Try again.'); return $html; } private function parseJSON(string $html): ?array { if (preg_match('/]*>window\._sharedData\s*=\s*({.+?});<\/script>/s', $html, $m) || preg_match('/]*>"entry_data":\s*({.+?})<\/script>/s', $html, $m)) { $json = json_decode($m[1], true); $media = $json['entry_data']['PostPage'][0]['graphql']['shortcode_media'] ?? null; if ($media) { return [ 'type' => $media['is_video'] ? 'video' : 'image', 'url' => $media['is_video'] ? $media['video_url'] : $media['display_url'], 'thumb' => $media['display_url'], 'hd' => $media['is_video'] ? $media['video_url'] : $media['display_url'] ]; } } return null; } private function parseOGMeta(string $html): ?array { $doc = new DOMDocument(); @$doc->loadHTML($html); $metas = $doc->getElementsByTagName('meta'); $data = ['type' => 'image', 'url' => '', 'thumb' => '', 'hd' => '']; foreach ($metas as $meta) { $prop = $meta->getAttribute('property'); if ($prop === 'og:video') $data['url'] = $data['hd'] = $meta->getAttribute('content'); if ($prop === 'og:image') $data['thumb'] = $meta->getAttribute('content'); if ($prop === 'og:video:type' && str_contains($meta->getAttribute('content'), 'mp4')) $data['type'] = 'video'; } if ($data['url'] || $data['thumb']) return $data; return null; } } // ====================== PAGE LOGIC ====================== $page = $_GET['page'] ?? 'home'; $downloader = new InstagramDownloader(); $media = null; $error = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['url'])) { try { $media = $downloader->getMedia($_POST['url']); } catch (Exception $e) { $error = $e->getMessage(); } } // ====================== LEGAL CONTENT ====================== $privacy = '

Privacy Policy

We do not collect any personal data. No login required. Downloads are processed server-side and deleted immediately.

'; $terms = '

Terms & Conditions

This tool is for personal use only. Respect Instagram TOS and copyright. We are not affiliated with Instagram.

'; $about = '

About Us

The #1 free Instagram Reels Downloader. Fast, HD, no watermark. Built for speed and SEO excellence.

'; ?> Instagram Reels Downloader | Download Reels in HD 4K Free

Instagram Reels Downloader

Download Instagram Reels, Videos & Photos in Full HD 1080p / 4K instantly. Free, no login, no watermark.

Instagram media preview

✅ Ready to download!

Download Audio Only

Lightning Fast

instagram reels download in seconds – no app needed.

Works on Phone & PC

instagram reels download app alternative – fully online.

100% Safe & Free

No login. No watermark. HD & 4K support.

How to Download Instagram Reels

1

Copy link from Instagram Reel

Paste here → Download instantly in Full HD.

Instagram Reels Downloader FAQ

How to download Instagram reels in 4K?

Use our tool – it auto-detects highest quality.

Previous Post
No Comment
Add Comment
comment url

Ad closing in 8 seconds