# $Id: Banzaj 11662 2010-07-13 01:31:48Z sparky $
# Video::Banzaj - Video getter plugin for rsget.pl
#
# 2009-2010 (c) Przemysław Iskra <sparky@pld-linux.org>
#		This program is free software,
# you may distribute it under GPL v2 or newer.

name: Banzaj
short: V:Banzaj
web: "http://www.video.banzaj.pl/"
uri: qr{video\.banzaj\.pl/film/\d+/\S+/}
slots: max
status: OK 2010-07-12

unify:
	s/#.*//;

start:
	GET( $-{_uri} );

	ERROR( "file not found" ) if
		m{: Nie znaleziono video} or m{^\s*404\s*$}s;

	! m{<title>(.*?)</title>};
	my $fname = de_ml( $1 );
	$fname =~ s{/}{_}g;
	$fname .= ".flv";
	INFO( name => $fname, quality => "flv" );

	! m{new SWFObject\("(.*?player\.swf)"};
	$-{_referer} = $1;

	! m{addVariable\("file","(.*?)"};

	DOWNLOAD( uri_unescape( $1 ), fname => $fname );

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