Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $videoid = $_GET['videoid'];
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "www.youtube-mp3.org/api/itemInfo/?video_id=".$videoid);
- curl_setopt($ch, CURLOPT_HEADER, false);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $infolink = curl_exec($ch);
- curl_close($ch);
- $hash = substr($infolink,strpos($infolink, "\"h\" : \"")+7,32);
- $dosya = "http://www.youtube-mp3.org/get?video_id=".$videoid."&h=".$hash;
- $isim = basename($dosya);
- header("content-type:audio/mpeg");
- header("content-disposition: attachment; filename=".$isim);
- readfile($dosya);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement