]> git.pld-linux.org Git - packages/clive.git/commitdiff
- rediff myself instead of junk submitted by lisu
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 20 Jan 2009 11:52:12 +0000 (11:52 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    clive-delfi.patch -> 1.16
    clive-reporter.patch -> 1.6

clive-delfi.patch
clive-reporter.patch

index c01e2bf8d5ccf27eddd9bd7e2b2f17ab9f6dc6f4..9bc1d182248ac42ac71d0d73dbcf8a63f19764ac 100644 (file)
@@ -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 %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 ($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;
++    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_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};
++    } 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;
++        my $page = "";
++        open my $fh, ">", \$page;
 +
-+         # Disable: header
-+        $curl->setopt(CURLOPT_HEADER, 0);
-+        $curl->setopt(CURLOPT_URL, $url);
-+        $curl->setopt(CURLOPT_WRITEDATA, $fh);
++        # Disable: header
++        $curl->setopt(CURLOPT_HEADER, 0);
++        $curl->setopt(CURLOPT_URL, $url);
++        $curl->setopt(CURLOPT_WRITEDATA, $fh);
 +
-+        my $rc = $curl->perform;
-+        close $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";
-+        }
++        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 f794527db4f6da6ee45f1eb9805d54f4153978e5..da64242edc3c99b9a84fa97cbd50372bd8af9d05 100644 (file)
@@ -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" ) {
 +                }
              }
              $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.
This page took 0.137192 seconds and 4 git commands to generate.