Advertisement
Guest User

Youtube Streamer PHP Side

a guest
Aug 20th, 2012
1,189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. <?php
  2. $videoid = $_GET['videoid'];
  3. $ch = curl_init();
  4. curl_setopt($ch, CURLOPT_URL, "www.youtube-mp3.org/api/itemInfo/?video_id=".$videoid);
  5. curl_setopt($ch, CURLOPT_HEADER, false);
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7. $infolink = curl_exec($ch);
  8. curl_close($ch);
  9. $hash = substr($infolink,strpos($infolink, "\"h\" : \"")+7,32);
  10. $dosya = "http://www.youtube-mp3.org/get?video_id=".$videoid."&h=".$hash;
  11. $isim = basename($dosya);
  12. header("content-type:audio/mpeg");
  13. header("content-disposition: attachment; filename=".$isim);
  14. readfile($dosya);
  15. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement