- unless(defined($content = LWP::Simple::get(sprintf('http://blip.tv/file/%s', $2)))) {
- $self->error('Could not download page');
- return undef;
- }
+ if ($pattern eq $self->{'PATTERNS'}->[0]) {
+ # blip.tv/file pattern
+ unless(defined($content = LWP::Simple::get(sprintf('http://blip.tv/file/%s', $2)))) {
+ $self->error('Could not download page');
+ return undef;
+ }
+
+ $p->handler(start => \@accum, "tagname, attr");
+ $p->handler(text => \@text, "text");
+ $p->report_tags(qw(script));
+ $p->utf8_mode(1);
+ $p->parse($content);
+
+ # Look for the post id in the javascript code
+ foreach $e (@text) {
+ if ($e->[0] =~ m|player.setPostsId\((\d+)\)|s) {
+ $xml = $1;
+ }
+ }
+ } elsif ($pattern eq $self->{'PATTERNS'}->[1]) {
+ my $r;
+ my $u;