SVN: toys/rsget.pl/Get/TurboUpload

sparky sparky at pld-linux.org
Fri Oct 23 18:24:07 CEST 2009


Author: sparky
Date: Fri Oct 23 18:24:06 2009
New Revision: 10837

Modified:
   toys/rsget.pl/Get/TurboUpload
Log:
- use new tools; checked


Modified: toys/rsget.pl/Get/TurboUpload
==============================================================================
--- toys/rsget.pl/Get/TurboUpload	(original)
+++ toys/rsget.pl/Get/TurboUpload	Fri Oct 23 18:24:06 2009
@@ -2,8 +2,8 @@
 
 name: TurboUpload
 short: TU
-uri: qr{turboupload\.com/}
-status: OK 2009-08-24
+uri: qr{turboupload\.com/(../)?files/get/.+?/.+}
+status: OK 2009-10-23
 
 start:
 	GET( $-{_uri} );
@@ -12,14 +12,13 @@
 	! m{<h2>\S* \S* (.*?)</h2>\s*<font .*?</font> \(($STDSIZE)\)</font>}s;
 	INFO( name => $1, asize => $2 );
 
-	! s/^.*?<Form method="POST" action=''>//s;
-	! s/(.*?)<\/Form>.*$/$1/s;
+	! my $form = $self->form( match => { body => qr/"method_free"/ } );
+	! $form->select( method_free => 0 );
 
-	my %opts;
-	$opts{$1} = $2 while s/<input type="hidden" name="(.*?)" value="(.*?)">//;
-	$opts{method_free} = "Free Download";
+	CLICK( $form->post() );
 
-	GET( "", post => \%opts );
+	ERROR( "file not found" )
+		if /No such file with this filename/;
 
 	if ( /You have to wait (.*) till next download/ ) {
 		$_ = $1;
@@ -30,20 +29,15 @@
 		RESTART( $wait, "free limit reached" );
 	}
 
-	! m#Enter code below:[\S\s]*?<div.*?>(.*?)</div>#;
-	my %opts = ( code => captcha( $1 ) );
-
-	! s/^.*?<Form name="F1" method="POST" action=""//s;
-	! s/(.*?)<\/Form>.*$/$1/s;
+	! $-{form} = $self->form( name => "F1" );
 
-	$opts{$1} = $2 while s/<input type="hidden" name="(.*?)" value="(.*?)">//s;
-	$opts{btn_download} = "Download File";
-
-	$-{post} = \%opts;
+	! m#Enter code below:[\S\s]*?<div.*?>(.*?)</div>#;
+	$-{form}->set( code => captcha( $1 ) );
 
-	WAIT( 60, "starting download" );
+	! m#<span id="countdown">(\d+)</span>#;
+	WAIT( $1, "starting download" );
 	
-	DOWNLOAD( $-{_referer}, post => $-{post} );
+	CLICK_DOWNLOAD( $-{form}->post() );
 
 perl:
 	sub captcha


More information about the pld-cvs-commit mailing list