CaFc_Versace

Bypass SoundCloud Disable Download

Nov 14th, 2015
2,101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.73 KB | None | 0 0
  1. <?php
  2. /**
  3.   (c) 2015, made by;
  4.   --
  5.   Dwi Siswanto ([email protected])
  6.   dwi-siswant0.blogspot.com
  7.   --
  8. **/
  9.  
  10. define("client_id", "02gUJC0hH2ct1EGOcYXQIzRFU91c72Ea"); // This is public "client id"
  11.  
  12. function hajar($yuerel, $dataAing = null) {
  13.     $cuih = curl_init();
  14.     curl_setopt($cuih, CURLOPT_URL, $yuerel);
  15.     if ($dataAing != null){
  16.         curl_setopt($cuih, CURLOPT_POST, true);
  17.         curl_setopt($cuih, CURLOPT_POSTFIELDS, $dataAing);
  18.     }
  19.     curl_setopt($cuih, CURLOPT_FOLLOWLOCATION, true);
  20.     curl_setopt($cuih, CURLOPT_RETURNTRANSFER, true);
  21.     curl_setopt($cuih, CURLOPT_SSL_VERIFYPEER, false);
  22.     curl_setopt($cuih, CURLOPT_COOKIESESSION, true);
  23.     $eks = curl_exec($cuih);
  24.     curl_close($cuih);
  25.     return $eks;
  26. }
  27.  
  28. if (isset($argv[1])) {
  29.     $meta = getInpoh($argv[1]);
  30.     echo $meta;
  31. } else {
  32.     echo "usage; this.php <soundcloud link>";
  33.     exit;
  34. }
  35.  
  36. function getInpoh($link) {
  37.     echo "# Getting info: ";
  38.     $data = json_decode(hajar("https://api.soundcloud.com/resolve.json?client_id=" . client_id . "&url=" . $link), true);
  39.     if (isset($data['errors'])) {
  40.         echo "ERROR!\n" . $data['errors'][0]['error_message'];
  41.         exit;
  42.     } else {
  43.         echo "OK!\n";
  44.         sleep(1);
  45.         echo "Artis: " . $data['user']['username'];
  46.         echo "\nTitle: " . $data['title'];
  47.         echo "\nGenre: " . $data['genre'] . "\n\n";
  48.         // echo "\nLink : " . $data['permalink_url'] . "\n\n";
  49.         $dl = getDownload($data['uri']);
  50.     }
  51. }
  52.  
  53. function getDownload($link) {
  54.     echo "# Getting download url: ";
  55.     $data = json_decode(hajar($link . "/streams?client_id=" . client_id), true);
  56.     if (isset($data['errors'])) {
  57.         echo "ERROR!\n" . $data['errors'][0]['error_message'];
  58.     } else {
  59.         echo "OK!\n";
  60.         echo "Link : " . $data['http_mp3_128_url'];
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment