Ripping MP3s from Last.fm with Linux, Streamripper and LastFMProxy

The tools

- Linux (I’m using Ubuntu)
- Streamripper (I’m using version 1.61.27)
- LastFMProxy
- Last.fm account

Installing LastFMProxy..

wget http://vidar.gimp.org/wp-content/uploads/2006/07/lastfmproxy-1.1.tar.gztar -xzf lastfmproxy-1.1.tar.gz

cd lastfmproxy-1.1/

vi config.py

# Stick your last.fm username and password between the quotes below.
username = “yourusername
password = “yourpassword

Now save the file and exit the editor (vi/nano/mcedit/etc)

Installing Streamripper

Download it.

tar -xzvf streamripper-1.61.27.tar.gz
cd streamripper-1.61.27
./configure
make
sudo make install

In Ubuntu or Debian just do apt-get install streamripper

Running LastFMProxy

First make sure you read the README

cd lastfmproxy-1.1
./main.py &

Note: if you have just created a username on Last.fm you need to “tell” it what kind of music you like, so after running LastFMProxy point your browser to one of these addresses:

http://localhost:1881/lastfm://globaltags/rock
http://localhost:1881/lastfm://globaltags/dance
http://localhost:1881/lastfm://artist/Madonna/similarartists
http://localhost:1881/lastfm://artist/Coldplay/similarartists
There is more information about this in the README

Running Streamripper and ripping MP3s

streamripper http://localhost:1881/lastfm.mp3
Connecting…
stream: last.fm
server name: last.fm Streaming Server
bitrate: 0
meta interval: 16000

[buffering - | ] - Wait…
[ripping… ] The Rapture - Infatuation [ 4.59M]
[ripping… ] Scissor Sisters - Take Your Mama Out [ 4.15M]

The end! :o

Fedora 7 Test 2 Released

The Fedora project has released Fedora 7 Test 2 (6.91). New in this release are Linux 2.6.21rc1, GNOME 2.17.91, a brand new icon set, the merger of Core and Extras, fast user switching, and much more. See the release schedule for more information.

extract audio from video or online stream

You can easily extract audio from video files such as avi, mpg, even flv! into mp3 uses either mplayer or ffmpeg. You can even record online stream into mp3, such as stream from radio cast.

Lets begin with mplayer. To extract audio from video files, use -dumpaudio option and specified the output filename with -dumpfile

mplayer -dumpaudio nodame_theme.flv -dumpfile nodame_theme.mp3

Okay check out the output:

file nodame_theme.mp3

Output:

MPEG ADTS, layer III, v2,   8 kBits, 22.05 kHz, Monaural

Okay, The audio extracted from flv, so quality is quite low, haha. But you can change the audio rate by using ffmpeg. Let see how to use ffmpeg.

ffmpeg -i nodame_theme.flv -ab 128 -ar 44100 nodame_theme.mp3

-i is to specified input file, -ab audio bitrate, -ar audio sampling frequency

Let say what file tells you.

MPEG ADTS, layer II, v1, 128 kBits, 44.1 kHz, Monaural

How about record online stream?
First, find an online radio cast to try, you can have plenty of it from shoutcast.

mplayer -dumpstream http://64.236.34.97:80/stream/1005 -dumpfile smoothjazz.mp3
ffmpeg -i http://64.236.34.97:80/stream/1005 -ab 128 -ar 44100 smoothjazz.mp3

Thanks to Mohd Shakir, you can make it a script for stream recording.

(linux.byexamples.com)

Pages (13): « First ... « 2 3 4 [5] 6 7 8 » ... Last »