# $Id: FreakShare 10867 2009-10-26 22:47:10Z sparky $
# Get::FreakShare - File getter plugin for rsget.pl
#
# 2009 (c) Przemysław Iskra <sparky@pld-linux.org>
#		This program is free software,
# you may distribute it under GPL v2 or newer.

name: FreakShare
short: FS
uri: qr{freakshare\.net/}
cookie: fs
status: OK 2009-10-22

start:
	GET( $-{_uri} );

	ERROR( "file not found" ) if /Sorry, this Download doesnt exist anymore/;

	! m#<h1 class="box_heading" style="text-align:center;">(.*)</h1>#;
	INFO( name => $1, size => -1 );

	! $-{form} = $self->form( match => { body => qr/"Free Download"/ } );

	! m#var time = (\d+)(?:\.\d+);\s*var intervall;#;
	WAIT( $1, "starting" );

	CLICK( $-{form}->post() );
	
	! $-{dlform} = $self->form( match => { onsubmit => qr/^disableButton/ } );

	! m#var time = (\d+)(?:\.\d+);\s*var intervall;#;
	WAIT( $1, "starting download" );

	CLICK_DOWNLOAD( $-{dlform}->post() );

	MULTI() if /Sorry, you cant  download more then 1 at time/;

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