[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:45:24 UTC 2009
The following commit has been merged in the master branch:
commit b143e0e145bd216e900cc70a31f6eb4471529aaa
Author: legatvs <legatvs at gmail.com>
Date: Thu Mar 26 22:53:44 2009 +0200
gvideo: Fix URI::Escape import error, fix "id not found" error handling.
diff --git a/clive b/clive
index ed31e5b..2d9757f 100755
--- a/clive
+++ b/clive
@@ -708,6 +708,7 @@ sub parse_input
if ($url =~ /&srcurl=(.*?)&/)
{ # GVideo: one of many redirects
+ require URI::Escape;
printf "found redirect ...%s\n=> %s\n",
(split(/&/, $url))[0],
(split(/&/, URI::Escape::uri_unescape($1)))[0]
@@ -788,35 +789,27 @@ sub handle_google
my %re = (
- #GrabRedirect => qr|lfRedirect\('(.*?)'|,
GrabVideoURL => qr|videoUrl\\x3d(.*?)\\x26|,
GrabID => qr|docid: '(.*?)'|,
GrabMP4 => qr|href="http://vp\.(.*?)"|,
);
- #my $redir = $1 if $$response_ref =~ /$re{GrabRedirect}/;
+ my $id = $1 if $$response_ref =~ /$re{GrabID}/;
+
my $xurl = URI::Escape::uri_unescape($1)
if $$response_ref =~ /$re{GrabVideoURL}/;
- my $id = $1 if $$response_ref =~ /$re{GrabID}/;
my $mp4 = $1 if $$response_ref =~ /$re{GrabMP4}/;
- # if ( $redir ) {
- # video.google.* http/302 redirects to the actual video hosts again.
- # Leaving this commented out until they decide to flip it back on
- # again after some mind-boggling brainstorming.
- # $redir =~ s{\\x3d}{=};
- # push @queue, $redir;
- # print "Found a redirect to another host. Pushed into queue.\n"
- # unless $opts{quiet};
- # } else {
- $xurl = "http://vp.$mp4"
- if $mp4 and $opts{format} eq "mp4";
+ my $errmsg;
+ $errmsg = "video id not found" if !$id;
+ $errmsg = "extraction url not found" if !$xurl && !$errmsg;
- print STDERR "\nerror: extraction url not found\n"
- unless $xurl;
+ print STDERR "\nerror: $errmsg\n" if $errmsg;
+
+ $xurl = "http://vp.$mp4"
+ if $mp4 && $opts{format} eq "mp4" && $xurl;
- # }
return ($xurl, $id);
}
--
Video extraction utility for YouTube, Google Video and other video sites (Debian packaging)
More information about the Pkg-perl-cvs-commits
mailing list