# $Id: LiveLeak 11660 2010-07-13 01:28:13Z sparky $
# Video::LiveLeak - 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: LiveLeak
short: V:LiveLeak
web: "http://liveleak.com/"
uri: qr{liveleak\.com/view\?i=}
slots: max
status: OK 2010-07-13

start:
	GET( $-{_uri} );

	ERROR( "file not found: $1" )
		if m#<h4><font color="FF0000">(.*?)<#;

	! m{<h4 id="s_hd">(.*?)</h4>};
	$-{fname} = de_ml( $1 );
	$-{fname} =~ s{/}{_}g;
	$-{fname} .= ".flv";

	INFO( name => $-{fname}, quality => "flv" );

	! m{'config','(.*?)'};
	GET( uri_unescape( $1 ), keep_referer => 1 );

	! m{<file>(.*?)</file>};
	GET( $1, keep_referer => 1 );

	! m{<location>(.*?)</location>};
	DOWNLOAD( $1, fname => $-{fname} );

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