return undef;
}
- # There is no XML header in the data, which makes XML::Simple unhappy
- $content = '<?xml version="1.0" encoding="UTF-8"?>' . $content;
-
unless(defined($t = $p->XMLin($content, KeepRoot => 1))) {
$self->error('Could not parse XML metadata');
return undef;
}
- $dlurl = $t->{'xml'}->{'video'}->{'hd_file'} || $t->{'xml'}->{'video'}->{'file'};
+ if (exists($t->{'xml'}->{'video'}->{'is_hd'}) and (0 != $t->{'xml'}->{'video'}->{'is_hd'})) {
+ $self->debug('Selecting HD video');
+ $dlurl = $t->{'xml'}->{'video'}->{'hd_file'};
+ } else {
+ $self->debug('Selecting SD video');
+ $dlurl = $t->{'xml'}->{'video'}->{'file'};
+ }
$timestamp = $t->{'xml'}->{'timestamp'};
unless(defined($dlurl)) {
+ $self->error('No dlurl found in XML');
return undef;
}
$timestamp += 1800;
$hash = md5_hex(sprintf('redFiretruck%s?e=%d', $dlpath, $timestamp));
} else {
+ $self->error('Unknown dlurl scheme: %s', $dlurl);
return undef;
}