1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Youtube to MP3 without convertation/download

Discussion in 'PHP' started by trecords, Nov 4, 2013.

  1. #1
    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.
     
    trecords, Nov 4, 2013 IP
  2. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #2
    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.
     
    Pudge1, Nov 5, 2013 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    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.
     
    nico_swd, Nov 6, 2013 IP
  4. trecords

    trecords Well-Known Member

    Messages:
    145
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #4
    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.
     
    trecords, Nov 6, 2013 IP
  5. Pudge1

    Pudge1 Well-Known Member

    Messages:
    912
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    140
    Digital Goods:
    1
    #5
    The MP3 audio of videos is stored on the YouTube site and you don't need to download it separately and convert it.
     
    Pudge1, Nov 7, 2013 IP
  6. italianddl

    italianddl Well-Known Member

    Messages:
    177
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    123
    Digital Goods:
    3
    #6
    https://marketplace.digitalpoint.com/youtube-to-mp3-music-download-converter-script.2289/item
     
    italianddl, Jan 4, 2014 IP
  7. sabato

    sabato Member

    Messages:
    407
    Likes Received:
    6
    Best Answers:
    1
    Trophy Points:
    43
    #7
    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.
     
    sabato, Jan 4, 2014 IP
  8. Avener

    Avener Well-Known Member

    Messages:
    244
    Likes Received:
    20
    Best Answers:
    1
    Trophy Points:
    135
    #8
    You're right about that.
    FFMPEG will take a whole lot of resources.

    Check this out: http://youtubeinmp3.com/api/
     
    Avener, Jan 7, 2014 IP
  9. NetStar

    NetStar Notable Member

    Messages:
    2,471
    Likes Received:
    541
    Best Answers:
    21
    Trophy Points:
    245
    #9
    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.
     
    NetStar, Jan 7, 2014 IP
  10. trecords

    trecords Well-Known Member

    Messages:
    145
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    105
    #10
    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.
     
    trecords, Jan 11, 2014 IP
  11. website1337

    website1337 Active Member

    Messages:
    65
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    68
    #11
    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.
     
    website1337, Jan 12, 2014 IP
    NetStar likes this.
  12. noniko

    noniko Greenhorn

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #12
    i like this https://video.net.ge/en/
     
    noniko, Feb 27, 2017 IP