cdfteller

Download Lagu321

Nov 1st, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. <?php
  2. date_default_timezone_set("Asia/Jakarta");
  3. //header('Content-Type: application/json');
  4. error_reporting(0);
  5.  
  6.  
  7. $dlagu = new dlagu();
  8. echo $dlagu->check($_GET['artist'], $_GET['id'], $_GET['title']);
  9.  
  10. class dlagu{
  11. public function check($artist, $idnya, $titlenya) {
  12. $linkcok = file_get_contents("https://downloadlagu321.net/api/search/$artist");
  13.  
  14. preg_match_all('/"id":"(.+?)"/', $linkcok, $id);
  15. preg_match_all('/"title":"(.+?)"/', $linkcok, $title);
  16.  
  17. // echo "ID : ", $id[1][0], " <br>Title : ", $title[1][0];
  18. // echo "<br><br>ID : ", $id[1][1], " <br>Title : ", $title[1][1];
  19. // echo "<br><br>ID : ", $id[1][2], " <br>Title : ", $title[1][2];
  20. // echo "<br><br>ID : ", $id[1][3], " <br>Title : ", $title[1][3];
  21. // echo "<br><br>ID : ", $id[1][4], " <br>Title : ", $title[1][4];
  22. // echo "<br><br>ID : ", $id[1][5], " <br>Title : ", $title[1][5];
  23. // echo "<br><br>ID : ", $id[1][6], " <br>Title : ", $title[1][6];
  24. // echo "<br><br>ID : ", $id[1][7], " <br>Title : ", $title[1][7];
  25. // echo "<br><br>ID : ", $id[1][8], " <br>Title : ", $title[1][8];
  26. // echo "<br><br>ID : ", $id[1][9], " <br>Title : ", $title[1][9];
  27. // echo "<br><br>ID : ", $id[1][11], " <br>Title : ", $title[1][11];
  28. // echo "<br><br>ID : ", $id[1][12], " <br>Title : ", $title[1][12];
  29. // echo "<br><br>ID : ", $id[1][13], " <br>Title : ", $title[1][13];
  30. // echo "<br><br>ID : ", $id[1][14], " <br>Title : ", $title[1][14];
  31. // echo "<br><br>ID : ", $id[1][15], " <br>Title : ", $title[1][15];
  32. // echo "<br><br>ID : ", $id[1][16], " <br>Title : ", $title[1][16];
  33. // echo "<br><br>ID : ", $id[1][17], " <br>Title : ", $title[1][17];
  34. // echo "<br><br>ID : ", $id[1][18], " <br>Title : ", $title[1][18];
  35. // echo "<br><br>ID : ", $id[1][19], " <br>Title : ", $title[1][19];
  36. // echo "<br><br><br>";
  37.  
  38. $ch = curl_init('https://downloadlagu321.net/save-file?id='.$idnya.'&title='.$titlenya.'&artist=');
  39. curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Encoding: gzip, deflate, br',
  40. 'Accept-Language: id,en-US;q=0.7,en;q=0.3',
  41. 'Upgrade-Insecure-Requests: 1',
  42. 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36',
  43. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
  44. 'Cache-Control: max-age=0',
  45. 'Connection: keep-alive'));
  46. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  47. curl_setopt($ch,CURLOPT_USERAGENT,' Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36');
  48. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  49. curl_setopt($ch, CURLOPT_HEADER, 1);
  50. $result = curl_exec($ch);
  51.  
  52. preg_match('/Location: (.+)/', $result, $linkloc);
  53.  
  54. $nahx = file_get_contents($linkloc[1]);
  55. echo $nahx;
  56. }
  57. }
  58. ?>
Add Comment
Please, Sign In to add comment