Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- date_default_timezone_set("Asia/Jakarta");
- //header('Content-Type: application/json');
- error_reporting(0);
- $dlagu = new dlagu();
- echo $dlagu->check($_GET['artist'], $_GET['id'], $_GET['title']);
- class dlagu{
- public function check($artist, $idnya, $titlenya) {
- $linkcok = file_get_contents("https://downloadlagu321.net/api/search/$artist");
- preg_match_all('/"id":"(.+?)"/', $linkcok, $id);
- preg_match_all('/"title":"(.+?)"/', $linkcok, $title);
- // echo "ID : ", $id[1][0], " <br>Title : ", $title[1][0];
- // echo "<br><br>ID : ", $id[1][1], " <br>Title : ", $title[1][1];
- // echo "<br><br>ID : ", $id[1][2], " <br>Title : ", $title[1][2];
- // echo "<br><br>ID : ", $id[1][3], " <br>Title : ", $title[1][3];
- // echo "<br><br>ID : ", $id[1][4], " <br>Title : ", $title[1][4];
- // echo "<br><br>ID : ", $id[1][5], " <br>Title : ", $title[1][5];
- // echo "<br><br>ID : ", $id[1][6], " <br>Title : ", $title[1][6];
- // echo "<br><br>ID : ", $id[1][7], " <br>Title : ", $title[1][7];
- // echo "<br><br>ID : ", $id[1][8], " <br>Title : ", $title[1][8];
- // echo "<br><br>ID : ", $id[1][9], " <br>Title : ", $title[1][9];
- // echo "<br><br>ID : ", $id[1][11], " <br>Title : ", $title[1][11];
- // echo "<br><br>ID : ", $id[1][12], " <br>Title : ", $title[1][12];
- // echo "<br><br>ID : ", $id[1][13], " <br>Title : ", $title[1][13];
- // echo "<br><br>ID : ", $id[1][14], " <br>Title : ", $title[1][14];
- // echo "<br><br>ID : ", $id[1][15], " <br>Title : ", $title[1][15];
- // echo "<br><br>ID : ", $id[1][16], " <br>Title : ", $title[1][16];
- // echo "<br><br>ID : ", $id[1][17], " <br>Title : ", $title[1][17];
- // echo "<br><br>ID : ", $id[1][18], " <br>Title : ", $title[1][18];
- // echo "<br><br>ID : ", $id[1][19], " <br>Title : ", $title[1][19];
- // echo "<br><br><br>";
- $ch = curl_init('https://downloadlagu321.net/save-file?id='.$idnya.'&title='.$titlenya.'&artist=');
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Encoding: gzip, deflate, br',
- 'Accept-Language: id,en-US;q=0.7,en;q=0.3',
- 'Upgrade-Insecure-Requests: 1',
- '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',
- 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
- 'Cache-Control: max-age=0',
- 'Connection: keep-alive'));
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
- 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');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HEADER, 1);
- $result = curl_exec($ch);
- preg_match('/Location: (.+)/', $result, $linkloc);
- $nahx = file_get_contents($linkloc[1]);
- echo $nahx;
- }
- }
- ?>
Add Comment
Please, Sign In to add comment