SVN: toys/rsget.pl/Video/ExtremeTube

sparky sparky at pld-linux.org
Wed Oct 13 00:51:28 CEST 2010


Author: sparky
Date: Wed Oct 13 00:51:27 2010
New Revision: 11841

Modified:
   toys/rsget.pl/Video/ExtremeTube
Log:
- updated
- use http head to get file size


Modified: toys/rsget.pl/Video/ExtremeTube
==============================================================================
--- toys/rsget.pl/Video/ExtremeTube	(original)
+++ toys/rsget.pl/Video/ExtremeTube	Wed Oct 13 00:51:27 2010
@@ -15,15 +15,19 @@
 start:
 	GET( $-{_uri} );
 
-	! m{<h1 class="title-video-box".+?>(.*?)</h1>};
+	! m{<h1 class="title-video-box.+?>(.*?)</h1>};
 	$-{fname} = de_ml( $1 );
 	$-{fname} =~ s{/}{_}g;
 	$-{fname} =~ s/\s*$/.flv/;
 
-	INFO( name => $-{fname}, quality => "flv" );
-
 	! m{flashvars\.video_url = '(.*?)'};
+	$-{file_uri} = uri_unescape( $1 );
+
+	GET( $-{file_uri}, headonly => 1, keep_referer => 1 );
+
+	! m{Content-Length:\s*(\d+)};
+	INFO( name => $-{fname}, size => $1 );
 
-	DOWNLOAD( $1, fname => $-{fname} );
+	DOWNLOAD( $-{file_uri}, fname => $-{fname} );
 
 # vim: filetype=perl:ts=4:sw=4


More information about the pld-cvs-commit mailing list