SVN: toys/rsget.pl/Premium/FileServe

sparky sparky at pld-linux.org
Fri Apr 22 02:52:22 CEST 2011


Author: sparky
Date: Fri Apr 22 02:52:21 2011
New Revision: 12232

Added:
   toys/rsget.pl/Premium/FileServe   (contents, props changed)
Log:
- NEW: premium fileserve getter


Added: toys/rsget.pl/Premium/FileServe
==============================================================================
--- (empty file)
+++ toys/rsget.pl/Premium/FileServe	Fri Apr 22 02:52:21 2011
@@ -0,0 +1,48 @@
+# $Id$
+# Premium::FileServe - File getter plugin for rsget.pl
+#
+# 2011 (c) Przemysław Iskra <sparky at pld-linux.org>
+#		This program is free software,
+# you may distribute it under GPL v2 or newer.
+
+name: FileServe
+short: *FSRV
+web: "http://fileserve.com/"
+tos: "http://fileserve.com/terms.php"
+uri: qr{fileserve\.com/file/[A-Za-z0-9]+(/.*)?}
+cookie: fsrv.p
+slots: max
+status: OK 2011-03-03
+
+pre:
+	my ($user, $pass);
+	if ( my $s = setting("premium_fileserve") ) {
+		($user, $pass) = ($s =~ /^(.+?):(.+)/) or die "Premium user:pass incorrect\n";
+	} else {
+		die "Premium user:pass not given\n";
+	}
+
+unify:
+	s/#.*//;
+	return "http://fileserve.com/file/$1"
+		if m{fileserve\.com/file/([A-Za-z0-9]+)};
+
+start:
+	GET( $-{_uri} );
+
+	ERROR( "file not found: $1" ) if m#<span class="fail_info">\s*(.*?)\s*</span>#s
+		or m{<img src="/images/stop_error\.gif".*?<h1>.*?</h1></li><li>(.*?)</li>}s;
+
+	! m#<h1>(.+?)<br/></h1>#;
+	my $fname = $1;
+	! m#<span.*?><strong>($STDSIZE)</strong> \| Uploaded on #o;
+	INFO( name => $fname, asize => $1 );
+
+	! ( $-{captcha_key} ) = m{var reCAPTCHA_publickey='(.*?)';};
+	! ( $-{captcha_encode} ) = m{"recaptcha_shortencode_field".*? value="(.*?)" />};
+
+	DOWNLOAD( "/login.php", post => { loginUserName => $user,
+			loginUserPassword => $pass, autoLogin => 'on',
+			loginFormSubmit => 'Login' } );
+
+# vim: filetype=perl:ts=4:sw=4


More information about the pld-cvs-commit mailing list