command line streaming URL scraping tool

Chris Brannon cmbrannon79 at gmail.com
Wed Jul 21 09:43:04 UTC 2010


Rudy Vener wrote:
> 
> I'm trying to locate a tool which when given a web page with a "Listen Live"
> link, can return the actual URL of  an audio stream which can be handed
> off to mplayer.

The shoutcast-search script may be useful for you.
It locates online streams that are registered with shoutcast.com.
Here's the link to the homepage:
http://www.k2h.se/code/shoutcast-search.html

When I type
shoutcast-search wabc
I get the following:
http://yp.shoutcast.com/sbin/tunein-station.pls?id=1378084
The URL points to a playlist, and you can pass it to mplayer, like so:
mplayer -playlist http://yp.shoutcast.com/sbin/tunein-station.pls?id=1378084

Note that shoutcast-search can (and often does) give multiple results.
E.G., the command "shoutcast-search classical" gives me 308 stations
at the moment.

You can also get verbose output from the tool:

shoutcast-search -v wabc
# Gives me the following output:
Search summary
------------------------------
# Lots of noise snipped from output.
WABC-AM [64kbps audio/mpeg]
	http://yp.shoutcast.com/sbin/tunein-station.pls?id=1378084
	talk, 70 listeners
	Now playing: 

Hope this helps,
-- Chris




More information about the Blinux-list mailing list