[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:27 UTC 2009


The following commit has been merged in the master branch:
commit 2d10bc0813b15329d628954483e6e94465bc340a
Author: legatvs <legatvs at gmail.com>
Date:   Sun Mar 29 15:25:58 2009 +0300

    Cleanup code.

diff --git a/clive b/clive
index fa0c5e2..3e5a2c2 100755
--- a/clive
+++ b/clive
@@ -370,7 +370,8 @@ sub process_page
     }
     elsif ($url =~ /$re_hosts{IsCctv}/)
     {
-        ($xurl, $id) = handle_cctv_space($response_ref, $response_fh, $url);
+        ($xurl, $id) =
+          handle_cctv_space($response_ref, $response_fh, $url);
     }
     return -1
       if !$xurl
@@ -1004,7 +1005,7 @@ sub handle_cctv_space
 
     if ($id)
     {
-        my $domain = join('.',strdomain($page_url));
+        my $domain = join('.', strdomain($page_url));
         my $conf_url =
           "http://$domain/playcfg/flv_info_new.jsp?videoId=$id";
         $xurl = fetch_cctv_space_config($conf_url, $resp_fh);
@@ -1017,52 +1018,6 @@ sub handle_cctv_space
     return ($xurl, $id);
 }
 
-sub fetch_cctv_space_config
-{
-    my ($conf_url, $resp_fh) = @_;
-
-    print "done.\nfetch config file ..."
-      unless $opts{quiet};
-
-    my $conf = "";
-    open my $fh, ">", \$conf;
-
-    # Disable: header
-    $curl->setopt(CURLOPT_HEADER,    0);
-    $curl->setopt(CURLOPT_URL,       $conf_url);
-    $curl->setopt(CURLOPT_WRITEDATA, $fh);
-
-    my $rc = $curl->perform;
-    close $fh;
-
-    my ($xurl, $errmsg);
-    if ($rc == 0)
-    {
-        my $re = qr|"url":"(.*?)"|;
-        if ($conf =~ /$re/)
-        {
-            $xurl = "http://v.cctv.com/flash/$1";
-        }
-        else
-        {
-            $errmsg = "extraction url not found";
-        }
-    }
-    else
-    {
-        $errmsg = $curl->strerror($rc) . " http/$rc\n";
-    }
-
-    print STDERR "\nerror: $errmsg\n" if $errmsg;
-
-    # Re-enable: header, reset WRITEDATA, the above overrides the
-    # original settings.
-    $curl->setopt(CURLOPT_HEADER,    0);
-    $curl->setopt(CURLOPT_WRITEDATA, $resp_fh);
-
-    return $xurl;
-}
-
 # Subroutines: Progress
 # NOTE: the 'dot' progress copies much from wget.
 
@@ -1682,6 +1637,52 @@ sub fetch_sevenload_configxml
     return ($xurl, $id);
 }
 
+sub fetch_cctv_space_config
+{
+    my ($conf_url, $resp_fh) = @_;
+
+    print "done.\nfetch config file ..."
+      unless $opts{quiet};
+
+    my $conf = "";
+    open my $fh, ">", \$conf;
+
+    # Disable: header
+    $curl->setopt(CURLOPT_HEADER,    0);
+    $curl->setopt(CURLOPT_URL,       $conf_url);
+    $curl->setopt(CURLOPT_WRITEDATA, $fh);
+
+    my $rc = $curl->perform;
+    close $fh;
+
+    my ($xurl, $errmsg);
+    if ($rc == 0)
+    {
+        my $re = qr|"url":"(.*?)"|;
+        if ($conf =~ /$re/)
+        {
+            $xurl = "http://v.cctv.com/flash/$1";
+        }
+        else
+        {
+            $errmsg = "extraction url not found";
+        }
+    }
+    else
+    {
+        $errmsg = $curl->strerror($rc) . " http/$rc\n";
+    }
+
+    print STDERR "\nerror: $errmsg\n" if $errmsg;
+
+    # Re-enable: header, reset WRITEDATA, the above overrides the
+    # original settings.
+    $curl->setopt(CURLOPT_HEADER,    0);
+    $curl->setopt(CURLOPT_WRITEDATA, $resp_fh);
+
+    return $xurl;
+}
+
 sub strdomain
 {
     my $uri = shift;

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



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