EG Information
Training Missions
Knowledge Bank
Pimp Us Out!
Has Enigma Group Helped You? Then Help Us By Advertising For Us. Place One Of The Following Images On Your Site And Create A Link Back To Enigma Group.
|
| |
Affiliates
|
|
Enigma Group's Code Bank
Soundcloud mp3 extract0rBy: c0re - Date Submitted: 2011-01-19 09:05:43 <?php /* @name: soundcloud-mp3-extract0r.php * @author: c0re <http://enigmagroup.org/> * @version: 1.0 * @copyright: <http://creativecommons.org/licenses/by-nc-sa/3.0/> */ '------------------------------------------------------ _ _ _ ___ ___ _ _ ___ _| |___| |___ _ _ _| | |_ -| . | | | | . | _| | . | | | . | |___|___|___|_|_|___|___|_|___|___|___| mp3 extract0r by c0re <http://enigmagroup.org/> ------------------------------------------------------'; $url = urldecode(@$argv[1]); //1 parameter is original url die("\n[-]ERROR: invalide arguments passed"); } //now we combine all and get our mp3 ;) downloadMp3(getSource($url),$name); print("\n\n[DONE] file saved in ".@getcwd()."\\".$name.".mp3\n "); ?> <?php function getSource($url) { //with a strong regex pattern to validate urls copy as you like.. $pattern = '%\b(?:(?:http|https)://|www\.)[\d.a-z-]+\.[a-z]{2,6}(?::\d{1,5}+)?(?:/[!$\'()*+,._a-z-]++){0,10}(?:/[!$\'()*+,._a-z-]+)?(?:\?[!$&\'()*+,.=_a-z-]*)?%i'; //..we check if url is valid if(!preg_match($pattern, $url)) { die("\n[-]ERROR: argv[1] doesnt look like an URL"); } //next check if curl is available if (!function_exists('curl_init')) { $markup = file_get_contents($url); if(empty($markup)) { die("\n[-]ERROR: couldnt get markup"); } //find anything between streamUrl":" and ", //( eg: "streamUrl":"http://media.soundcloud.com/stream/3mZyUWW9iikL?stream_token=wK1Cm", ) if(preg_match('/streamUrl\"\:\"(.*?)\"\,/', $markup, $stream)) { //return the splitted array from the regex } } //set a blank + useragent for the header $referer = ""; $useragent = "Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13"; //send an header array containing normal looking firefox 3.x.x data "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept-Language: en-us;q=0.5,en;q=0.3", "Accept-Encoding: gzip,deflate", "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7", "Keep-Alive: 115", "Connection: keep-alive" ); //initialize the handle //stuff it all in an array for curl_setopt CURLOPT_URL => $url, //set the url CURLOPT_RETURNTRANSFER => true, //return webpage CURLOPT_BINARYTRANSFER => true, //return untouch data CURLOPT_USERAGENT => $useragent, //send custom useragent CURLOPT_REFERER => $referer, //send custom refferer CURLOPT_HTTPHEADER => $header, //send custom header CURLOPT_ENCODING => "", //handle all encodings CURLOPT_HEADER => false, //dont return headers CURLOPT_TIMEOUT => 10 //a little break ); //apply the options array //execute the whole thing //get the answer for error code checking //close handle, free up memory //check for html error codes if($returncode != 200 && $returncode != 302 && $returncode != 304) { die("\n[-]ERROR: this URL seems not alive!"); } //check if we got html source to search //find anything between streamUrl":" and ", //( eg: "streamUrl":"http://media.soundcloud.com/stream/3mZyUWW9iikL?stream_token=wK1Cm", ) if(preg_match('/streamUrl\"\:\"(.*?)\"\,/', $markup, $stream)) { //return the splitted array from the regex } else { die("\[-]nERROR: cant find the streamUrl"); } } else { die("\n[-]ERROR: couldnt receive html source"); } } function downloadMp3($stream,$name) { //check if we find any extension in $name die("\n[-]ERROR: argv[2] doesnt need any kind of extension"); } //just send a blank referer now $referer = ""; //initialize the handle //set the new filename $filename = dirname(__FILE__).'/'.$name.'.mp3'; //set the filehandle for writing $handle = fopen($filename,'w'); //stuff it all in an array for curl_setopt CURLOPT_URL => $stream, //set the url CURLOPT_FOLLOWLOCATION => true, //follow location headers /* PLEASE NOTE: without curlopt_followlocation set this wont work because soundcloud redirects you to a random created link */ CURLOPT_REFERER => $referer, //sent custom refferer CURLOPT_HEADER => false, //dont return headers CURLOPT_FILE => $handle, //set the file handle ); //apply the options array //execute it //close handle, free up memory //close the file handle, free up memory } ?>
|
| Return to
php category list |
|
|
Who Visited EnigmaGroup Today?
1387 Guests, 227 Users (216 Spiders)
terrorbyte, Pabz, Nightraven, cat1vo, lolzsec, interspirehost, lamb, tgm001, plex, Edika, TheCheeseDemon, rockcraft, recoveryToolbox, saraf, soufiaane, sickmind, mjneat, famous0123, Galagatron, dark_void, CJ_Omaha, junaid_junaid59, JohnJohnJohn, ssmaslov, psychomarine, Dregoon, Patrickk, Aska, Beat_Slayer, M0rdak, Ausome1, Imre, Vreality2007, mmndglxuwn, m0rt, unholyblood, iterrumzz, VurbTrurb, Mayonoula, MAMWOURBROR, mutabor, gobinda, cossyDrybrich, Razin, zaCruBumas8, hunja, johny34, pantoufle, bagy, arctica, hackarchives, UsedDeteKef, Peculator, Fadhilat606, TheTrueMonarch, Pascall01, hackaday, Tjm, arndevil, flairvelocity, lol, alphbond, kdivanov, elizbethallis6, Rik, bn11, BorgBot, SHASHANK101hello, 4poc4lyptic, ksajxai, nbmorri1, electro-technic, شمالي عرعر, AutobotPrime, Underleaf, The End, tomtombomb, killobyte, snowgirlx, so_saucey, zerolife, Althor, Cramps, Hekser, Hyperborn, cyber-guard, jhgrunn, cobra, Partisan, MAZI_, cyborg, GenbreedX, moel77, cliptoX, pwnpwnlolz, letshavepie, Mrwormz, yshiau, mirmo, roozyoppomo, soft_devil, cls777, scoobywan, Reiversed, joshua, st3alth, Afrika, PaiffDryday, venter, Anthony12796, sh3llcod3, 8FIGURE, Rannim, Evil1, maloaboy, BACanON, SlayingDragons, Repuhlsive, IvanDimitriev, 1RiB, mzungudo, Micro_Geek, iMaxx, aciboummamymn, k0unterkulcher, somebody777, m14m16, GoododotAlcob, negasora, Rastii, UninueMem, Swifsolja, ad.conquest, ngolatkar, Infinity8, Jigoku, thesupervisor, p0is0n5ting, kernel_mod, AKL, GothicLogic, themastersinner, dnatrixene135, ChewBigRed, kalak55, sejem, cve916, pollolololo, triecturn, Violatedsmurf, Ops, jmp, xsiemich, generalisimo, strudels, ga3ttpom, KingOfBritains, epoch_qwert, suten, FriskyKat, Ryuske, Adonis Achilles, ubqbcdzzhf, 3vil, US£RNAM£, Weindittewcon, Batesheelocot, GSmyrlis, MaxMeier, Elite.America, rabbidmind, Psiber_Syn, phoenix22, imittyerrotte, peewster, cyberturtle, ctb, dexgeda, sdw, Pizza, White_widdow, devarian, finesse, Nature112091777, Danc7171, Alphadragon, Estadagause, 53QR10U5, Xargos, Alkomage, hardlock, Barry Gonzoles, MineDweller, Gkjt, N4g4c3N, [I]nfectedbug, wimsteege, aqr5zdcw, xin214, Bugshuppy, SnoopSky, Hessesian, voodooKobra, sKcarr, IROverRated, W1F1G3NJU75U, Baddy, ziadmosaan, gamble86, realzs, CruelDemon, Shinju, aVoid, aquiredanonymity, kukumumu, web_request, callmeneon, KissMyDAFFODIL, Feld Grau, Abhinav2107, prabhataditya, mbuyiselo, shumer, phenom216, princennamdi, huskyboiza, ninety-nine |
| |
|
|
|
|
|