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

pre:
	use MIME::Base64;

start:
	GET( $-{_uri} );

	my @list;
	push @list, $1
		while s/className='inner_link\d+';window\.open\('(.*?)'\)">//;

	ERROR("no links") unless @list;

	$-{list} = \@list;
	$-{outlist} = [];

stage_get_link:
	GET( shift @{$-{list}}, keep_referer => 1 );
	m{var versch = '(.*?)';};
	$_ = decode_base64( $1 );
	m{ src="(.*?)">};
	push @{$-{outlist}}, $1;

	GOTO stage_get_link if @{$-{list}};

	LINK( @{$-{outlist}} );

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