Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often listen to the di.fm online radio with VLC. Streaming is MP3 over HTTP.

I want to record all track names that are played on this radio. VLC does show track name, but when the next track is played, the name is lost.

I'll use this track names to do some statistics (like finding top 10) and find tracks whose names I don't remember fully.

Is the task possible with VLC or another Windows client?

share|improve this question
    
I need not to save the actual music (audio), only Tags of music (text). – osgx Jun 12 '11 at 0:16
    
Note to close voters: Just because the stream is from a web site doesn't mean that using VLC (which is on-topic) to record stuff from it is off-topic. I'm voting Leave Open. – Ben N Feb 13 at 21:20
up vote 2 down vote accepted

VLC (2.2.1 in this example) has an HTTP interface where you can query the currently playing track. You can enable it from the command line:

vlc --extraintf=http --http-host 0.0.0.0:8080 --http-password 'watpasswd'

or through the GUI (these settings persist through restarts):

  1. Tools > Preferences, Show settings: All
  2. Interface > Main interfaces, check "Web"
  3. Interface > Main interfaces > Lua > Lua HTTP > Password

You can visit http://localhost:8080/requests/status.xml in a browser, enter the password, and you should receive an XML containing a section like this:

<category name="meta">
  <info name="title">Jazz</info>
  <info name="filename">http://example.com/station</info>
  <info name="genre">smooth</info>
  <info name="now_playing">Jimmy Sommers - Fly Me To The Moon</info>
</category>

All that remains is to set up a cron job to periodically save the playing track.

#!/bin/bash
vlc_status="$(curl --connect-timeout 15 --silent -u :watpasswd http://localhost:8080/requests/status.xml)"

# Parse out now-playing track, escape named entities e.g. '&amp;'
track=$(echo "${vlc_status}" | xmlstarlet sel -t -v ".//info[@name='now_playing']" | xmlstarlet unesc)

# Append new track to log file
echo "$track" >> vlc_log.txt

# Remove duplicates of new track if any
# http://stackoverflow.com/a/1444448/
gawk -i inplace '!x[$0]++' vlc_log.txt
share|improve this answer

VLC includes support for submitting tracks to Last.fm. If you sign up at Last.fm and enter your password to VLC preferences, played tracks will be recorded in your Last.fm profile, even with statistics.

(I'm not actually sure if this works with streams, though. It might be for local files only.)

share|improve this answer
    
I hav no last.fm and want not to register. How can I submit track names to the local file? I can do all stats by myself (i hav excel, perl and awk for this). – osgx Jun 12 '11 at 12:38

Still don't know how to make this locally with vlc or any stream client, but I used wget + cron to get "3 just played songs" from web-site of this radio into text files.

share|improve this answer
1  
This answer is "bad" in the sense that if someone wants to do the same thing but with a different internet radio stream then they have to write a different script to deal with the different web page. I am really surprised that the community cannot generate a better answer than this, and I'd really like to know a better answer :-( Complicated programs like vlc/winamp are capable of reading the track names and printing them on the screen -- all that is needed here is a simple program which reads the track names and writes them to a file. Can this really be so hard? – Kevin Buzzard Sep 15 '13 at 15:50
    
@KevinBuzzard It's not. You can do it with just VLC. – approxiblue Feb 11 at 19:58

Personally I listen to DI premium with Winamp and then use Streamripper to save the tracks. Streamripper is clever enough to save each track as its own file as opposed to one long stream file with track name and artist. Word of warning though is I found Winamp doesn't like sharing bandwidth Streamripper even if there is enough space and you will find that Winamp will jump between "tracks" ( term used loosely as it all connects to DI and is the same stream, the pls file inserts three connections to Winamp ) and unless you have repeat on, it will stop playing. With repeat on you will hear the jump live but it does not get recorded.

DI listener for 7 years. Cant function without it now :) i dont record unless its an epic track. Takes up too much memory.

Hope this helps :)

share|improve this answer
  • RadioSure

  • Screamer Radio

  • streamWriter

  • RarmaRadio

  • TapinRadio

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .