SOURCES: clive-delfi.patch, clive-reporter.patch - adjusted for 2.1.2

lisu lisu at pld-linux.org
Thu Jan 1 19:53:33 CET 2009


Author: lisu                         Date: Thu Jan  1 18:53:33 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- adjusted for 2.1.2

---- Files affected:
SOURCES:
   clive-delfi.patch (1.14 -> 1.15) , clive-reporter.patch (1.4 -> 1.5) 

---- Diffs:

================================================================
Index: SOURCES/clive-delfi.patch
diff -u SOURCES/clive-delfi.patch:1.14 SOURCES/clive-delfi.patch:1.15
--- SOURCES/clive-delfi.patch:1.14	Fri Dec 12 10:35:43 2008
+++ SOURCES/clive-delfi.patch	Thu Jan  1 19:53:27 2009
@@ -1,84 +1,83 @@
---- clive-2.1.0/clive	2008-12-11 20:19:25.263179888 +0200
-+++ clive-2.1.0-delfi/clive	2008-12-11 23:03:43.000000000 +0200
+--- clive-2.1.2/clive~	2009-01-01 13:04:20.000000000 +0000
++++ clive-2.1.2/clive	2009-01-01 13:13:24.000000000 +0000
 @@ -84,6 +84,7 @@
      IsBreak     => qr|\Qbreak.com\E|i,
      IsLastfm    => qr|\Qlast.fm\E|i,
      IsLiveleak  => qr|\Qliveleak.com\E|i,
 +    IsDelfi     => qr|\Q.delfi.\E|i,
+     IsEvisor    => qr|\Qevisor.tv\E|i,
      #IsMetacafe => qr|\Qmetacafe.com\E|i,
  );
- 
-@@ -303,6 +304,8 @@
+@@ -331,6 +332,8 @@
          ($xurl, $id, $title) = handle_break($response_ref);
      } elsif ( $url =~ /$re_hosts{IsLiveleak}/ ) {
          ($xurl, $id) = handle_liveleak($response_ref, $response_fh);
 +    } elsif ( $url =~ /$re_hosts{IsDelfi}/ ) {
-+        ($xurl, $id) = handle_delfi($response_ref, $response_fh);
++	($xurl, $id) = handle_delfi($response_ref, $response_fh);
+     } elsif ( $url =~ /$re_hosts{IsEvisor}/ ) {
+         ($xurl, $id) = handle_evisor($response_ref);
      }
- #    elsif ( $url =~ /$re_hosts{IsMetacafe}/ ) {
- #        ($xurl, $id) = handle_metacafe($response_ref);
-@@ -712,6 +715,64 @@
+@@ -863,6 +866,63 @@
      return ($xurl, $id);
  }
  
 +sub handle_delfi {
-+    my ($response_ref, $response_fh) = @_;
++	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 %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}/;
++	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$};
++	if ($videobox_url) {
++	   $id = $1 if $videobox_url =~ m{/([^/]+)\.flv$};
 +		$xurl = $videobox_url;
 +
 +	} elsif ($video_url) {
-+        $xurl = uri_unescape($video_url);
-+        $id = $1 if $xurl =~ m{^\S+://[^/]+/v/(.+?)\.flv};
++	   $xurl = 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";
-+    }
++	} 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);
++	return ($xurl, $id);
 +}
-+
  
  # Subroutines: Progress
  # NOTE: the 'dot' progress copies much from wget.

================================================================
Index: SOURCES/clive-reporter.patch
diff -u SOURCES/clive-reporter.patch:1.4 SOURCES/clive-reporter.patch:1.5
--- SOURCES/clive-reporter.patch:1.4	Thu Dec 11 23:02:18 2008
+++ SOURCES/clive-reporter.patch	Thu Jan  1 19:53:27 2009
@@ -1,27 +1,27 @@
---- clive-2.1.0/clive	2008-12-11 23:42:37.000000000 +0200
-+++ clive-2.1.0-reporter/clive	2008-12-11 23:43:19.000000000 +0200
+--- clive-2.1.2/clive~	2009-01-01 13:27:50.000000000 +0000
++++ clive-2.1.2/clive	2009-01-01 13:33:20.000000000 +0000
 @@ -85,6 +85,7 @@
      IsLastfm    => qr|\Qlast.fm\E|i,
      IsLiveleak  => qr|\Qliveleak.com\E|i,
      IsDelfi     => qr|\Q.delfi.\E|i,
 +    IsReporter  => qr|\Qwww.reporter.ee\E|i,
