[SCM] Video extraction utility for YouTube, Google Video and other video sites (Debian packaging) branch, master, updated. upstream/2.1.7-214-g6762190

legatvs legatvs at gmail.com
Wed Apr 1 14:44:36 UTC 2009


The following commit has been merged in the master branch:
commit c51da1cf48925b1d23f3210b0c273141174b221e
Author: legatvs <legatvs at gmail.com>
Date:   Mon Jan 26 01:19:09 2009 +0200

    Cleaned up: embed url => video page url.

diff --git a/CHANGES b/CHANGES
index 7c3a080..136b624 100644
--- a/CHANGES
+++ b/CHANGES
@@ -4,6 +4,9 @@ Version 2.1.4
   * Tweaked --version output
   * Fixed progressbar time => string conversion
 
+ Developer-visible changes:
+  * Cleaned up: embed url => video page url
+
 
 Version 2.1.3
 (January 9, 2009)
diff --git a/clive b/clive
index 8117632..d12bec4 100755
--- a/clive
+++ b/clive
@@ -1500,38 +1500,11 @@ sub grep_cache {
 }
 
 sub translate_embed {
-    my ($urlref) = @_;
-
-    my %re = ( # See clivescan for more details
-        YoutubeEmbed => {
-            url_prefix => "http://youtube.com/watch?v=",
-            search_for => qr|\Qyoutube.com/v/\E(.*?)$|i,
-        },
-        GVideoEmbed => {
-            url_prefix => "http://video.google.com/videoplay?docid=",
-            search_for => qr|\Q/googleplayer.swf?docid=\E(.*?)$|i,
-        },
-        SevenLoadEmbed => {
-            url_prefix => "http://sevenload.com/videos/",
-            search_for => qr|\Qsevenload.com/pl/\E(.*?)/|i,
-        },
-        LiveleakEmbed => {
-            url_prefix => "http://liveleak.com/view?i=",
-            search_for => qr|\Qliveleak.com/e/\E(.*?)$|i,
-        },
-#        MetacafeEmbed => {
-#            url_prefix => "http://metacafe.com/watch/",
-#            search_for => qr|\Qmetacafe.com/fplayer/\E(.*?)/|i,
-#        },
-        # TODO: add BreakEmbed, e.g.:
-        # Page  URL: http://break.com/index/if-all-movies-had-cell-phones.html
-        # Embed URL: http://embed.break.com/600081
-    );
-
-    while ( my $host = each( %re ) ) {
-        $$urlref = "$re{$host}{url_prefix}$1" and last
-            if ( $$urlref =~ /$re{$host}{search_for}/ );
-    }
+    my ($url) = @_;
+    $$url =~ s!/v/!/watch?v=!i;              # youtube
+    $$url =~ s!googleplayer.swf!videoplay!i; # googlevideo
+    $$url =~ s!/pl/!/videos/!i;              # sevenload
+    $$url =~ s!/e/!/view?i=!i;               # liveleak
 }
 
 sub emit {

-- 
Video extraction utility for YouTube, Google Video and other video sites (Debian packaging)



More information about the Pkg-perl-cvs-commits mailing list