3

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?

fixer1234
  • 28,064
osgx
  • 7,017

5 Answers5

4

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
2
  • RadioSure

  • Screamer Radio

  • streamWriter

  • RarmaRadio

  • TapinRadio

0

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.)

grawity
  • 501,077
0

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.

osgx
  • 7,017
0

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 :)