-
-
Save harran55/ce33f23ed6e9d79b1ac203f2b70ad8e7 to your computer and use it in GitHub Desktop.
ini_set('display_errors', 1); | |
error_reporting(E_ALL ^ E_NOTICE); | |
function file_get_contents_curl($url) | |
{ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
return $data; | |
} | |
if (!isset($_GET["url"])){ | |
?> | |
<form> | |
<input placeholder="ضع الرابط هنا https://www.instagram.com/p/BZJNeBDBmwe/" name="url" /> | |
<input type="submit" value="تحميل"> | |
</form> | |
<?php | |
die(); | |
} | |
$html = file_get_contents_curl($_GET["url"]); | |
//parsing begins here: | |
$doc = new DOMDocument(); | |
@$doc->loadHTML($html); | |
$metas = $doc->getElementsByTagName('meta'); | |
for ($i = 0; $i < $metas->length; $i++) | |
{ | |
$meta = $metas->item($i); | |
$src = $meta->getAttribute('content'); | |
if (strpos($src, 'cdninstagram') !== false) { | |
$src=str_replace("http:", "https:", $src); | |
echo " | |
<embed src=\"$src\"> | |
<br/> | |
رابط مباشر للملف | |
<br/> | |
<input name=\"textfield\" type=\"text\" value=\"$src\"><a class=\"download\" download href='$src'>تحميل الملف</a><br> | |
<br/> | |
"; | |
} |
xlmnxp
commented
Sep 21, 2017
die(); } $html = file_get_contents_curl($_GET["url"]); //parsing begins here: $doc = new DOMDocument(); @$doc->loadHTML($html); $metas = $doc->getElementsByTagName('meta'); for ($i = 0; $i < $metas->length; $i++) { $meta = $metas->item($i); $src = $meta->getAttribute('property'); if ($src == 'og:video:secure_url') || ($src == 'og:image') { $src=str_replace("http:", "https:", $src); echo " <embed src=\"$src\"> <br/> رابط مباشر للملف <br/> <input name=\"textfield\" type=\"text\" value=\"$src\"><a class=\"download\" download href='$src'>تحميل الملف</a><br> <br/> "; } }
ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE);
function file_get_contents_curl($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
if (!isset($_GET["url"])){
?>
<form>
<input placeholder="ضع الرابط هنا https://www.instagram.com/p/BZJNeBDBmwe/" name="url" />
<input type="submit" value="تحميل">
</form>
<?php
die();
}
$html = file_get_contents_curl($_GET["url"]);
//parsing begins here:
$doc = new DOMDocument();
@$doc->loadHTML($html);
$metas = $doc->getElementsByTagName('meta');
for ($i = 0; $i < $metas->length; $i++)
{
$meta = $metas->item($i);
$src = $meta->getAttribute('property');
if ($src == 'og:video:secure_url') || ($src == 'og:image')) {
$link = $meta->getAttribute('content');
$link = str_replace("http:", "https:", $link);
echo "<embed src=\"$link\"><br/>رابط مباشر للملف<br/>
<input name=\"textfield\" type=\"text\" value=\"$link\"><a class=\"download\" download href='$link'>تحميل الملف</a><br><br/>";
}
}
if (strpos($src, 'og:video:secure_url') !== false || strpos($src, 'og:image') !== false) {
$link = $meta->getAttribute('content');
$link = str_replace("http:", "https:", $link);