1 --- clive-2.1.10/clive~ 2009-04-27 11:29:24.000000000 +0200
2 +++ clive-2.1.10/clive 2009-04-27 11:30:52.000000000 +0200
4 IsDmotion => qr|dailymotion.com|i,
5 IsCctv => qr|tv.cctv.com|i,
6 IsDelfi => qr|.delfi.|i,
7 + IsReporter => qr|www.reporter.ee|i,
12 [$re_hosts{IsDmotion}, \&handle_dmotion],
13 [$re_hosts{IsCctv}, \&handle_cctv],
14 [$re_hosts{IsDelfi}, \&handle_delfi],
15 + [$re_hosts{IsReporter}, \&handle_reporter],
23 + # Reporter returns "flv-application/octet-stream"
24 + } elsif ( $content_type =~ m!application/octet-stream! ) {
25 + if ( $entry{page_url} =~ /$re_hosts{IsReporter}/ ) {
26 + if ( $opts{format} eq "flv" ) {
27 + $entry{file_suffix} = 'flv';
32 $errmsg = "expected different content-type, "
33 . "received \"$content_type\"" unless $content_ok;
34 @@ -1061,6 +1062,28 @@
38 +sub handle_reporter {
39 + my ($response_ref, $response_fh) = @_;
42 + # http://www.reporter.ee/index.php/2008/04/21/soiduopetaja-vorpis-poiste-nupeldamisest-videoklippe/
43 + GrabVideoPrefix => qr|obj\s+=\s+{type:"video",file:"(\w+://[^"]+)|,
44 + GrabVideoID => qr|attributes\s+=\s+{id:\s+"video([^"]+)"|,
48 + my $id = $1 if $$response_ref =~ /$re{GrabVideoID}/;
49 + my $prefix = $1 if $$response_ref =~ /$re{GrabVideoPrefix}/;
51 + if ($id and $prefix) {
52 + $xurl = $prefix . $id . '.flv';
54 + print STDERR "error: url not found\n";
57 + return ($xurl, $id);
60 # Subroutines: Progress
61 # NOTE: the 'dot' progress copies much from wget.