Skip to content

Commit

Permalink
shoutcast_parser: fast hack to get at the real streams
Browse files Browse the repository at this point in the history
  • Loading branch information
trapd00r committed Jan 19, 2013
1 parent cf3dd61 commit b236324
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions 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
.
;
}

0 comments on commit b236324

Please sign in to comment.