Downloading Music the 1337 Way!

Published on March 10, 2008 in General by Rami Taibah

NOTE: This howto is for Linux users. If you are a Windows user go pay someone $40 and then another $15. Good luck.

So you are at work and really want a song but just can’t get it because torrenting at work is blocked or could really get you in trouble? No problem, why not use youtube? Chances are that the song is already there on some video, either the official music video or some random compilation!

Search for a video that has the song you are looking for, then download the video using keepvid and save it on your desktop. Now you will need a script to convert your newly downloaded video from .flv to .avi. So fire up your favorite text editor and copy this into it:


#!/bin/sh
if [ -z "$1" ]; then
echo "Usage: $0 {-divx|-xvid} list_of_flv_files"
exit 1
fi

# video encoding bit rate
V_BITRATE=1000

while [ "$1" ]; do
case "$1" in
-divx)
MENC_OPTS="-ovc lavc -lavcopts \
vcodec=mpeg4:vbitrate=$V_BITRATE:mbd=2:v4mv:autoaspect"
;;
-xvid)
MENC_OPTS="-ovc xvid -xvidencopts bitrate=$V_BITRATE:autoaspect"
;;
*)
if file "$1" | grep -q "Macromedia Flash Video"; then
mencoder "$1" $MENC_OPTS -vf pp=lb -oac mp3lame \
-lameopts fast:preset=standard -o \
"`basename $1 .flv`.avi"
else
echo "$1 is not Flash Video. Skipping"
fi
;;
esac
shift
done

Save the file as flv2avi.sh. Next chmod it and move it into your /usr/bin (while you are in the directory of the script)


sudo chmod a+x flv2avi.sh
sudo mv flv2avi.sh /usr/bin/flv2avi.sh

Ok so now we are ready to convert our downloaded .flv file to avi, so run this command (while you are in the directory of the video)

flv2avi.sh -divx name_of_file.flv

After some crunching you will get a new file called name_of_file.avi, all you need now is to strip the sound from the video. Use the following command:

mplayer name_of_file.avi -ao pcm:file=temp1.wav

Thats it! You got your song in a .wav format. Convert the .wav file into whatever format you prefer :)


About Rami Taibah

Rami Taibah the founder of The Linuxologist and a self proclaimed geek and Linux aficionado. This fall, he will be pursuing an MIMS degree at UC Berkeley, California. You can follow him on Twitter @rtaibah.

«

»

  • McBain
    This is all well and good. Well, its good if you like your music encoded at 64k mono. Ever noticed how low quality the audio tracks on youtube videos are?

    Seriously bro, 64k mono isn't even FM radio quality. As a way to download music, this sucks.
  • McBain
    This is all well and good. Well, its good if you like your music encoded at 64k mono. Ever noticed how low quality the audio tracks on youtube videos are?

    Seriously bro, 64k mono isn't even FM radio quality. As a way to download music, this sucks.
  • Ok it's in thanks Tuxie :)

    Ya I know there are a lot of tools like that, this one is just a quick and dirty guide. You know. Anyways thanks for the links.
  • Ok it's in thanks Tuxie :)

    Ya I know there are a lot of tools like that, this one is just a quick and dirty guide. You know. Anyways thanks for the links.
  • I posted a comment (#560) but didn't get approved nor deleted. Was it eaten by the spam filter for containing URLs in it?

    Thanks.
  • I posted a comment (#560) but didn't get approved nor deleted. Was it eaten by the spam filter for containing URLs in it?

    Thanks.
  • I developed a tiny bash script to download videos from youtube, convert and play them. It's called "latuba".

    http://tuxie.debianuruguay.org/?p=69
    http://tuxie.debianuruguay.org/xtras/latuba

    It depends on youtube-dl or whatever software you want to use to do the actual download, ffmpeg to convert it to avi and vlc to play it. It also receives a list of parameters, like youtube's username and password to download adult only videos.

    It would be a nice feature to extract the audio from the video, I'll add it in the future.
  • I developed a tiny bash script to download videos from youtube, convert and play them. It's called "latuba".

    http://tuxie.debianuruguay.org/?p=69
    http://tuxie.debianuruguay.org/xtras/latuba

    It depends on youtube-dl or whatever software you want to use to do the actual download, ffmpeg to convert it to avi and vlc to play it. It also receives a list of parameters, like youtube's username and password to download adult only videos.

    It would be a nice feature to extract the audio from the video, I'll add it in the future.
  • Anytime mate, tell me how it works out :)
  • Anytime mate, tell me how it works out :)
  • BSA
    thanks for the advice :)
  • BSA
    thanks for the advice :)
  • You should feel inferior :P One argument that has been beaten to death is that most people see computers as tools and don't care how it works, so yes when it comes to "computer kung fu" they are inferior...on the other hand, if one is interested in computers and only does Windows, may god have mercy on his soul.
  • You should feel inferior :P One argument that has been beaten to death is that most people see computers as tools and don't care how it works, so yes when it comes to "computer kung fu" they are inferior...on the other hand, if one is interested in computers and only does Windows, may god have mercy on his soul.
  • Trying to make us Windows users feel inferior? Well, it won't work here, buddy!
  • Trying to make us Windows users feel inferior? Well, it won't work here, buddy!
blog comments powered by Disqus