# $Id: .template 11952 2010-12-05 23:44:43Z sparky $
# Premium::[NAME] - Premium file getter plugin for rsget.pl
#
# 2010 (c) ??? <???@???.??>
#		This program is free software,
# you may distribute it under GPL v2 or newer.

name: [NAME]
short: *[NAME]
web: "http://gsite.com/"
uri: qr{gsite\.com/}
slots: max
status: OK [DATE]

pre:
	my ($user, $pass);

	if ( my $s = setting("premium_" . lc "[NAME]" ) ) {
		($user, $pass) = ($s =~ /^(.+?):(.+)/) or die "Premium user:pass incorrect\n";
	} else {
		die "Premium user:pass not given\n";
	}

unify:
	return $_;

start:
	GET( $-{_uri} );

	ERROR( "file not found: $1" )
		if /^ERROR: (File .*)/;

	CLICK( "http://login", post => { user => $user, password => $pass } );

	DOWNLOAD( "file" );

# vim: filetype=perl:ts=4:sw=4
