ipsBruno

(PHP) Tubidy Downloader

Dec 5th, 2012
637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.06 KB | None | 0 0
  1. <?php
  2.  
  3.     /*--------------------------------------------
  4.    
  5.         Pegar link para download via-tubidy
  6.           Link direto via MP3 download
  7.  
  8.          Por Bruno da Silva @ brunodasilva.com
  9.          
  10.     ----------------------------------------------*/
  11.  
  12.  
  13.     $musica = $_GET['musica'];
  14.    
  15.     $url = "http://tubidy.mobi/search.php?q=" . urlencode($musica);
  16.    
  17.     $array1 = explode( "<a href=\"/watch/" , file_get_contents($url) );
  18.     $array2 = explode( "\">",  $array1[1] );
  19.    
  20.     $url = "http://tubidy.mobi/watch/" . $array2[0];
  21.    
  22.  
  23.     $matriz0 = explode( "alt=\"MP3 Download\"", get_data($url) );
  24.    
  25.     $matriz1 = explode( "<a href=\"",           $matriz0[1] );
  26.     $matriz2 = explode( "\">MP3 ",              $matriz1[1] );
  27.    
  28.  
  29.     echo $matriz2[0];
  30.    
  31.     function get_data($url) {
  32.    
  33.         $ch = curl_init();
  34.  
  35.         curl_setopt($ch,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
  36.         curl_setopt($ch, CURLOPT_URL, $url);
  37.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  38.  
  39.         $data = curl_exec($ch);
  40.  
  41.         curl_close($ch);
  42.  
  43.         return $data;
  44.     }
  45.    
  46.    
  47.    
  48. ?>
Add Comment
Please, Sign In to add comment