Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shoutcast_parser: fast hack to get at the real streams
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
. | ||
; | ||
} |