close IN;
} else {
- my $url = "http://$c->{'host'}:$c->{'port'}/xml";
my $content_type;
- ($content_type, $status) = xml_fetch($url);
+ # In MythTV 0.25 the path changed from /xml to /Status/GetStatus
+ for my $path ('Status/GetStatus', 'xml') {
+ my $url = "http://$c->{'host'}:$c->{'port'}/$path";
+ ($content_type, $status) = xml_fetch($url);
+
+ last
+ if defined $status;
+ }
die "Nothing was received from the MythTV Backend"
unless defined $status;
die "Sorry, failed to fetch $url: Connection to MythTV timed out.\n"
unless defined $response;
- die "Sorry, failed to fetch $url:\n" . $response->status_line . "\n"
+ # If we get a page doesn't exist, then just ignore it, we need to fetch
+ # the status page from a few different locations.
+ if ($response->code == 404) {
+ exit 1;
+ }
+
+ die "Sorry, failed to fetch $url: " . $response->status_line . "\n"
unless $response->is_success;
print $response->header('Content-Type') . "\n";