Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Sistema de ouvir músicas pelo nome
- by Vaca_Marinha
- (isso aqui é gambiarra pura)
- Eu ia fazer com a API do soundcloud, porém não estão disponibilizando criar keys nela :v
- */
- $nome = (isset($_GET['n'])) ? urlencode($_GET['n']) : exit("Digite um nome");
- $url = "http://site.mtabrasil.com.br/musicas/?s=".$nome;
- $content = file_get_contents($url);
- $first_step = explode( '<audio controls preload="none">' , $content );
- $links = array();
- foreach ($first_step as $key => $value) {
- if($key > 0)
- {
- $second_step = explode("</audio>" , $value );
- if (preg_match('/"([^"]+)"/', $second_step[0], $m)) {
- array_push($links, $m[1]);
- break;
- } else {
- }
- }
- }
- header("Location: ".$links[0]);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement