Hi, I want to know is it possible to get mp3 of the youtube videos directly without downloading and converting videos ? I have find site youtube-mp3. org which can do this. I am very interested how can they do this. I am als programmer and if you have any idea of implementing this let me know and I will try to create some script for this. Regards.
Those sites know the algorithm in which YouTube uses to hide the URLs where the MP3 files and other video files of each video is contained. There are some free to download scripts on the web using PHP that accomplish this if you wanted to take a look at them and how exactly they did it.
As far as I'm concerned, they don't store the audio track separately (although I could be wrong). So there's no way to get the audio without downloading and converting anything. Step one: Find out how to download the video from YouTube. Either by following the flow in the "Network" tab in Chrome's developer tools, or by seeing how other scripts achieve this. Step two: Download the video to a temporary location using cURL (probably your best bet) Step three: Install php-ffmpeg and extract the audio track from the file. ffmpeg -i video.flv -acodec libmp3lame -aq 4 audio.mp3 Code (markup): If your server doesn't come with php-ffmpeg pre-installed, or you're not on a VPS with root privileges, it's gonna be tough.
ffmpeg takes more resources and with several visitors big server can get loaded easily There is have to be some algorithm to read mp3 from the youtube videos as the site uses this we also have to be able to do this. I know that with HD and Full HD mp3 comes as separate mp3 stream but don`t know how can I get it.
The MP3 audio of videos is stored on the YouTube site and you don't need to download it separately and convert it.
There is no direct mp3 file available on youtube site. You have to copy a video url on to your server and encode it with ffmpeg.
You're right about that. FFMPEG will take a whole lot of resources. Check this out: http://youtubeinmp3.com/api/
Please know what you are talking about before posting advice. YouTube hosts videos. There is no MP3 for each video. If you would like an mp3 audio version that video must be downloaded and the audio must be extracted and converted to the mp3 format. There are several conversion tools available. FFMpeg being the most popular. Large web sites that host mp3 versions of YouTube videos are not lucky web masters who have discovered the secret hidden audio files. They are webmasters who have created a system to perform the conversions. It is both resource and bandwidth intensive and you should rethink why you want to do this in the first place.
All of you are wrong, youtube HD videos audio files are stored as separate file than video with specific algorithm which is I am trying to decode.
I don't think that's the case but sorry about that since I could be wrong. If you know that it's possible please post a source, that would be really helpful for many here to help you solve the problem. As far as I know, YouTube uses H.264/MPEG-4 coding with AAC stereo sound. The sound is embedded within the video file, which means that you pretty much have to download the whole video in order to recover the sound tracks. That's pretty sad and does of course not help you solve the problem. But I have something that might help you a bit. I've been downloading the sound from many youtube videos as mp3s and the best one I've found (and the fastest one) is video2mp3.net. Converting any videos takes some seconds, and then you get a link to download the mp3. Beware though so you get an mp3 file, there's lots of ads on the page. Hope that helps a bit at least.