Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: HOWTO: Download a youtube song into MP3

  1. #1
    Join Date
    Dec 2007
    Beans
    103

    HOWTO: Download a youtube song into MP3

    Hello!

    Well, This is something that helps me very much and i wanted to share it with you.

    In this small HOWTO i'm going to explain how to download song from youtube to MP3 format.

    For example, Here is the song "Master Of Puppets" by "Metallica":
    I'll teach you how to download the SONG master of puppets.

    SO LET'S BEGIN!

    Installation
    First, We're going to install 2 simple software from Ubuntu repos.

    Open Terminal (Applications -> Accessories -> Terminal), and type:
    sudo apt-get install ffmpeg youtube-dl
    Then enter your password (if needed) and type "Y" for anything he asks.


    Downloading a video to FLV format
    Now, In the terminal, Write the youtube-dl and the url to the movie you want to download. If you want to download the Master of puppets, enter this:

    Now it should download it to FLV format. (This may take about a miniute to download)

    Turning the FLV to a normal MP3 song

    now, to see what is the FLV's name, enter this command:
    ls *flv
    For the Master Of Puppets, it should be this name:
    holder@holder-laptop:~$ ls *flv
    _z-hEyVQDRA.flv
    Copy the name of it, and make this command for MP3 turning:
    ffmpeg -i _z-hEyVQDRA.flv MasterOfPuppets.mp3
    (Again, This should take some time.)

    To check if it covert it successfully, make this command:
    ls *mp3
    and if you did all right, you should see the "MasterOfPuppets.mp3" in the list.


    Cleanning
    When you got the mp3 file, you don't need the FLV anymore, so delete by this command:

    rm _z-hEyVQDRA.flv



    That's it! now you have the mp3 song saved in your computer :]

    Enjoy,
    ~Forks Holder.
    DO NOT USE RM COMMANDS!!! Click Here for more information.
    Linux & Metal FTW
    See ya at Ubuntu.

  2. #2
    fedex1993 is offline Grande Half-n-Half Cinnamon Ubuntu
    Join Date
    Apr 2007
    Location
    Dallas, Texas
    Beans
    876

    Re: HOWTO: Download a youtube song into MP3

    yes this might be better to post in the tutorials sections of the forums since this is actually general help forum. Still pretty cool thoe

  3. #3
    Join Date
    Dec 2007
    Beans
    103

    Re: HOWTO: Download a youtube song into MP3

    Quote Originally Posted by fedex1993 View Post
    yes this might be better to post in the tutorials sections of the forums since this is actually general help forum. Still pretty cool thoe

    Bah sorry =/

    If there is an administrator here, please move it.
    DO NOT USE RM COMMANDS!!! Click Here for more information.
    Linux & Metal FTW
    See ya at Ubuntu.

  4. #4
    Join Date
    Dec 2007
    Beans
    560

    Re: HOWTO: Download a youtube song into MP3

    You need youtube-dl and ffmpeg for this to work right

    After seeing this guide/tutorial I know this was my chance to learn bash, well it took me about 2 hours? of learning, and testing, and its not perfect, but it works nicely.

    Step 1

    Paste that into gedit or nano or whatever your favorite editor is, save it as. yt2mp3

    Code:
    #!/bin/bash
    echo Enter the youtube url to begin downloading the video.
    read VIDEO
    echo What is the artist of the song?
    read ARTIST
    echo What is the name of the song?
    read NAME
    youtube-dl $VIDEO -o "${ARTIST} - ${NAME}.flv"
    ffmpeg -i "${ARTIST} - ${NAME}.flv" "${ARTIST} - ${NAME}.mp3"
    rm -rf "${ARTIST} - ${NAME}.flv"
    echo Your video is finally converted into a mp3!
    Step 2

    then run
    Code:
    chmod +x yt2mp3
    
    sudo mv yt2mp3 /bin/
    Now you can run yt2mp3 and download your video and convert it in no time

    feed back, please, since this is my first bash script pretty much.

    Nice guide btw
    Last edited by chris4585; July 12th, 2008 at 05:26 AM.

  5. #5
    Join Date
    Dec 2007
    Beans
    103

    Re: HOWTO: Download a youtube song into MP3

    Quote Originally Posted by chris4585 View Post
    You need youtube-dl and ffmpeg for this to work right

    After seeing this guide/tutorial I know this was my chance to learn bash, well it took me about 2 hours? of learning, and testing, and its not perfect, but it works nicely.

    Step 1

    Paste that into gedit or nano or whatever your favorite editor is, save it as. yt2mp3

    Code:
    #!/bin/bash
    echo Enter the youtube url to begin downloading the video.
    read VIDEO
    echo What is the artist of the song?
    read ARTIST
    echo What is the name of the song?
    read NAME
    youtube-dl $VIDEO -o "${ARTIST} - ${NAME}.flv"
    ffmpeg -i "${ARTIST} - ${NAME}.flv" "${ARTIST} - ${NAME}.mp3"
    rm -rf "${ARTIST} - ${NAME}.flv"
    echo Your video is finally converted into a mp3!
    Step 2

    then run
    Code:
    chmod +x yt2mp3
    
    sudo mv yt2mp3 /bin/
    Now you can run yt2mp3 and download your video and convert it in no time

    feed back, please, since this is my first bash script pretty much.

    Nice guide btw

    First of all, It's nice that you leaned such things, it will help you if in the future you'll want to program something.

    Anyways,
    You can download and convert it by your way, but editing the file will be kinda long when you can just make it by 1 command.. but very nice idea (: keep thinking of doing Howto's, it's helping a lot the Ubuntu community.

    Thanks,
    ~ForksHolder.
    DO NOT USE RM COMMANDS!!! Click Here for more information.
    Linux & Metal FTW
    See ya at Ubuntu.

  6. #6
    Join Date
    Sep 2007
    Location
    USA
    Beans
    Hidden!

    Re: HOWTO: Download a youtube song into MP3

    Um. I might be out of line but:

    Is this something that should be promoted here?

  7. #7
    Join Date
    Dec 2007
    Beans
    103

    Re: HOWTO: Download a youtube song into MP3

    Quote Originally Posted by AnLGP View Post
    Um. I might be out of line but:

    Is this something that should be promoted here?
    As i was writing,
    It's a HOWTO, not General help. I have missed click.

    Anyway, If there is a moderator here, please move it.
    DO NOT USE RM COMMANDS!!! Click Here for more information.
    Linux & Metal FTW
    See ya at Ubuntu.

  8. #8
    Join Date
    Sep 2007
    Location
    USA
    Beans
    Hidden!

    Re: HOWTO: Download a youtube song into MP3

    I'm not speaking on where it should be but to the morality of the howto

  9. #9
    Join Date
    May 2009
    Beans
    1

    Re: HOWTO: Download a youtube song into MP3

    Quote Originally Posted by ForksHolder View Post
    Hello!

    Well, This is something that helps me very much and i wanted to share it with you.

    In this small HOWTO i'm going to explain how to download song from youtube to MP3 format.

    For example, Here is the song "Master Of Puppets" by "Metallica":


    I'll teach you how to download the SONG master of puppets.

    SO LET'S BEGIN!

    Installation
    First, We're going to install 2 simple software from Ubuntu repos.

    Open Terminal (Applications -> Accessories -> Terminal), and type:


    Then enter your password (if needed) and type "Y" for anything he asks.


    Downloading a video to FLV format
    Now, In the terminal, Write the youtube-dl and the url to the movie you want to download. If you want to download the Master of puppets, enter this:



    Now it should download it to FLV format. (This may take about a miniute to download)

    Turning the FLV to a normal MP3 song

    now, to see what is the FLV's name, enter this command:

    For the Master Of Puppets, it should be this name:


    Copy the name of it, and make this command for MP3 turning:

    (Again, This should take some time.)

    To check if it covert it successfully, make this command:

    and if you did all right, you should see the "MasterOfPuppets.mp3" in the list.


    Cleanning
    When you got the mp3 file, you don't need the FLV anymore, so delete by this command:






    That's it! now you have the mp3 song saved in your computer :]

    Enjoy,
    ~Forks Holder.

    Ok so i managed to download the youtube video successfully but when i tried to convert it to .mp3 it just made a file with 0 bytes (like an empty file)

    on terminal the last line says "Unsupported codec for output stream #0.0"

    can anyone help??

  10. #10
    Join Date
    Jan 2008
    Location
    /us/al/home/mb_webguy
    Beans
    2,339
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO: Download a youtube song into MP3

    There are actually multiple ways to do this. If you want to do it completely using GUI applications, you can use the Video DownloadHelper extension (or similar extension) in Firefox to download the video, then VLC to strip the audio.

    Or, since the Video DownloadHelper extension has a conversion feature that allows you to specify the method(s) of conversion, you can use the ffmpeg method in the original post to allow you to download and convert the video to an mp3 in one step.

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •