]> git.pld-linux.org Git - packages/clive.git/blob - clive-reporter.patch
- adjusted for 2.1.2
[packages/clive.git] / clive-reporter.patch
1 --- clive-2.1.2/clive~  2009-01-01 13:27:50.000000000 +0000
2 +++ clive-2.1.2/clive   2009-01-01 13:33:20.000000000 +0000
3 @@ -85,6 +85,7 @@
4      IsLastfm    => qr|\Qlast.fm\E|i,
5      IsLiveleak  => qr|\Qliveleak.com\E|i,
6      IsDelfi     => qr|\Q.delfi.\E|i,
7 +    IsReporter  => qr|\Qwww.reporter.ee\E|i,
8      IsEvisor    => qr|\Qevisor.tv\E|i,
9      #IsMetacafe => qr|\Qmetacafe.com\E|i,
10  );
11 @@ -334,6 +335,8 @@
12          ($xurl, $id) = handle_liveleak($response_ref, $response_fh);
13      } elsif ( $url =~ /$re_hosts{IsDelfi}/ ) {
14         ($xurl, $id) = handle_delfi($response_ref, $response_fh);
15 +    } elsif ( $url =~ /$re_hosts{IsReporter}/ ) {
16 +        ($xurl, $id) = handle_reporter($response_ref, $response_fh);
17      } elsif ( $url =~ /$re_hosts{IsEvisor}/ ) {
18          ($xurl, $id) = handle_evisor($response_ref);
19      }
20 @@ -402,6 +405,14 @@
21                          $content_ok = 1;
22                      }
23                  }
24 +          # Reporter returns "flv-application/octet-stream"
25 +            } elsif ( $content_type =~ m!application/octet-stream! ) {
26 +                if ( $entry{page_url} =~ /$re_hosts{IsReporter}/ ) {
27 +                    if ( $opts{format} eq "flv" ) {
28 +                        $entry{file_suffix} = 'flv';
29 +                        $content_ok = 1;
30 +                    }
31 +                }
32              }
33              $errmsg = "expected different content-type, "
34                      . "received \"$content_type\""
35 @@ -879,6 +890,7 @@
36            GrabVideoSite   => qr|src="(\S+://[^/]+)/js/embed.js"|,
37            # videoproject
38            # http://video.delfi.ee/video/CzurzqNz/
39 +          # http://video.delfi.ee/video/Uu4gF58g/
40            GrabVideoURL   => qr|\.addVariable\('file',\s*'([^']+)'|,
41         );
42  
43 @@ -924,6 +936,28 @@
44         return ($xurl, $id);
45  }
46  
47 +sub handle_reporter {
48 +    my ($response_ref, $response_fh) = @_;
49 +
50 +    my %re = (
51 +       # http://www.reporter.ee/index.php/2008/04/21/soiduopetaja-vorpis-poiste-nupeldamisest-videoklippe/
52 +               GrabVideoPrefix => qr|obj\s
53 +               GrabVideoID     => qr|attributes\s
54 +    );
55 +
56 +       my $xurl;
57 +    my $id     = $1 if $$response_ref =~ /$re{GrabVideoID}/;
58 +    my $prefix = $1 if $$response_ref =~ /$re{GrabVideoPrefix}/;
59 +
60 +       if ($id and $prefix) {
61 +        $xurl = $prefix . $id . '.flv';
62 +       } else {
63 +        print STDERR "error: url not found\n";
64 +    }
65 +
66 +    return ($xurl, $id);
67 +}
68 +
69  # Subroutines: Progress
70  # NOTE: the 'dot' progress copies much from wget.
71  
This page took 0.095776 seconds and 3 git commands to generate.