Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Saturday, February 23, 2008

Downloading and ripping music from YouTube videos

Uses


  • music videos

  • speeches

  • news stories

  • video podcasts

  • etc.

Ways to download YouTube videos

  • On Debian-based systems,

    sudo apt-get install youtube-dl; youtube-dl http://youtube.com/watch?v=foobar123

    The best reason to use youtube-dl is so that you can automate this process to do batch downloads.

  • Use a web-based tool

  • The easiest way is to let your browser do it for you. Go to the video page, and wait until your browser downloads it. Then check /tmp on *nix systems with Firefox (not sure about other browsers) for a file like FlashXXXXX where X is an alphanumeric character. This is the downloaded FLV video.

  • Another solution for anyone using Firefox is to look in the disk cache (about:cache?device=disk) and look for an entry starting with http://www.youtube.com/get_video?video_id=foobar123&t=foobar456. Clicking on this entry will show you its location on disk e.g. /home/yourusername/.mozilla/firefox/xx4xmys7.default/Cache/FB999693d01. The main benefit of using this method is that Firefox will show you the direct URL of the video on the web: http://lax-v305.lax.youtube.com/get_video?video_id=BUNCHOFTEXTHERE

  • Look through the site html and javascript and figure out the flv URL. jk :)


Ways to extract the audio from the file

  • Use vixy.net. Just type in the youtube URL and select mp3 from the dropdown.

  • Use ffmpeg -i youtubevid.flv youtubemusic.mp3

  • Use mplayer -dumpaudio youtubevid.flv -dumpfile youtubemusic.mp3



Vixy.net method [via labnol.blogspot.com]

FFmpeg method [via linux.byexamples.com]

mplayer method [via tips.webdesign10.com] (also created a bash script to automate this)

Saturday, November 24, 2007

Compiling packages from source on Ubuntu

A default Ubuntu install doesn't come with many compiling tools like GCC, G++, libc6-dev, and Make that you need to compile programs from source. To get all those packages, type in:

sudo apt-get install build-essential

You will need the Ubuntu CD for this.

Jump words with Control-Arrow in the Ubuntu terminal

On a fresh install of both Ubuntu 7.04 and 7.10, pressing Ctrl-[Arrow Key] does not jump words but instead writes a control code onto the screen such as ;5C or ;5D.

To fix this, add export INPUTRC=/etc/inputrc to /etc/bash.bashrc.

Make sure /etc/inputrc has these lines in it:

# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
"\e[1;5C": forward-word
"\e[1;5D": backward-word
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word

Wednesday, February 21, 2007

Ubuntu hack for waking up your monitor

Sometimes, when I close the lid of my Dell E1505 laptop and open it again, the monitor doesn't resume and stays black instead. Today, I discovered a little hack to get the monitor working again instead of just doing a hard reboot. Press [Fn] + [Esc / Stand By] which suspends the computer, close the lid, open it, and bam...the monitor works and it decreases the chances of corrupt system files.