# $Id: ProtectLinks 10867 2009-10-26 22:47:10Z sparky $
# Link::ProtectLinks - Link decrypter 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: ProtectLinks
short: L:ProtectLinks
uri: qr{protectlinks\.com/}
slots: max
status: OK 2009-10-24

start:
	$_ = $-{_uri};
	
	ERROR( "unsupported uri" )
		unless m#^(.*?com/)(redirect\.php\?id=)?(\d+)#;
	
	$-{_referer} = $1 . $3;

	GET( $1 . "redirect.php?id=" . $3 );

	ERROR( "Can't find link" )
		unless m#<iframe name="pagetext".*? src="\s*(.*?)\s*">#;

	LINK( $1 );

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