Page 1 of 5 123 ... LastLast
Results 1 to 10 of 126

Thread: HOWTO: Download YouTube Stereo MP3s

Hybrid View

  1. #1
    Join Date
    Jul 2005
    Location
    Remote Desert, USA
    Beans
    683

    HOWTO: Download YouTube Stereo MP3s

    I'm editing this on Jan 3 2009. YouTube basically broke the API discussed here. Thread can be closed.

    YouTube provides videos for practically every band you've ever heard of, even obscure ones or one-hit-wonders on some TV show you saw. The video quality is moderate but effective, and works on most browsers without having to do anything special. In all your excitement of finding that favorite song of yours, you might not have noticed that it was in mono. You might not have also known that you can extract the sound from it. Unlike P2P networks like Limewire, these YouTube videos are often complete, often not fake, and 99.5% of them download properly on to your computer for playback in your browser.

    Well I'm about to change your perspective on YouTube. You are in for a treat.

    The following script makes an "mp3" folder in your home directory, downloads a YouTube video to it, extracts out a mono MP3 file, then feeds it through a sophisticated simulated stereo filter to create a fairly high quality stereo MP3 file.

    The simulated stereo filter puts an 8 microsecond delay on the right channel and then differs the EQ slightly in each channel. If the delay is increased, the first thing that happens is distortion. Then, it becomes a hollow or tinny sound, and then becomes just pure echo. But with an 8 microsecond delay, plus some EQ modification, it creates a cool stereo effect and no distortion or echo is present.

    I also noticed that some music videos are made up, such as with Asian Anime or kids goofing off in front of it, but the soundtrack is the real thing in some cases. By throwing away the video part, the MP3 sound, especially when converted to fake stereo, sounds great.

    REQUIREMENTS

    You first need to do this:

    Code:
    $ sudo su
    # apt-get update
    # apt-get install xulrunner
    # apt-get install ffmpeg
    # apt-get install lame
    # apt-get install mpg123
    # apt-get ecasound
    # exit
    Now surf with your browser to YouTube and try to play a video. If it asks to install
    Flash, do so because I think it updates your video codecs on your PC.

    Now surf with your browser to find an MPG file on the Internet and download it. Now
    try to open it. Ubuntu will ask you to choose some codecs to download and install.
    Do so.

    SCRIPT

    The following script can be placed as "ytr" in your /usr/bin folder and then made into an executable file with "sudo chmod a+x /usr/bin/ytr". In my case, I made a launcher for it, created my own YouTube icon, and then set the launcher to require a Terminal Window.

    Code:
    #!/bin/bash
    #
    # Bash script to convert YouTube Video to Simulated Stereo MP3
    #
    # Public Domain
    # Contributors: Supermike, Crouse, Kai Vehmanen, Chriss.Hi
    #
    bu="http://rd.cache.l.google.com/get_video?video_id="
    mkdir -p ~/mp3;cd ~/mp3
    read -p "YouTube url? " ur
    read -p "Name? " nv
    echo;echo;
    uf=`echo $ur | cut -d = -f 2`
    wget "${bu}${uf}" -O /tmp/y.flv
    ffmpeg -i /tmp/y.flv -f mp3 -vn -acodec copy "/tmp/${nv}.mp3"
    ecasound -i "/tmp/${nv}.mp3" -etf:8 -o "${nv}.mp3"
    echo;echo;
    rm -f "/tmp/${nv}.mp3"
    echo "File is saved in your home directory in the 'mp3' folder."
    read
    IF YOU WANT A GUI VERSION
    I also whipped up a GUI version at:

    http://code.google.com/p/yt2mp3/

    UNINSTALLATION:
    Code:
    $ sudo apt-get --purge remove ecasound
    $ sudo rm -f /usr/bin/ytr
    Anything else that is removed could potentially disturb your ability to use MPEG audio and video on your PC, but this is what it would look like....

    Code:
    $ sudo apt-get --purge remove ffmpeg

    SOURCES:
    Crouse, admin from BashScripts.org
    Kai Vehmanen, one of the developers of the Ecasound tool
    Chriss.Hi, who showed me an interesting Google hack

    TESTED:
    Ubuntu Breezy Badger
    Ubuntu Feisty Fawn
    Last edited by SuperMike; January 3rd, 2009 at 08:29 PM. Reason: It's broke now
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

  2. #2
    Join Date
    Jan 2006
    Location
    UK
    Beans
    130
    Distro
    Ubuntu 6.10 Edgy

    Re: HOWTO: Download YouTube Stereo MP3s

    WOW this is incredible, very good work. This is seriously very cool
    public void signature(){
    }

  3. #3
    Join Date
    Jul 2005
    Location
    Remote Desert, USA
    Beans
    683

    Re: HOWTO: Download YouTube Stereo MP3s

    Glad you like it. My Sansa MP3 player is filled to the hilt with this stuff.

    Right now I've got another project I'm working on -- a large web-based CRM project -- but I do plan to knock out some time to use this technique...

    http://www.ubuntuforums.org/showthread.php?t=333862

    ...to build a GUI to do what this script does. Perhaps someone could knock it out faster in Python and PyGTK if they are eager.
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

  4. #4
    Join Date
    Jul 2005
    Location
    Remote Desert, USA
    Beans
    683

    Arrow Re: HOWTO: Download YouTube Stereo MP3s

    GUI Available Now

    Get it here:

    http://code.google.com/p/yt2mp3/

    I wrote it in XUL. See requirements on the project page.

    Last edited by SuperMike; January 28th, 2007 at 09:48 PM.
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

  5. #5
    Join Date
    Jul 2006
    Beans
    26

    Re: HOWTO: Download YouTube Stereo MP3s

    Pretty cool, I'd love to have it working but right now when I do

    $ xulrunner yt2mp3/yt2mp3.xulrun

    I get the error message "Gecko MinVersion requirement not met." I did some googling and I think it has something to do with applications.ini but I haven't really been able to figure out exactly what to do...any ideas?

  6. #6
    Join Date
    Jul 2005
    Location
    Remote Desert, USA
    Beans
    683

    Re: HOWTO: Download YouTube Stereo MP3s

    Upgrade your xulrunner with the latest from Mozilla.com?
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

  7. #7
    Join Date
    Jan 2006
    Beans
    59

    Re: HOWTO: Download YouTube Stereo MP3s

    Really nice script. You might want to include a note somewhere that if there is a "/" in the name of the mp3, it won't work (I think). I tried save an mp3 and it downloaded fine but then couldn't open the file to encode it. I'm pretty sure it was because of the / because I tried the same video again with a different name and it worked fine. Thanks for making this; it's incredible.

  8. #8
    Join Date
    Jul 2005
    Location
    Remote Desert, USA
    Beans
    683

    Re: HOWTO: Download YouTube Stereo MP3s

    Glad you liked it. I guess that's why they call me "Super".

    Yeah, my daughter gets a kick out of it too. She uses the XUL version now. I'm taking suggestions for updating it like what you mention here if you go to the website for it, or here is fine too, I guess.

    I think what I should do is prevent certain keystrokes on the field in the XUL application. Did you run this by script or by XUL application? If you haven't tried the XUL app, it's cool.
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

  9. #9
    Join Date
    Jul 2006
    Beans
    26

    Re: HOWTO: Download YouTube Stereo MP3s

    Hehe OK I'm back...haven't used this in awhile but I went to use it today and got this error:

    XML Parsing Error: undefined entity
    Location: chrome://mozapps/content/profile/profileSelection.xul
    Line Number 53, Column 1:<dialog

    I haven't done anything explicitly to mess with this program but perhaps something I did inadvertently messed it up.
    Any suggestions?

  10. #10
    Join Date
    Jul 2005
    Location
    Remote Desert, USA
    Beans
    683

    Re: HOWTO: Download YouTube Stereo MP3s

    Hmmm. That's not even my chrome. That's a chrome for something else and looks like a profile selection for the browser.

    Did you download and install xulrunner from Mozilla? The XUL app I wrote runs through that.

    If you have xulrunner installed on the system and in the system path ($PATH) properly, then the thing should load properly. I also provide two versions. One is the XUL app and the other is a binary. Both, however, assume you have xulrunner installed on Ubuntu and in the system path.
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

Page 1 of 5 123 ... LastLast

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
  •