Page 1 of 13 12311 ... LastLast
Results 1 to 10 of 126

Thread: HOWTO: Download YouTube Stereo MP3s

  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
    Jul 2006
    Beans
    26

    Re: HOWTO: Download YouTube Stereo MP3s

    I'm running 1.8.0.5-4.2, thats the latest as far as I know.

  8. #8
    Join Date
    Jul 2006
    Beans
    26

    Re: HOWTO: Download YouTube Stereo MP3s

    Hmm well I didn't do anything at all and it seems to be working now, so I dunno what the problem was before

    Time to try it out now!


    OK just got a song! This is great, thanks for sharing!
    Last edited by tonofclay; January 29th, 2007 at 12:32 AM.

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

    Re: HOWTO: Download YouTube Stereo MP3s

    Hmm. That's strange. Let me know if the problem comes back. Perhaps it has to do with Firefox being open and that Gecko engine in RAM, or perhaps not. Another possibility is that xulrunner might be running in memory from a hung job or something, and a 'sudo killall xulrunner' a couple times might kill it.
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

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

    Re: HOWTO: Download YouTube Stereo MP3s

    Perhaps it was a typo. For instance, try this:

    $ xulrunner typocity

    It generates the same error that you see. This can possibly explain why the intermittent results. I'll admit that typing yt2mp3 is not the easiest thing in the world -- I was mistyping that a lot when working with the project. Note I also provide a binary you can download instead of the source. It was compiled with the 'makeself' tool, which is pretty darn cool.
    SuperMike
    When in doubt, follow the penguins.
    Evil Kitty is watching you

Page 1 of 13 12311 ... 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
  •