Advertisement
AbdulMuttaqin

ig scrap

Oct 23rd, 2019
2,657
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <?php
  2. $judul = " Instagram Photo/Video Downloader ";
  3. include '../head.php';
  4. ?>
  5. <style>
  6. embed{
  7. max-width: 100%;
  8. width: 400px;
  9. padding-top: 20px;
  10. }
  11. body {
  12. text-align: center;
  13. }
  14. </style>
  15.  
  16. <?php
  17.  
  18. ini_set('display_errors', 1);
  19. error_reporting(E_ALL ^ E_NOTICE);
  20.  
  21.  
  22. function file_get_contents_curl($url)
  23. {
  24.     $ch = curl_init();
  25.  
  26.     curl_setopt($ch, CURLOPT_HEADER, 0);
  27.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  28.     curl_setopt($ch, CURLOPT_URL, $url);
  29.     curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  30.  
  31.     $data = curl_exec($ch);
  32.     curl_close($ch);
  33.  
  34.     return $data;
  35. }
  36. if (!isset($_GET["url"])){
  37.    
  38.  
  39. $html = file_get_contents_curl($_GET["url"]);
  40.  
  41. //parsing begins here:
  42. $doc = new DOMDocument();
  43. @$doc->loadHTML($html);
  44.  
  45.  
  46. $metas = $doc->getElementsByTagName('meta');
  47. for ($i = 0; $i < $metas->length; $i++)
  48. {
  49.     $meta = $metas->item($i);
  50.        $src = $meta->getAttribute('content');
  51. if (strpos($src, 'cdninstagram') !== false) {
  52. $src=str_replace("http:", "https:", $src);
  53. echo "
  54. <div class=\"container\">
  55.     <div class=\"panel panel-primary\">
  56.         <div class=\"panel-heading\">
  57.             <h4><center><i class=\"fas fa-sign-in-alt\"></i> Hasil </center></h4>
  58.         </div>
  59.           <div class=\"panel-body\">
  60.             <center>
  61.  
  62.          
  63. <embed src=\"$src\"><br><br><a class=\"btn btn-info\" href='$src'>Direct Link</a><br>
  64. </div>
  65.          
  66.     </div>
  67.  </div>
  68. ";
  69. }
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement