O'Reilly logo

Home Theater Hacks by Brett McLaughlin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Hack #97. Streaming Internet Audio Broadcasts to TiVo

Stream SHOUTcast Internet audio alongside your own MP3s to your HMO-enabled TiVo.

TiVo's Home Media Option (HMO) allows you to stream MP3 music from your home PC through your TiVo to your television and home audio system speakers. But what of those online music broadcasts, streamed talk shows, and specials? The HMO can handle those too, thanks to Tobias Hoellrich's m3ugen.pl(http://www.kahunaburger.com/blog/archives/000054.html).

m3ugen.pl is a simple Perl (http://www.perl.com) script that generates .m3u files from SHOUTcast playlists. These .m3u files are what TiVo uses to stream music from PCs and Macs in your house to TiVo.

The Code

Save the following code to a file named m3ugen.pl somewhere on your PC or Mac's hard drive:

 #!c:\perl\bin\perl.exe use strict; use HTML::LinkExtor; use LWP::Simple; use URI::URL; use constant PROVIDER => qq{http://www.shoutcast.com/}; use constant DIRECTORY => PROVIDER.qq{directory/}; my $genre=$ARGV[0]; my $results=$ARGV[1]; my $outfile=$ARGV[2]; unless (defined($genre) && defined($results) && $results && $results <= 25 && defined($outfile)) { die qq{Usage:\t$0 [genre] [numresults] [outfile]\n}. qq{\tgenre=TopTen,House,Blues,Punk,...\n}. qq{\tnumresults=1..25\n}. qq{\toutfile=m3u output file\n}; } my @playlists=getPlaylists(DIRECTORY. qq{?sgenre=$genre&numresult=$results},PROVIDER); unless (scalar(@playlists)) { die "No results found - unable to create playlist\n"; exit(0); } @playlists=mapFor ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required