- if ($p->get_tag('title')) {
- $metadata->{'TITLE'} = $p->get_text();
- $metadata->{'TITLE'} =~ s/^LiveLeak\.com\s+-\s+(.+)$/$1/im;
- }
-
- # Get the file containing the video metadata
- unless(defined($content = $self->simple_get(sprintf('http://www.liveleak.com/mi?token=%s', $2), $ua))) {
- $self->error('Could not download metadata');
- return undef;
- }
-
- unless ($content =~ m/file_location=([^\&]+)\&/) {
- $self->error('Could not find download URL');
- return undef;
+ while ($tag = $p->get_tag('script', 'meta')) {
+ if ('meta' eq $tag->[0]) {
+ if (exists($tag->[1]->{property}) and ('og:title' eq $tag->[1]->{property})) {
+ $metadata->{'TITLE'} = $tag->[1]->{content};
+ $metadata->{'TITLE'} =~ s/^LiveLeak\.com - //;
+ }
+ } elsif ('script' eq $tag->[0]) {
+ my $e = $p->get_text();
+
+ if ($e =~ /file: "([^"]+)"/) {
+ $self->debug("Found file: %s", $1);
+ $metadata->{'DLURL'} = $1;
+ }
+ }