From b236324e01183dd7893c3b97b8f8bbc6a67fb55c Mon Sep 17 00:00:00 2001 From: Magnus Woldrich Date: Sat, 19 Jan 2013 12:57:14 +0100 Subject: [PATCH] shoutcast_parser: fast hack to get at the real streams --- shoutcast_parser | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 shoutcast_parser diff --git a/shoutcast_parser b/shoutcast_parser new file mode 100755 index 00000000..14925a67 --- /dev/null +++ b/shoutcast_parser @@ -0,0 +1,24 @@ +#!/usr/bin/perl +# vim: ft=perl: +use strict; +use LWP::Simple; + +my $url = shift or usage(); + +my $seen_title = 0; +for my $l(split(/\n/, LWP::Simple::get($url))) { + if(($seen_title < 1) && ($l =~ m/Title[0-9]+=(.+)$/)) { + $seen_title++; + print STDERR "$1\n"; + } + elsif($l =~ m/^File[0-9]+=(\S+)$/) { + print "$1\n"; + } +} + +sub usage() { + die << "." + Usage: $0 url +. +; +}