Net::MythTV - Interface to MythTV
use Net::MythTV; my $mythtv = Net::MythTV->new(); my @recordings = $mythtv->recordings; foreach my $recording (@recordings) { my $filename = $recording->title . ' ' . $recording->start . '.mpg'; $filename =~ s{[^a-zA-Z0-9]}{_}g; print $recording->channel . ', ' . $recording->title . ' ' . $recording->start . ' - ' . $recording->stop . ' (' . $recording->size . ') -> ' . $filename . "\n"; $mythtv->download_recording( $recording, $filename ); } # prints out something like: # BBC TWO, Springwatch 2009-06-11T19:00:00 - 2009-06-11T20:00:00 # (3184986020) -> Springwatch_2009_06_11T19_00_00_mpg # Channel 4, Derren Brown 2009-06-11T22:40:00 - 2009-06-11T23:10:00 # (1734615088) -> Derren_Brown_2009_06_11T22_40_00_mpg
This module provides a simple interface to MythTV using the MythTV protocol. MythTV is a free open source digital video recorder. Find out more at http://www.mythtv.org/.
This module allows you to query the recordings and to download them to a local file. By default the MythTV protocol is only allowed on the local machine running MythTV.
The constructor takes a hostname and port, but defaults to:
my $mythtv = Net::MythTV->new(); my $mythtv = Net::MythTV->new( hostname => 'localhost', port => 6543 );
List the recordings and return them as Net::MythTV::Recording objects:
my @recordings = $mythtv->recordings; foreach my $recording (@recordings) { print $recording->channel . ', ' . $recording->title . ' ' . $recording->start . ' - ' . $recording->stop . ' (' . $recording->size . ') -> ' . $filename . "\n"; }
Downloads a recording to a local file:
$mythtv->download_recording( $recording, $filename );
Net::MythTV::Connection, Net::MythTV::Recording.
Leon Brocard <acme@astray.com>.
Copyright (C) 2009, Leon Brocard
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
To install Net::MythTV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::MythTV
CPAN shell
perl -MCPAN -e shell install Net::MythTV
For more information on module installation, please visit the detailed CPAN module installation guide.