Author: glen                         Date: Tue Jan 20 11:52:17 2009 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- rediff myself instead of junk submitted by lisu

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

---- Diffs:

================================================================
Index: SOURCES/clive-delfi.patch
diff -u SOURCES/clive-delfi.patch:1.15 SOURCES/clive-delfi.patch:1.16
--- SOURCES/clive-delfi.patch:1.15      Thu Jan  1 19:53:27 2009
+++ SOURCES/clive-delfi.patch   Tue Jan 20 12:52:11 2009
@@ -1,83 +1,84 @@
---- 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,
+--- clive-2.1.3/clive~ 2009-01-20 13:48:45.000000000 +0200
++++ clive-2.1.3/clive  2009-01-20 13:49:36.000000000 +0200
+@@ -85,6 +85,7 @@
      IsLastfm    => qr|\Qlast.fm\E|i,
      IsLiveleak  => qr|\Qliveleak.com\E|i,
-+    IsDelfi     => qr|\Q.delfi.\E|i,
      IsEvisor    => qr|\Qevisor.tv\E|i,
++    IsDelfi     => qr|\Q.delfi.\E|i,
      #IsMetacafe => qr|\Qmetacafe.com\E|i,
  );
-@@ -331,6 +332,8 @@
-         ($xurl, $id, $title) = handle_break($response_ref);
-     } elsif ( $url =~ /$re_hosts{IsLiveleak}/ ) {
+ 
+@@ -333,6 +334,8 @@
          ($xurl, $id) = handle_liveleak($response_ref, $response_fh);
-+    } elsif ( $url =~ /$re_hosts{IsDelfi}/ ) {
-+      ($xurl, $id) = handle_delfi($response_ref, $response_fh);
      } elsif ( $url =~ /$re_hosts{IsEvisor}/ ) {
          ($xurl, $id) = handle_evisor($response_ref);
++    } elsif ( $url =~ /$re_hosts{IsDelfi}/ ) {
++        ($xurl, $id) = handle_delfi($response_ref, $response_fh);
      }
-@@ -863,6 +866,63 @@
+ #    elsif ( $url =~ /$re_hosts{IsMetacafe}/ ) {
+ #        ($xurl, $id) = handle_metacafe($response_ref);
+@@ -712,6 +715,64 @@
      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 ($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_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";
-+        }
++    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_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);
++    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.5 SOURCES/clive-reporter.patch:1.6
--- SOURCES/clive-reporter.patch:1.5    Thu Jan  1 19:53:27 2009
+++ SOURCES/clive-reporter.patch        Tue Jan 20 12:52:12 2009
@@ -1,27 +1,27 @@
---- 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
+--- 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
 @@ -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,
  );
-@@ -334,6 +335,8 @@
+ 
+@@ -306,6 +307,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);
      }
-@@ -402,6 +405,14 @@
+ #    elsif ( $url =~ /$re_hosts{IsMetacafe}/ ) {
+ #        ($xurl, $id) = handle_metacafe($response_ref);
+@@ -369,6 +372,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,32 @@
 +                }
              }
              $errmsg = "expected different content-type, "
-                     . "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*'([^']+)'|,
-       );
- 
-@@ -924,6 +936,28 @@
-       return ($xurl, $id);
+                 . "received \"$content_type\"" unless $content_ok;
+@@ -773,6 +784,27 @@
+     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
-+               GrabVideoID     => qr|attributes\s
++    # 
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 $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.15&r2=1.16&f=u
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/clive-reporter.patch?r1=1.5&r2=1.6&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to