+++ /dev/null
---- clive-2.1.14/clive~ 2009-05-29 10:38:23.000000000 +0200
-+++ clive-2.1.14/clive 2009-05-29 10:38:19.000000000 +0200
-@@ -78,6 +78,7 @@
- IsDmotion => qr|dailymotion.com|i,
- IsCctv => qr|tv.cctv.com|i,
- IsRedtube => qr|redtube.com|i,
-+ IsDelfi => qr|.delfi.|i,
- );
-
- my @re_hosts_arr = (
-@@ -91,6 +92,7 @@
- [ $re_hosts{IsDmotion}, \&handle_dmotion ],
- [ $re_hosts{IsCctv}, \&handle_cctv ],
- [ $re_hosts{IsRedtube}, \&handle_redtube ],
-+ [ $re_hosts{IsDelfi}, \&handle_delfi],
- );
-
- # Parse config
-@@ -1016,6 +1018,64 @@
- return ( $xurl, $video_id );
- }
-
-+sub handle_delfi {
-+ my ($response_ref, $response_fh) = @_;
-+
-+ my %re = (
-+ # videobox
-+ # http://www.delfi.ee/news/paevauudised/paevavideo/article.php?id=15218215
-+ GrabVideoboxURL => qr|flv_url:\s*'(.*?)'|,
-+ # videoproject embed
-+ # http://www.delfi.ee/news/paevauudised/paevavideo/article.php?id=18759038
-+ GrabVideoSalt => qr|_delfiVideoSalt\s*=\s*"([^"]+)";|,
-+ GrabVideoSite => qr|src="(\S+://[^/]+)/js/embed.js"|,
-+ # videoproject
-+ # http://video.delfi.ee/video/CzurzqNz/
-+ GrabVideoURL => qr|\.addVariable\('file',\s*'([^']+)'|,
-+ );
-+
-+ my ($xurl, $id);
-+ my $videobox_url = $1 if $$response_ref =~ /$re{GrabVideoboxURL}/;
-+ my $video_salt = $1 if $$response_ref =~ /$re{GrabVideoSalt}/;
-+ my $video_site = $1 if $$response_ref =~ /$re{GrabVideoSite}/;
-+ my $video_url = $1 if $$response_ref =~ /$re{GrabVideoURL}/;
-+
-+ if ($videobox_url) {
-+ $id = $1 if $videobox_url =~ m{/([^/]+)\.flv$};
-+ $xurl = $videobox_url;
-+
-+ } elsif ($video_url) {
-+ $xurl = URI::Escape::uri_unescape($video_url);
-+ $id = $1 if $xurl =~ m{^\S+://[^/]+/v/(.+?)\.flv};
-+
-+ } elsif ($video_salt and $video_site) {
-+ my $url = $video_site . '/video/' . $video_salt . '/';
-+ print "done.\nfetch page ..." unless $opts{quiet};
-+
-+ my $page = "";
-+ open my $fh, ">", \$page;
-+
-+ # Disable: header
-+ $curl->setopt(CURLOPT_HEADER, 0);
-+ $curl->setopt(CURLOPT_URL, $url);
-+ $curl->setopt(CURLOPT_WRITEDATA, $fh);
-+
-+ my $rc = $curl->perform;
-+ close $fh;
-+
-+ if ($rc == 0) {
-+ # recurse
-+ ($xurl, $id) = handle_delfi(\$page);
-+ } else {
-+ print STDERR "\nerror: " . $curl->strerror($rc) . " (http/$rc)\n";
-+ }
-+ } else {
-+ print STDERR "error: url not found\n";
-+ }
-+
-+ return ($xurl, $id);
-+}
-+
- # Subroutines: Progress
- # NOTE: the 'dot' progress copies much from wget.
-
+++ /dev/null
---- clive-2.1.10/clive~ 2009-04-27 11:29:24.000000000 +0200
-+++ clive-2.1.10/clive 2009-04-27 11:30:52.000000000 +0200
-@@ -88,6 +88,7 @@
- IsDmotion => qr|dailymotion.com|i,
- IsCctv => qr|tv.cctv.com|i,
- IsDelfi => qr|.delfi.|i,
-+ IsReporter => qr|www.reporter.ee|i,
- );
-
- my @re_hosts_arr = (
-@@ -101,6 +102,7 @@
- [$re_hosts{IsDmotion}, \&handle_dmotion],
- [$re_hosts{IsCctv}, \&handle_cctv],
- [$re_hosts{IsDelfi}, \&handle_delfi],
-+ [$re_hosts{IsReporter}, \&handle_reporter],
- );
-
- # Parse config
-@@ -369,6 +372,14 @@
- $content_ok = 1;
- }
- }
-+ # Reporter returns "flv-application/octet-stream"
-+ } elsif ( $content_type =~ m!application/octet-stream! ) {
-+ if ( $entry{page_url} =~ /$re_hosts{IsReporter}/ ) {
-+ if ( $opts{format} eq "flv" ) {
-+ $entry{file_suffix} = 'flv';
-+ $content_ok = 1;
-+ }
-+ }
- }
- $errmsg = "expected different content-type, "
- . "received \"$content_type\"" unless $content_ok;
-@@ -1061,6 +1062,28 @@
- return ($xurl, $id);
- }
-
-+sub handle_reporter {
-+ my ($response_ref, $response_fh) = @_;
-+
-+ my %re = (
-+ # http://www.reporter.ee/index.php/2008/04/21/soiduopetaja-vorpis-poiste-nupeldamisest-videoklippe/
-+ GrabVideoPrefix => qr|obj\s+=\s+{type:"video",file:"(\w+://[^"]+)|,
-+ GrabVideoID => qr|attributes\s+=\s+{id:\s+"video([^"]+)"|,
-+ );
-+
-+ my $xurl;
-+ my $id = $1 if $$response_ref =~ /$re{GrabVideoID}/;
-+ my $prefix = $1 if $$response_ref =~ /$re{GrabVideoPrefix}/;
-+
-+ if ($id and $prefix) {
-+ $xurl = $prefix . $id . '.flv';
-+ } else {
-+ print STDERR "error: url not found\n";
-+ }
-+
-+ return ($xurl, $id);
-+}
-+
- # Subroutines: Progress
- # NOTE: the 'dot' progress copies much from wget.
-