- 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;
-
- $ua = LWP::UserAgent->new(max_redirect => 0);
- $r = $ua->get(sprintf('http://blip.tv/play/%s', $2));
+ unless(defined($content = $self->simple_get($url, $ua))) {
+ $self->error('Could not download page');
+ return undef;
+ }