+     IsEvisor    => qr|\Qevisor.tv\E|i,
      #IsMetacafe => qr|\Qmetacafe.com\E|i,
  );
- 
-@@ -306,6 +307,8 @@
+@@ -334,6 +335,8 @@
          ($xurl, $id) = handle_liveleak($response_ref, $response_fh);
      } elsif ( $url =~ /$re_hosts{IsDelfi}/ ) {
-         ($xurl, $id) = handle_delfi($response_ref, $response_fh);
+ 	($xurl, $id) = handle_delfi($response_ref, $response_fh);
 +    } elsif ( $url =~ /$re_hosts{IsReporter}/ ) {
 +        ($xurl, $id) = handle_reporter($response_ref, $response_fh);
+     } elsif ( $url =~ /$re_hosts{IsEvisor}/ ) {
+         ($xurl, $id) = handle_evisor($response_ref);
      }
- #    elsif ( $url =~ /$re_hosts{IsMetacafe}/ ) {
- #        ($xurl, $id) = handle_metacafe($response_ref);
-@@ -369,6 +372,14 @@
+@@ -402,6 +405,14 @@
                          $content_ok = 1;
                      }
                  }
-+            # Reporter returns "flv-application/octet-stream"
++	   # 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" ) {
@@ -31,41 +31,41 @@
 +                }
              }
              $errmsg = "expected different content-type, "
-                 . "received \"$content_type\"" unless $content_ok;
-@@ -727,7 +738,7 @@
-         GrabVideoSalt   => qr|_delfiVideoSalt\s*=\s*"([^"]+)";|,
-         GrabVideoSite   => qr|src="(\S+://[^/]+)/js/embed.js"|,
- 	# videoproject
--	# http://video.delfi.ee/video/CzurzqNz/
-+	# http://video.delfi.ee/video/Uu4gF58g/
- 		GrabVideoURL   => qr|\.addVariable\('file',\s*'([^']+)'|,
-     );
+                     . "received \"$content_type\""
+@@ -879,6 +890,7 @@
+ 	   GrabVideoSite   => qr|src="(\S+://[^/]+)/js/embed.js"|,
+ 	   # videoproject
+ 	   # http://video.delfi.ee/video/CzurzqNz/
++	   # http://video.delfi.ee/video/Uu4gF58g/
+ 	   GrabVideoURL   => qr|\.addVariable\('file',\s*'([^']+)'|,
+ 	);
  
-@@ -773,6 +784,27 @@
-     return ($xurl, $id);
+@@ -924,6 +936,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([^"]+)"|,
++       # http://www.reporter.ee/index.php/2008/04/21/soiduopetaja-vorpis-poiste-nupeldamisest-videoklippe/
++               GrabVideoPrefix => qr|obj\s
++               GrabVideoID     => qr|attributes\s
 +    );
 +
-+	my $xurl;
++       my $xurl;
 +    my $id     = $1 if $$response_ref =~ /$re{GrabVideoID}/;
 +    my $prefix = $1 if $$response_ref =~ /$re{GrabVideoPrefix}/;
 +
-+	if ($id and $prefix) {
++       if ($id and $prefix) {
 +        $xurl = $prefix . $id . '.flv';
-+	} else {
++       } else {
 +        print STDERR "error: url not found\n";
 +    }
 +
 +    return ($xurl, $id);
 +}
- 
++
  # Subroutines: Progress
  # NOTE: the 'dot' progress copies much from wget.
+ 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/clive-delfi.patch?r1=1.14&r2=1.15&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/clive-reporter.patch?r1=1.4&r2=1.5&f=u



More information about the pld-cvs-commit mailing list