How can Wireshark be used to extract, in real-time (i.e., continuously, not from a capture file) a string such as:
StreamTitle='The Rolling Stones - Black Box [Disc 3] (1970) - Bitch';
from a network audio stream (such as http://50.7.76.250:8757/stream), and append this string to a file?
What I'm trying to do is make a real-time playlist from this network audio stream for posting on a website.
My first attempt to do what I wanted was to compile the source code for VLC Media Player on CentOS 6 so I could simply write, based on their New Title=
debug statement, the corresponding string (e.g., 'Van Morrison - Born To Sing: No Plan B (2012) - Retreat and View'
) to a file. Unfortunately I could not get the source code to compile.
After failing to get VLC Media Player to compile under CentOS I switched to using Wireshark to inspect the TCP stream. Using Find, I can locate the StreamTitle=
info from captured packets, but I can't figure out how to extract- & save-it on a real-time, continual basis (e.g., 24x7).
ETA: I know Perl and C if I have to write code to do this.
UPDATE: I ended up learning enough Lua to script VLC and get what I needed:
function get_meta_now_playing()
local inpt = vlc.object.input()
if inpt == nil then
return nil
end
local item = vlc.item or vlc.input.item()
if not item then
return nil
else
local metas = item:metas();
local nwp = metas["now_playing"]
if nwp then
return nwp
else
return nil
end
end
end