CVE-2021-4312 (PHP, published 2023-01-13T18:15Z)
Description: value: ** UNSUPPORTED WHEN ASSIGNED ** A vulnerability classified as problematic has been found in Th3-822 Rapidleech. This affects the function zip_go of the file classes/options/zip.php. The manipulation of the argument archive leads to cross site scripting. It is possible to initiate the attack remotely. The patch is named 885a87ea4ee5e14fa95801eca255604fb2e138c6. It is recommended to apply a patch to fix this issue. The associated identifier of this vulnerability is VDB-218295. NOTE: This vulnerability only affects products that are no longer supported by the maintainer.
Severity: nan (CVSS v3 base score: 6.1)
Weakness: CWE-79 \u2014 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Repository: https://github.com/Th3-822/rapidleech
Files changed:
.htaccess
README.md
ajax.php
app.json
audl.php
auul.php
checker.php
classes/.htaccess
classes/ajax_refresh.js
classes/bar.php
classes/blowfish.php
classes/class.pcrypt.php
classes/cookie.php
classes/ftp.php
classes/http.php
classes/image.php
classes/index.html
classes/js.js
classes/linkchecker.php
classes/mail.php
classes/main.php
classes/options.php
classes/options/.htaccess
classes/options/boxes.php
classes/options/crc32.php
classes/options/delete.php
classes/options/ftp.php
classes/options/list.php
classes/options/mail.php
classes/options/md5.php
classes/options/md5change.php
classes/options/merge.php
classes/options/mrename.php
classes/options/pack.php
classes/options/rar.php
classes/options/rename.php
classes/options/sha1.php
classes/options/split.php
classes/options/unrar.php
classes/options/unzip.php
classes/options/upload.php
classes/options/zip.php
classes/other.php
classes/pclzip.php
classes/pear.php
classes/rar.php
classes/sinfo.php
classes/sorttable.js
classes/tar.php
classes/unzip.php
configs/.htaccess
configs/accounts.php
configs/default.php
configs/index.html
configs/setup.php
configs/site_checker.php
deny.php
files/.htaccess
hosts/.htaccess
hosts/DownloadClass.php
hosts/download/.htaccess
hosts/download/1fichier_com.php
hosts/download/2shared_com.php
hosts/download/4shared_com.php
hosts/download/4sync_com.php
hosts/download/GenericXFS_DL.php
hosts/download/adrive_com.php
hosts/download/alfafile_net.php
hosts/download/allmyvideos_net.php
hosts/download/anafile_com.php
hosts/download/aparat_com.php
hosts/download/axfiles_net.php
hosts/download/baidu_com.php
hosts/download/bestreams_net.php
hosts/download/bitshare_com.php
hosts/download/br2share_net.php
hosts/download/brupload_net.php
hosts/download/clicknupload_co.php
hosts/download/cloud_mail_ru.php
hosts/download/cloudtime_to.php
hosts/download/cloudy_ec.php
hosts/download/copiapop_com.php
hosts/download/crocko_com.php
hosts/download/d_h_st.php
hosts/download/dailymotion_com.php
hosts/download/dailyuploads_net.php
hosts/download/datafile_com.php
hosts/download/datafilehost_com.php
hosts/download/depfile_com.php
hosts/download/depositfiles_com.php
hosts/download/diskokosmiko_mx.php
hosts/download/dl_free_fr.php
hosts/download/dropapk_com.php
hosts/download/easybytez_com.php
hosts/download/ex_load_com.php
hosts/download/facebook_com.php
hosts/download/file_al.php
hosts/download/file_upload_com.php
hosts/download/fileband_com.php
hosts/download/fileboom_me.php
hosts/download/filecloud_io.php
hosts/download/filefactory_com.php
hosts/download/fileflyer_com.php
hosts/download/filejoker_net.php
hosts/download/filenext_com.php
hosts/download/fileover_net.php
hosts/download/filepost_com.php
hosts/download/filerio_in.php
hosts/download/filescdn_com.php
hosts/download/filesend_co.php
hosts/download/fileserving_com.php
hosts/download/filesflash_com.php
hosts/download/filesmonster_com.php
hosts/download/fshare_in.php
hosts/download/fshare_vn.php
hosts/download/furk_net.php
hosts/download/gigapeta_com.php
hosts/download/gigasize_com.php
hosts/download/google_com.php
hosts/download/hitfile_net.php
hosts/download/hosts.php
hosts/download/howfile_com.php
hosts/download/hulkload_com.php
hosts/download/index.html
hosts/download/indishare_me.php
hosts/download/junocloud_me.php
hosts/download/keep2share_cc.php
hosts/download/kingfiles_net.php
hosts/download/kumpulbagi_id.php
hosts/download/kutucugum_com.php
hosts/download/letitbit_net.php
hosts/download/littlebyte_net.php
hosts/download/longfiles_com.php
hosts/download/maknyos_indowebster_com.php
hosts/download/mediafire_com.php
hosts/download/mediafree_co.php
hosts/download/mega_co_nz.php
hosts/download/megashares_com.php
hosts/download/mexa_sh.php
hosts/download/mightyupload_com.php
hosts/download/minhateca_com_br.php
hosts/download/moyapidbirka_com_ua.php
hosts/download/my_pcloud_com.php
hosts/download/namasha_com.php
hosts/download/netload_in.php
hosts/download/nippyshare_com.php
hosts/download/nitroflare_com.php
hosts/download/novafile_com.php
hosts/download/novamov_com.php
hosts/download/nowvideo_sx.php
hosts/download/ok_ru.php
hosts/download/openload_co.php
hosts/download/ourupload_com.php
hosts/download/ozofiles_com.php
hosts/download/partagora_com.php
hosts/download/picofile_com.php
hosts/download/plunder_com.php
hosts/download/prefiles_com.php
hosts/download/rainy_la.php
hosts/download/rapidgator_net.php
hosts/download/rapidrar_com.php
hosts/download/rapidu_net.php
hosts/download/rioupload_com.php
hosts/download/rodfile_com.php
hosts/download/samsung_firmware_org.php
hosts/download/sendmyway_com.php
hosts/download/sendspace_com.php
hosts/download/share_online_biz.php
hosts/download/shareflare_net.php
hosts/download/sharemods_com.php
hosts/download/shrvid_com.php
hosts/download/solidfiles_com.php
hosts/download/sourceforge_net.php
hosts/download/speedyshare_com.php
hosts/download/stagevu_com.php
hosts/download/streamin_to.php
hosts/download/subyshare_com.php
hosts/download/supershare_pl.php
hosts/download/thevideo_me.php
hosts/download/thevideos_tv.php
hosts/download/trainbit_com.php
hosts/download/transferbigfiles_com.php
hosts/download/tune_pk.php
hosts/download/turbobit_net.php
hosts/download/tusfiles_net.php
hosts/download/txxx_com.php
hosts/download/ultramegabit_com.php
hosts/download/up_4ever_com.php
hosts/download/upfile_mobi.php
hosts/download/upload_mobi.php
hosts/download/upload_so.php
hosts/download/uploadbaz_com.php
hosts/download/uploadboy_com.php
hosts/download/uploaded_net.php
hosts/download/uploader_link.php
hosts/download/uploadkadeh_com.php
hosts/download/uploadrocket_net.php
hosts/download/uploads_to.php
hosts/download/uplod_ir.php
hosts/download/uplod_it.php
hosts/download/uppit_com.php
hosts/download/uptobox_com.php
hosts/download/uptostream_com.php
hosts/download/userscloud_com.php
hosts/download/usersfiles_com.php
hosts/download/vidbull_com.php
hosts/download/videohut_to.php
hosts/download/videomega_tv.php
hosts/download/videoraj_to.php
hosts/download/videoweed_es.php
hosts/download/vidgg_to.php
hosts/download/vidhos_com.php
hosts/download/vidzi_tv.php
hosts/download/vip-file_com.php
hosts/download/vshare_eu.php
hosts/download/xvideos_com.php
hosts/download/youtube_com.php
hosts/download/youwatch_org.php
hosts/download/ziddu_com.php
hosts/download/ziifile_com.php
hosts/download/zippyshare_com.php
hosts/index.html
hosts/upload/.htaccess
hosts/upload/115.com.index.php
hosts/upload/115.com.php
hosts/upload/1fichier.com.index.php
hosts/upload/1fichier.com.php
hosts/upload/2shared.com.index.php
hosts/upload/2shared.com.php
hosts/upload/4share.vn_member.index.php
hosts/upload/4share.vn_member.php
hosts/upload/4shared.com_member.index.php
hosts/upload/4shared.com_member.php
hosts/upload/GenericXFSHost.inc.php
hosts/upload/adrive.com.index.php
hosts/upload/adrive.com.php
hosts/upload/alfafile.net_member.index.php
hosts/upload/alfafile.net_member.php
hosts/upload/amonshare.com.index.php
hosts/upload/amonshare.com.php
hosts/upload/anafile.com.index.php
hosts/upload/anafile.com.php
hosts/upload/archive.org_member.index.php
hosts/upload/archive.org_member.php
hosts/upload/backup.bz.index.php
hosts/upload/backup.bz.php
hosts/upload/bigfile.to.index.php
hosts/upload/bigfile.to.php
hosts/upload/biggerupload.com.index.php
hosts/upload/biggerupload.com.php
hosts/upload/bitshare.com_member.index.php
hosts/upload/bitshare.com_member.php
hosts/upload/br2share.net.index.php
hosts/upload/br2share.net.php
hosts/upload/brupload.net.index.php
hosts/upload/brupload.net.php
hosts/upload/crocko.com_member.index.php
hosts/upload/crocko.com_member.php
hosts/upload/dailymotion.com.index.php
hosts/upload/dailymotion.com.php
hosts/upload/datafilehost.com.index.php
hosts/upload/datafilehost.com.php
hosts/upload/datei.to.index.php
hosts/upload/datei.to.php
hosts/upload/depositfiles.com_member.index.php
hosts/upload/depositfiles.com_member.php
hosts/upload/dl.free.fr.index.php
hosts/upload/dl.free.fr.php
hosts/upload/downace.com.index.php
hosts/upload/downace.com.php
hosts/upload/ex-load.com.index.php
hosts/upload/ex-load.com.php
hosts/upload/ex.ua.index.php
hosts/upload/ex.ua.php
hosts/upload/file.karelia.ru_member.index.php
hosts/upload/file.karelia.ru_member.php
hosts/upload/filecad.com.index.php
hosts/upload/filecad.com.php
hosts/upload/filecloud.io_member.index.php
hosts/upload/filecloud.io_member.php
hosts/upload/filedropper.com.index.php
hosts/upload/filedropper.com.php
hosts/upload/filefactory.com_member.index.php
hosts/upload/filefactory.com_member.php
hosts/upload/fileflyer.com.index.php
hosts/upload/fileflyer.com.php
hosts/upload/filefront.com.index.php
hosts/upload/filefront.com.php
hosts/upload/filehosting.org.index.php
hosts/upload/filehosting.org.php
hosts/upload/filejoker.net_member.index.php
hosts/upload/filejoker.net_member.php
hosts/upload/filepost.com_member.index.php
hosts/upload/filepost.com_member.php
hosts/upload/filerio.in.index.php
hosts/upload/filerio.in.php
hosts/upload/filescdn.com.index.php
hosts/upload/filescdn.com.php
hosts/upload/filesin.com_member.index.php
hosts/upload/filesin.com_member.php
hosts/upload/filesin.com_premium.index.php
hosts/upload/filesin.com_premium.php
hosts/upload/fshare.vn_member.index.php
hosts/upload/fshare.vn_member.php
hosts/upload/ge.tt.index.php
hosts/upload/ge.tt.php
hosts/upload/gettyfile.ru.index.php
hosts/upload/gettyfile.ru.php
hosts/upload/gigasize.com_premium.index.php
hosts/upload/gigasize.com_premium.php
hosts/upload/hitfile.net.index.php
hosts/upload/hitfile.net.php
hosts/upload/index.html
hosts/upload/katfile.com.index.php
hosts/upload/katfile.com.php
hosts/upload/keep2share.cc_member.index.php
hosts/upload/keep2share.cc_member.php
hosts/upload/letitbit.net_member.index.php
hosts/upload/letitbit.net_member.php
hosts/upload/load.to.index.php
hosts/upload/load.to.php
hosts/upload/maknyos.indowebster.com.index.php
hosts/upload/maknyos.indowebster.com.php
hosts/upload/mediafire.com_member.index.php
hosts/upload/mediafire.com_member.php
hosts/upload/mediafree.co.index.php
hosts/upload/mediafree.co.php
hosts/upload/mega.co.nz_member.index.php
hosts/upload/mega.co.nz_member.php
hosts/upload/megashare.vnn.vn.index.php
hosts/upload/megashare.vnn.vn.php
hosts/upload/megashares.com_member.index.php
hosts/upload/megashares.com_member.php
hosts/upload/minhateca.com.br.index.php
hosts/upload/minhateca.com.br.php
hosts/upload/minhateca.com.br_box.index.php
hosts/upload/minhateca.com.br_box.php
hosts/upload/mirrorcreator.com.index.php
hosts/upload/mirrorcreator.com.php
hosts/upload/multiup.org.index.php
hosts/upload/multiup.org.php
hosts/upload/netload.in.index.php
hosts/upload/netload.in.php
hosts/upload/netload.in_premium.index.php
hosts/upload/netload.in_premium.php
hosts/upload/nippyshare.com.index.php
hosts/upload/nippyshare.com.php
hosts/upload/novafile.com_member.index.php
hosts/upload/novafile.com_member.php
hosts/upload/novamov.com.index.php
hosts/upload/novamov.com.php
hosts/upload/openload.co.index.php
hosts/upload/openload.co.php
hosts/upload/ourupload.com.index.php
hosts/upload/ourupload.com.php
hosts/upload/rapidgator.net_member.index.php
hosts/upload/rapidgator.net_member.php
hosts/upload/rapidshare.ru.index.php
hosts/upload/rapidshare.ru.php
hosts/upload/rghost.ru.index.php
hosts/upload/rghost.ru.php
hosts/upload/rioupload.com.index.php
hosts/upload/rioupload.com.php
hosts/upload/rodfile.com.index.php
hosts/upload/rodfile.com.php
hosts/upload/sendmyway.com.index.php
hosts/upload/sendmyway.com.php
hosts/upload/sendspace.com.index.php
hosts/upload/sendspace.com.php
hosts/upload/share-online.biz_member.index.php
hosts/upload/share-online.biz_member.php
hosts/upload/share.megaplus.vn_member.index.php
hosts/upload/share.megaplus.vn_member.php
hosts/upload/shared.com_member.index.php
hosts/upload/shared.com_member.php
hosts/upload/shareflare.net.index.php
hosts/upload/shareflare.net.php
hosts/upload/solidfiles.com.index.php
hosts/upload/solidfiles.com.php
hosts/upload/turbobit.net.index.php
hosts/upload/turbobit.net.php
hosts/upload/tusfiles.net.index.php
hosts/upload/tusfiles.net.php
hosts/upload/tusfiles.net_member.index.php
hosts/upload/tusfiles.net_member.php
hosts/upload/u.115.com.index.php
hosts/upload/u.115.com.php
hosts/upload/uafile.com.index.php
hosts/upload/uafile.com.php
hosts/upload/up-4ever.com.index.php
hosts/upload/up-4ever.com.php
hosts/upload/upfile.mobi.index.php
hosts/upload/upfile.mobi.php
hosts/upload/upload.com.ua.index.php
hosts/upload/upload.com.ua.php
hosts/upload/uploaded.net_member.index.php
hosts/upload/uploaded.net_member.php
hosts/upload/uploading.com_member.index.php
hosts/upload/uploading.com_member.php
hosts/upload/uploadjockey.com.index.php
hosts/upload/uploadjockey.com.php
hosts/upload/uploadkadeh.com_member.index.php
hosts/upload/uploadkadeh.com_member.php
hosts/upload/uploadocean.com.index.php
hosts/upload/uploadocean.com.php
hosts/upload/uploadrocket.net.index.php
hosts/upload/uploadrocket.net.php
hosts/upload/uploadstube.de.index.php
hosts/upload/uploadstube.de.php
hosts/upload/uplod.it.index.php
hosts/upload/uplod.it.php
hosts/upload/uptobox.com.index.php
hosts/upload/uptobox.com.php
hosts/upload/uptotal.com.index.php
hosts/upload/uptotal.com.php
hosts/upload/uptotal.com_member.index.php
hosts/upload/uptotal.com_member.php
hosts/upload/upvast.com.index.php
hosts/upload/upvast.com.php
hosts/upload/userscloud.com.index.php
hosts/upload/userscloud.com.php
hosts/upload/usersfiles.com.index.php
hosts/upload/usersfiles.com.php
hosts/upload/vid.me.index.php
hosts/upload/vid.me.php
hosts/upload/videobb.com.index.php
hosts/upload/videobb.com.php
hosts/upload/vk.com.index.php
hosts/upload/vk.com.php
hosts/upload/wat.tv_member.index.php
hosts/upload/wat.tv_member.php
hosts/upload/wikifortio.com.php
hosts/upload/wikifortio.index.php
hosts/upload/wikiupload.com.index.php
hosts/upload/wikiupload.com.php
hosts/upload/wrzuta.pl.index.php
hosts/upload/wrzuta.pl.php
hosts/upload/ziddu.com.index.php
hosts/upload/ziddu.com.php
hosts/upload/zippyshare.com.index.php
hosts/upload/zippyshare.com.php
index.php
languages/.htaccess
languages/ar.php
languages/de.php
languages/en.php
languages/es.php
languages/fa.php
languages/fr.php
languages/it.php
languages/pt-br.php
languages/th.php
languages/tr.php
languages/zn.php
notes.php
rar/.htaccess
rev.History.txt
rl_init.php
templates/.htaccess
templates/neatblue/.htaccess
templates/neatblue/footer.php
templates/neatblue/functions.php
templates/neatblue/header.php
templates/neatblue/images/.htaccess
templates/neatblue/main.php
templates/neatblue/sinfo.php
templates/neatblue/styles/.htaccess
templates/neatblue/styles/rl_style_pm.css
templates/neatblue/transloadui.php
templates/neatblue/uploadui.php
templates/plugmod/.htaccess
templates/plugmod/footer.php
templates/plugmod/functions.php
templates/plugmod/header.php
templates/plugmod/images/.htaccess
templates/plugmod/main.php
templates/plugmod/sinfo.php
templates/plugmod/styles/.htaccess
templates/plugmod/styles/rl_style_pm.css
templates/plugmod/transloadui.php
templates/plugmod/uploadui.php
upload.php
Commit message: Fixed XSS on classes/options/zip.php


Vulnerable code:

Fixed code:
order deny,allow

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files index.php>
allow from all
</files>

#Uncomment the 3 lines below, ONLY when you want to run the checker.php!
#<files checker.php>
#allow from all
#</files>

<files ~ "^deny.php">
allow from all
</files>

<files notes.php>
allow from all
</files>

<files audl.php>
allow from all
</files>

<files upload.php>
allow from all
</files>

<files auul.php>
allow from all
</files>

<files ajax.php>
allow from all
</files>

<files ~ "^\.">
deny from all
</files>

#CGI Auth Fix
<IfModule mod_rewrite.c>
	Options +SymLinksIfOwnerMatch
	RewriteEngine on
	RewriteCond %{HTTP:Authorization} !^$
	RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
# Rapidleech

[![GitHub last commit](https://img.shields.io/github/last-commit/Th3-822/rapidleech?label=last%20update)](https://github.com/Th3-822/rapidleech/commits/master)
[![Support Forum](https://img.shields.io/badge/Support%20Forum-Click%20Here-blue)](https://rapidleech.com/forum/)

Rapid Leech is a free server transfer script for use on various popular upload/download sites such as uploaded.net, Rapidgator.net and more than 127 others. The famous Rapidleech script transfers files from Other Filehosting Servers To Your Server via your fast servers connection speed and dumps the file on your server. You may then download these files from your server anytime later.

Rapidleech script has being used by more than 5 million users worldwide and has being installed on more than 2000 servers.
For webmasters, if you have not tried the script before, download and install now and you will see how convenient the script can be. You may also generate income by offering your Rapidleech sites to end-users and earn income from advertising programs. Some webmasters are earning hundreds per day on the advertising program(Google and yahoo Ads) from their Rapidleech sites. Script installation is extremely easy and does not require any database.

For end-users, you may search on our forum for readily available installed scripts on servers worldwide. You may use them but please support these sites by visiting their sponsors or donate in order to keep these sites available.
<?php
error_reporting(0);
set_time_limit(0);
define('RAPIDLEECH', 'yes');
define('CLASS_DIR', 'classes/');
define('CONFIG_DIR', 'configs/');
require_once(CONFIG_DIR."config.php");
require_once(CLASS_DIR . 'other.php');
define ( 'TEMPLATE_DIR', 'templates/'.$options['template_used'].'/' );
$nn = "\r\n";
// For ajax calls, lets make it use less resource as possible
switch ($_GET['ajax']) {
	case 'server_stats':
		if ($options['server_info'] && $options['ajax_refresh']) {
			ob_start();
			require(CLASS_DIR.'sinfo.php');
			ob_end_clean();
			$AjaxReturn = array();
			$AjaxReturn['FreeSpace'] = ZahlenFormatieren($frei);
			$AjaxReturn['InUse'] = ZahlenFormatieren($belegt);
			$AjaxReturn['InUsePercent'] = round($prozent_belegt, '2');
			$AjaxReturn['DiskPercent'] = round($prozent_belegt, '2');
			$AjaxReturn['DiskSpace'] = ZahlenFormatieren($insgesamt);
			$AjaxReturn['CPULoad'] = round($cpulast, '0');
			$AjaxReturn['CPUPercent'] = round($cpulast, '2');
			echo array_to_json($AjaxReturn);
		}
		break;
	case 'linkcheck':
		require_once(CLASS_DIR.'linkchecker.php');
		$glinks = array();
		if(!empty($_POST['debug'])) {
			if($debug == 1)
			debug();
			else
			echo lang(16);
		}
		if (isset($_POST['submit'])) {
			$alllinks = $_POST['links'];
			$alllinks = explode(' ', $alllinks);
			$alllinks = implode("\n", $alllinks);
			$alllinks = explode("\n", $alllinks);

			$x = $x2 = 1;
			$l = ($_POST['k']) ? false : true;
			$d = ($_POST['d']) ? false : true;
			$dk = (!$l && !$d) ? true : false;

			$alllinks = array_unique($alllinks); //removes duplicates
			echo "<div id='listlinks'>\n";
			foreach($alllinks as $link) {
				if (empty($link)) continue;
				$x2++;
				$link = trim($link);
				$Checked = $skip = $Kl = false;

				if (preg_match("/^(http)\:\/\/(www\.)?anonym\.to\/\?/i", $link)) {
					$link = explode('?', $link);
					unset($link[0]);
					$link = implode($link, '?');
					$Kl = 'anonym.to';
				}

				if (preg_match('@^http://(www\.)?((adf\.ly)|([jq]\.gs)|([9u]\.bb))/((\d+/.+)|([^/|\r|\n]+))@i', $link, $m)) {
					$page = curl($m[0]);
					if (!preg_match("@window\.location = '(((https?:)|(/go/))[^']+)'@i", $page, $match)) 
						if (!preg_match("@self\.location = '(((https?:)|(/go/))[^']+)'@i", $page, $match)) 
							preg_match("@var url = '(((https?:)|(/go/))[^']+)'@i", $page, $match);
					if (!empty($match[1]) && $match[1] != $link) {
						if (preg_match('@^(?:https?://([^/]+\.)?((adf\.ly)|([jq]\.gs)|([9u]\.bb)))?/go/\w+/([^/|\?]+)@i', $match[1], $b64redir)) $match[1] = base64_decode(urldecode($b64redir[count($b64redir)-1]));
						$link = $match[1];
						$Kl = 'adf.ly';
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('@^http://(www\.)?zpag\.es/((\d+/.+)|([^/|\r|\n]+))@i', $link, $m)) {
					$page = curl($m[0]);
					preg_match('/window\.location = "(https?:[^"]+)"/i', $page, $match);
					if (!empty($match[1]) && $match[1] != $link) {
						$link = $match[1];
						$Kl = 'zpag.es';
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('@^http://(?:www\.)?adfoc\.us/(?:serve/\?id=)?(\d+)@i', $link, $m)) {
					$page = curl('http://adfoc.us/serve/click/?id='.$m[1].'&servehash=1&timestamp='.time(), 0, 0);
					if (!preg_match('@Location: (https?://[^\r|\n]+)@i', $page, $match)) {
						$page = curl($m[0], 0, 0);
						$page = str_ireplace('http://adfoc.us/serve/click/', '', $page);
						preg_match('@var click_url = "(https?://[^\"\s\t<>]+)"@i', $page, $match);
					}
					if (!empty($match[1]) && $match[1] != $link) {
						$link = $match[1];
						$Kl = 'adfoc.us';
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('@^http://(www\.)?bc\.vc/(\w+)@i', $link, $m)) {
					$page = curl($m[0]);
					if (!preg_match('@Location: (https?://[^\r\n]+)@i', $page, $match) && preg_match('@aid:(\d+)\s?,\s?lid:(\d+)\s?,\s?oid:(\d+)@i', $page, $args)) {
						$post = array('opt'=>'check_log','args%5Baid%5D'=>$args[1],'args%5Blid%5D'=>$args[2],'&args%5Boid%5D'=>$args[3], 'args%5Bref%5D'=>'');
						$L = 'http://bc.vc/fly/ajax.fly.php';
						$page = curl($L, $post);
						$cookie = GetCookiesArr($page);
						$page = curl($L, $post, $cookie);
						if (stripos($page, '"message":false') !== false) {
							$page = curl($L, $post, $cookie);
							$cookie = GetCookiesArr($page, $cookie);
						}
						$post['opt'] = 'make_log';
						sleep(6); // (rand(5,7));
						$page = curl($L, $post, $cookie);
						preg_match('@"url":"(https?:[^\r\n\"\}\{]+)"@i', $page, $match);
						if (!empty($match[1])) $match[1] = stripslashes($match[1]);
						unset($L);
					}
					if (!empty($match[1]) && $match[1] != $link) {
						$link = $match[1];
						$Kl = 'bv.vc';
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('/^http:\/\/(www\.)?lnk\.co\/\w+/i', $link, $m)) {
					$page = curl($m[0],0,0,0);
					if (!preg_match('/id=\'linkurl\' href="(https?:[^"]+)"/i', $page, $match)) 
						if (!preg_match("/id='urlholder' value='(https?:[^']+)'/i", $page, $match)) 
							preg_match('@Location: (https?://[^\r|\n]+)@i', $page, $match);
					if (!empty($match[1]) && $match[1] != $link) {
						$link = $match[1];
						$Kl = 'lnk.co';
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('@^http://(\w+\.)?linkbucks\.com/?(link/[^/\r\n]+)?@i' , $link, $m)) {
					$page = curl($m[0],0,0,0);
					sleep(2); // linkbucks now show a flood warning, waiting 2 seconds.
					if (!preg_match("/(?:(?:Linkbucks)|(?:Lbjs)).TargetUrl = '(https?:[^']+)'/i" , $page , $match)) 
						if (!preg_match('/<iframe id="content" src="(https?:[^"]+)"/i' , $page , $match)) 
							preg_match("/Location: (https?:.+)/i", $page, $match);
					if (!empty($match[1]) && $match[1] != $link) {
						$link = $match[1];
						$Kl = 'linkbucks.com';
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('@^http://((\d+\.)|(\w+\.))?((rsmonkey\.com)|((\w+\.)?canhaz\.it))(/\d+)?@i', $link, $m)) {
					$page = curl($m[0]);
					preg_match("/top\.location\.replace\('(https?:[^']+)'\)/i", $page, $match);
					if (!empty($match[1]) && $match[1] != $link) {
						$link = $match[1];
						$Kl = 'rsmonkey.com';
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('@^http://(?:www\.)?((?:linksafe\.me)|(?:safelinking\.net))/d/([^/\W]+(?:/[^/\r\n]+)?)/?@i', $link, $m)) {
					$page = curl($m[0],0,0,0);
					if (!preg_match('/Location: (https?:.+)/i', $page, $match)) 
						preg_match('/window\.location="(https?:[^"]+)"/i', $page, $match);
					if (!empty($match[1]) && $match[1] != $m[0]) {
						$link = $match[1];
						$Kl = $m[1];
					} else {
						$link = $m[0].' - ERROR.';
						$skip = true;
					}
				}

				if (!$skip && preg_match('@^http://(?:www\.)?multiupload\.nl/(\w{2}_)?\w+@i', $link, $m)) {
					$page = curl($m[0],0,0,0);
					if (stristr($page, "the link you have clicked is not available")) {
						$link = $m[0].' - Not found.';
						$skip = true;
					}
					if (empty($m[1]) && !$skip) {
						if (preg_match_all('@(http://(?:www\.)?multiupload\.nl/(?:\w{2}_\w+))</a@i', $page, $match)) {
							foreach ($match[1] as $link) showlink($link, 0, 3, "Removed folder: multiupload.nl");
							$Checked = true;
							CountandCheck($x);
						}
						else $link = $m[0].' - ERROR.';
					} elseif (!$skip) {
						preg_match('/Location: (https?:.+)/i', $page, $match);
						if (!empty($match[1]) && $match[1] != $m[0]) {
							$link = $match[1];
							$Kl = 'multiupload.nl';
						} else $link = $m[0].' - ERROR.';
					}
				}

				// Some hosts needs other way to check file and get the filesize
				if ($l && !$skip && preg_match('@^https?://(?:[^/]+\.)?mediafire\.com/(?:(?:imageview\.php)|(?:view/))?\?(?:quickkey=)?(\w+)@i', $link, $m)) {
					$page = curl('http://www.mediafire.com/api/file/get_info.php?quick_key='.$m[1],0,0,0,0,0);
					$link = 'http://www.mediafire.com/?'.$m[1];
					$size = '';
					if (stripos($page, '<result>Success</result>') !== false && preg_match('@<size>(\d+)</size>@i', $page, $sz) && $sz[1] > 0) {
						$chk = 1;
						$size = explode(' ', bytesToKbOrMbOrGb($sz[1]));
						$size[0] = round($size[0], 2);
						$size = implode(' ', $size);
					} elseif (stripos($page, '<message>Access denied</message>') !== false) $chk = 2;
					else {
						$chk = 0;
						$page = curl('http://www.mediafire.com/api/folder/get_content.php?folder_key='.$m[1].'&content_type=files',0,0,0,0,0);
						if (stripos($page, '<result>Success</result>') !== false && preg_match_all('@<quickkey>([^<]+)</quickkey>@i', $page, $qids)) {
							foreach ($qids[1] as $qid) showlink("http://www.mediafire.com/?$qid", 0, 3, 'Removed folder: mediafire.com');
							$skip = true;
						} elseif (stripos($page, '<message>Access denied</message>') !== false) $chk = 2;
					}

					if (!$skip) {
						showlink($link, $size, $chk);
						if ($chk == 1) $glinks[$link] = $size;
					}
					$Checked = $skip = true;
					CountandCheck($x);
				}

				if ($l && !$skip && preg_match('@^https?://(?:[^/]+\.)?rapidshare\.com/(?:(?:files/(\d+)/([^/#\r\n]+))|(?:\??#!download\|[^\|]+\|(\d+)\|([^\|\r\n]+)))@i', $link, $m)) { // O.O
					if (!empty($m[1])) {
						$m['id'] = $m[1];
						$m['filename'] = $m[2];
					} else {
						$m['id'] = $m[3];
						$m['filename'] = $m[4];
					}
					$page = curl('http://api.rapidshare.com/cgi-bin/rsapi.cgi', "sub=checkfiles&files={$m['id']}&filenames=".$m['filename'],0,0,0,0);
					$page = explode(',', $page);
					if ($page[2] > 0) {
						if ($page[4] == 1) $chk = 1;
						elseif ($page[4] == 3) $chk = 2;
						else $chk = 0;
					} else $chk = 0;

					$link = "http://rapidshare.com/files/{$page[0]}/".$page[1];
					if ($chk == 1) {
						$size = explode(' ', bytesToKbOrMbOrGb($page[2]));
						$size[0] = round($size[0], 2);
						$size = implode(' ', $size);
						$glinks[$link] = $size;
					} else $size = 0;
					showlink($link, $size, $chk);
					$Checked = $skip = true;
					CountandCheck($x);
				}

				if ($l && !$skip && preg_match('@^https?://(?:[^/]+\.)?share-online\.biz/(?:(?:download\.php\?id=)|(?:dl/))(\w+)@i', $link, $m)) {
					$page = curl('http://api.share-online.biz/linkcheck.php?links='.$m[1],0,0,0,0,0);
					$page = explode(';', $page);
					$page = array_map('trim', $page);

					$link = 'http://www.share-online.biz/dl/'.$m[1];
					$size = '';
					switch ($page[1]) {
						case 'OK' : $chk = 1; break;
						case 'DELETED' : case 'NOT FOUND' : $chk = 0; break;
						default : $chk = 4; break;
					}

					if ($chk == 1) {
						$size = explode(' ', bytesToKbOrMbOrGb($page[3]));
						$size[0] = round($size[0], 2);
						$size = implode(' ', $size);
						$glinks[$link] = $size;
					}
					showlink($link, $size, $chk);
					$Checked = $skip = true;
					CountandCheck($x);
				}

				if ($l && !$skip) {
					foreach($sites as $site) {
						if (!empty($site['link']) && preg_match('@'.$site['link'].'@i', $link)) {
							$szregex = $pattern = $replace = '';
							$opt = array();
							if (($d || $dk) && !empty($site['szregex'])) $szregex = $site['szregex'];
							if (isset($site['pattern'])) $pattern = $site['pattern'];
							if (isset($site['replace'])) $replace = $site['replace'];
							if (array_key_exists('options', $site) && is_array($site['options'])) $opt = $site['options'];
							list($chk, $size) = check($link, $x, $site['regex'], $szregex, $pattern, $replace, $opt);
							if ($chk == 1) $glinks[$link] = $size;
							flush();//ob_flush();
							$Checked = true;
							CountandCheck($x);
						}
					}
				}

				if (($d || $dk) && !$Checked && $Kl != false) {
					showlink($link, 0, 3, "Removed: $Kl");
					CountandCheck($x);
					flush();
				} elseif($d && !$Checked) {
					showlink($link, 0, 4, 'Unknown Link');
					//CountandCheck($x); //Count?
					flush();
				}
			}
			echo "</div>\n";
			$time = explode(' ', microtime());
			$time = $time[1] + $time[0];
			$endtime = $time;
			$totaltime = ($endtime - $begintime);
			$x--;$x2--;
			$plural = ($x == 1) ? '' : lang(19);
			($options['fgc'] == 0) ? $method = 'cURL' : $method = 'file_get_contents';
			echo '<p style="text-align:center">';
			printf(lang(18),$x,$plural,$totaltime,$method);
			echo "</p>\n";
			if (count($glinks) > 1 && @is_file('audl.php')) {
				$links = '';
				$fsize = 0;
				$afhs = true; // 
				foreach ($glinks as $lnk => $sz) {
					$links .= "$lnk\n";
					if (!empty($sz) && $sz > 0) {
						$sz = explode(' ', strtoupper($sz));
						switch ($sz[1]) { // KbOrMbOrGbToBytes :D
							case 'GB': $sz[0] *= 1024;
							case 'MB': $sz[0] *= 1024;
							case 'KB': $sz[0] *= 1024;
						}
						$fsize += $sz[0];
					} else $afhs = false;
				}
				$fsize = explode(' ', bytesToKbOrMbOrGb($fsize));
				$fsize[0] = round($fsize[0], 2);
				$fsize = implode(' ', $fsize);
				$fsize = (!$afhs ? '&gt;' : '').$fsize;
				echo "<div style='text-align:center;'>\n";
				echo "<br /><form action='".((($pos = strrpos($_SERVER['SCRIPT_NAME'], '/')) !== false) ? substr($_SERVER['SCRIPT_NAME'], 0, $pos + 1).'audl.php?GO=GO' : 'audl.php?GO=GO')."' method='POST' >\n";
				echo "<input type='hidden' name='links' value='" . $links . "'>\n";
				//$key_array = array("useproxy", "proxy", "proxyuser", "proxypass", "premium_acc", "premium_user", "premium_pass", "cookieuse", "cookie");
				//foreach ($key_array as $v) if (array_key_exists($v, $_GET)) echo "<input type='hidden' name='".$v."' value='".$_GET[$v]."' />\n";
				if ($x == $x2) $btext = "Send links to AUDL ($fsize)";
				else $btext = "Send working links to AUDL ($fsize)";
				echo "<input type='submit' value='$btext' />\n";
				echo "</form>\n";
				echo "</div>\n";
			}
			flush();
		}
		break;
}

function CountandCheck(&$x) {
	global $maxlinks;
	$x++;
	if($x > $maxlinks) {
		echo '<p style="text-align:center; color: red; background-color: #fec; padding: 3px; border: 2px solid $FFAA00; line-height: 25px">';
		printf(lang(17), $maxlinks);
		echo("</p></div>\n");
		include(TEMPLATE_DIR.'/footer.php');
		exit();
	}
}

function array_to_json($array){

	if (!is_array($array)) return false;

	$associative = count(array_diff(array_keys($array), array_keys(array_keys($array))));
	if ($associative) {
		$construct = array();
		foreach ($array as $key => $value){

			// We first copy each key/value pair into a staging array,
			// formatting each key and value properly as we go.

			// Format the key:
			if (is_numeric($key)) $key = "key_$key";
			$key = "'".addslashes($key)."'";

			// Format the value:
			if (is_array($value)) $value = array_to_json($value);
			elseif(!is_numeric($valu ) || is_string($value)) $value = "'".addslashes($value)."'";

			// Add to staging array:
			$construct[] = "$key: $value";
		}

		// Then we collapse the staging array into the JSON form:
		$result = "{ " . implode(", ", $construct) . " }";

	} else { // If the array is a vector (not associative):

		$construct = array();
		foreach ($array as $value){

			// Format the value:
			if (is_array($value)) $value = array_to_json($value);
			elseif (!is_numeric($value) || is_string($value)) $value = "'".addslashes($value)."'";

			// Add to staging array:
			$construct[] = $value;
		}

		// Then we collapse the staging array into the JSON form:
		$result = "[ " . implode(", ", $construct) . " ]";
	}

	return $result;
}

?>
{
  "name": "Rapidleech",
  "repository": "https://github.com/Th3-822/rapidleech"
}
<?php

require_once('rl_init.php');
if ($options['auto_download_disable']) {
	require_once('deny.php');
	exit();
}
error_reporting(0);
ignore_user_abort(true);

login_check();

require(TEMPLATE_DIR . '/header.php');
?>
<br />
<center>
<?php
if (isset($_REQUEST['GO']) && $_REQUEST['GO'] == 'GO') {
	$_REQUEST['links'] = (isset($_REQUEST['links'])) ? trim($_REQUEST['links']) : '';
	if (empty($_REQUEST['links'])) html_error('No link submited');
	$getlinks = array_values(array_unique(array_filter(array_map('trim', explode("\r\n", $_REQUEST['links'])))));
	if (count($getlinks) < 1) html_error('No links submited');
	if (isset($_REQUEST['server_side']) && $_REQUEST['server_side'] == 'on') {
		// Get supported download plugins
		require_once(HOST_DIR . 'download/hosts.php');
		require_once(CLASS_DIR . 'ftp.php');
		require_once(CLASS_DIR . 'http.php');
?>
<table class="container" cellspacing="1">
	<tr>
		<td width="80%" align="center"><b><?php echo lang(21); ?></b></td>
		<td width="70" align="center"><b><?php echo lang(22); ?></b></td>
	</tr>
<?php
		for ($i = 0; $i < count($getlinks); $i++) echo "\t<tr><td width='80%' nowrap='nowrap'>".htmlentities($getlinks[$i])."</td><td width='70' id='status$i'>".lang(23)."</td></tr>$nn";
?>
</table>
<script type="text/javascript">
/* <![CDATA[ */
function updateStatus(id, status) {
	document.getElementById('status'+id).innerHTML = status;
}
function resetProgress() {
	document.getElementById('received').innerHTML = '0 KB';
	document.getElementById('percent').innerHTML = '0%';
	document.getElementById('progress').style.width = '0%';
	document.getElementById('speed').innerHTML = '0 KB/s';
	document.title = 'RAPIDLEECH PLUGMOD - Auto Download';
}
/* ]]> */
</script>
<br /><br />
<?php
		for ($i = 0; $i < count($getlinks); $i++) {
			$isHost = false;
			unset($FileName);
			unset($force_name);
			//$bytesReceived = 0; // fix for GLOBAL in geturl()
			unset($bytesReceived);

			$LINK = $getlinks[$i];
			$Url = parse_url($LINK);
			$Url['scheme'] = strtolower($Url['scheme']);
			$Url['path'] = (empty($Url['path'])) ? '/' :str_replace('%2F', '/', rawurlencode(rawurldecode($Url['path'])));

			$Referer = $Url;
			unset($Referer['user'], $Referer['pass']); // Remove login from Referer
			$Referer = rebuild_url($Referer);

			$_GET = array('GO' => 'GO'); // for insert_location()

			if (isset($_POST['useproxy']) && (empty($_POST['proxy']) || strpos($_POST['proxy'], ':') === false)) html_error(lang(20));
			if (isset($_POST['useproxy']) && $_POST['useproxy'] == 'on') {
				$_GET['useproxy'] = 'on';
				$_GET['proxy'] = $_POST['proxy'];
				$_GET['pauth'] = (!empty($_GET['proxyuser']) && !empty($_GET['proxypass'])) ? base64_encode($_GET['proxyuser'] . ':' . $_GET['proxypass']) : '';
			}

			if (isset($_POST['premium_acc'])) {
				$_GET['premium_acc'] = 'on';
				$_GET['premium_user'] = $_REQUEST['premium_user'] = (empty($_POST['premium_user'])) ? '' : $_POST['premium_user'];
				$_GET['premium_pass'] = $_REQUEST['premium_pass'] = (empty($_POST['premium_pass'])) ? '' : $_POST['premium_pass'];
			}

			if (!empty($Url['user']) && !empty($Url['pass'])) {
				$_GET['premium_acc'] = 'on';
				$_GET['premium_user'] = $_REQUEST['premium_user'] = $Url['user'];
				$_GET['premium_pass'] = $_REQUEST['premium_pass'] = $Url['pass'];
				$auth = urlencode(encrypt(base64_encode(rawurlencode($Url['user']) . ':' . rawurlencode($Url['pass']))));
				unset($Url['user'], $Url['pass']);
			} elseif (empty($Url['user']) xor empty($Url['pass'])) unset($Url['user'], $Url['pass']);

			$LINK = rebuild_url($Url);

			if (!in_array($Url['scheme'], array('http', 'https', 'ftp'))) echo "<script type='text/javascript'>updateStatus($i, '".lang(24)."');</script>$nn";
			else {
				require_once(TEMPLATE_DIR . '/transloadui.php');
				echo "<div id='progress$i' style='display:block;'>$nn";
				$isHost = false;
				$redir = $lastError = '';
				$GLOBALS['throwRLErrors'] = true;
				foreach ($host as $site => $file) {
					if (host_matches($site, $Url['host'])) { //if (preg_match("/^(.+\.)?".$site."$/i", $Url['host'])) {
						$isHost = true;
						try {
							require_once(HOST_DIR . 'DownloadClass.php');
							require_once(HOST_DIR . 'download/' . $file);
							$class = substr($file, 0, -4);
							$firstchar = substr($file, 0, 1);
							if ($firstchar > 0) $class = "d$class";
							if (class_exists($class)) {
								$hostClass = new $class(false);
								$hostClass->Download($LINK);
							}
						} catch (Exception $e) {
							echo "</div><script type='text/javascript'>updateStatus($i, '".htmlspecialchars($e->getMessage(), ENT_QUOTES)."');$nn"."document.getElementById('progress$i').style.display='none';</script>$nn";
							continue 2;
						}
					}
				}
				if (!$isHost) {
					$FileName = isset($Url['path']) ? basename($Url['path']) : '';
					$redir = GetDefaultParams();
					$redir['filename'] = urlencode($FileName);
					$redir['host'] = urlencode($Url['host']);
					if (!empty($Url['port'])) $redir['port'] = urlencode($Url['port']);
					$redir['path'] = urlencode($Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''));
					$redir['referer'] = urlencode($Referer);
					$redir['link'] = urlencode($LINK);
					if (!empty($_GET['cookie'])) $redir['cookie'] = urlencode(encrypt($_GET['cookie']));
					if (!empty($auth)) $redir['auth'] = $auth;
					insert_location($redir);
				}
				echo "<script type='text/javascript'>updateStatus($i, '".lang(25)."');</script>$nn";

				$_GET['saveto'] = ($options['download_dir_is_changeable'] ? urldecode(trim($_GET['saveto'])) : ((substr($options['download_dir'], 0, 6) != 'ftp://') ? realpath(DOWNLOAD_DIR) : $options['download_dir']));
				$_GET['proxy'] = !empty($_GET['proxy']) ? trim(urldecode($_GET['proxy'])) : '';
				$pauth = (empty($_GET['proxy']) || empty($_GET['pauth'])) ? '' : urldecode(trim($_GET['pauth']));
				do {
					$_GET['filename'] = urldecode(trim($_GET['filename']));
					if (strpos($_GET['filename'], '?') !== false) $_GET['filename'] = substr($_GET['filename'], 0, strpos($_GET['filename'], '?'));
					$_GET['host'] = urldecode(trim($_GET['host']));
					$_GET['path'] = urldecode(trim($_GET['path']));
					$_GET['port'] = !empty($_GET['port']) ? urldecode(trim($_GET['port'])) : 0;
					$_GET['referer'] = !empty($_GET['referer']) ? urldecode(trim($_GET['referer'])) : 0;
					$_GET['link'] = urldecode(trim($_GET['link']));
					$_GET['post'] = !empty($_GET['post']) ? unserialize(decrypt(urldecode(trim($_GET['post'])))) : 0;
					$_GET['cookie'] = !empty($_GET['cookie']) ? decrypt(urldecode(trim($_GET['cookie']))) : '';
					$redirectto = '';

					$AUTH = array();
					$_GET['auth'] = !empty($_GET['auth']) ? trim($_GET['auth']) : '';
					if ($_GET['auth'] == '1') {
						if (!preg_match('|^(?:.+\.)?(.+\..+)$|i', $_GET['host'], $hostmatch)) html_error('No valid hostname found for authorisation!');
						$hostmatch = str_replace('.', '_', $hostmatch[1]);
						if (isset($premium_acc["$hostmatch"]) && is_array($premium_acc["$hostmatch"]) && !empty($premium_acc["$hostmatch"]['user']) && !empty($premium_acc["$hostmatch"]['pass'])) {
							$auth = base64_encode($premium_acc["$hostmatch"]['user'] . ':' . $premium_acc["$hostmatch"]['pass']);
						} else html_error('No usable premium account found for this download - please set one in accounts.php');
					} elseif (!empty($_GET['auth'])) {
						$auth = decrypt(urldecode($_GET['auth']));
						list($AUTH['user'], $AUTH['pass']) = array_map('rawurldecode', explode(':', base64_decode($auth), 2));
					} else $auth = false;

					$pathWithName = $_GET['saveto'] . PATH_SPLITTER . basename(urldecode($_GET['filename']));
					while (strpos($pathWithName, "\\\\") !== false) $pathWithName = str_replace("\\\\", "\\", $pathWithName);
					if (strpos($pathWithName, '?') !== false) $pathWithName = substr($pathWithName, 0, strpos($pathWithName, '?'));

					echo "<script type='text/javascript'>updateStatus($i, '".lang(26)."');</script>$nn";
					$url = parse_url($_GET['link']);
					if (empty($url['port'])) $url['port'] = $_GET['port'];
					if (isset($url['scheme']) && $url['scheme'] == 'ftp' && empty($_GET['proxy'])) $file = getftpurl($_GET['host'], defport($url), urldecode($_GET['path']), $pathWithName);
					else {
						!empty($_GET['force_name']) ? $force_name = urldecode($_GET['force_name']) : '';
						$file = geturl($_GET['host'], defport($url), $_GET['path'], $_GET['referer'], $_GET['cookie'], $_GET['post'], $pathWithName, $_GET['proxy'], $pauth, $auth, $url['scheme']);
					}

					if ($options['redir'] && $lastError && strpos($lastError, substr(lang(95), 0, strpos(lang(95), '%1$s'))) !== false) {
						$redirectto = trim(cut_str($lastError, substr(lang(95), 0, strpos(lang(95), '%1$s')), ']'));
						$_GET['referer'] = urlencode($_GET['link']);
						if (strpos($redirectto, '://') === false) { // If redirect doesn't have the host
							$ref = parse_url(urldecode($_GET['referer']));
							unset($ref['user'], $ref['pass'], $ref['query'], $ref['fragment']);
							if (substr($redirectto, 0, 1) != '/') $redirectto = "/$redirectto";
							$purl = array_merge($ref, parse_url($redirectto));
						} else $purl = parse_url($redirectto);
						$_GET['link'] = urlencode(rebuild_url($purl));
						$_GET['filename'] = urlencode(basename($purl['path']));
						$_GET['host'] = urlencode($purl['host']);
						$_GET['path'] = urlencode($purl['path'] . (!empty($purl['query']) ? '?' . $purl['query'] : ''));
						$_GET['port'] = !empty($purl['port']) ? $purl['port'] : 80;
						$_GET['cookie'] = !empty($_GET['cookie']) ? urlencode(encrypt($_GET['cookie'])) : '';
						if (is_array($_GET['post'])) $_GET['post'] = urlencode(encrypt(serialize($_GET['post'])));
						$lastError = $_GET['auth'] = ''; // With $_GET['auth'] empty it will still using the $auth
						unset($ref, $purl);
					}
					if ($lastError) echo "<script type='text/javascript'>updateStatus($i, '".addslashes($lastError)."');</script>$nn";
					elseif ($file['bytesReceived'] == $file['bytesTotal'] || $file['size'] == 'Unknown') {
						echo "<script type='text/javascript'>updateStatus($i, '100%');</script>$nn";
						write_file(CONFIG_DIR."files.lst", serialize(array('name' => $file['file'], 'size' => $file['size'], 'date' => time(), 'link' => $_GET['link'], 'comment' => (!empty($_GET['comment']) ? str_replace(array("\r", "\n"), array('\r', '\n'), $_GET['comment']) : ''))) . "\r\n", 0);
					} else echo "<script type='text/javascript'>updateStatus($i, '".lang(27)."');</script>$nn";
				} while ($redirectto && !$lastError);
				echo "</div>$nn<script type='text/javascript'>resetProgress();document.getElementById('progress$i').style.display='none';</script>$nn";
			}
			if (isset($_POST['server_dodelay']) && $_POST['server_dodelay'] == 'on' && !empty($_POST['serversidedelay'])) sleep((int) $_POST['serversidedelay']);
		}
		echo "<script type='text/javascript'>$('.transloadui').hide();</script>$nn";
		exit;
	} else {
		$start_link = 'index.php?audl=doum';

		if (isset($_REQUEST['useproxy']) && (empty($_REQUEST['proxy']) || strpos($_REQUEST['proxy'], ':') === false)) html_error(lang(20));
		elseif (isset($_REQUEST['useproxy']) && $_REQUEST['useproxy'] == 'on') {
			$start_link .= '&useproxy=on&proxy=' . urlencode(trim($_REQUEST['proxy']));
			if (!empty($_REQUEST['proxyuser']) && !empty($_REQUEST['proxypass'])) {
				$start_link .= '&proxyuser=' . urlencode(trim($_REQUEST['proxyuser']));
				$start_link .= '&proxypass=' . urlencode(trim($_REQUEST['proxypass']));
			}
		}

		if (!empty($_POST['premium_acc']) && $_POST['premium_acc'] == 'on') {
			$start_link .= '&premium_acc=on';
			if (!empty($_POST['premium_user']) && !empty($_POST['premium_pass'])) $start_link .= '&premium_user=' . urlencode(trim($_POST['premium_user'])) . '&premium_pass='.urlencode(trim($_POST['premium_pass']));
		}

		if (isset($_POST['cookieuse']) && !empty($_POST['cookie'])) $start_link .= '&cookie=' . urlencode(trim($_POST['cookie']));
		if (isset($_POST['ytube_mp4']) && isset($_POST['yt_fmt'])) $start_link .= '&ytube_mp4=' . urlencode($_POST['ytube_mp4']) . '&yt_fmt='.urlencode($_POST['yt_fmt']);
		if (isset($_POST['cleanname'])) $start_link .= '&cleanname=' . urlencode($_POST['cleanname']);

?>
<script type="text/javascript">
/* <![CDATA[ */
	var current_dlink = -1;
	var links = new Array();
	var start_link = '<?php echo $start_link; ?>';

	function startauto() {
		current_dlink = -1;
		document.getElementById('auto').style.display = 'none';
		nextlink();
	}

	function nextlink() {
		if (document.getElementById('status'+current_dlink)) document.getElementById('status'+current_dlink).innerHTML = '<?php echo lang(28); ?>';
		current_dlink++;

		if (current_dlink < links.length) {
			document.getElementById('status'+current_dlink).innerHTML = '<?php echo lang(26); ?>';
			opennewwindow(current_dlink);
		}
	}

	function opennewwindow(id) {
		window.frames['idownload'].location = start_link+'&link='+links[id];
	}

	function addLinks() {
		var tbody = document.getElementById('links').getElementsByTagName('tbody')[0];
		var stringLinks = document.getElementById('addlinks').value;
		var regexRN = new RegExp('\r\n', 'g');
		var regexN = new RegExp('\n', 'g');
		var stringLinksN = stringLinks.replace(regexRN, "\n");
		var arrayLinks = stringLinksN.split(regexN);
		for (var i = 0; i < arrayLinks.length; i++) {
			var row = document.createElement('tr');
			var td1 = document.createElement('td');
			td1.appendChild(document.createTextNode(arrayLinks[i]));
			var td2 = document.createElement('td');
			td2.appendChild(document.createTextNode('<?php echo lang(23); ?>'));
			td2.setAttribute('id', 'status'+links.length);
			row.appendChild(td1);
			row.appendChild(td2);
			tbody.appendChild(row);
			links[links.length] = arrayLinks[i];
		}
		document.getElementById('addlinks').value = '';
	}
<?php for ($i = 0; $i < count($getlinks); $i++) echo "\tlinks[$i] = '" . urlencode($getlinks[$i]) . "';\n"; ?>
/* ]]> */
</script>

<table id="links" class="container" cellspacing="1">
	<thead>
		<tr><td width="80%" align="left"><b><?php echo lang(21); ?></b></td><td width="70" align="left"><b><?php echo lang(22); ?></b></td></tr>
	</thead><tfoot>
		<tr id="auto"><td colspan="2" align="center"><input type="button" value="<?php echo lang(29); ?>" onclick="javascript:startauto();" /></td></tr>
	</tfoot><tbody>
<?php for ($i = 0; $i < count($getlinks); $i++) echo "\t<tr><td nowrap='nowrap'>".htmlentities($getlinks[$i])."</td><td id='status$i'>" . lang(307) . "</td></tr>\r\n"; ?>
	</tbody>
</table>
<br />
<iframe width="90%" height="300" src="" name="idownload"><?php echo lang(30); ?></iframe>
<br />
<table class="container" cellspacing="1">
	<tr>
		<td><textarea name="addlinks" id="addlinks" cols="100" rows="5"></textarea></td>
		<td><input type="button" value="<?php echo lang(31); ?>" onclick="javascript:addLinks();" /></td>
	</tr>
</table>
</center>
<?php
		include(TEMPLATE_DIR.'footer.php');
		exit;
	}
}
?>
<script type="text/javascript">
/* <![CDATA[ */
	function ViewPage(page) {
		document.getElementById('listing').style.display = 'none';
		document.getElementById('options').style.display = 'none';
		document.getElementById(page).style.display = 'block';
	}

	function HideAll() {
		document.getElementById('entered').style.display = 'none';
		/* document.getElementById('worked_frame').style.display = 'block'; */
	}
/* ]]> */
</script>
<table class="container" cellspacing="0" cellpadding="1" id="entered">
	<tr><td>
		<form action="?GO=GO" method="post" >
		<table align="center" width="700" border="0">
			<tr id="menu"><td width="700" align="center"><a href="javascript:ViewPage('listing');"><?php echo lang(32); ?></a>&nbsp;|&nbsp;<a href="javascript:ViewPage('options');"><?php echo lang(33); ?></a></td></tr>
			<tr><td width="100%" valign="top">
				<div id="listing" style="display:block;">
					<table border="0" style="width:710px;">
						<tr><td align="center"><textarea id="links" name="links" rows="25" cols="100" style="width:600px;height:400px;border:1px solid #002E43;"></textarea></td></tr>
						<tr><td align="center" valign="top"><input type="submit" value="<?php echo lang(34); ?>" onclick="javascript:HideAll();" style="width:100px;" /></td></tr>
					</table>
				</div>
				<div id="options" style="display:none;">
					<table cellspacing="5" style="width:710px;">
						<tbody>
							<tr><td align="center">
								<table align="center">
									<tr>
										<td><input type="checkbox" id="useproxy" name="useproxy" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('proxy').style.display=displ;"<?php echo !empty($_COOKIE['useproxy']) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(35); ?></td>
										<td>&nbsp;</td>
										<td id="proxy"<?php echo !empty($_COOKIE['useproxy']) ? '' : ' style="display: none;"'; ?>>
											<table border="0">
												<tr><td><?php echo lang(36); ?>:</td><td><input name="proxy" size="25"<?php echo !empty($_COOKIE['roxy']) ? ' value="'.htmlspecialchars($_COOKIE['proxy'], ENT_QUOTES).'"' : ''; ?> /></td></tr>
												<tr><td><?php echo lang(37); ?>:</td><td><input name="proxyuser" size="25"<?php echo !empty($_COOKIE['proxyuser']) ? ' value="'.htmlspecialchars($_COOKIE['proxyuser'], ENT_QUOTES).'"' : ''; ?> /></td></tr>
												<tr><td><?php echo lang(38); ?>:</td><td><input name="proxypass" size="25"<?php echo !empty($_COOKIE['proxypass']) ? ' value="'.htmlspecialchars($_COOKIE['proxypass'], ENT_QUOTES).'"' : ''; ?> /></td></tr>
											</table>
										</td>
									</tr>
<?php if ($options['download_dir_is_changeable']) { ?>
									<tr>
										<td><input type="checkbox" name="saveto" id="saveto" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('path').style.display=displ;"<?php echo !empty($_COOKIE['saveto']) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(40); ?></td>
										<td>&nbsp;</td>
										<td id="path" <?php echo !empty($_COOKIE['saveto']) ? '' : ' style="display: none;"'; ?>><?php echo lang(41); ?>:&nbsp;<input name="savedir" size="30" value="<?php echo (!empty($_COOKIE['savedir']) ? $_COOKIE['savedir'] : (substr($options['download_dir'], 0, 6) != 'ftp://' ? realpath(DOWNLOAD_DIR) : $options['download_dir'])); ?>" /></td>
									</tr>
<?php } ?>
									<tr>
										<td><input type="checkbox" value="on" name="premium_acc" id="premium_acc" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('premiumblock').style.display=displ;"<?php if (count($premium_acc) > 0) echo ' checked="checked"'; ?> />&nbsp;<?php echo lang(42); ?></td>
										<td>&nbsp;</td>
										<td id="premiumblock" style="display: none;">
											<table width="150" border="0">
												<tr><td><?php echo lang(37); ?>:&nbsp;</td><td><input type="text" name="premium_user" id="premium_user" size="15" value="" /></td></tr>
												<tr><td><?php echo lang(38); ?>:&nbsp;</td><td><input type="password" name="premium_pass" id="premium_pass" size="15" value="" /></td></tr>
											</table>
										</td>
									</tr>
									<tr>
										<td><input type="checkbox" name="cookieuse" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('cookieblock').style.display=displ;" />&nbsp;<?php echo lang(235); ?></td>
										<td>&nbsp;</td>
										<td id="cookieblock" style="display: none;">
											<table width="150" border="0">
												<tr><td><?php echo lang(236); ?>;</td><td><input type="text" name="cookie" id="cookie" size="25" value="" /></td></tr>
											</table>
										</td>
									</tr>
									<tr>
										<td>
											<label><input type="checkbox" name="ytube_mp4" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('ytubeopt').style.display=displ;" checked="checked" />&nbsp;<?php echo lang(206); ?></label>
											<table width="150" border="0" id="ytubeopt" style="display: none;">
												<tr>
													<td>&nbsp;<label><input type="checkbox" name="cleanname" checked="checked" value="1" /><small>&nbsp;Remove non-supported characters from filename</small></label></td>
												</tr>
												<tr>
													<td>
														<select name="yt_fmt" id="yt_fmt">
															<option value="highest" selected="selected"><?php echo lang(219); ?></option>
															<option value='22'>[22] Video: MP4 720p | Audio: AAC ~192 Kbps</option>
															<option value='43'>[43] Video: WebM 360p | Audio: Vorbis ~128 Kbps</option>
															<option value='18'>[18] Video: MP4 360p | Audio: AAC ~96 Kbps</option>
															<option value='5'>[5] Video: FLV 240p | Audio: MP3 ~64 Kbps</option>
															<option value='36'>[36] Video: 3GP 240p | Audio: AAC ~36 Kbps</option>
															<option value='17'>[17] Video: 3GP 144p | Audio: AAC ~24 Kbps</option>
															<option value='138'>[138] Video only: MP4 @ 4320p</option>
															<option value='272'>[272] Video only: WebM @ 4320p</option>
															<option value='315'>[315] Video only: WebM @ 2160p60</option>
															<option value='266'>[266] Video only: MP4 @ 2160p</option>
															<option value='313'>[313] Video only: WebM @ 2160p</option>
															<option value='308'>[308] Video only: WebM @ 1440p60</option>
															<option value='264'>[264] Video only: MP4 @ 1440p</option>
															<option value='271'>[271] Video only: WebM @ 1440p</option>
															<option value='299'>[299] Video only: MP4 @ 1080p60</option>
															<option value='303'>[303] Video only: WebM @ 1080p60</option>
															<option value='137'>[137] Video only: MP4 @ 1080p</option>
															<option value='248'>[248] Video only: WebM @ 1080p</option>
															<option value='298'>[298] Video only: MP4 @ 720p60</option>
															<option value='302'>[302] Video only: WebM @ 720p60</option>
															<option value='140'>[140] Audio only: AAC @ ~128 Kbps</option>
															<option value='171'>[171] Audio only: Vorbis @ ~160 Kbps</option>
															<option value='251'>[251] Audio only: Opus @ ~128 Kbps</option>
															<option value='250'>[250] Audio only: Opus @ ~64 Kbps</option>
															<option value='249'>[249] Audio only: Opus @ ~48 Kbps</option>
														</select>
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<tr><td><label><input type="checkbox" name="server_side" value="on" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('serverside').style.display=displ;" />&nbsp;<?php echo lang(43); ?></label></td></tr>
									<tr id="serverside" style="display: none;">
										<td><input type="checkbox" name="server_dodelay" value="on" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('serverdelay').style.display=displ;" /><?php echo lang(44); ?></td>
										<td>&nbsp;</td>
										<td id="serverdelay" style="display: none;"><?php echo lang(45); ?>: <input type="text" name="serversidedelay" /></td>
									</tr>
								</table>
							</td></tr>
						</tbody>
					</table>
				</div>
			</td></tr>
		</table>
		</form>
	</td></tr>
</table>
</center>
<?php include(TEMPLATE_DIR.'footer.php'); ?>
<?php

require_once('rl_init.php');

if ($options['auto_upload_disable']) {
	require_once('deny.php');
	exit();
}
error_reporting(0);
ignore_user_abort(true);

login_check();

$id = 1;
require_once(HOST_DIR.'download/hosts.php');
require_once(CLASS_DIR.'http.php');
include(TEMPLATE_DIR.'header.php');
?>
<br />
<center>
<?php
	// If the user submit to upload, go into upload page
	if ($_GET['action'] == 'upload') {
		// Define another constant
		if(!defined('CRLF')) define('CRLF',"\r\n");
		// The new line variable
		$nn = "\r\n";
		// Initialize some variables here
		$uploads = array();
		$total = 0;
		$hostss = array();
		// Get number of windows to be opened
		$openwin = (int) $_POST['windows'];
		if ($openwin <= 0) $openwin = 4;
		$openwin--;
		// Sort the upload hosts and files
		foreach ($_POST['files'] as $file) {
			foreach ($_POST['hosts'] as $host) {
				$hostss[] = $host;
				$uploads[] = array('host' => $host,
					'file' => DOWNLOAD_DIR.base64_decode($file));
				$total++;
			}
		}
		// Clear out duplicate hosts
		$hostss = array_unique($hostss);
		// If there aren't anything
		if (count($uploads) == 0) {
			echo lang(46);
			exit;
		}
		$save_style = "";
		if (!empty($_POST['save_style']) && $_POST['save_style'] != lang(51)) {
			$save_style = '&save_style='.urlencode(base64_encode($_POST['save_style']));
		}
		$start_link = "upload.php";
		$i = 0;
		foreach ($uploads as $upload) {
			$getlinks[$i][] = "?uploaded=".$upload['host']."&filename=".urlencode(base64_encode($upload['file'])).$save_style;
			$i++;
			if ($i>$openwin) $i = 0;
		}
?>
<script type="text/javascript">
/* <![CDATA[ */
<?php
	for ($i=0;$i<=$openwin;$i++) {
?>
	var current_dlink<?php echo $i; ?>=-1;
	var links<?php echo $i; ?> = new Array();
<?php
	}
?>
	var start_link='<?php echo $start_link; ?>';
	var usingwin = 0;

	function startauto()
		{
			current_dlink0=-1;
			//document.getElementById('auto').style.display='none';
			nextlink0();
<?php
	for ($i=1;$i<=$openwin;$i++) {
?>
			if (links<?php echo $i; ?>.length > 0) {
				current_dlink<?php echo $i; ?>=-1;
				nextlink<?php echo $i; ?>();
			} else {
				document.getElementById('idownload<?php echo $i; ?>').style.display = 'none';
			}
<?php
	}
?>
		}

<?php
	for ($i=0;$i<=$openwin;$i++) {
?>
	function nextlink<?php echo $i; ?>() {
		current_dlink<?php echo $i; ?>++;
		if (current_dlink<?php echo $i; ?> < links<?php echo $i; ?>.length) {
			opennewwindow<?php echo $i; ?>(current_dlink<?php echo $i; ?>);
		} else {
			document.getElementById('idownload<?php echo $i; ?>').style.display = 'none';
		}
	}

	function opennewwindow<?php echo $i; ?>(id) {
		window.frames["idownload<?php echo $i; ?>"].location = start_link+links<?php echo $i; ?>[id]+'&auul=<?php echo $i; ?>';
	}
<?php
	}
		for ($j=0;$j<=$openwin;$j++) {
			foreach ($getlinks[$j] as $i=>$link) {
				echo "\tlinks{$j}[".$i."]='".$link."';\n";
			}
		}
?>
/* ]]> */
</script>
<?php
	for ($i=0;$i<=$openwin;$i++) {
		if (( $i+1 )% 2) echo "<br />";
?>
<iframe width="49%" height="300" src="" name="idownload<?php echo $i; ?>" id="idownload<?php echo $i; ?>" style="float:left; border:1px solid;"><?php echo lang(30); ?></iframe>
<?php
	}
?>
<script type="text/javascript">startauto();</script><br />
<a href="files/myuploads.txt">myuploads.txt</a>
<?php

	} else {
?>
<?php 
$options['show_all'] = true;
$_COOKIE["showAll"] = 1;
_create_list();
require_once("classes/options.php");
unset($Path);
?>
<form name="flist" method="post" action="auul.php?action=upload">
<p><b><?php echo lang(47); ?></b></p>
<div style="overflow:auto; height:200px; width: 300px;">
<table>
<?php
	$d = opendir(HOST_DIR."upload/");
	while (false !== ($modules = readdir($d)))
		{
			if($modules!="." && $modules!="..")
				{
					if(is_file(HOST_DIR."upload/".$modules))
						{
							if (strpos($modules,".index.php")) include_once(HOST_DIR."upload/".$modules);
						}
				}
		}
	if (empty($upload_services)) 
	{
		echo '<span class="warning"><b>'.lang(48).'</b></span>';
	} else {
		sort($upload_services); reset($upload_services);
		$cc=0;
		foreach($upload_services as $upl)
		{
?>
	<tr>
		<td><input type="checkbox" name="hosts[]" value="<?php echo $upl; ?>" /></td>
		<td><?php echo str_replace("_"," ",$upl)." (".($max_file_size[$upl]==false ? "Unlim" : $max_file_size[$upl]."Mb").")"; ?></td>
	</tr>
<?php
		}
	}
?>
</table>
</div><br />
<hr /><br />
<input type="submit" name="submit" value="Upload" /> <?php echo lang(49); ?>: <input type="text" size="2" name="windows" value="4" /><br />
<?php echo lang(50); ?>: <input type="text" size="50" name="save_style" placeholder="{name}: {link} or {link}" /><br />
<a href="javascript:setCheckboxes(1);" class="chkmenu"><?php echo lang(52); ?></a> |
<a href="javascript:setCheckboxes(0);" class="chkmenu"><?php echo lang(53); ?></a> |
<a href="javascript:setCheckboxes(2);" class="chkmenu"><?php echo lang(54); ?></a> |
<a href="files/myuploads.txt" class="chkmenu">myuploads.txt</a>
<div style="overflow:auto; height:400px; width: 700px;">
<table cellpadding="3" cellspacing="1" width="100%" class="filelist" id="table_filelist_au">
	<tr class="flisttblhdr" valign="bottom">
		<th class="sorttable_checkbox">&nbsp;</th>
		<th class="sorttable_alpha"><?php echo lang(55); ?></th>
		<th><?php echo lang(56); ?></th>
	</tr>
<?php
if (!$list) {
?>
	<center><?php echo lang(57); ?></center>
<?php
} else {
?>
<?php
	foreach($list as $key => $file) {
		if(file_exists($file["name"])) {
?>
	<tr>
		<td><input type="checkbox" name="files[]" value="<?php echo base64_encode(basename($file["name"])); ?>" /></td>
		<td><?php echo basename($file["name"]); ?></td>
		<td><?php echo $file["size"]; ?></td>
	</tr>
<?php
		}
	}
?>
</table>
<?php
	if ($options['flist_sort']) {
		echo '<script type="text/javascript">sorttable.makeSortable(document.getElementById("table_filelist_au"));</script>';
	}
?>
<br />
<?php echo lang(58); ?><br />
<ol>
	<li>{link} : <?php echo lang(59); ?></li>
	<li>{name} : <?php echo lang(60); ?></li>
	<li><?php echo lang(51); ?> : <?php echo lang(61); ?></li>
</ol><br />
<?php echo lang(62); ?>
</div>
</form>
<?php
}
}

?>
</center>
<?php include(TEMPLATE_DIR.'footer.php'); ?>
<?php
define ( 'RAPIDLEECH', 'yes' );
define ( 'CONFIG_DIR', 'configs/' );
require_once(CONFIG_DIR.'setup.php');
define ( 'TEMPLATE_DIR', 'templates/'.$options['template_used'].'/' );
require_once('classes/other.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title>Rapidleech Checker Script</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link title="Rapidleech Style" href="<?php echo TEMPLATE_DIR; ?>styles/rl_style_pm.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?php
$phpver = phpversion();
$phpverr = str_replace(".", "", $phpver);

if ($phpverr >= 430) {
	$phpverr = '<span class="checkerp">'.lang(308).'</span>';
} else {
	$phpverr = '<span class="checkerf">'.lang(309).'</span>';
}

if ( ini_get('safe_mode') ){
	$safemode = '<span class="checkerf">'.lang(309).'</span>';
} else {
	$safemode = '<span class="checkerp">'.lang(308).'</span>';
}

if (!function_exists('stream_socket_client')) {
	$fsockopen = '<span class="checkerf">'.lang(309).'</span>';
} else {
	$fsockopen = '<span class="checkerp">'.lang(308).'</span>';
}

@ini_set('memory_limit', '64M');
if ((int)ini_get('memory_limit') > 32) {
	$memory_limit = '<span class="checkerp">'.lang(308).'</span>';
} else {
	$memory_limit = '<span class="checkerf">'.lang(309).'</span>';
}

if (!function_exists('curl_version')) {
	$curl = '<span class="checkerf">'.lang(309).'</span>';
} else {
	$curl = '<span class="checkerp">'.lang(308).'</span>';
}

if (!ini_get('allow_url_fopen')) {
	$fopen = '<span class="checkerf">'.lang(309).'</span>';
} else {
	$fopen = '<span class="checkerp">'.lang(308).'</span>';
}

if (!ini_get('allow_call_time_pass_reference')) {
	$call_time = '<span class="checkerf">'.lang(310).'</span>';
} else {
	$call_time = '<span class="checkerp">'.lang(308).'</span>';
}

if (!function_exists('passthru')) {
	$passthru = '<span class="checkerf">'.lang(311).'</span>';
} else {
	$passthru = '<span class="checkerp">'.lang(308).'</span>';
}

if (!function_exists('disk_free_space')) {
	$disk_free_space = '<span class="checkerf">'.lang(311).'</span>';
} else {
	$disk_free_space = '<span class="checkerp">'.lang(308).'</span>';
}

if (!extension_loaded('openssl')) {
    $ssl = '<span class="checkerf">'.lang(309).'</span>';
} else {
    $ssl = '<span class="checkerp">'.lang(308).'</span>';
}

if (function_exists('apache_get_version')) {
	$apache_version = apache_get_version();
	preg_match('/Apache\/([0-9])\./U',$apache_version,$apacver);
	if ($apacver[1] < 2) {
		$apacver = '<span class="checkerf">'.lang(312).'</span>';
	} else {
		$apacver = '<span class="checkerp">'.lang(308).'</span>';
	}
}
?>
<center><img src="<?php echo TEMPLATE_DIR; ?>images/logo_pm.gif" alt="RapidLeech PlugMod" border="0" /></center>
<br />
<table border="0" width="100%" align="center">
	<tr>
		<td>
			<div align="center">
				<table border="1" cellpadding="20" style="border-collapse: collapse">
					<tr>
						<td align="center" style="font-family: 'Verdana'; font-size: smaller">
							<b><?php echo lang(313); ?></b>
						</td>
					</tr>
					<tr>
						<td align="center" style="font-family: 'Verdana'; font-size: smaller;">
							<b><?php echo lang(314); ?></b>: <?php echo $fsockopen; ?><br /><br />
							<b><?php echo lang(315); ?></b>: <?php echo $memory_limit; ?><br /><br />
							<b><?php echo lang(316); ?></b>: <?php echo $safemode; ?><br /><br />
							<b><?php echo lang(317); ?></b>: <?php echo $curl; ?><br /><br />
							<b><?php echo lang(318); ?></b>: <?php echo $fopen; ?><br /><br />
							<b><?php echo lang(319); ?><?php echo $phpver; ?></b>: <?php echo $phpverr; ?><br /><br />
							<b><?php echo lang(320); ?></b>: <?php echo $call_time; ?><br /><br />
							<b><?php echo lang(321); ?></b>: <?php echo $passthru; ?><br /><br />
							<b><?php echo lang(322); ?></b>: <?php echo $disk_free_space; ?><br /><br />
							<b><?php echo lang(388); ?></b>: <?php echo $ssl; ?><br /><br />
<?php if ($apache_version) {
?>
							<b><?php echo lang(323); ?><?php echo $apache_version; ?></b>: <?php echo $apacver; ?><br /><br />
<?php
}?>
						</td>
					</tr>
				</table>
			</div>
		</td>
	</tr>
</table>
</body>
</html>
order deny,allow
deny from all

<files ~ "\.(?i:js)$">
allow from all
</files>

<files bar.php>
allow from all
</files>
var idleTime = 0;
$(document).ready(function(){
  var idleInterval = setInterval("idleTime++;", 1000);
  $(this).mousemove(function(e){
    var tmp = idleTime;
    idleTime = 0;
    if (tmp >= 120) { stats_timer = setTimeout("refreshStats()",1000); }
  });
});

var stats_timed = 10;
function refreshStats() {
	$.ajax({
		type: "GET",
		url: 'ajax.php?ajax=server_stats',
		dataType: 'json',
		success: function (data) {
			$('#cpuload').html(data.CPULoad);
			$('#inuse').html(data.InUse);
			$('#inusepercent').html(data.InUsePercent);
			$('#freespace').html(data.FreeSpace);
			$('#diskspace').html(data.DiskSpace);
			diskPercent = new Image();
			diskPercent.src = "classes/bar.php?rating=" + data.DiskPercent;
			$('#diskpercent').attr('src',diskPercent.src);
			cpuPercent = new Image();
			cpuPercent.src = "classes/bar.php?rating=" + data.CPUPercent;
			$('#cpupercent').attr('src',cpuPercent.src);
			if (stats_timed < 60) { stats_timed = stats_timed + 10; }
			if (idleTime < 120) {
				clearTimeout(stats_timer);
				stats_timer = setTimeout("refreshStats()",stats_timed * 1000);
			}
		}
	});
}
<?php
error_reporting(0);
function drawRating() {
   $width = $_GET['width'];
   $height = $_GET['height'];
   if ($width == 0) {
     $width = 200;
   }
   if ($height == 0) {
     $height = 7;
   }
   $rating = $_GET['rating'];
   $ratingbar = (($rating/100)*$width)-2;
   $image = imagecreate($width,$height);
   $fill = ImageColorAllocate($image,0,255,0); 
   if ($rating > 49) { $fill = ImageColorAllocate($image,255,255,0); } 
   if ($rating > 74) { $fill = ImageColorAllocate($image,255,128,0); } 
   if ($rating > 89) { $fill = ImageColorAllocate($image,255,0,0); } 
   $back = ImageColorAllocate($image,205,205,205);
   $border = ImageColorAllocate($image,0,0,0);
   ImageFilledRectangle($image,0,0,$width-1,$height-1,$back);
   ImageFilledRectangle($image,1,1,$ratingbar,$height-1,$fill);
   ImageRectangle($image,0,0,$width-1,$height-1,$border);
   imagePNG($image);
   imagedestroy($image);
}
Header("Content-type: image/png");
drawRating();
?>
<?php

// +----------------------------------------------------------------------+
// | Perfect Scripts                                         blowfish.php |
// | Brazilian Organization                                               |
// +----------------------------------------------------------------------+
// | Viva ao Linux!                                                       |
// | Porque nÃ³s amamos a liberdade!                                       |
// +----------------------------------------------------------------------+
// | Class Perfect Crypt                                                  |
// | Created By Igor Ribeiro de Assis                                     |
// | <igor21@terra.com.br> UIN: 71064682                                  |
// +----------------------------------------------------------------------+
// | http://ps.wmforce.com                                                |
// +----------------------------------------------------------------------+
// | Under GPL                                                            |
// +----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published    |
// | by the Free Software Foundation; either version 2 of the License,    |
// | or (at your option) any later version.                               |
// |                                                                      |
// | This program is distributed in the hope that it will be useful,      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to the Free Software          |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA             |
// | 02111-1307  USA                                                      |
// +----------------------------------------------------------------------+
// | Mon Apr 12 17:01:55 BRT 2004										  |
// +----------------------------------------------------------------------+

/**
  * Class Blowfish extends PCrypt Class
  * This class is a implementation of the Blowfish Crypt Algorithm to use with
  * PCrypt Class.
  * Based on Bruce Schneier Code in Applied Cryptography Book
  */

class pcrypt_blowfish 
{

    /** Attributes */
    
    /** 
      * S-Boxes ($sbox0, $sbox1, $sbox2 and $sbox3)
      *
      * These are the subkeys boxes with 256 entries each. 
      *
      * @access private
      * @var    array
      */
    var $sbox0 = array (
    
    0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
    0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
    0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,
    0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
    0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,
    0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
    0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,
    0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
    0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,
    0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
    0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,
    0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
    0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,
    0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
    0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,
    0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
    0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,
    0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
    0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,
    0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
    0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,
    0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
    0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,
    0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
    0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,
    0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
    0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,
    0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
    0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,
    0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
    0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,
    0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
    0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,
    0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
    0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,
    0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
    0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,
    0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
    0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,
    0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
    0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,
    0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
    0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a);

    var $sbox1 = array(
    0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d,
    0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
    0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65,
    0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
    0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9,
    0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
    0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d,
    0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
    0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc,
    0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
    0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908,
    0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
    0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124,
    0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
    0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908,
    0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
    0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b,
    0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
    0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa,
    0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
    0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d,
    0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
    0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5,
    0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
    0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96,
    0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
    0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca,
    0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
    0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77,
    0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
    0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054,
    0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
    0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea,
    0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
    0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646,
    0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
    0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea,
    0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
    0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e,
    0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
    0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd,
    0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
    0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7);

    var $sbox2 = array(
    0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7,
    0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
    0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af,
    0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
    0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4,
    0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
    0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec,
    0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
    0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332,
    0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
    0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58,
    0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
    0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22,
    0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
    0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60,
    0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
    0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99,
    0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
    0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74,
    0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
    0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3,
    0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
    0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979,
    0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
    0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa,
    0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
    0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086,
    0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
    0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24,
    0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
    0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84,
    0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
    0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09,
    0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
    0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe,
    0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
    0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0,
    0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
    0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188,
    0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
    0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8,
    0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
    0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0);

    var $sbox3 = array(
    0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,
    0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
    0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,
    0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
    0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,
    0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
    0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,
    0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
    0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,
    0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
    0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,
    0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
    0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,
    0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
    0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,
    0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
    0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,
    0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
    0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,
    0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
    0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,
    0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
    0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,
    0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
    0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,
    0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
    0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,
    0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
    0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,
    0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
    0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,
    0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
    0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,
    0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
    0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,
    0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
    0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,
    0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
    0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,
    0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
    0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,
    0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
    0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6);

    /** P-Array consists of 18 32-bit subkeys
      *
      * @var array $parray 
      * @access private
      */

    var $parray = array(
    0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,
    0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
    0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b);
    
    /** Block size in bytes
      *
      * @access public
      * @var    int $blocksize
      */
    var $blocksize = 8; //bytes
    
    /** Methods */

    /** The Constructor of the class.
      *
      * This class make a copy of the $sboxs and $parray and init the subkeys. 
      *
      * @access public
      * @param  string $key the key used to encrypt and decrypt
      * @return void
      */
    function __construct($key)
    {
        $this->bctx = array('p'  => $this->parray,
                            'sb' => array( $this->sbox0, $this->sbox1, 
                                           $this->sbox2, $this->sbox3));
        $this->_init($key);
    }
    
    
    /** This functions encrypt the block.
      *
      * @access private
      * @param  int $Xl left uInt32 part of the block
      * @param  int $Xr right uInt32 part of the block
      * @return void
      */
    function _blowfish_crypt(&$Xl, &$Xr)
    {
        for($i = 0; $i < 16; $i++)
        {
            $Xl = $Xl ^ $this->bctx['p'][$i];
            $Xr = $this->_F($Xl) ^ $Xr;

            // Swap $Xl and $Xr
            $tmp = $Xl;
            $Xl = $Xr;
            $Xr = $tmp;
        }
        
        // Undo last swap 
        $tmp = $Xl;
        $Xl  = $Xr;
        $Xr  = $tmp;
        
        $Xr  = $Xr ^ $this->bctx['p'][16];
        $Xl  = $Xl ^ $this->bctx['p'][17];
    }
    
    /** This method decrypt the block.
      *    
      * @access private
      * @param  int $Xl left uInt32 part of the block
      * @param  int $Xr right uInt32 part of the block
      * @return void
      */
    function _blowfish_decrypt(&$Xl, &$Xr)
    {
        for($i = 17; $i >= 2 ; $i--)
        {
            $Xl = $Xl ^ $this->bctx['p'][$i];
            $Xr = $this->_F($Xl) ^ $Xr;

            // Swap $Xl and $Xr
            $tmp = $Xl;
            $Xl = $Xr;
            $Xr = $tmp;
        }
        
        // Undo last swap 
        $tmp = $Xl;
        $Xl  = $Xr;
        $Xr  = $tmp;
        
        $Xr  = $Xr ^ $this->bctx['p'][1];
        $Xl  = $Xl ^ $this->bctx['p'][0];
    }
    
    /** The F function defined in Blowfish paper.
      *
      * Divide the block in 4 parts and execute the function  
      * 
      * @access private
      * @param  int $x the block
      * @return int $y the new block 
      */
    function _F($x)
    {

        $d = $x & 0xff;
        $x = $x >> 8;
        $c = $x & 0xff;
        $x = $x >> 8;
        $b = $x & 0xff;
        $x = $x >> 8;
        $a = $x & 0xff;
        
        $y = $this->bctx['sb'][0][$a] + $this->bctx['sb'][1][$b];
        $y = ($y ^ $this->bctx['sb'][2][$c]) + $this->bctx['sb'][3][$d]; 
        
        return $y;
    }

    /** This function initialize the subkeys.
      *
      * @access public
      * @param  string $key the key used to encrypt and decrypt
      * @return void
      */
    function _init($key)
    {
        // unpack binary string in unsigned chars
        $key  = array_values(unpack("C*",$key));
        $keyl = count($key);
        
        $j = 0;
        for ($i = 0; $i < 18; $i++)
        {
            
            // xor P1 with the first 32-bits of the key, xor P2 with the second 32-bits ...
            $data = 0;
            for($k = 0; $k < 4; $k++)
            {
                $data = ($data << 8) | $key[$j];
                $j++;
                if ($j >= $keyl)
                    $j = 0;
            }
            $this->bctx['p'][$i] = $this->parray[$i] ^ $data;
        }

        // encrypt the zero-string, replace P1 and P2 with the encrypted data,         encrypt P3 and P4 with the new P1 and P2, do it with all P-array and subkeys
        $datal = 0;
        $datar = 0;
        for ($i = 0; $i < 18; $i += 2)
        {
            $this->_blowfish_crypt($datal, $datar);
            $this->bctx['p'][$i] = $datal;
            $this->bctx['p'][$i+1] = $datar;
        }

        for ($i = 0; $i < 4; $i++)
        {
            for ($j = 0; $j < 256; $j += 2)
            {
                $this->_blowfish_crypt($datal, $datar);
                $this->bctx['sb'][$i][$j] = $datal;
                $this->bctx['sb'][$i][$j+1] = $datar;
            }
        }
    }
    
    /** This method is called by pcrypt class.
      *
      * This method encrypt the block and return the new block.
      *
      * @access public
      * @param  string $block the block to be encrypted
      * @return string the block encrypted
      */
    function _encrypt($block)
    {
        // unpack the block in unsigned long ints (uInt32)
        $data = array_values(unpack('N*', $block));
        
        // encrypt the block and return the block packed into string
        $this->_blowfish_crypt($data[0],$data[1]);
        
        return pack('N*',$data[0], $data[1]);
    }

    /** This method is called by pcrypt class.
      *
      * This method decrypt the cipher block and return the new.
      *
      * @access public
      * @param  string $block the encrypted block to be decrypted
      * @return string the plain text block
      */
    function _decrypt($block)
    {
        // unpack the block in unsigned long ints (uInt32)
        $data = array_values(unpack('N*', $block));
        
        // decrypt the block and return the block packed into string 
        $this->_blowfish_decrypt($data[0],$data[1]);
        
        return pack('N*',$data[0],$data[1]);
    }

}

?>
<?php

// +----------------------------------------------------------------------+
// | Perfect Scripts                                     class.pcrypt.php |
// | Brazilian Organization                                               |
// +----------------------------------------------------------------------+
// | Viva ao Linux!                                                       |
// | Porque nÃ³s amamos a liberdade!                                       |
// +----------------------------------------------------------------------+
// | Class Perfect Crypt                                                  |
// | Created By Igor Ribeiro de Assis                                     |
// | <igor21@terra.com.br> UIN: 71064682                                  |
// +----------------------------------------------------------------------+
// | http://ps.wmforce.com                                                |
// +----------------------------------------------------------------------+
// | Under GPL                                                            |
// +----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published    |
// | by the Free Software Foundation; either version 2 of the License,    |
// | or (at your option) any later version.                               |
// |                                                                      |
// | This program is distributed in the hope that it will be useful,      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to the Free Software          |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA             |
// | 02111-1307  USA                                                      |
// +----------------------------------------------------------------------+

/**
* Encryption Block Mode constants
*
* @const MODE_ECB ecb mode
* @const MODE_CBC cbc mode
*/
define("MODE_ECB",0);
define("MODE_CBC",1);

/**
  * An abstract layer class to encrypt data.
  *
  * This class is class is used to encrypt and decrypt data using different algorithms
  * and modes.
  *
  * @author  Igor Ribeiro de Assis <igor21@terra.com.br>
  * @version 1.0-beta
  * @access  public
  * @package Perfect Crypt
  */

class pcrypt
{
    /** Encryption Block Mode: ECB, CBC actually.
      *
      * @var    int the mode used 
      * @access private
      */
    var $blockmode = MODE_ECB;
    
    /** Key for Encryption
      *
      * @var    string the key used in encryption and decryption
      * @access public
      */
    var $key = null;

    /** IV - Initialization Vector String
      *
      * @var    string initialization vector for some modes (CBC)
      * @access public
      */
    var $iv  = "z4c8e7gh"; 
    
    /** Methods */
    
    /** Constructor of the class.
      * 
      * The constructor initialize some important vars and include the algorithm
      * file.
      *
      * @access public
      * @param  int $blockmode the blockmode to use
      * @param  string $cipher the algorithm used to crypt
      * @param  string $key the ley used to crypt
      * 
      * @return void
      */
    
    function __construct($blockmode = MODE_ECB, $cipher = 'BLOWFISH', $key = null)
    {
        // Include cipher_class file
        $cipher = strtolower($cipher);
        if (!file_exists($cipher.".php")) 
        {
            //$this->error();
        }
        include_once $cipher.".php";
        
        // Load cipher_class
        if (!class_exists("pcrypt_".$cipher))
        {
            $this->error("Class pcrypt_".$cipher." doesn't exists");
        }
        
        $class  = "pcrypt_".$cipher;
        $this->cipher = new $class($key);
        
        // Initialize Vars
        $this->blockmode = $blockmode;
        $this->key = $key;
    }
    
    /** Crypt data using the selected algorithm
      * 
      * This method encrypt data using the selected algorithm and mode:
      *    Algorithms: Blowfish
      *    Modes: ECB, CBC
      * For a description about algorithms and modes see: 
      * Applied Cryptography by Bruce Schneier
      *
      * @access public
      * @param  string $plain  the plain text to be encrypted
      * @return string $cipher the plain text encrypted
      */
    function encrypt($plain)
    {
        if (empty($plain))
        {
            $this->error("Empty Plain Text");
        }
        
        // Encrypt using the correct mode
        switch($this->blockmode) {
        case MODE_ECB:
            $cipher = $this->_ecb_encrypt($plain);
            break;
        
        case MODE_CBC:
            $cipher = $this->_cbc_encrypt($plain);
            break;

        default:
            $this->error("Invalid mode ".$this->blockmode);
        }
        
        return $cipher;
    }

    /** Decrypt using the selected algorithm
      *
      * This method decrypt data using the selected algorithm and mode.
      * TODO: Discover the algorithm and mode auto
      *
      * @access public
      * @param  string $cipher the crypted data to be decrypted
      * @return string $plain  the cipher text decrypted
      */
    function decrypt($cipher)
    {
        if (empty($cipher))
        {
            $this->error("Invalid Cipher Text");
        }
        
        // Decrypt with the correct mode        
        switch($this->blockmode) {
        case MODE_ECB:
            $plain = $this->_ecb_decrypt($cipher);
            break;
        
        case MODE_CBC:
            $plain = $this->_cbc_decrypt($cipher);
            break;

        default:
            $this->error("Invalid mode ".$this->blockmode);
        }
        
        return $plain;
    }
    
    /** Method to encrypt using ECB mode.
      * 
      * In ECB mode the blocks are encrypted independently 
      *
      * @access private
      * @param  string $plain  the plain text to be encrypted
      * @return string $cipher the plain text encrypted
      */
    function _ecb_encrypt($plain)
    {
        $blocksize = $this->cipher->blocksize;
        $plainsize = strlen($plain);
        $cipher    = '';
       
        for($i = 0;$i < $plainsize;$i = $i + $blocksize)
        {
            $block = substr($plain,$i,$blocksize); 
            
            if(strlen($block) < $blocksize)
            {
                // pad block with '\0'
                $block = str_pad($block,$blocksize,"\0",STR_PAD_LEFT);
            }
            $cipher .= $this->cipher->_encrypt($block);
        }
        
        return $cipher;
    }
    
    /** Method to decrypt using ECB mode.
      *
      * @access private
      * @param  string $cipher the cipher text
      * @return string $plain  the cipher text decrypted
      */
    function _ecb_decrypt($cipher)
    {
        $blocksize  = $this->cipher->blocksize;
        $ciphersize = strlen($cipher);
        $plain      = ''; 
        
        for($i = 0;$i < $ciphersize;$i = $i + $blocksize)
        {
            $block = substr($cipher,$i,$blocksize); 
            $block = $this->cipher->_decrypt($block);
            
            // Remove padded chars 
            while(substr($block,0,1) == "\0")
            {
                $block = substr($block,1);
            }
            $plain .= $block;
        }
        
        return $plain;
    }
    
    /** This method encrypt using CBC mode.
      *
      * In CBC mode each block is xored with the last. This function use $iv as
      * first block.
      *
      * @access private
      * @param  string $plain  the plain text to be decrypted
      * @return string $cipher the plain text encrypted
      */
    function _cbc_encrypt($plain)
    {
        $blocksize = $this->cipher->blocksize;
        $plainsize = strlen($plain);
        $cipher    = '';
        $lcipher   = $this->iv;
        
        // encrypt each block
        for($i = 0;$i < $plainsize;$i = $i + $blocksize)
        {
            $block = substr($plain,$i,$blocksize); 
            if(strlen($block) < $blocksize)
            {
                // pad block with '\0' 
                $block = str_pad($block,$blocksize,"\0",STR_PAD_LEFT);
            }
            // crypt the block xored with the last cipher block
            $lcipher = $this->cipher->_encrypt($block ^ $lcipher);
            $cipher .= $lcipher;
        }
        
        return $cipher;
    }
    
    /** This method decrypt using CBC.
      *
      * @access private
      * @param  string $cipher the cipher text
      * @return string $plain  the cipher text decrypted
      */
    function _cbc_decrypt($cipher)
    {
        // get the block size of the cipher
        $blocksize  = $this->cipher->blocksize;
        $ciphersize = strlen($cipher);
        $plain      = '';
        $lcipher    = $this->iv;
        
        for($i = 0;$i < $ciphersize;$i = $i + $blocksize)
        {
            $block   = substr($cipher,$i,$blocksize); 
            
            // xor the block with the last cipher block
            $dblock  = $lcipher ^ $this->cipher->_decrypt($block);
            $lcipher = $block;
            
            // Remove padded chars 
            while(substr($dblock,0,1) == "\0")
            {
                $dblock = substr($dblock,1);
            }
            $plain .= $dblock;
        }
        
        return $plain;
    }
    
    /**
      * A simple function for error handling.
      * 
      * TODO: Improve the error handling of the class 
      *
      * @access private
      * @param  string $message erro message
      * @return boolean true
      */
    function error($message)
    {
        //echo "Error: ".$message."<br>";   	

        return 1;
    }
}

?>
<?php

if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit();
}

function unsetcookies() {
	foreach (func_get_args() as $name) {
		if (!empty($name) && !empty($_COOKIE[$name])) {
			setcookie($name, '', time() - 3600);
			unset($_COOKIE[$name]);
		}
	}
}

if (!empty($_COOKIE['clearsettings'])) unsetcookies('domail', 'email', 'saveto', 'path', 'useproxy', 'proxy', 'proxyuser', 'proxypass', 'split', 'partSize', 'savesettings', 'clearsettings', 'premium_acc', 'premium_user', 'premium_pass');

if (!empty($_GET['savesettings']) && $_GET['savesettings'] == 'on') {
	$expiretime = time() + 800600;
	setcookie('savesettings', '1', $expiretime);

	if (!empty($_GET['domail']) && $_GET['domail'] == 'on' && !empty($_GET['email']) && checkmail($_GET['email'])) {
		setcookie('domail', '1', $expiretime);
		setcookie('email', $_GET['email'], $expiretime);
		if (!empty($_GET['split']) && $_GET['split'] == 'on') {
			setcookie('split', '1', $expiretime);
			if (!empty($_GET['partSize']) && is_numeric($_GET['partSize'])) setcookie('partSize', $_GET['partSize'], $expiretime);
			else unsetcookies('partSize');
			if (!empty($_GET['method']) && in_array($_GET['method'], array('tc', 'rfc'))) setcookie('method', $_GET['method'], $expiretime);
			else unsetcookies('method');
		} else unsetcookies('split', 'partSize', 'method');
	} else unsetcookies('domail', 'email', 'split', 'partSize', 'method');

	if ($options['download_dir_is_changeable'] && !empty($_GET['saveto']) && $_GET['saveto'] == 'on' && !empty($_GET['path'])) {
		setcookie('saveto', '1', $expiretime);
		setcookie('path', $_GET['path'], $expiretime);
	} else unsetcookies('saveto', 'path');

	if (!empty($_GET['useproxy']) && $_GET['useproxy'] == 'on' && !empty($_GET['proxy'])) {
		setcookie('useproxy', '1', $expiretime);
		if (strlen(strstr($_GET['proxy'], ':')) > 0) setcookie('proxy', $_GET['proxy'], $expiretime);
		else unsetcookies('proxy');
		if (!empty($_GET['proxyuser']) && !empty($_GET['proxypass'])) {
			setcookie('proxyuser', $_GET['proxyuser'], $expiretime);
			setcookie('proxypass', $_GET['proxypass'], $expiretime);
		} else unsetcookies('proxyuser', 'proxypass');
	} else unsetcookies('useproxy', 'proxy', 'proxyuser', 'proxypass');
	unset($expiretime);
}

?>
<?php
if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit;
}

if (!defined('CRLF')) define('CRLF', "\r\n");
if (!defined('FTP_AUTOASCII')) define('FTP_AUTOASCII', -1);
if (!defined('FTP_BINARY')) define('FTP_BINARY', 1);
if (!defined('FTP_ASCII')) define('FTP_ASCII', 0);
if (!defined('FTP_FORCE')) define('FTP_FORCE', true);
if (!defined('FTP_OS_Unix')) define('FTP_OS_Unix', 'u');
if (!defined('FTP_OS_Windows')) define('FTP_OS_Windows', 'w');
if (!defined('FTP_OS_Mac')) define('FTP_OS_Mac', 'm');

function getftpurl($host, $port, $url, $saveToFile = 0) {
	global $nn, $lastError, $FtpBytesTotal, $FtpBytesReceived, $FtpTimeStart, $FtpChunkSize, $options;

	$ftp = new ftp(FALSE, FALSE);
	$server = "$host:$port";
	if (empty($host) || empty($port) || !$ftp->SetServer($host, (int) $port)) {
		$ftp->quit();
		$lastError = sprintf(lang(79), $server);
		return FALSE;
	} else {
		if (!$ftp->connect()) {
			$ftp->quit();
			$lastError = sprintf(lang(79), $server);
			return FALSE;
		} else {
			if (!$ftp->login()) {
				$ftp->quit();
				$lastError = lang(80);
				return FALSE;
			} else {
				echo('<p>');
				printf(lang(81), $server);
				echo('<br />');
				//$ftp->Passive(FALSE);
				$tmp = explode("/", $url);
				$ftp_file = array_pop($tmp);
				$ftp_dir = implode('/', $tmp);
				$ftp->chdir($ftp_dir);
				$fileSize = $FtpBytesTotal = $ftp->filesize($ftp_file);
				$FtpChunkSize = ftpGetChunkSize($fileSize);

				if ($options['file_size_limit'] > 0) {
					if ($fileSize > $options['file_size_limit']*1024*1024) {
						$lastError = lang(336) . bytesToKbOrMbOrGb($options['file_size_limit'] * 1024 * 1024) . '.';
						return false;
					}
				}

				$FileName = str_replace(array_merge(range(chr(0), chr(31)), str_split("<>:\"/|?*\x5C\x7F")), '', basename(trim($saveToFile)));

				$extPos = strrpos($FileName, '.');
				$ext = ($extPos ? substr($FileName, $extPos) : '');
				if (is_array($options['forbidden_filetypes']) && in_array(strtolower($ext), array_map('strtolower', $options['forbidden_filetypes']))) {
					if ($options['forbidden_filetypes_block']) return html_error(sprintf(lang(82), $ext));
					if (empty($options['rename_these_filetypes_to'])) $options['rename_these_filetypes_to'] = '.xxx';
					else if (strpos($options['rename_these_filetypes_to'], '.') === false) $options['rename_these_filetypes_to'] = '.' . $options['rename_these_filetypes_to'];
					$FileName = substr_replace($FileName, $options['rename_these_filetypes_to'], $extPos);
				}

				if (!empty($options['rename_prefix'])) $FileName = $options['rename_prefix'] . '_' . $FileName;
				if (!empty($options['rename_suffix'])) $FileName = ($extPos > 0 ? substr($FileName, 0, $extPos) : $FileName) . '_' . $options['rename_suffix'] . $ext;
				if (!empty($options['rename_underscore'])) $FileName = str_replace(array(' ', '%20'), '_', $FileName);

				$saveToFile = dirname($saveToFile) . PATH_SPLITTER . $FileName;

				if (@file_exists($saveToFile) && $Resume['use'] !== TRUE) {
					if ($options['bw_save']) return html_error(lang(99) . ': ' . link_for_file($saveToFile));
					$FileName = time() . '_' . $FileName;
					$saveToFile = dirname($saveToFile) . PATH_SPLITTER . $FileName;
				}

				printf(lang(83), $FileName, bytesToKbOrMbOrGb($fileSize));
				echo "<br />";

				$FtpTimeStart = microtime(true);
				$FtpLastChunkTime = 0;
				require_once(TEMPLATE_DIR . '/transloadui.php');

				if ($ftp->get($ftp_file, $saveToFile)) {
					$ftp->quit();
					$time = microtime(true) - $FtpTimeStart;
					return array('time' => sec2time(round($time)),
						'speed' => @round($FtpBytesTotal / 1024 / ($time), 2),
						'received' => TRUE,
						'size' => bytesToKbOrMbOrGb($fileSize),
						'bytesReceived' => $FtpBytesReceived,
						'bytesTotal' => $FtpBytesTotal,
						'file' => $saveToFile,
						'name' => $FileName);
				}
				$ftp->quit();
				return FALSE;
			}
		}
	}
}

function updateFtpProgress($bytesReceived) {
	global $FtpBytesTotal, $FtpBytesReceived, $FtpTimeStart, $FtpLastChunkTime, $FtpChunkSize, $FtpLast, $FtpUpload, $FtpUploadBytesSent;
	if ($FtpUpload) {
		$FtpUploadBytesSent += $bytesReceived;
		$bytesReceived = $FtpUploadBytesSent;
	}
	$FtpBytesReceived = $bytesReceived;
	if ($bytesReceived > $FtpLast + $FtpChunkSize && (!$FtpLastChunkTime || !((microtime(true) - $FtpLastChunkTime) < 1))) {
		$time = microtime(true) - $FtpTimeStart;
		$chunkTime = $time - $FtpLastChunkTime;
		$FtpLastChunkTime = $time;
		if ($bytesReceived >= $FtpBytesTotal) $percent = 100;
		else $percent = @round($bytesReceived / $FtpBytesTotal * 100);
		$speed = @round((($bytesReceived - $FtpLast) / 1024) / $chunkTime, 2);
		echo "<script type='text/javascript'>pr($percent, '" . bytesToKbOrMbOrGb($bytesReceived) . "', $speed)</script>\r\n";
		flush();
		$FtpLast = $bytesReceived;
	}
}

function ftpGetChunkSize($fsize) {
	if ($fsize <= 0) return 4096;
	if ($fsize < 4096) return (int)$fsize;
	if ($fsize <= 1024 * 1024) return 4096;
	if ($fsize <= 1024 * 1024 * 10) return 4096 * 10;
	if ($fsize <= 1024 * 1024 * 40) return 4096 * 30;
	if ($fsize <= 1024 * 1024 * 80) return 4096 * 47;
	if ($fsize <= 1024 * 1024 * 120) return 4096 * 65;
	if ($fsize <= 1024 * 1024 * 150) return 4096 * 70;
	if ($fsize <= 1024 * 1024 * 200) return 4096 * 85;
	if ($fsize <= 1024 * 1024 * 250) return 4096 * 100;
	if ($fsize <= 1024 * 1024 * 300) return 4096 * 115;
	if ($fsize <= 1024 * 1024 * 400) return 4096 * 135;
	if ($fsize <= 1024 * 1024 * 500) return 4096 * 170;
	if ($fsize <= 1024 * 1024 * 1000) return 4096 * 200;
	return 4096 * 210;
}

class ftp_base {
	/* Public variables */

	var $LocalEcho = FALSE;
	var $Verbose = FALSE;
	var $OS_local;

	/* Private variables */
	var $_lastaction = NULL;
	var $_errors;
	var $_type;
	var $_umask;
	var $_timeout;
	var $_passive;
	var $_host;
	var $_fullhost;
	var $_port;
	var $_datahost;
	var $_dataport;
	var $_ftp_control_sock;
	var $_ftp_data_sock;
	var $_ftp_temp_sock;
	var $_login;
	var $_password;
	var $_connected;
	var $_ready;
	var $_code;
	var $_message;
	var $_can_restore;
	var $_port_available;
	var $_error_array = array();
	var $AuthorizedTransferMode = array(
		FTP_AUTOASCII,
		FTP_ASCII,
		FTP_BINARY
	);
	var $OS_FullName = array(
		FTP_OS_Unix => 'UNIX',
		FTP_OS_Windows => 'WINDOWS',
		FTP_OS_Mac => 'MACOS'
	);
	var $NewLineCode = array(
		FTP_OS_Unix => "\n",
		FTP_OS_Mac => "\r",
		FTP_OS_Windows => "\r\n"
	);
	var $AutoAsciiExt = array('ASP', 'BAT', 'C', 'CPP', 'CSV', 'H', 'HTM', 'HTML', 'SHTML', 'INI', 'LOG', 'PHP', 'PHP3', 'PL', 'PERL', 'SH', 'SQL', 'TXT');

	/* Constructor */

	function ftp_base($port_mode=FALSE) {
		$this->_port_available = ($port_mode == TRUE);
		$this->SendMSG('Staring FTP client class with' . ($this->_port_available ? '' : 'out') . ' PORT mode support');
		$this->_connected = FALSE;
		$this->_ready = FALSE;
		$this->_can_restore = FALSE;
		$this->_code = 0;
		$this->_message = "";
		$this->SetUmask(0022);
		$this->SetType(FTP_AUTOASCII);
		$this->SetTimeout(30);
		$this->Passive(!$this->_port_available);
		$this->_login = 'anonymous';
		$this->_password = 'anon@ftp.com';
		$this->OS_local = FTP_OS_Unix;
		if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') $this->OS_local = FTP_OS_Windows;
		elseif (strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') $this->OS_local = FTP_OS_Mac;
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!--       Public functions                                                                  -->
// <!-- --------------------------------------------------------------------------------------- -->
	function parselisting($list) {
//Parses i line like:"drwxrwx---  2 owner group 4096 Apr 23 14:57 text"
		if (preg_match('/^([-ld])([rwxst-]+)\s+(\d+)\s+([-_\w]+)\s+([-_\w]+)\s+(\d+)\s+(\w{3})\s+(\d+)\s+([\:\d]+)\s+(.+)$/i', $list, $ret)) {
			$v = array(
				'type' => ($ret[1] == '-' ? 'f' : $ret[1]),
				'perms' => 0,
				'inode' => $ret[3],
				'owner' => $ret[4],
				'group' => $ret[5],
				'size' => $ret[6],
				'date' => $ret[7] . ' ' . $ret[8] . ' ' . $ret[9],
				'name' => $ret[10]
			);
			if ($ret[2][0] == 'r') $v['perms'] |= 00400;
			if ($ret[2][1] == 'w') $v['perms'] |= 00200;
			if (in_array($ret[2][2], array('x', 's'))) $v['perms'] |= 00100;
			if ($ret[2][3] == 'r') $v['perms'] |= 00040;
			if ($ret[2][4] == 'w') $v['perms'] |= 00020;
			if (in_array($ret[2][5], array('x', 's'))) $v['perms'] |= 00010;
			if ($ret[2][6] == 'r') $v['perms'] |= 00004;
			if ($ret[2][7] == 'w') $v['perms'] |= 00002;
			if (in_array($ret[2][8], array('x', 's'))) $v['perms'] |= 00001;
			if (strtolower($ret[2][2]) == 's') $v['perms'] |= 04000;
			if (strtolower($ret[2][5]) == 's') $v['perms'] |= 02000;
			if (strtolower($ret[2][8]) == 't') $v['perms'] |= 01000;
		}
		return $v;
	}

	function SendMSG($message = '', $crlf=true) {
		if ($this->Verbose) {
			textarea($message . ($crlf ? CRLF : ''), 0, max(1, substr_count($message, "\n")));
			flush();
		}
		return TRUE;
	}

	function SetType($mode=FTP_AUTOASCII) {
		if (!in_array($mode, $this->AuthorizedTransferMode)) {
			$this->SendMSG('Wrong type');
			return FALSE;
		}
		$this->_type = $mode;
		$this->_data_prepare($mode);
		$this->SendMSG('Transfer type: ' . ($this->_type == FTP_BINARY ? 'binary' : ($this->_type == FTP_ASCII ? 'ASCII' : 'auto ASCII') ));
		return TRUE;
	}

	function Passive($pasv=NULL) {
		if (is_null($pasv)) $this->_passive = !$this->_passive;
		else $this->_passive = $pasv;
		if (!$this->_port_available and !$this->_passive) {
			$this->SendMSG('Only passive connections available!');
			$this->_passive = TRUE;
			return FALSE;
		}
		$this->SendMSG('Passive mode ' . ($this->_passive ? 'on' : 'off'));
		return TRUE;
	}

	function SetServer($host, $port=21, $reconnect=true) {
		if (!is_long($port)) {
			$this->verbose = true;
			$this->SendMSG('Incorrect port syntax');
			return FALSE;
		} else {
			$ip = @gethostbyname($host);
			$dns = @gethostbyaddr($host);
			if (!$ip) $ip = $host;
			if (!$dns) $dns = $host;
			if (ip2long($ip) === -1) {
				$this->SendMSG("Wrong host name/address \"$host\"");
				return FALSE;
			}
			$this->_host = $ip;
			$this->_fullhost = $dns;
			$this->_port = $port;
			$this->_dataport = $port - 1;
		}
		$this->SendMSG('Host "' . $this->_fullhost . '(' . $this->_host . '):' . $this->_port . '"');
		if ($reconnect) {
			if ($this->_connected) {
				$this->SendMSG('Reconnecting');
				if (!$this->quit(FTP_FORCE)) return FALSE;
				if (!$this->connect()) return FALSE;
			}
		}
		return TRUE;
	}

	function SetUmask($umask=0022) {
		$this->_umask = $umask;
		umask($this->_umask);
		$this->SendMSG('UMASK 0' . decoct($this->_umask));
		return TRUE;
	}

	function SetTimeout($timeout=30) {
		$this->_timeout = $timeout;
		$this->SendMSG('Timeout ' . $this->_timeout);
		if ($this->_connected) if (!$this->_settimeout($this->_ftp_control_sock)) return FALSE;
		return TRUE;
	}

	function connect() {
		$this->SendMsg('Local OS : ' . $this->OS_FullName[$this->OS_local]);
		if (!($this->_ftp_control_sock = $this->_connect($this->_host, $this->_port))) {
			$this->SendMSG('Error : Cannot connect to remote host "' . $this->_fullhost . ' :' . $this->_port . '"');
			return FALSE;
		}
		$this->SendMSG('Connected to remote host "' . $this->_fullhost . ':' . $this->_port . '". Waiting for greeting.');
		do {
			if (!$this->_readmsg()) return FALSE;
			if (!$this->_checkCode()) return FALSE;
			$this->_lastaction = time();
		} while ($this->_code < 200);
		$this->_ready = true;
		return TRUE;
	}

	function quit($force=false) {
		if ($this->_ready) {
			if (!$this->_exec('QUIT') and !$force) return FALSE;
			if (!$this->_checkCode() and !$force) return FALSE;
			$this->_ready = false;
			$this->SendMSG('Session finished');
		}
		$this->_quit();
		return TRUE;
	}

	function login($user = 'anonymous', $pass = 'anonymous@leechget.com') {
		global $AUTH;
		if (!empty($AUTH['user']) && !empty($AUTH['pass'])) {
			$this->_login = $AUTH['user'];
			$this->_password = $AUTH['pass'];
		} else {
			$this->_login = $user;
			$this->_password = $pass;
		}
		if (!$this->_exec('USER ' . $this->_login, 'login')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		if ($this->_code != 230) {
			if (!$this->_exec((($this->_code == 331) ? 'PASS ' : 'ACCT ') . $this->_password, 'login')) return FALSE;
			if (!$this->_checkCode()) return FALSE;
		}
		$this->SendMSG('Authentication succeeded');
		$this->_can_restore = $this->restore(100);
		$this->SendMSG('This server can' . ($this->_can_restore ? '' : '\'t') . ' resume broken uploads/downloads');
		return TRUE;
	}

	function pwd() {
		if (!$this->_exec('PWD', 'pwd')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return preg_replace('#^[0-9]{3} \"(.+)\" .+' . CRLF . '#', "\\1", $this->_message);
	}

	function cdup() {
		if (!$this->_exec('CDUP', 'cdup')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return true;
	}

	function chdir($pathname) {
		if (!$this->_exec("CWD $pathname", 'chdir')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function rmdir($pathname) {
		if (!$this->_exec("RMD $pathname", 'rmdir')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function mkdir($pathname) {
		if (!$this->_exec("MKD $pathname", 'mkdir')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function rename($from, $to) {
		if (!$this->_exec("RNFR $from", 'rename')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		if ($this->_code == 350) {
			if (!$this->_exec("RNTO $to", 'rename')) return FALSE;
			if (!$this->_checkCode()) return FALSE;
		} else return FALSE;
		return TRUE;
	}

	function filesize($pathname) {
		if (!$this->_exec("SIZE $pathname", 'filesize')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return preg_replace('#^[0-9]{3} ([0-9]+)' . CRLF . '#', "\\1", $this->_message);
	}

	function mdtm($pathname) {
		if (!$this->_exec("MDTM $pathname", 'mdtm')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		$mdtm = preg_replace('#^[0-9]{3} ([0-9]+)' . CRLF . '#', "\\1", $this->_message);
		$date = sscanf($mdtm, '%4d%2d%2d%2d%2d%2d');
		$timestamp = mktime($date[3], $date[4], $date[5], $date[1], $date[2], $date[0]);
		return $timestamp;
	}

	function systype() {
		if (!$this->_exec('SYST', 'systype')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		$DATA = explode(' ', $this->_message);
		return $DATA[1];
	}

	function delete($pathname) {
		if (!$this->_exec("DELE $pathname", 'delete')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function site($command, $fnction='site') {
		if (!$this->_exec("SITE $command", $fnction)) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function chmod($pathname, $mode) {
		if (!$this->site('CHMOD ' . decoct($mode) . " $pathname", 'chmod')) return FALSE;
		return TRUE;
	}

	function restore($from) {
		if (!$this->_exec("REST $from", 'restore')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return TRUE;
	}

	function features() {
		if (!$this->_exec('FEAT', 'features')) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return preg_split('/[' . CRLF . ']+/', preg_replace('#[0-9]{3}[ -][^' . CRLF . ']*' . CRLF . '#', '', $this->_message), -1, PREG_SPLIT_NO_EMPTY);
	}

	function rawlist($arg='', $pathname='') {
		return $this->_list(($arg ? ' ' . $arg : '') . ($pathname ? ' ' . $pathname : ''), 'LIST', 'rawlist');
	}

	function nlist($arg='', $pathname='') {
		return $this->_list(($arg ? ' ' . $arg : '') . ($pathname ? ' ' . $pathname : ''), 'NLST', 'nlist');
	}

	function is_exists($pathname) {
		if (!($remote_list = $this->nlist('-a', dirname($pathname)))) {
			$this->SendMSG('Error : Cannot get remote file list');
			return -1;
		}
		reset($remote_list);
		while (list(, $value) = each($remote_list)) {
			if ($value == basename($pathname)) {
				$this->SendMSG("Remote file $pathname exists");
				return TRUE;
			}
		}
		$this->SendMSG("Remote file $pathname does not exist");
		return FALSE;
	}

	function get($remotefile, $localfile=NULL) {
		if (is_null($localfile)) $localfile = $remotefile;
		if (@file_exists($localfile)) $this->SendMSG('Warning: local file will be overwritten');
		$fp = @fopen($localfile, 'wb');
		if (!$fp) {
			$this->PushError('get', "can't open local file", 'Cannot create "' . $localfile . '"');
			return FALSE;
		}
		$pi = pathinfo($remotefile);
		if ($this->_type == FTP_ASCII or ($this->_type == FTP_AUTOASCII and in_array(strtoupper($pi['extension']), $this->AutoAsciiExt))) $mode = FTP_ASCII;
		else $mode=FTP_BINARY;
		if (!$this->_data_prepare($mode)) {
			fclose($fp);
			return FALSE;
		}
		if ($this->_can_restore) $this->restore(0);
		if (!$this->_exec("RETR $remotefile", 'get')) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		if (!$this->_checkCode()) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		$out = $this->_data_read($mode, $fp);
		fclose($fp);
		$this->_data_close();
		if (!$this->_readmsg()) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return $out;
	}

	function get2($remotefile, $from) {
		$mode = FTP_BINARY;
		if (!$this->_data_prepare($mode)) {
			return FALSE;
		}
		if ($this->_can_restore)
			$this->restore($from);
		if (!$this->_exec("RETR $remotefile", 'get')) {
			$this->_data_close();
			return FALSE;
		}
		if (!$this->_checkCode()) {
			$this->_data_close();
			return FALSE;
		}
		$out = $this->_data_read2();
		$this->_data_close();
		if (!$this->_readmsg()) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return $out;
	}

	function put($localfile, $remotefile=NULL) {
		if (is_null($remotefile)) $remotefile = $localfile;
		if (!@file_exists($localfile)) {
			$this->PushError('put', "can't open local file", 'No such file or directory "' . $localfile . '"');
			return FALSE;
		}
		$fp = @fopen($localfile, 'rb');
		if (!$fp) {
			$this->PushError('put', "can't open local file", 'Cannot read file "' . $localfile . '"');
			return FALSE;
		}
		$pi = pathinfo($localfile);
		if ($this->_type == FTP_ASCII or ($this->_type == FTP_AUTOASCII and in_array(strtoupper($pi['extension']), $this->AutoAsciiExt))) $mode = FTP_ASCII;
		else $mode=FTP_BINARY;
		if (!$this->_data_prepare($mode)) {
			fclose($fp);
			return FALSE;
		}
		if ($this->_can_restore) $this->restore(0);
		if (!$this->_exec("STOR $remotefile", 'put')) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		if (!$this->_checkCode()) {
			$this->_data_close();
			fclose($fp);
			return FALSE;
		}
		$ret = $this->_data_write($mode, $fp);
		fclose($fp);
		$this->_data_close();
		if (!$this->_readmsg()) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		return $ret;
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!--       Private functions                                                                 -->
// <!-- --------------------------------------------------------------------------------------- -->
	function _checkCode() {
		return ($this->_code < 400 and $this->_code > 0);
	}

	function _list($arg='', $cmd='LIST', $fnction='_list') {
		if (!$this->_data_prepare()) return FALSE;
		if (!$this->_exec($cmd . $arg, $fnction)) {
			$this->_data_close();
			return FALSE;
		}
		if (!$this->_checkCode()) {
			$this->_data_close();
			return FALSE;
		}
		$out = $this->_data_read();
		$this->_data_close();
		if (!$this->_readmsg()) return FALSE;
		if (!$this->_checkCode()) return FALSE;
		if ($out === FALSE) return FALSE;
		$out = preg_split('/[' . CRLF . ']+/', $out, -1, PREG_SPLIT_NO_EMPTY);
		$this->SendMSG(implode($this->NewLineCode[$this->OS_local], $out));
		return $out;
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!-- Partie : gestion des erreurs                                                            -->
// <!-- --------------------------------------------------------------------------------------- -->
// Genere une erreur pour traitement externe a la classe
	function PushError($fctname, $msg, $desc=false) {
		$error = array();
		$error['time'] = time();
		$error['fctname'] = $fctname;
		$error['msg'] = $msg;
		$error['desc'] = $desc;
		if ($desc) $tmp = " ($desc)";
		else $tmp='';
		$this->SendMSG($fctname . ': ' . $msg . $tmp);
		return(array_push($this->_error_array, $error));
	}

// Recupere une erreur externe
	function PopError() {
		if (count($this->_error_array)) return(array_pop($this->_error_array));
		else return(false);
	}

}

$mod_sockets = TRUE;
if (!extension_loaded('sockets')) {
	$prefix = (PHP_SHLIB_SUFFIX == 'dll') ? 'php_' : '';
	if (!@dl($prefix . 'sockets.' . PHP_SHLIB_SUFFIX)) $mod_sockets = FALSE;
}

class ftp extends ftp_base {

	function ftp($verb=FALSE, $le=FALSE) {
		$this->LocalEcho = $le;
		$this->Verbose = $verb;
		$this->ftp_base();
	}

// <!-- --------------------------------------------------------------------------------------- -->
// <!--       Private functions                                                                 -->
// <!-- --------------------------------------------------------------------------------------- -->

	function _settimeout($sock) {
		echo '===';
		/* if(!@stream_set_timeout($sock, $this->_timeout)) {
		  $this->PushError('_settimeout','socket set send timeout');
		  $this->_quit();
		  return FALSE;
		  }
		 */return TRUE;
	}

	function _connect($host, $port) {
		$this->SendMSG('Creating socket');
		$sock = @fsockopen($host, $port, $errno, $errstr, $this->_timeout);
		if (!$sock) {
			$this->PushError('_connect', 'socket connect failed', $errstr . " (" . $errno . ")");
			return FALSE;
		}
		$this->_connected = true;
		return $sock;
	}

	function _readmsg($fnction='_readmsg') {
		if (!$this->_connected) {
			$this->PushError($fnction, 'Connect first');
			return FALSE;
		}
		$result = true;
		$this->_message = '';
		$this->_code = 0;
		$go = true;
		do {
			$tmp = @fgets($this->_ftp_control_sock, 512);
			if ($tmp === false) {
				$go = $result = false;
				$this->PushError($fnction, 'Read failed');
			} else {
				$this->_message.=$tmp;
//for($i=0; $i<strlen($this->_message); $i++)
//if(ord($this->_message[$i])<32) echo "#".ord($this->_message[$i]); else echo $this->_message[$i];
//echo CRLF;
				if (preg_match('/^([0-9]{3})(-(.*' . CRLF . ')+\\1)? [^' . CRLF . ']+' . CRLF . '$/', $this->_message, $regs)) $go = false;
			}
		} while ($go);
		if ($this->LocalEcho) textarea('GET < ' . rtrim($this->_message, CRLF), 0, max(1, substr_count($this->_message, "\n")));
		$this->_code = (int) $regs[1];
		return $result;
	}

	function _exec($cmd, $fnction='_exec') {
		if (!$this->_ready) {
			$this->PushError($fnction, 'Connect first');
			return FALSE;
		}
		if ($this->LocalEcho) textarea('PUT > '. $cmd, 0, max(1, substr_count($cmd, "\n")));
		$status = @fputs($this->_ftp_control_sock, $cmd . CRLF);
		if ($status === false) {
			$this->PushError($fnction, 'socket write failed');
			return FALSE;
		}
		$this->_lastaction = time();
		if (!$this->_readmsg($fnction)) return FALSE;
		return TRUE;
	}

	function _data_prepare($mode=FTP_ASCII) {
		if ($mode == FTP_BINARY) {
			if (!$this->_exec('TYPE I', '_data_prepare')) return FALSE;
		} else {
			if (!$this->_exec('TYPE A', '_data_prepare')) return FALSE;
		}
		if ($this->_passive) {
			if (!$this->_exec('PASV', 'pasv')) {
				$this->_data_close();
				return FALSE;
			}
			if (!$this->_checkCode()) {
				$this->_data_close();
				return FALSE;
			}
			$ip_port = explode(',', preg_replace('#^.+ \\(?([0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]{1,3},[0-9]+,[0-9]+)\\)?.*' . CRLF . '$#', "\\1", $this->_message));
			$this->_datahost = $ip_port[0] . '.' . $ip_port[1] . '.' . $ip_port[2] . '.' . $ip_port[3];
			$this->_dataport = (((int) $ip_port[4]) << 8) + ((int) $ip_port[5]);
			$this->SendMSG('Connecting to ' . $this->_datahost . ':' . $this->_dataport);
			$this->_ftp_data_sock = @fsockopen($this->_datahost, $this->_dataport, $errno, $errstr, $this->_timeout);
			if (!$this->_ftp_data_sock) {
				$this->PushError('_data_prepare', 'fsockopen fails', "$errstr ($errno)");
				$this->_data_close();
				return FALSE;
			} else $this->_ftp_data_sock;
		} else {
			$this->SendMSG('Only passive connections available!');
			return FALSE;
		}
		return TRUE;
	}

	function _data_read($mode=FTP_ASCII, $fp=NULL) {
		$NewLine = $this->NewLineCode[$this->OS_local];
		if (is_resource($fp)) $out = 0;
		else $out='';
		if (!$this->_passive) {
			$this->SendMSG('Only passive connections available!');
			return FALSE;
		}
		if ($mode != FTP_BINARY) {
			while (!feof($this->_ftp_data_sock)) {
				$tmp = fread($this->_ftp_data_sock, 4096);
				$line.=$tmp;
				if (!preg_match('/' . CRLF . '$/', $line)) continue;
				$line = rtrim($line, CRLF) . $NewLine;
				if (is_resource($fp)) {
					$out+=fwrite($fp, $line, strlen($line));
					updateFtpProgress($out);
				} else {
					$out.=$line;
				}
				$line = '';
			}
		} else {
			while (!feof($this->_ftp_data_sock)) {
				$block = fread($this->_ftp_data_sock, 4096);
				if (is_resource($fp)) {
					$out+=fwrite($fp, $block, strlen($block));
					updateFtpProgress($out);
				} else {
					$out.=$line;
				}
			}
		}
		return $out;
	}

	function _data_read2() {
		$NewLine = $this->NewLineCode[$this->OS_local];
		$out = 0;
		if (!$this->_passive) {
			$this->SendMSG('Only passive connections available!');
			return FALSE;
		}
		while (!feof($this->_ftp_data_sock)) {
			$block = fread($this->_ftp_data_sock, 4096);
			$out+=strlen($block);
			echo $block;
		}
		return $out;
	}

	function _data_write($mode=FTP_ASCII, $fp=NULL) {
		$NewLine = $this->NewLineCode[$this->OS_local];
		if (is_resource($fp)) $out = 0;
		else $out="";
		if (!$this->_passive) {
			$this->SendMSG('Only passive connections available!');
			return FALSE;
		}
		if (is_resource($fp)) {
			while (!feof($fp)) {
				$line = fgets($fp, 4096);
				if ($mode != FTP_BINARY) $line = rtrim($line, CRLF) . CRLF;
				do {
					if (($res = @fwrite($this->_ftp_data_sock, $line)) === FALSE) {
						$this->PushError('_data_write', "Can't write to socket");
						return FALSE;
					} else {
						updateFtpProgress(strlen($line));
					}
					$line = substr($line, $res);
				} while ($line != '');
			}
		} else {
			if ($mode != FTP_BINARY) $fp = rtrim($fp, $NewLine) . CRLF;
			do {
				if (($res = @fwrite($this->_ftp_data_sock, $fp)) === FALSE) {
					$this->PushError('_data_write', "Can't write to socket");
					return FALSE;
				} else {
					updateFtpProgress(strlen($fp));
				}
				$fp = substr($fp, $res);
			} while ($fp != '');
		}
		return TRUE;
	}

	function _data_close() {
		@fclose($this->_ftp_data_sock);
		$this->SendMSG('Disconnected data from remote host');
		return TRUE;
	}

	function _quit($force=FALSE) {
		if ($this->_connected or $force) {
			@fclose($this->_ftp_control_sock);
			$this->_connected = false;
			$this->SendMSG('Socket closed');
		}
	}

}
?>
<?php
if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit();
}

// Allow user-agent to be changed easily
if (!defined('rl_UserAgent')) define('rl_UserAgent', 'Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0');

/*
 * Pauses for countdown timer in file hosts
 * @param int The number of seconds to count down
 * @param string The text you want to display when counting down
 * @param string The text you want to display when count down is complete
 * @param bool
 * @return bool
 */
function insert_timer($countd, $caption = '', $timeouttext = '', $hide = false) {
	if (empty($countd) || !is_numeric($countd) || $countd < 0) return false;
	$countd = ceil($countd);

	$timerid = jstime();
	echo "\n<div id='timer_$timerid' align='center'>\n\t<br /><span class='caption'>$caption</span>&nbsp;&nbsp;\n\t<span id='timerlabel_$timerid' class='caption'></span>\n</div>\n<script type='text/javascript'>/* <![CDATA[ */\n\tvar count_$timerid = $countd;\n\tfunction timer_$timerid() {\n\t\tif (count_$timerid > 0) {\n\t\t\t$('#timerlabel_$timerid').html('". sprintf(lang(87), "' + count_$timerid + '") . "');\n\t\t\tcount_$timerid--;\n\t\t\tsetTimeout('timer_$timerid()', 1000);\n\t\t}";
	if ($hide) echo "else $('#timer_$timerid').css('display', 'none');";
	elseif (!empty($timeouttext)) echo "else $('#timer_$timerid').html('" . addslashes($timeouttext) . "');";
	echo "\n\t} timer_$timerid();\n/* ]]> */</script>";
	flush();
	sleep($countd);
	return true;
}

/*
 * Counter for those filehosts that displays mirror after countdown
 * @param int The number of seconds to count down
 * @param string Text you want to display above the counter
 * @param string The text you want to display when counting down
 * @param string The text you want to display when count down is complete
 */
function insert_new_timer($countd, $displaytext, $caption = '', $text = '') {
	if (!is_numeric($countd)) return html_error(lang(85));
	echo ('<div id="code"></div>');
	echo ('<div align="center">');
	echo ('<div id="dl"><h4>' . lang(86) . '</h4></div></div>');
	echo ('<script type="text/javascript">var c = ' . $countd . ';fc("' . $caption . '","' . $displaytext . '");</script>');
	if (!empty($text)) print $text;
	require (TEMPLATE_DIR . '/footer.php');
}

/*
 * Function to check if geturl function has completed successfully
 */
function is_page($lpage) {
	global $lastError;
	if (!$lpage) return html_error(lang(84) . "<br />$lastError");
}

function readCustomHeaders(&$referer) {
	$headers = array();
	if (!empty($referer)) {
		$tmp = array_map('trim', explode("\n", $referer));
		$referer = array_shift($tmp);
		if (count($tmp) > 0) {
			foreach (array_filter($tmp) as $tmp) {
				$tmp = array_map('trim', explode(':', $tmp, 2));
				// Avoid set an empty method header (key: '')
				if ($tmp[0] !== '' || $tmp[1] !== '') {
					// Key must be lowercase (for override default header)
					$headers[strtolower($tmp[0])] = $tmp[1];
				}
			}
		}
	}
	return $headers;
}

function headers2request(array $headers, $data = '') {
	if (empty($headers) || empty($headers[''])) return html_error('Empty headers array or Non HTTP method');
	$request = trim($headers['']) . "\r\n";
	unset($headers['']);
	foreach ($headers as $header => $value) {
		$header = strtolower($header);
		if ($header != 'connection' && $value !== '') {
			$request .= strtr(ucwords(strtr(trim($header), '-', ' ')), ' ', '-') . ': ' . trim($value) . "\r\n";
		}
	}
	$request .= "Connection: Close\r\n\r\n$data";
	return $request;
}

function geturl($host, $port, $url, $referer = 0, $cookie = 0, $post = 0, $saveToFile = 0, $proxy = 0, $pauth = 0, $auth = 0, $scheme = 'http', $resume_from = 0, $XMLRequest = 0) {
	global $nn, $lastError, $Resume, $bytesReceived, $fp, $fs, $force_name, $options, $sFilters;
	$scheme = strtolower($scheme) . '://';

	if (($post !== 0) && ($scheme == 'http://' || $scheme == 'https://')) {
		$method = 'POST';
		$postdata = is_array($post) ? formpostdata($post) : $post;
	} else {
		$method = 'GET';
		$postdata = '';
	}

	if (!empty($cookie)) {
		if (is_array($cookie)) $cookies = (count($cookie) > 0) ? CookiesToStr($cookie) : 0;
		else $cookies = trim($cookie);
	}

	if ($scheme == 'https://') {
		if (!extension_loaded('openssl')) return html_error('You need to install/enable PHP\'s OpenSSL extension to support downloading via HTTPS.');
		$scheme = 'ssl://';
		if ($port == 0 || $port == 80) $port = 443;
	} else if ($port == 0) $port = 80;

	if ($proxy) {
		list($proxyHost, $proxyPort) = explode(':', $proxy, 2);
		if ($scheme != 'ssl://') {
			$host = $host . ($port != 80 && $port != 443 ? ":$port" : '');
			$url = "$scheme$host$url";
		}
	}

	if ($scheme != 'ssl://') $scheme = '';

	$cHeaders = readCustomHeaders($referer);
	$request = array();
	$request[''] = $method . ' ' . str_replace(' ', '%20', $url) . ' HTTP/1.1';
	$request['host'] = $host;
	$request['user-agent'] = rl_UserAgent;
	$request['accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
	if (!$saveToFile) $request['accept-encoding'] = 'gzip, deflate';
	$request['accept-language'] = 'en-US,en;q=0.5';
	if (!empty($referer)) $request['referer'] = $referer;
	if (!empty($cookies)) $request['cookie'] = $cookies;
	$request['cache-control'] = $request['pragma'] = 'no-cache';
//	if (!empty($Resume['use']) && $Resume['use'] === TRUE) $request['range'] = 'bytes=' . $Resume['from'] . '-';
	if (!empty($auth)) $request['authorization'] = "Basic $auth";
	if (!empty($pauth) && !$scheme) $request['proxy-authorization'] = "Basic $pauth";
	if ($method == 'POST') {
		$request['content-type'] = 'application/x-www-form-urlencoded';
		$request['content-length'] = strlen($postdata);
	}
	if ($XMLRequest) $request['x-requested-with'] = 'XMLHttpRequest';

	$request = headers2request(array_merge($request, $cHeaders), $postdata);

	$errno = 0;
	$errstr = '';
	if ($scheme == 'ssl://') {
		$hosts = (!empty($proxyHost) ? $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
		if ($proxy) $url = "https://$host$url"; // For the 'connected to' message
	} else $hosts = (!empty($proxyHost) ? $scheme . $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
	$fp = @stream_socket_client($hosts, $errno, $errstr, 120, STREAM_CLIENT_CONNECT);

	if (!$fp) {
		if (!function_exists('stream_socket_client')) return html_error('[ERROR] stream_socket_client() is disabled.');
		$dis_host = !empty($proxyHost) ? $proxyHost : $host;
		$dis_port = !empty($proxyPort) ? $proxyPort : $port;
		return html_error(sprintf(lang(88), $dis_host, $dis_port));
	}

	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}

	stream_set_timeout($fp, 120);

	if ($saveToFile) {
		if ($proxy) echo '<p>' . sprintf(lang(89), $proxyHost, $proxyPort) . '<br />GET: <b>' . htmlspecialchars($url) . "</b>...<br />\n";
		else echo '<p>'.sprintf(lang(90), $host, $port).'</p>';
	}

	if ($scheme == 'ssl://' && $proxy) {
		$connRequest = array();
		$connRequest[''] = "CONNECT $host:$port HTTP/1.1";
		if (!empty($pauth)) $connRequest['proxy-authorization'] = "Basic $pauth";
		$connRequest['proxy-connection'] = 'Close';
		$connRequest = headers2request($connRequest);

		fwrite($fp, $connRequest);
		fflush($fp);

		$llen = 0;
		$header = '';
		do {
			$header .= fgets($fp, 16384);
			$len = strlen($header);
			if (!$header || $len == $llen) {
				$lastError = 'No response from proxy after CONNECT.';
				stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
				fclose($fp);
				return false;
			}
			$llen = $len;
		} while (strpos($header, $nn . $nn) === false);

		$status = intval(substr($header, 9, 3));
		if ($status != 200) {
			return html_error("Proxy returned $status after CONNECT.");
		}

		// Start TLS.
		if (!stream_socket_enable_crypto($fp, true, (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT') ? STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT : STREAM_CRYPTO_METHOD_TLS_CLIENT))) return html_error('TLS Startup Error.');
	}

	#########################################################################
	fwrite($fp, $request);
	fflush($fp);
	$timeStart = microtime(true);

	// Rewrote the get header function according to the proxy script
	// Also made sure it goes faster and I think 8192 is the best value for retrieving headers
	// Oops.. The previous function hooked up everything and now I'm returning it back to normal

	$llen = 0;
	$header = '';
	do {
		$header .= fgets($fp, 16384);
		$len = strlen($header);
		if (!$header || $len == $llen) {
			$lastError = lang(91);
			stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
			fclose($fp);
			return false;
		}
		$llen = $len;
	} while (strpos($header, $nn . $nn) === false);

	// Array for active stream filters
	$sFilters = array();
	if (stripos($header, "\nTransfer-Encoding: chunked") !== false && in_array('dechunk', stream_get_filters())) {
		// Add built-in dechunk filter
		$sFilters['dechunk'] = stream_filter_append($fp, 'dechunk', STREAM_FILTER_READ);
		if (!$sFilters['dechunk'] && $saveToFile) return html_error('Unknown error while initializing dechunk filter, cannot continue download.');
	}

	#########################################################################

	if ($saveToFile) {
		if (!isset($_GET['dis_plug']) || $_GET['dis_plug'] != 'on') {
			$cbhost = (strpos($host, ':') !== false) ? substr($host, 0, strpos($host, ':')) : $host; // Remove the port that may be added when it's using proxy
			$chkhost = preg_match('/^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$/', $cbhost) ? false : true;
			if (!empty($referer)) {
				$cbrefhost = (stripos($referer, 'www.') === 0) ? substr($referer, 4) : $referer;
				$cbrefhost = parse_url($cbrefhost, PHP_URL_HOST);
				$chkref = (empty($cbrefhost) || preg_match('/^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}$/', $cbrefhost)) ? false : (($chkhost && strtolower($cbhost) == strtolower($cbrefhost)) ? false : true);
			} else $chkref = false;
			$found = false;
			if ($chkhost || $chkref) foreach ($GLOBALS['host'] as $site => $file) {
				if ($chkhost && host_matches($site, $cbhost)) {
					$found = true;
					break;
				} elseif ($chkref && host_matches($site, $cbrefhost)) {
					$found = true;
					break;
				}
			}
			if ($found) {
				require_once(HOST_DIR . 'DownloadClass.php');
				require_once(HOST_DIR . "download/$file");
				$class = substr($file, 0, -4);
				$firstchar = substr($file, 0, 1);
				if ($firstchar > 0) $class = "d$class";
				if (class_exists($class) && method_exists($class, 'CheckBack')) { // is_callable(array($class , 'CheckBack'))
					$hostClass = new $class(false);
					$hostClass->CheckBack($header);
				}
			}
			unset($cbhost, $cbrefhost, $chkhost, $chkref, $found);
		}
		if (preg_match('/^HTTP\/1\.[0|1] (\d+) .*/', $header, $responsecode) && ($responsecode[1] == 404 || $responsecode[1] == 403)) {
			// Do some checking, please, at least tell them what error it was
			if ($responsecode [1] == 403) {
				$lastError = lang(92);
			} elseif ($responsecode [1] == 404) {
				$lastError = lang(93);
			} else {
				// Weird, it shouldn't come here...
				$lastError = lang(94);
			}
			return false;
		}
		//$bytesTotal = intval ( trim ( cut_str ( $header, "Content-Length:", "\n" ) ) );
		$bytesTotal = trim(cut_str($header, "\nContent-Length: ", "\n"));

		global $options;
		if ($options['file_size_limit'] > 0 && ($bytesTotal > ($options['file_size_limit'] * 1024 * 1024))) {
			$lastError = lang(336) . bytesToKbOrMbOrGb ($options['file_size_limit'] * 1024 * 1024) . '.';
			return false;
		}
		if (stripos($header, "\nLocation: ") !== false && preg_match('/\nLocation: ([^\r\n]+)/i', $header, $redir)) {
			$redirect = trim($redir[1]);
			$lastError = sprintf(lang(95), $redirect);
			return FALSE;
		}
		if (in_array(cut_str($header, "\nWWW-Authenticate: ", ' '), array('Basic', 'Digest'))) {
			$lastError = lang(96);
			return FALSE;
		}
		//$ContentType = trim (cut_str($header, "\nContent-Type:", "\n")); // Unused
		if (!empty($Resume['use']) && $Resume['use'] === TRUE && stripos($header, "\nContent-Range: ") === false) {
			$lastError = (stripos($header, '503 Limit Exceeded') !== false) ? lang(97) : lang(98);
			return FALSE;
		}

		if ($force_name) $FileName = $force_name;
		else {
			$ContentDisposition = cut_str($header, "\nContent-Disposition: ", "\n");
			if (!empty($ContentDisposition) && stripos($ContentDisposition, 'filename') !== false) {
				if (preg_match("@filename\*=UTF-8''((?:[\w\-\.]|%[0-F]{2})+)@i", $ContentDisposition, $fn)) $FileName = rawurldecode($fn[1]);
				else if (preg_match('@filename=(\")?([^\r\n]+?)(?(1)\"|[;\r\n])@i', $ContentDisposition, $fn)) {
					if (preg_match('@&(?:[A-Z]+|#[0-9]+|#X[0-9A-F]+);@i', $fn[2])) $fn[3] = html_entity_decode($fn[2], ENT_QUOTES, 'UTF-8');
					$FileName = (empty($fn[3]) ? $fn[2] : $fn[3]);
				}
				else $FileName = $saveToFile;
			} else $FileName = $saveToFile;
		}
		$FileName = str_replace(array_merge(range(chr(0), chr(31)), str_split("<>:\"/|?*\x5C\x7F")), '', basename(trim($FileName)));

		$extPos = strrpos($FileName, '.');
		$ext = ($extPos ? substr($FileName, $extPos) : '');
		if (is_array($options['forbidden_filetypes']) && in_array(strtolower($ext), array_map('strtolower', $options['forbidden_filetypes']))) {
			if ($options['forbidden_filetypes_block']) return html_error(sprintf(lang(82), $ext));
			if (empty($options['rename_these_filetypes_to'])) $options['rename_these_filetypes_to'] = '.xxx';
			else if (strpos($options['rename_these_filetypes_to'], '.') === false) $options['rename_these_filetypes_to'] = '.' . $options['rename_these_filetypes_to'];
			$FileName = substr_replace($FileName, $options['rename_these_filetypes_to'], $extPos);
		}

		if (!empty($options['rename_prefix'])) $FileName = $options['rename_prefix'] . '_' . $FileName;
		if (!empty($options['rename_suffix'])) $FileName = ($extPos > 0 ? substr($FileName, 0, $extPos) : $FileName) . '_' . $options['rename_suffix'] . $ext;
		if (!empty($options['rename_underscore'])) $FileName = str_replace(array(' ', '%20'), '_', $FileName);

		$saveToFile = dirname($saveToFile) . PATH_SPLITTER . $FileName;

		if (!empty($Resume['use']) && $Resume['use'] !== TRUE && @file_exists($saveToFile)) {
			if ($options['bw_save']) return html_error(lang(99) . ': ' . link_for_file($saveToFile));
			$FileName = time() . '_' . $FileName;
			$saveToFile = dirname($saveToFile) . PATH_SPLITTER . $FileName;
		}
		$fs = @fopen($saveToFile, ((!empty($Resume['use']) && $Resume['use'] === TRUE) ? 'ab' : 'wb'));
		if (!$fs) {
			$lastError = sprintf(lang(101), $FileName, dirname($saveToFile)) . '<br />' . lang(102) . '<br /><a href="javascript:location.reload();">' . lang(103) . '</a>';
			return FALSE;
		}

		flock($fs, LOCK_EX);
		if (!empty($Resume['use']) && $Resume['use'] === TRUE && stripos($header, "\nContent-Range: ") !== false) {
			list($temp, $Resume['range']) = explode(' ', trim(cut_str($header, "\nContent-Range: ", "\n")));
			list($Resume['range'], $fileSize) = explode('/', $Resume['range']);
			$fileSize = bytesToKbOrMbOrGb($fileSize);
		} else $fileSize = bytesToKbOrMbOrGb($bytesTotal);
		$chunkSize = GetChunkSize($bytesTotal);
		echo(lang(104) . " <b>$FileName</b>, " . lang(56) . " <b>$fileSize</b>...<br />");

		//$scriptStarted = false;
		require_once(TEMPLATE_DIR . '/transloadui.php');
		if (!empty($Resume['use']) && $Resume['use'] === TRUE) {
			$received = bytesToKbOrMbOrGb(filesize($saveToFile));
			$percent = round($Resume['from'] / ($bytesTotal + $Resume['from']) * 100, 2);
			echo "<script type='text/javascript'>pr('$percent', '$received', '0');</script>";
			//$scriptStarted = true;
			flush();
		} else $Resume = array('use' => false, 'from' => 0, 'range' => 0);

		$time = $last = $lastChunkTime = 0;
		do {
			$data = @fread($fp, $chunkSize);
			$datalen = strlen($data);
			if ($datalen <= 0) break;
			$bytesSaved = fwrite($fs, $data);
			if ($bytesSaved !== false && $datalen == $bytesSaved) {
				$bytesReceived += $bytesSaved;
			} else {
				$lastError = sprintf(lang(105), $FileName);
				// unlink($saveToFile);
				return false;
			}
			if ($bytesReceived >= $bytesTotal) $percent = 100;
			else $percent = @round(($bytesReceived + $Resume['from']) / ($bytesTotal + $Resume['from']) * 100, 2);
			if ($bytesReceived > $last + $chunkSize && (!$lastChunkTime || !(((microtime(true) - $timeStart) - $lastChunkTime) < 1))) {
				$received = bytesToKbOrMbOrGb($bytesReceived + $Resume['from']);
				$time = microtime(true) - $timeStart;
				$chunkTime = $time - $lastChunkTime;
				$chunkTime = ($chunkTime > 0) ? $chunkTime : 1;
				$lastChunkTime = $time;
				$speed = @round((($bytesReceived - $last) / 1024) / $chunkTime, 2);
				echo "<script type='text/javascript'>pr('$percent', '$received', '$speed');</script>";
				flush();
				$last = $bytesReceived;
			}
			if (!empty($bytesTotal) && ($bytesReceived + $chunkSize) > $bytesTotal) $chunkSize = max($bytesTotal - $bytesReceived, 4096);
		} while (!feof($fp));

		flock($fs, LOCK_UN);
		fclose($fs);
		if ($bytesReceived <= 0) {
			$lastError = lang(106);
			stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
			fclose($fp);
			return FALSE;
		}
	} else {
		$length = trim(cut_str($header, "\nContent-Length: ", "\n"));
		if (!$length || !is_numeric($length)) $length = -1;
		$page = stream_get_contents($fp, $length);
	}

	stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
	fclose($fp);
	if ($saveToFile) {
		return array('time' => sec2time(round($time)), 'speed' => @round($bytesTotal / 1024 / (microtime(true) - $timeStart), 2), 'received' => true, 'size' => $fileSize, 'bytesReceived' => ($bytesReceived + $Resume['from']), 'bytesTotal' => ($bytesTotal + $Resume ['from']), 'file' => $saveToFile, 'name' => $FileName);
	} else {
		if (empty($sFilters['dechunk']) && stripos($header, "\nTransfer-Encoding: chunked") !== false && function_exists('http_chunked_decode')) {
			$dechunked = http_chunked_decode($page);
			if ($dechunked !== false) $page = $dechunked;
			unset($dechunked);
		}
		if (stripos($header, "\nContent-Encoding: gzip") !== false) {
			$decompressed = gzinflate(substr($page, 10));
			if ($decompressed !== false) $page = $decompressed;
			unset($decompressed);
		} else if (stripos($header, "\nContent-Encoding: deflate") !== false) {
			$decompressed = gzinflate(in_array(substr($page, 0, 2), array("x\x01", "x\x9C", "x\xDA")) ? substr($page, 2) : $page);
			if ($decompressed !== false) $page = $decompressed;
			unset($decompressed);
		}
		$page = $header.$page;
		return $page;
	}
}

function cURL($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $opts = 0) {
	static $NSS, $ch, $lastProxy;
	if (empty($link) || !is_string($link)) return html_error(lang(24));
	if (!extension_loaded('curl') || !function_exists('curl_init') || !function_exists('curl_exec')) return html_error('cURL isn\'t enabled or cURL\'s functions are disabled');
	if (!empty($referer)) {
		$arr = array_map('trim', explode("\n", $referer));
		$referer = array_shift($arr);
		$header = array_filter($arr);
	} else $header = array();
	$link = str_replace(array(' ', "\r", "\n"), array('%20'), $link);
	$opt = array(CURLOPT_HEADER => 1, CURLOPT_SSL_VERIFYPEER => 0,
		CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_RETURNTRANSFER => 1,
		CURLOPT_FOLLOWLOCATION => 0, CURLOPT_FAILONERROR => 0,
		CURLOPT_FORBID_REUSE => 0, CURLOPT_FRESH_CONNECT => 0,
		CURLINFO_HEADER_OUT => 1, CURLOPT_URL => $link,
		CURLOPT_SSLVERSION => (defined('CURL_SSLVERSION_TLSv1') ? CURL_SSLVERSION_TLSv1 : 1),
		CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		CURLOPT_ENCODING => 'gzip, deflate', CURLOPT_USERAGENT => rl_UserAgent);

	// Fixes "Unknown cipher in list: TLSv1" on cURL with NSS
	if (!isset($NSS)) {
		$cV = curl_version();
		$NSS = (!empty($cV['ssl_version']) && strtoupper(substr($cV['ssl_version'], 0, 4)) == 'NSS/');
	}
	if (!$NSS) $opt[CURLOPT_SSL_CIPHER_LIST] = 'TLSv1';


	// Uncomment next line if do you have IPv6 problems
	// $opt[CURLOPT_IPRESOLVE] = CURL_IPRESOLVE_V4;

	$opt[CURLOPT_REFERER] = !empty($referer) ? $referer : false;
	$opt[CURLOPT_COOKIE] = !empty($cookie) ? (is_array($cookie) ? CookiesToStr($cookie) : trim($cookie)) : false;

	if (!empty($_GET['useproxy']) && !empty($_GET['proxy'])) {
		$opt[CURLOPT_HTTPPROXYTUNNEL] = strtolower(parse_url($link, PHP_URL_SCHEME) == 'https') ? true : false; // cURL https proxy support... Experimental.
		// $opt[CURLOPT_HTTPPROXYTUNNEL] = false; // Uncomment this line for disable https proxy over curl.
		$opt[CURLOPT_PROXY] = $_GET['proxy'];
		$opt[CURLOPT_PROXYUSERPWD] = (!empty($GLOBALS['pauth']) ? base64_decode($GLOBALS['pauth']) : false);
	} else $opt[CURLOPT_PROXY] = false;

	// Send more headers...
	$headers = array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language: en-US,en;q=0.5', 'Pragma: no-cache', 'Cache-Control: no-cache', 'Connection: Keep-Alive');
	if (empty($opt[CURLOPT_REFERER])) $headers[] = 'Referer:';
	if (empty($opt[CURLOPT_COOKIE])) $headers[] = 'Cookie:';
	if (!empty($opt[CURLOPT_PROXY]) && empty($opt[CURLOPT_PROXYUSERPWD])) $headers[] = 'Proxy-Authorization:';
	if (count($header) > 0) $headers = array_merge($headers, $header);
	$opt[CURLOPT_HTTPHEADER] = $headers;

	if ($post != '0') {
		$opt[CURLOPT_POST] = 1;
		$opt[CURLOPT_POSTFIELDS] = is_array($post) ? formpostdata($post) : $post;
	} else $opt[CURLOPT_HTTPGET] = 1;

	if ($auth) {
		$opt[CURLOPT_HTTPAUTH] = CURLAUTH_BASIC;
		$opt[CURLOPT_USERPWD] = base64_decode($auth);
	} else $opt[CURLOPT_HTTPAUTH] = false;

	$opt[CURLOPT_CONNECTTIMEOUT] = $opt[CURLOPT_TIMEOUT] = 120;
	if (is_array($opts) && count($opts) > 0) foreach ($opts as $O => $V) $opt[$O] = $V;

	if (!isset($lastProxy)) $lastProxy = $opt[CURLOPT_PROXY];
	if (!isset($ch)) $ch = curl_init();
	elseif ($lastProxy != $opt[CURLOPT_PROXY]) {
		// cURL seems that doesn't like switching proxies on a active resource, there is a bug about that @ https://bugs.php.net/bug.php?id=68211
		curl_close($ch);
		$ch = curl_init();
		$lastProxy = $opt[CURLOPT_PROXY];
	}

	foreach ($opt as $O => $V) curl_setopt($ch, $O, $V); // Using this instead of 'curl_setopt_array'

	$page = curl_exec($ch);
	$info = curl_getinfo($ch);
	$errz = curl_errno($ch);
	$errz2 = curl_error($ch);
	// curl_close($ch);

	if (substr($page, 9, 3) == '100' || !empty($opt[CURLOPT_PROXY])) $page = preg_replace("@^HTTP/1\.[01] \d{3}(?:\s[^\r\n]+)?\r\n\r\n(HTTP/1\.[01] \d+ [^\r\n]+)@i", "$1", $page, 1); // The "100 Continue" or "200 Connection established" can break some functions in plugins, lets remove it...
	if ($errz != 0) return html_error("[cURL:$errz] $errz2");

	return $page;
}

// This new function requires less line and actually reduces filesize :P
// Besides, using less globals means more variables available for us to use
function formpostdata($post=array()) {
	$postdata = '';
	foreach ($post as $k => $v) $postdata .= "$k=$v&";

	// Remove the last '&'
	$postdata = substr($postdata, 0, -1);
	return $postdata;
}

// function to convert an array of cookies into a string
function CookiesToStr($cookie=array()) {
	if (empty($cookie)) return '';
	$cookies = '';
	foreach ($cookie as $k => $v) $cookies .= "$k=$v; ";

	// Remove the last '; '
	$cookies = substr($cookies, 0, -2);
	return $cookies;
}

function GetCookies($content) {
	if (($hpos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, 0, $hpos); // We need only the headers
	if (empty($content) || stripos($content, "\nSet-Cookie: ") === false) return '';
	// The U option will make sure that it matches the first character
	// So that it won't grab other information about cookie such as expire, domain and etc
	preg_match_all('/\nSet-Cookie: (.*)(;|\r\n)/Ui', $content, $temp);
	$cookie = $temp[1];
	$cookie = implode('; ', $cookie);
	return $cookie;
}

/**
 * Function to get cookies & converted into array
 * @param string The content you want to get the cookie from
 * @param array Array of cookies to be updated [optional]
 * @param bool Options to remove "deleted" or expired cookies (usually it named as 'deleted') [optional]
 * @param mixed The default name for temporary cookie, values are accepted in an array [optional]
 */
function GetCookiesArr($content, $cookie=array(), $del=true, $dval=array('','deleted')) {
	if (!is_array($cookie)) $cookie = array();
	if (($hpos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, 0, $hpos); // We need only the headers
	if (empty($content) || stripos($content, "\nSet-Cookie: ") === false || !preg_match_all ('/\nSet-Cookie: ([^\r\n]+)/i', $content, $temp)) return $cookie;
	foreach ($temp[1] as $v) {
		if (strpos($v, ';') !== false) list($v, $p) = explode(';', $v, 2);
		else $p = false;
		$v = explode('=', $v, 2);
		$cookie[$v[0]] = $v[1];
		if ($del) {
			if (!is_array($dval)) $dval = array($dval);
			if (in_array($v[1], $dval)) unset($cookie[$v[0]]);
			elseif (!empty($p)) {
				if (stripos($p, 'Max-Age=') !== false && preg_match('/[ \;]?Max-Age=(-?\d+)/i', $p, $P) && (int)$P[1] < 1) unset($cookie[$v[0]]);
				elseif (stripos($p, 'expires=') !== false && preg_match('/[ \;]?expires=([a-zA-Z]{3}, \d{1,2} [a-zA-Z]{3} \d{4} \d{1,2}:\d{1,2}:\d{1,2} GMT)/i', $p, $P) && ($P = strtotime($P[1])) !== false && $P <= time()) unset($cookie[$v[0]]);
			}
		}
	}
	return $cookie;
}

/**
 * Function to convert a string of cookies into an array
 * @param string The existing string cookie value
 * @param array The existing array cookie value that we want to merged/updated [optional]
 * @param bool Options to remove temporary cookie (usually it named as 'deleted') [optional]
 * @param mixed The default name for temporary cookie, values are accepted in an array [optional]
 */
function StrToCookies($cookies, $cookie=array(), $del=true, $dval=array('','deleted')) {
	if (!is_array($cookie)) $cookie = array();
	$cookies = trim($cookies);
	if (empty($cookies)) return $cookie;
	foreach (array_filter(array_map('trim', explode(';', $cookies))) as $v) {
		$v = array_map('trim', explode('=', $v, 2));
		$cookie[$v[0]] = $v[1];
		if ($del) {
			if (!is_array($dval)) $dval = array($dval);
			if (in_array($v[1], $dval)) unset($cookie[$v[0]]);
		}
	}
	return $cookie;
}

function GetChunkSize($fsize) {
	if ($fsize <= 0) return 4096;
	if ($fsize < 4096) return intval($fsize);
	if ($fsize <= 1024 * 1024) return 4096;
	if ($fsize <= 1024 * 1024 * 10) return 4096 * 10;
	if ($fsize <= 1024 * 1024 * 40) return 4096 * 30;
	if ($fsize <= 1024 * 1024 * 80) return 4096 * 47;
	if ($fsize <= 1024 * 1024 * 120) return 4096 * 65;
	if ($fsize <= 1024 * 1024 * 150) return 4096 * 70;
	if ($fsize <= 1024 * 1024 * 200) return 4096 * 85;
	if ($fsize <= 1024 * 1024 * 250) return 4096 * 100;
	if ($fsize <= 1024 * 1024 * 300) return 4096 * 115;
	if ($fsize <= 1024 * 1024 * 400) return 4096 * 135;
	if ($fsize <= 1024 * 1024 * 500) return 4096 * 170;
	if ($fsize <= 1024 * 1024 * 1000) return 4096 * 200;
	return 4096 * 210;
}

function upfile($host, $port, $url, $referer, $cookie, $post, $file, $filename, $fieldname, $field2name = '', $proxy = 0, $pauth = 0, $upagent = 0, $scheme = 'http') {
	global $nn, $lastError, $fp, $fs;

	if (empty($upagent)) $upagent = rl_UserAgent;
	$scheme = strtolower("$scheme://");

	$bound = '--------' . md5(microtime());
	$saveToFile = 0;

	$postdata = '';
	if (!empty($post) && is_array($post)) foreach ($post as $key => $value) {
		$postdata .= '--' . $bound . $nn;
		$postdata .= "Content-Disposition: form-data; name=\"$key\"$nn$nn";
		$postdata .= $value . $nn;
	}

	$fieldname = $fieldname ? $fieldname : 'file' . md5($filename);

	if (!is_readable($file)) {
		$lastError = sprintf(lang(65), $file);
		return FALSE;
	}

	$fileSize = filesize($file);

	if (!empty($field2name)) {
		$postdata .= '--' . $bound . $nn;
		$postdata .= "Content-Disposition: form-data; name=\"$field2name\"; filename=\"\"$nn";
		$postdata .= "Content-Type: application/octet-stream$nn$nn";
	}

	$postdata .= '--' . $bound . $nn;
	$postdata .= "Content-Disposition: form-data; name=\"$fieldname\"; filename=\"$filename\"$nn";
	$postdata .= "Content-Type: application/octet-stream$nn$nn";

	if (!empty($cookie)) {
		if (is_array($cookie)) $cookies = (count($cookie) > 0) ? CookiesToStr($cookie) : 0;
		else $cookies = trim($cookie);
	}

	if ($scheme == 'https://') {
		if (!extension_loaded('openssl')) return html_error('You need to install/enable PHP\'s OpenSSL extension to support uploading via HTTPS.');
		$scheme = 'ssl://';
		if ($port == 0 || $port == 80) $port = 443;
	} else if ($port == 0) $port = 80;

	if (!empty($referer) && ($pos = strpos("\r\n", $referer)) !== 0) {
		$origin = parse_url($pos ? substr($referer, 0, $pos) : $referer);
		$origin = strtolower($origin['scheme']) . '://' . strtolower($origin['host']) . (!empty($origin['port']) && $origin['port'] != defport(array('scheme' => $origin['scheme'])) ? ':' . $origin['port'] : '');
	} else $origin = ($scheme == 'ssl://' ? 'https://' : $scheme) . $host . ($port != 80 && ($scheme != 'ssl://' || $port != 443) ? ':' . $port : '');

	if ($proxy) {
		list($proxyHost, $proxyPort) = explode(':', $proxy, 2);
		if ($scheme != 'ssl://') {
			$host = $host . ($port != 80 && $port != 443 ? ":$port" : '');
			$url = "$scheme$host$url";
		}
	}

	if ($scheme != 'ssl://') $scheme = '';

	$cHeaders = readCustomHeaders($referer);
	$request = array();
	$request[''] = 'POST ' . str_replace(' ', '%20', $url) . ' HTTP/1.1';
	$request['host'] = $host;
	$request['user-agent'] = $upagent;
	$request['accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
	$request['accept-encoding'] = 'gzip, deflate';
	$request['accept-language'] = 'en-US,en;q=0.5';
	if (!empty($referer)) $request['referer'] = $referer;
	if (!empty($cookies)) $request['cookie'] = $cookies;
	if (!empty($pauth) && !$scheme) $request['proxy-authorization'] = "Basic $pauth";
	$request['origin'] = $origin;
	$request['content-type'] = "multipart/form-data; boundary=$bound";
	$request['content-length'] = (strlen($postdata) + strlen($nn . "--" . $bound . "--" . $nn) + $fileSize);

	$request = headers2request(array_merge($request, $cHeaders), $postdata);

	$errno = 0;
	$errstr = '';
	if ($scheme == 'ssl://') {
		$hosts = (!empty($proxyHost) ? $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
		if ($proxy) $url = "https://$host$url"; // For the 'connected to' message
	} else $hosts = (!empty($proxyHost) ? $scheme . $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
	$fp = @stream_socket_client($hosts, $errno, $errstr, 120, STREAM_CLIENT_CONNECT);

	if (!$fp) {
		if (!function_exists('stream_socket_client')) return html_error('[ERROR] stream_socket_client() is disabled.');
		$dis_host = !empty($proxyHost) ? $proxyHost : $host;
		$dis_port = !empty($proxyPort) ? $proxyPort : $port;
		return html_error(sprintf(lang(88), $dis_host, $dis_port));
	}

	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}

	if ($proxy) echo '<p>' . sprintf(lang(89), $proxyHost, $proxyPort) . '<br />UPLOAD: <b>' . htmlspecialchars($url) . "</b>...<br />\n";
	else echo '<p>'.sprintf(lang(90), $host, $port).'</p>';

	if ($scheme == 'ssl://' && $proxy) {
		$connRequest = array();
		$connRequest[''] = "CONNECT $host:$port HTTP/1.1";
		if (!empty($pauth)) $connRequest['proxy-authorization'] = "Basic $pauth";
		$connRequest['proxy-connection'] = 'Close';
		$connRequest = headers2request($connRequest);

		fwrite($fp, $connRequest);
		fflush($fp);

		$llen = 0;
		$header = '';
		do {
			$header .= fgets($fp, 16384);
			$len = strlen($header);
			if (!$header || $len == $llen) {
				$lastError = 'No response from proxy after CONNECT.';
				stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
				fclose($fp);
				return false;
			}
			$llen = $len;
		} while (strpos($header, $nn . $nn) === false);

		$status = intval(substr($header, 9, 3));
		if ($status != 200) {
			return html_error("Proxy returned $status after CONNECT.");
		}

		// Start TLS.
		if (!stream_socket_enable_crypto($fp, true, (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT') ? STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT : STREAM_CRYPTO_METHOD_TLS_CLIENT))) return html_error('TLS Startup Error.');
	}

	echo(lang(104) . ' <b>' . htmlspecialchars($filename) . '</b>, ' . lang(56) . ' <b>' . bytesToKbOrMbOrGb($fileSize) . '</b>...<br />');
	$GLOBALS['id'] = md5(time() * rand(0, 10));
	require (TEMPLATE_DIR . '/uploadui.php');
	flush();

	fwrite($fp, $request);
	fflush($fp);
	$timeStart = microtime(true);
	$chunkSize = GetChunkSize($fileSize);

	$fs = fopen($file, 'r');

	$totalsend = $time = $lastChunkTime = 0;
	while (!feof($fs) && !$errno && !$errstr) {
		$data = fread($fs, $chunkSize);
		if ($data === false) {
			fclose($fs);
			fclose($fp);
			return html_error(lang(112));
		}

		$sendbyte = @fwrite($fp, $data);
		fflush($fp);

		if ($sendbyte === false || strlen($data) > $sendbyte) {
			fclose($fs);
			fclose($fp);
			return html_error(lang(113));
		}

		$totalsend += $sendbyte;

		$time = microtime(true) - $timeStart;
		$chunkTime = $time - $lastChunkTime;
		$chunkTime = $chunkTime ? $chunkTime : 1;
		$chunkTime = ($chunkTime > 0) ? $chunkTime : 1;
		$lastChunkTime = $time;
		$speed = round($sendbyte / 1024 / $chunkTime, 2);
		$percent = round($totalsend / $fileSize * 100, 2);
		echo "<script type='text/javascript'>pr('$percent', '" . bytesToKbOrMbOrGb($totalsend) . "', '$speed');</script>\n";
		flush();
	}

	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}
	fclose($fs);

	fwrite($fp, $nn . "--" . $bound . "--" . $nn);
	fflush($fp);

	$llen = 0;
	$header = '';
	do {
		$header .= fgets($fp, 16384);
		$len = strlen($header);
		if (!$header || $len == $llen) {
			$lastError = lang(91);
			stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
			fclose($fp);
			return false;
		}
		$llen = $len;
	} while (strpos($header, $nn . $nn) === false);

	// Array for active stream filters
	$sFilters = array();
	if (stripos($header, "\nTransfer-Encoding: chunked") !== false && in_array('dechunk', stream_get_filters())) $sFilters['dechunk'] = stream_filter_append($fp, 'dechunk', STREAM_FILTER_READ); // Add built-in dechunk filter

	$length = trim(cut_str($header, "\nContent-Length: ", "\n"));
	if (!$length || !is_numeric($length)) $length = -1;
	$page = stream_get_contents($fp, $length);

	stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
	fclose($fp);

	if (empty($sFilters['dechunk']) && stripos($header, "\nTransfer-Encoding: chunked") !== false && function_exists('http_chunked_decode')) {
		$dechunked = http_chunked_decode($page);
		if ($dechunked !== false) $page = $dechunked;
		unset($dechunked);
	}
	if (stripos($header, "\nContent-Encoding: gzip") !== false) {
		$decompressed = gzinflate(substr($page, 10));
		if ($decompressed !== false) $page = $decompressed;
		unset($decompressed);
	} else if (stripos($header, "\nContent-Encoding: deflate") !== false) {
		$decompressed = gzinflate(in_array(substr($page, 0, 2), array("x\x01", "x\x9C", "x\xDA")) ? substr($page, 2) : $page);
		if ($decompressed !== false) $page = $decompressed;
		unset($decompressed);
	}
	$page = $header.$page;
	return $page;
}

function putfile($host, $port, $url, $referer, $cookie, $file, $filename, $proxy = 0, $pauth = 0, $upagent = 0, $scheme = 'http') {
	global $nn, $lastError, $fp, $fs;

	if (empty($upagent)) $upagent = rl_UserAgent;
	$scheme = strtolower("$scheme://");

	if (!is_readable($file)) {
		$lastError = sprintf(lang(65), $file);
		return FALSE;
	}

	$fileSize = filesize($file);

	if (!empty($cookie)) {
		if (is_array($cookie)) $cookies = (count($cookie) > 0) ? CookiesToStr($cookie) : 0;
		else $cookies = trim($cookie);
	}

	if ($scheme == 'https://') {
		if (!extension_loaded('openssl')) return html_error('You need to install/enable PHP\'s OpenSSL extension to support uploading via HTTPS.');
		$scheme = 'ssl://';
		if ($port == 0 || $port == 80) $port = 443;
	} else if ($port == 0) $port = 80;

	if (!empty($referer) && ($pos = strpos("\r\n", $referer)) !== 0) {
		$origin = parse_url($pos ? substr($referer, 0, $pos) : $referer);
		$origin = strtolower($origin['scheme']) . '://' . strtolower($origin['host']) . (!empty($origin['port']) && $origin['port'] != defport(array('scheme' => $origin['scheme'])) ? ':' . $origin['port'] : '');
	} else $origin = ($scheme == 'ssl://' ? 'https://' : $scheme) . $host . ($port != 80 && ($scheme != 'ssl://' || $port != 443) ? ':' . $port : '');

	if ($proxy) {
		list($proxyHost, $proxyPort) = explode(':', $proxy, 2);
		if ($scheme != 'ssl://') {
			$host = $host . ($port != 80 && $port != 443 ? ":$port" : '');
			$url = "$scheme$host$url";
		}
	}

	if ($scheme != 'ssl://') $scheme = '';

	$cHeaders = readCustomHeaders($referer);
	$request = array();
	$request[''] = 'PUT ' . str_replace(' ', '%20', $url) . ' HTTP/1.1';
	$request['host'] = $host;
	$request['user-agent'] = $upagent;
	$request['accept'] = 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8';
	$request['accept-encoding'] = 'gzip, deflate';
	$request['accept-language'] = 'en-US,en;q=0.5';
	if (!empty($referer)) $request['referer'] = $referer;
	if (!empty($cookies)) $request['cookie'] = $cookies;
	if (!empty($pauth) && !$scheme) $request['proxy-authorization'] = "Basic $pauth";
	$request['origin'] = $origin;
	$request['content-disposition'] = 'attachment';
	$request['content-type'] = 'multipart/form-data';
	$request['x-file-name'] = $filename;
	$request['x-file-size'] = $request['content-length'] = $fileSize;

	$request = headers2request(array_merge($request, $cHeaders));

	$errno = 0;
	$errstr = '';
	if ($scheme == 'ssl://') {
		$hosts = (!empty($proxyHost) ? $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
		if ($proxy) $url = "https://$host$url"; // For the 'connected to' message
	} else $hosts = (!empty($proxyHost) ? $scheme . $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
	$fp = @stream_socket_client($hosts, $errno, $errstr, 120, STREAM_CLIENT_CONNECT);

	if (!$fp) {
		if (!function_exists('stream_socket_client')) return html_error('[ERROR] stream_socket_client() is disabled.');
		$dis_host = !empty($proxyHost) ? $proxyHost : $host;
		$dis_port = !empty($proxyPort) ? $proxyPort : $port;
		return html_error(sprintf(lang(88), $dis_host, $dis_port));
	}

	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}

	if ($proxy) echo '<p>' . sprintf(lang(89), $proxyHost, $proxyPort) . '<br />PUT: <b>' . htmlspecialchars($url) . "</b>...<br />\n";
	else echo '<p>'.sprintf(lang(90), $host, $port).'</p>';

	if ($scheme == 'ssl://' && $proxy) {
		$connRequest = array();
		$connRequest[''] = "CONNECT $host:$port HTTP/1.1";
		if (!empty($pauth)) $connRequest['proxy-authorization'] = "Basic $pauth";
		$connRequest['proxy-connection'] = 'Close';
		$connRequest = headers2request($connRequest);

		fwrite($fp, $connRequest);
		fflush($fp);

		$llen = 0;
		$header = '';
		do {
			$header .= fgets($fp, 16384);
			$len = strlen($header);
			if (!$header || $len == $llen) {
				$lastError = 'No response from proxy after CONNECT.';
				stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
				fclose($fp);
				return false;
			}
			$llen = $len;
		} while (strpos($header, $nn . $nn) === false);

		$status = intval(substr($header, 9, 3));
		if ($status != 200) {
			return html_error("Proxy returned $status after CONNECT.");
		}

		// Start TLS.
		if (!stream_socket_enable_crypto($fp, true, (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT') ? STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT | STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT : STREAM_CRYPTO_METHOD_TLS_CLIENT))) return html_error('TLS Startup Error.');
	}

	echo(lang(104) . ' <b>' . htmlspecialchars($filename) . '</b>, ' . lang(56) . ' <b>' . bytesToKbOrMbOrGb($fileSize) . '</b>...<br />');
	$GLOBALS['id'] = md5(time() * rand(0, 10));
	require (TEMPLATE_DIR . '/uploadui.php');
	flush();

	fwrite($fp, $request);
	fflush($fp);
	$timeStart = microtime(true);
	$chunkSize = GetChunkSize($fileSize);

	$fs = fopen($file, 'r');

	$totalsend = $time = $lastChunkTime = 0;
	while (!feof($fs) && !$errno && !$errstr) {
		$data = fread($fs, $chunkSize);
		if ($data === false) {
			fclose($fs);
			fclose($fp);
			return html_error(lang(112));
		}

		$sendbyte = @fwrite($fp, $data);
		fflush($fp);

		if ($sendbyte === false || strlen($data) > $sendbyte) {
			fclose($fs);
			fclose($fp);
			return html_error(lang(113));
		}

		$totalsend += $sendbyte;

		$time = microtime(true) - $timeStart;
		$chunkTime = $time - $lastChunkTime;
		$chunkTime = ($chunkTime > 0) ? $chunkTime : 1;
		$lastChunkTime = $time;
		$speed = round($sendbyte / 1024 / $chunkTime, 2);
		$percent = round($totalsend / $fileSize * 100, 2);
		echo "<script type='text/javascript'>pr('$percent', '" . bytesToKbOrMbOrGb($totalsend) . "', '$speed');</script>\n";
		flush();
	}

	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}
	fclose($fs);

	fflush($fp);

	$llen = 0;
	$header = '';
	do {
		$header .= fgets($fp, 16384);
		$len = strlen($header);
		if (!$header || $len == $llen) {
			$lastError = lang(91);
			stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
			fclose($fp);
			return false;
		}
		$llen = $len;
	} while (strpos($header, $nn . $nn) === false);

	// Array for active stream filters
	$sFilters = array();
	if (stripos($header, "\nTransfer-Encoding: chunked") !== false && in_array('dechunk', stream_get_filters())) $sFilters['dechunk'] = stream_filter_append($fp, 'dechunk', STREAM_FILTER_READ); // Add built-in dechunk filter

	$length = trim(cut_str($header, "\nContent-Length: ", "\n"));
	if (!$length || !is_numeric($length)) $length = -1;
	$page = stream_get_contents($fp, $length);

	stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
	fclose($fp);

	if (empty($sFilters['dechunk']) && stripos($header, "\nTransfer-Encoding: chunked") !== false && function_exists('http_chunked_decode')) {
		$dechunked = http_chunked_decode($page);
		if ($dechunked !== false) $page = $dechunked;
		unset($dechunked);
	}
	if (stripos($header, "\nContent-Encoding: gzip") !== false) {
		$decompressed = gzinflate(substr($page, 10));
		if ($decompressed !== false) $page = $decompressed;
		unset($decompressed);
	} else if (stripos($header, "\nContent-Encoding: deflate") !== false) {
		$decompressed = gzinflate(in_array(substr($page, 0, 2), array("x\x01", "x\x9C", "x\xDA")) ? substr($page, 2) : $page);
		if ($decompressed !== false) $page = $decompressed;
		unset($decompressed);
	}
	$page = $header.$page;
	return $page;
}
<?php
if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit ();
}

$LINK = trim(urldecode($_GET ["image"]));
$Url = parse_url($LINK);
$Referer = ($_GET ["referer"] ? trim(urldecode($_GET ["referer"])) : $LINK);
$Cookie = ($_GET ["cookie"] ? trim(urldecode($_GET ["cookie"])) : 0);
//die(print_r($Url));
$Image = geturl($Url ["host"], $Url ["port"] ? $Url ["port"] : 80, $Url ["path"] . ($Url ["query"] ? "?" . $Url ["query"] : ""), $Referer, $Cookie, 0, 0, $_GET ["proxy"], $pauth, $auth, $Url ["scheme"]);

if ($Image) {
    if (stristr($Image, "\n\n")) {
        $det = "\n\n";
    } elseif (stristr($Image, $nn . $nn)) {
        $det = $nn . $nn;
    }
    if ($det) {
        $Image = explode($det, $Image);
        $header = explode("\n", $Image [0]);
        foreach ($header as $value) {
            header($value);
        }
        echo $Image [1];
    }
}
?>
<html>
<head>
<title>RAPIDLEECH V2.2</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
<!--
@import url("../images/style.css");
-->
</style>
</head>
<body>
<center>
<img src="../images/logo_pm.gif" alt="RAPIDLEECH V2.2" />
<h1>403: RapidLeech -&gt; Forbidden</h1>
<hr />
You have reached this page in error, please use
your back button to return to RapidLeech.
</center>
</body>
</html>
// Frame Buster
if (top != self) {
	try {
		if (top.location.host != self.location.host) throw 1;
	} catch (err) {
		top.location.replace(self.location.protocol + '//' + self.location.host + self.location.pathname);
	}
}

function new_transload_window() {
	var tmp = (new Date()).getTime();
	$('form[name=transload]').attr('target', 'rapidleech_' + tmp);
	var options = 'width=700,height=320,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no';
	window.open('', 'rapidleech_' + tmp, options);
	window.setTimeout('$(\'form[name=transload]\').submit();', 200);
}

function table_filelist_refresh_headers() {
	if ($.browser.msie == true) {
		if ($('#table_filelist').parent().height() > 450) {
			$('#table_filelist').parent().height(450);
		}
		$('#table_filelist_h, #table_filelist_f').width($('#table_filelist').width());
		$('#table_filelist tr.flisttblhdr td').each(function (id) {
			$('#table_filelist_h tr.flisttblhdr td:eq(' + id + ')').html($(this).html().replace(/(<span .*?sorttable.*?>|<\/span>)/gi, ''));
			$('#table_filelist_h tr.flisttblhdr td:eq(' + id + '), #table_filelist_f tr.flisttblftr td:eq(' + id + ')').width($(this).width());
		});
	} else {
		$('#table_filelist_h, #table_filelist_f').css('width', $('#table_filelist').css('width'));
		$('#table_filelist tr.flisttblhdr td').each(function (id) {
			$('#table_filelist_h tr.flisttblhdr td:eq(' + id + ')').html($(this).html().replace(/(<span .*?sorttable.*?>|<\/span>)/gi, ''));
			$('#table_filelist_h tr.flisttblhdr td:eq(' + id + '), #table_filelist_f tr.flisttblftr td:eq(' + id + ')').css('width', $(this).css('width'));
		});
	}
}

function switchCell(m) {
	$('#tb1, #tb2, #tb3, #tb4').hide();
	$('#navcell1, #navcell2, #navcell3, #navcell4').removeClass('selected');
	$('#navcell' + m).addClass('selected');
	$('#tb' + m).fadeIn('slow');
	if (m == 3 && $('#table_filelist_h').length != 0) {
		table_filelist_refresh_headers();
	}
}

function getCookie(name) {
	var dc = document.cookie;
	var prefix = name + '=';
	var begin = dc.indexOf('; ' + prefix);
	if (begin == -1) {
		begin = dc.indexOf(prefix);
		if (begin != 0) {
			return null;
		}
	} else {
		begin += 2;
	}
	var end = document.cookie.indexOf(';', begin);
	if (end == -1) {
		end = dc.length;
	}
	return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
	if (getCookie(name)) {
		document.cookie = name + '=' + ((path) ? '; path=' + path : '') + ((domain) ? '; domain=' + domain : '') + '; expires=Thu, 01-Jan-70 00:00:01 GMT';
	}
}

function clearSettings() {
	clear('domail', 'email', 'saveto', 'path', 'useproxy', 'proxy', 'proxyuser', 'proxypass', 'split', 'partSize', 'savesettings', 'clearsettings', 'premium_acc', 'premium_user', 'premium_pass');
	$('#domail, #splitchkbox, #useproxy, #premium_acc, #saveto, #savesettings').prop('checked', false);
	$('#email, #proxyproxy, #proxyuser, #proxypass, #premium_user, #premium_pass').val('');
	$('#emailtd, #splittd, #methodtd, #proxy, #premiumblock, #path, #clearsettings').hide();
	document.cookie = 'clearsettings = 1;';
}

function clear() {
	for (var i = 0; i < arguments.length; i++) document.cookie = arguments[i] + ' = ; expires=Thu, 01-Jan-70 00:00:01 GMT';
}

//Match text
function flist_match() {
	var text, insensitive, text_regexp, e_to_click;
	text = $('#flist_match_search').val();
	if (text == '') {
		return false;
	}
	insensitive = $('#flist_match_ins').prop('checked');
	text = '*' + text + '*';
	while (text.search(/\*\*/g) != -1) {
		text = text.replace(/\*\*/g, '*');
	}
	text = text.replace(/\^|\$|\?|\+|\||\(|\{|\[|\\/g, '');
	text = text.replace(/\./g, '\\.');
	text = text.replace(/\*/g, '.*?');
	text_regexp = new RegExp(text, insensitive ? 'i' : '');
	$('#table_filelist :checked').prop('checked', false);
	$('#table_filelist :checkbox').each(function () {
		if ($(this).parent().next().children().html().match(text_regexp) !== null) {
			$(this).prop('checked', true);
		}
	});
	if ($('#table_filelist :checked').size() > 0) {
		e_to_click = ($('#file_list_checkbox_title_h').length != 0) ? $('#file_list_checkbox_title_h') : $('#file_list_checkbox_title');
		e_to_click.click();
		if ($('#file_list_checkbox_title').html().search('sorttable_sortrevind') == -1) {
			e_to_click.click();
		}
		$('#table_filelist').parent().animate({
			scrollTop: '0'
		});
	}
	return false;
}

function setCheckboxes(act) {
	elts = document.getElementsByName('files[]');
	var elts_cnt = (typeof (elts.length) != 'undefined') ? elts.length : 0;
	if (elts_cnt) {
		for (var i = 0; i < elts_cnt; i++) {
			elts[i].checked = (act == 1 || act == 0) ? act : (elts[i].checked ? 0 : 1);
		}
	}
}

function showAll() {
	if (getCookie('showAll') == 1) {
		clear('showAll');
		location.href = location.href.split('?', 1) + '?act=files';
	} else {
		document.cookie = 'showAll = 1;';
		location.href = location.href.split('?', 1) + '?act=files';
	}
}

function mail(str, field) {
	document.getElementById('mailPart.' + field).innerHTML = str;
	return true;
}

function setFtpParams() {
	setParam('host', 'port', 'login', 'password', 'dir');
	document.cookie = 'ftpParams=1';
	document.getElementById('hrefSetFtpParams').style.color = '#808080';
	document.getElementById('hrefDelFtpParams').style.color = '#0000FF';
}

function delFtpParams() {
	clear('host', 'port', 'login', 'password', 'dir', 'ftpParams');
	document.getElementById('hrefSetFtpParams').style.color = '#0000FF';
	document.getElementById('hrefDelFtpParams').style.color = '#808080';
}

function setParam() {
	for (var i = 0; i < arguments.length; i++) document.cookie = arguments[i] + '=' + document.getElementById(arguments[i]).value;
}

function changeStatus(file, size) {
	document.getElementById('status').innerHTML = 'Uploading File <b>' + file + '</b>, Size <b>' + size + '</b>...<br />';
}

function checkFile(id) {
	if (document.getElementById('files' + id).checked == true) document.getElementById('files' + id).checked = false;
	else document.getElementById('files' + id).checked = true;
	return false;
}

function openNotes() {
	var options = 'width=700,height=450,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,copyhistory=no';
	window.open('notes.php', 'open_window', options);
}

/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
//@ sourceMappingURL=jquery.min.map
*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);

function startLinkCheck() {
	// Post ajax
	$.ajax({
		type: 'POST',
		url: 'ajax.php?ajax=linkcheck',
		data: ({
			submit: 'Check Links',
			links: $('#links').val(),
			k: ($('#chk_k').prop('checked')) ? 1 : 0,
			d: ($('#chk_d').prop('checked')) ? 1 : 0
		}),
		beforeSend: function () {
			$('#linkchecker-results').hide();
			$('#loading').show();
			$('#linkchecker').addClass('linkchecker-load');
			$('#submit').prop('disabled', true);
		},
		success: function (data) {
			$('#linkchecker-results').html(data);
			$('#linkchecker-results').show();
		},
		complete: function () {
			$('#loading').hide();
			$('#linkchecker').removeClass('linkchecker-load');
			$('#linkchecker-results').show();
			$('#submit').prop('disabled', false);
		}
	});
	return false;
}

function fc(caption, displaytext) {
	if (c > 0) {
		document.getElementById("dl").innerHTML = caption + php_js_strings[87].replace('%1$s', c.toFixed(1));
		c = c - 0.5;
		setTimeout('fc(\'' + caption + '\',\'' + displaytext + '\')', 500);
	} else {
		document.getElementById('dl').style.display = 'none';
		document.getElementById('code').innerHTML = unescape(displaytext);
	}
}

// Javascript clock for server time
/**
 * Numbers < 10 should be presented with a zero in front
 */
function fixNumber(number) {
	return (number < 10) ? '0' + number : number;
}

/**
 * Fixed look for month
 */
function fixMonth(number) {
	number = number + 1;
	return (number < 10) ? '0' + number : number;
}

function getLocalDate(year, month, day, dateFormat) {
	if (dateFormat.length < 2) { // When not logged in there is no dateformat
		dateFormat = 'yyyy-mm-dd';
	}
	dateFormat = dateFormat.replace('yyyy', year);
	dateFormat = dateFormat.replace('mm', month);
	dateFormat = dateFormat.replace('dd', day);
	dateFormat = dateFormat.replace('d', day);
	dateFormat = dateFormat.replace('m', month);

	return dateFormat;
}

/**
 * Show online users and clock
 */
function runClock(timeDiff, dateFormat) {
	var now = new Date();

	var newTime;
	newTime = now.getTime() - timeDiff;
	now.setTime(newTime);

	var localDate = getLocalDate(now.getFullYear(), fixMonth(now.getMonth()), fixNumber(now.getDate()), dateFormat);

	document.getElementById('server').innerHTML = fixNumber(now.getHours()) + ':' + fixNumber(now.getMinutes()) + ':' + fixNumber(now.getSeconds());

	setTimeout('runClock(timeDiff,"' + dateFormat + '");', 1000);
}

/**
 * Calculates a time difference between client and server, to make js clock to run correctly
 */
function timeDiff(Year, Month, Day, Hour, Minute, Second, dateFormat) {
	var timeDifferense;
	var serverClock = new Date(Year, Month - 1, Day, Hour, Minute, Second);

	var clientClock = new Date();
	var serverSeconds;
	var clientSeconds;
	timeDiff = clientClock.getTime() - serverClock.getTime() - 3000;
	runClock(timeDiff, dateFormat);
}

function getthedate() {
	var mydate = new Date();
	var hours = mydate.getHours();
	var minutes = mydate.getMinutes();
	var seconds = mydate.getSeconds();
	var dn = 'AM';
	if (hours >= 12) dn = 'PM';
	if (hours > 12) hours = hours - 12;
	if (hours == 0) hours = 12;
	if (hours <= 9) hours = '0' + hours;
	if (minutes <= 9) minutes = '0' + minutes;
	if (seconds <= 9) seconds = '0' + seconds;

	var cdate = '<span class="cpu-clock-lt-text">' + php_js_strings[281] + ':</span> &nbsp;&nbsp;&nbsp;<span class="cpu-clock-lt-time">' + hours + ':' + minutes + ':' + seconds + ' ' + dn + '</span><br />';
	$('#clock').html(cdate);
	setTimeout('getthedate()', 1000);
}
<?php
if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit;
}
//Copyright Dman :p this has been coded by dman biatches!!!
//Optimized by zpikdum :D
//Moded by eqbal ;)
//Lets calulate the time required.
$time = explode(' ', microtime());
$time = $time[1] + $time[0];
$begintime = $time;
//User Enabled settings
$debug = 0; // change it to one to enable it.
//Override PHP's stardard time limit
set_time_limit(120);
$maxlinks = 300;
$lcver = 301;
if ($options['fgc'] != 1 && !extension_loaded('curl')) $options['fgc'] = 1;
//$options['fgc'] = 1;

//Lets use this as a function to visit the site.
function curl($link, $post = 0, $cookie = 0, $follow = 1, $refer = 0, $header = 1) {
	global $options, $debug;
	if ($follow && ($follow > 9 || $follow < 1)) $follow = 1;
	if ($post && is_array($post)) {
		$POST = '';
		foreach ($post as $k => $v) $POST .= "$k=$v&";
		$post = substr($POST, 0, -1);
		unset($POST);
	}
	if ($cookie && is_array($cookie)) {
		if (count($cookie) > 0) {
			$cookies = '';
			foreach ($cookie as $k => $v) $cookies .= "$k=$v; ";
			$cookie = substr($cookies, 0, -2);
			unset($cookies);
		} else $cookie = 0;
	}

	if($options['fgc'] == 1) {
		// Using file_get_contents.
		$opt = array(
			'method' => ($post != 0) ? 'POST' : 'GET',
			'content' => ($post != 0) ? $post : '',
			'max_redirects' => (!$follow) ? 1 : $follow + 1,
			'header' => "Accept-language: en-us;q=0.7,en;q=0.3\r\nAccept: text/html, application/xml;q=0.9, application/xhtml+xml, */*;q=0.1\r\n" .
			($refer ? "Referer: $refer\r\n" : "") .
			($cookie ? "Cookie: $cookie\r\n" : "") .
			"User-Agent: Opera/9.80 (Windows NT 6.1; U; en-US) Presto/2.10.289 Version/12.02\r\n"
		);

		$context = stream_context_create(array('http' => $opt));
		$page = @file_get_contents($link, false, $context);

		if ($header != 0) {
			$headers = implode("\r\n", $http_response_header);
			$page = $headers . "\r\n\r\n" . $page;
		}
	} else {
		// Using cURL.
		$ch = curl_init($link);
		curl_setopt($ch, CURLOPT_HEADER, $header);
		if($cookie) {
			curl_setopt($ch, CURLOPT_COOKIE, $cookie);
			curl_setopt($ch, CURLOPT_COOKIEJAR, "1");
			curl_setopt($ch, CURLOPT_COOKIEFILE, "1");
		}
		if($follow) {
			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
			curl_setopt($ch, CURLOPT_MAXREDIRS, $follow+1);
		}
		curl_setopt($ch, CURLOPT_USERAGENT, 'Opera/9.80 (Windows NT 6.1; U; en-US) Presto/2.10.289 Version/12.02');

		curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: text/html, application/xml;q=0.9, application/xhtml+xml, */*;q=0.1','Accept-Language: en-us;q=0.7,en;q=0.3'));
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
		if (!empty($refer)) {
			$arr = explode("\r\n", $refer);
			$header = array();
			if (count($arr) > 1) {
				$refer = $arr[0];
				unset($arr[0]);
				$header = array_filter(array_map('trim', $arr));
			}
			curl_setopt($ch, CURLOPT_REFERER, $refer);
			if (count($header) > 0) curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
		}
		if($post != '0') {
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
		}
		$page = curl_exec($ch);
		$errz = curl_errno($ch);
		$errz2 = curl_error($ch);
		$info = curl_getinfo($ch);
		curl_close($ch);
	}
	//if ($debug == 1 && !empty($_POST['debug'])){
	if ($debug == 1) {
		$debugtxt = "Request: $link\n";
		if ($refer) $debugtxt .= "Referer: $refer\n";
		if ($cookie) $debugtxt .= "Cookie: $cookie\n";
		if (isset($errz) && $errz != 0) $debugtxt .= "cURL($errz): $errz2\n";
		if ($post) $debugtxt .= 'POST: '.print_r($post, true)."\n";
		$debugtxt .= "\n" . $page;
		textarea($debugtxt, 170, 15);
	}
	return($page);
}


function check(&$link, $x, $regex, $szregex='', $pattern='', $replace='', $opt = array()) {
	if(!empty($pattern)) $link = preg_replace($pattern, $replace, $link);

	$cook = $ref = $bytes = $fixsize = $size = 0;
	$fol = $head = 1;
	if(!empty($opt)) {
		if (array_key_exists('bytes', $opt)) $bytes = ($opt['bytes']) ? 1 : 0;
		if (array_key_exists('fixsize', $opt)) {
			$fixsize = ($opt['fixsize']) ? 1 : 0;
			$fixsizeP = $fixsizeR = '';
			if ($fixsize && array_key_exists('fixsizeP', $opt)) {
				$fixsizeP = $opt['fixsizeP'];
				if (array_key_exists('fixsizeR', $opt)) $fixsizeR = $opt['fixsizeR'];
			}
		}
		if (array_key_exists('cookie', $opt) && $opt['cookie'] != false) $cookie = $opt['cookie'];
		if (array_key_exists('follow', $opt)) $fol = $opt['follow'];
		if (array_key_exists('referer', $opt) && $opt['referer'] != false) $ref = $opt['referer'];
		if (array_key_exists('header', $opt)) $head = ($opt['header']) ? 1 : 0;
	}

	$page = curl($link, 0, $cookie, $fol, $ref, $head);
	$link = htmlentities($link, ENT_QUOTES);

	if (($szregex !== true && preg_match('@'.$regex.'@i', $page)) || ($szregex === true && preg_match('@'.$regex.'@i', $page, $fz))) {
		if (!empty($fz) || (!empty($szregex) && preg_match('@'.$szregex.'@i', $page, $fz))) {
			if (!array_key_exists('size', $fz)) $fz['size'] = $fz[1];

			if ($bytes) $size = bytesToKbOrMbOrGb($fz['size']);
			else if ($fixsize) {
				if (!array_key_exists('XB', $fz)) $fz['XB'] = $fz[2];
				$fz['XB'] = str_replace(array('YTES', 'YTE'), '', strtoupper($fz['XB']));
				if (!empty($fixsizeP)) $fz['size'] = str_replace($fixsizeP, $fixsizeR, $fz['size']);
				$fz['size'] = str_replace(',', '.', $fz['size']);
				switch ($fz['XB']) { // KbOrMbOrGbToBytes :D
					case 'GB': $fz['size'] *= 1024;
					case 'MB': $fz['size'] *= 1024;
					case 'KB': $fz['size'] *= 1024;
				}
				$size = bytesToKbOrMbOrGb($fz['size']);
			} else {
				if (!array_key_exists('XB', $fz)) $fz['XB'] = strtoupper($fz[2]);
				$fz['size'] = str_replace(',', '.', $fz['size']);
				$size = $fz['size'].' '.$fz['XB'];
			}

			$size = explode(' ', $size);
			$size[0] = round($size[0], 2);
			$size = implode(' ', $size);
		}
		$chk = showlink($link, $size);
	} elseif (empty($page) || preg_match('@class="bott_p_access2?"@i', $page)) $chk = showlink($link, 0, 2);
	else $chk = showlink($link, 0, 0);

	return array($chk, $size);
}

function showlink($link, $size='', $chk=1, $title='') {
	global $x;
	switch ($chk) {
		case 1:
			$cl = 'g';
			$ret = "<a class='$cl' title='".lang(114)."' href='$link'><b>$link</b></a>";
			if (!$_POST['d']) $ret = "$x: ".lang(114).": $ret";
			if (!empty($size)) $ret .= " | <span title='".lang(56)."'>$size</span>";
			break;
		case 2:
			$cl = 'y';
			$ret = "<a class='$cl' title='".lang(115)."' href='$link'><b>$link</b></a>";
			if (!$_POST['d']) $ret = "$x: ".lang(115).": $ret";
			break;
		case 3:
			$cl = 'b';
			$ret = "<a class='$cl' title='".htmlentities($title, ENT_QUOTES)."' href='$link'><b>$link</b></a>";
			break;
		case 4:
			$cl = 'y';
			$ret = "<b>$link&nbsp;???</b>";
			break;
		default:
			$cl = 'r';
			$ret = "<a class='$cl' title='".lang(116)."' href='$link'><b>$link</b></a>";
			if (!$_POST['d']) $ret = "$x: ".lang(116).": $ret";
			break;
	}

	$ret = "<div class='$cl' style='text-align:left;'".(!empty($title)?" title='".htmlentities($title, ENT_QUOTES)."'":'').">$ret</div>\n";

	echo $ret;
	return $chk;
}

// Load /classes/http.php or paste the function?...
function GetCookiesArr($content, $cookie=array(), $del=true, $dval=array('','deleted')) {
	if (!is_array($cookie)) $cookie = array();
	if (($hpos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, 0, $hpos); // We need only the headers
	if (empty($content) || stripos($content, "\r\nSet-Cookie: ") === false || !preg_match_all ('/\r\nSet-Cookie: (.*)(;|\r\n)/U', $content, $temp)) return $cookie;
	foreach ($temp[1] as $v) {
		$v = explode('=', $v, 2);
		$cookie[$v[0]] = $v[1];
		if ($del) {
			if (!is_array($dval)) $dval = array($dval);
			if (in_array($v[1], $dval)) unset($cookie[$v[0]]);
		}
	}
	return $cookie;
}

function debug() {
	echo '<div style="text-align:left; margin:0 auto; width:450px;">';
	if ( !extension_loaded("curl") )
		echo lang(117)."<br />";
	else
		echo "<b>".lang(118)."</b><br />";
	if( PHP_VERSION < 5 ){
		echo lang(119)."<br />";
	}
	echo lang(120)."<br />";
	echo "</div>";
}
?>
<?php
if (! defined ( 'RAPIDLEECH' )) {
	require ('../deny.php');
	exit ();
}

function xmail($from, $to, $subj, $text, $filename, $partSize = FALSE, $method = FALSE) {
	global $un;
	$fileContents = read_file ( $filename );
	$fileSize = strlen ( $fileContents );
	
	if ($partSize != FALSE & $method == "tc") {
		$crc = strtoupper ( dechex ( crc32 ( $fileContents ) ) );
		$crc = str_repeat ( "0", 8 - strlen ( $crc ) ) . $crc;
	} else {
		$file = base64_encode ( $fileContents );
		$file = chunk_split ( $file );
		unset ( $fileContents );
	}
	
	if (! $file && ! $fileContents) {
		return FALSE;
	}
	
	printf(lang(121),basename ( $filename ));
	echo "...<br />";
	flush ();
	sleep ( 1 );
	for($i = 0; $i < strlen ( $subj ); $i ++) {
		$subzh .= "=" . strtoupper ( dechex ( ord ( substr ( $subj, $i, 1 ) ) ) );
	}
	
	$subj = "=?UTF-8?Q?" . $subzh . '?=';
	$un = strtoupper ( uniqid ( time () ) );
	$head = "From: " . $from . "\n" . "X-Mailer: PHP RapidLeech PlugMod\n" . "Reply-To: " . $from . "\n" . "Mime-Version: 1.0\n" . "Content-Type: multipart/mixed; boundary=\"----------" . $un . "\"\n\n";
	$zag = "------------" . $un . "\nContent-Type: text/plain; charset=UTF-8\n" . "Content-Transfer-Encoding: 8bit\n\n" . $text . "\n\n" . "------------" . $un . "\n" . "Content-Type: application/octet-stream; name=\"" . basename ( $filename ) . "\"\n" . "Content-Transfer-Encoding: base64\n" . "Content-Disposition: attachment; filename=\"" . basename ( $filename ) . "\"\n\n";
	echo '<span id="mailPart.' . md5 ( basename ( $filename ) ) . '"></span><br />';
	flush ();
	if ($partSize) {
		$partSize = round ( $partSize );
		if ($method == "rfc") {
			$multiHeadMain = "From: " . $from . "\n" . "X-Mailer: PHP RapidLeech PlugMod\n" . "Reply-To: " . $from . "\n" . "Mime-Version: 1.0\n" . "Content-Type: message/partial; ";
			$totalParts = ceil ( strlen ( $file ) / $partSize );
			
			if ($totalParts == 1) {
				echo lang(122)."...<br />";
				flush ();
				return mail ( $to, $subj, $zag . $file, $head ) ? TRUE : FALSE;
			}
			
			printf(lang(123),bytesToKbOrMbOrGb ( $partSize ));
			echo ", ".lang(124)." - RFC 2046...<br />";
			echo "Total Parts: <b>" . $totalParts . "</b><br />";
			$mailed = TRUE;
			echo('<script type="text/javascript">');
			for($i = 0; $i < $totalParts; $i ++) {
				$multiHead = $multiHeadMain . "id=\"" . $filename . "\"; number=" . ($i + 1) . "; total=" . $totalParts . "\n\n";
				if ($i == 0) {
					$multiHead = $multiHead . $head;
					$fileChunk = $zag . substr ( $file, 0, $partSize );
				} elseif ($i == $totalParts - 1) {
					$fileChunk = substr ( $file, $i * $partSize );
				} else {
					$fileChunk = substr ( $file, $i * $partSize, $partSize );
				}
				echo "mail('".sprintf(lang(125),($i + 1))."...', '" . md5 ( basename ( $filename ) ) . "');\r\n";
				flush ();
				$mailed = $mailed & mail ( $to, $subj, $fileChunk, $multiHead );
				if (! $mailed) {
					return false;
				}
			}
			echo('</script>');
		} elseif ($method == "tc") {
			$totalParts = ceil ( $fileSize / $partSize );
			
			if ($totalParts == 1) {
				echo lang(126)."...<br />";
				flush ();
				return mail ( $to, $subj, $zag . chunk_split ( base64_encode ( $fileContents ) ), $head ) ? TRUE : FALSE;
			}
			
			printf(lang(123),bytesToKbOrMbOrGb ( $partSize ));
			echo ", ".lang(124)." - Total Commander...<br />";
			echo "Total Parts: <b>" . $totalParts . "</b><br />";
			$mailed = TRUE;
			$fileTmp = $filename;
			while ( strpos ( $fileTmp, "." ) ) {
				$fileName .= substr ( $fileTmp, 0, strpos ( $fileTmp, "." ) + 1 );
				$fileTmp = substr ( $fileTmp, strpos ( $fileTmp, "." ) + 1 );
			}
			$fileName = substr ( $fileName, 0, - 1 );
			echo('<script type="text/javascript">');
			for($i = 0; $i < $totalParts; $i ++) {
				if ($i == 0) {
					$fileChunk = substr ( $fileContents, 0, $partSize );
					$addHeads = addAdditionalHeaders ( array ("msg" => $text . "\r\n" . "File " . basename ( $filename ) . " (ï¿½ï¿½ï¿½ï¿½ï¿½ " . ($i + 1) . " ï¿½ï¿½ " . $totalParts . ").", "file" => array ("filename" => $fileName . ".crc", "stream" => chunk_split ( base64_encode ( "filename=" . basename ( $filename ) . "\r\n" . "size=" . $fileSize . "\r\n" . "crc32=" . $crc . "\r\n" ) ) ) ) );
					$addHeads .= addAdditionalHeaders ( array ("file" => array ("filename" => $fileName . ".001", "stream" => chunk_split ( base64_encode ( $fileChunk ) ) ) ) );
				} elseif ($i == $totalParts - 1) {
					$fileChunk = substr ( $fileContents, $i * $partSize );
					$addHeads = addAdditionalHeaders ( array ("msg" => "File " . basename ( $filename ) . " (parts " . ($i + 1) . " from " . $totalParts . ").", "file" => array ("filename" => $fileName . "." . (strlen ( $i + 1 ) == 2 ? "0" . ($i + 1) : (strlen ( $i + 1 ) == 1 ? "00" . ($i + 1) : ($i + 1))), "stream" => chunk_split ( base64_encode ( $fileChunk ) ) ) ) );
				} else {
					$fileChunk = substr ( $fileContents, $i * $partSize, $partSize );
					$addHeads = addAdditionalHeaders ( array ("msg" => "File " . basename ( $filename ) . " (parts " . ($i + 1) . " from " . $totalParts . ").", "file" => array ("filename" => $fileName . "." . (strlen ( $i + 1 ) == 2 ? "0" . ($i + 1) : (strlen ( $i + 1 ) == 1 ? "00" . ($i + 1) : ($i + 1))), "stream" => chunk_split ( base64_encode ( $fileChunk ) ) ) ) );
				}
				echo "mail('".sprintf(lang(125),($i + 1))."...', '" . md5 ( basename ( $filename ) ) . "');\r\n";
				flush ();
				$mailed = $mailed & mail ( $to, $subj, $addHeads, $head );
				if (! $mailed) {
					return false;
				}
			}
			echo('</script>');
		}
	} else {
		return mail ( $to, $subj, $zag . $file, $head ) ? TRUE : FALSE;
	}
	
	return $mailed ? TRUE : FALSE;
}

function addAdditionalHeaders($head) {
	global $un;
	if ($head ["msg"]) {
		$ret = "------------" . $un . "\nContent-Type: text/plain; charset=UTF-8\n" . "Content-Transfer-Encoding: 8bit\n\n" . $head ["msg"] . "\n\n";
	}
	if ($head ["file"] ["filename"]) {
		$ret .= "------------" . $un . "\n" . "Content-Type: application/octet-stream; name=\"" . basename ( $head ["file"] ["filename"] ) . "\"\n" . "Content-Transfer-Encoding: base64\n" . "Content-Disposition: attachment; filename=\"" . basename ( $head ["file"] ["filename"] ) . "\"\n\n" . $head ["file"] ["stream"] . "\n\n";
	}
	return $ret;
}
?>
<?php
if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit;
}

// Load template functions
require_once(TEMPLATE_DIR . 'functions.php');

// Render the main screen
include(TEMPLATE_DIR.'header.php');
include(TEMPLATE_DIR.'main.php');
include(TEMPLATE_DIR.'footer.php');
?>
<?php
if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit;
}
$all_act_files_exist = false;
if (!empty($_GET['act']) && $_GET['act'] !== 'files') {
	if (!empty($options['disable_actions'])) echo lang(328).'<br /><br />';
	elseif ($_GET['act'] == 'list') $all_act_files_exist = true;
	elseif ((!is_array($_GET['files']) || count($_GET['files']) < 1) && (!is_array($_POST['files']) || count($_POST['files']) < 1)) echo lang(138).'<br /><br />';
	else {
		$all_act_files_exist = true;
		foreach($_GET['files'] as $v) {
			if (empty($list[$v])) {
				$file = '';
				$size_time = false;
			} else if (!is_file(($file = $list[$v]['name']))) {
				if ($options['2gb_fix'] && in_array($_GET['act'], array('delete', 'delete_go')) && file_exists($file) && !is_dir($file) && !is_link($file)) $size_time = file_data_size_time($file);
				else $size_time = false;
			} else $size_time = true;
			if ($size_time === false) {
				$all_act_files_exist = false;
				echo sprintf(lang(64),'<b>'.htmlentities($file).'</b>').'<br />';
				break;
			}
		}
	}
}
if ($all_act_files_exist) {
	switch($_GET['act']) {
		case 'upload' :
			if (!empty($options['disable_upload'])) break;
			require(CLASS_DIR . 'options/upload.php');
			upload();
			break;

		case 'delete' :
			if (!empty($options['disable_delete'])) break;
			require(CLASS_DIR . 'options/delete.php');
			delete();
			break;

		case 'delete_go' :
			if (!empty($options['disable_delete'])) break;
			require(CLASS_DIR . 'options/delete.php');
			delete_go();
			break;

		case 'mail' :
			if (!empty($options['disable_email'])) break;
			require(CLASS_DIR . 'options/mail.php');
			rl_mail();
			break;

		case 'mail_go' :
			if (!empty($options['disable_email'])) break;
			require(CLASS_DIR . 'options/mail.php');
			mail_go();
			break;

		case 'boxes' :
			if (!empty($options['disable_mass_email'])) break;
			require(CLASS_DIR . 'options/boxes.php');
			boxes();
			break;

		case 'boxes_go' :
			if (!empty($options['disable_mass_email'])) break;
			require(CLASS_DIR . 'options/boxes.php');
			boxes_go();
			break;

		case 'md5' :
			if (!empty($options['disable_hashing'])) break;
			require(CLASS_DIR . 'options/md5.php');
			rl_md5();
			break;

		case 'crc32' :
			if (!empty($options['disable_hashing'])) break;
			require(CLASS_DIR . 'options/crc32.php');
			rl_crc32();
			break;

		case 'sha1' :
			if (!empty($options['disable_hashing'])) break;
			require(CLASS_DIR . 'options/sha1.php');
			rl_sha1();
			break;

		case 'md5_change' :
			if (!empty($options['disable_md5_change'])) break;
			require(CLASS_DIR . 'options/md5change.php');
			md5_change();
			break;

		case 'md5_change_go' :
			if (!empty($options['disable_md5_change'])) break;
			require(CLASS_DIR . 'options/md5change.php');
			md5_change_go();
			break;

		case 'unzip' :
			if (!empty($options['disable_unzip'])) break;
			require(CLASS_DIR . 'options/unzip.php');
			unzip();
			break;

		case 'unzip_go' :
			if (!empty($options['disable_unzip'])) break;
			require(CLASS_DIR . 'options/unzip.php');
			unzip_go();
			break;

		case 'split' :
			if (!empty($options['disable_split'])) break;
			require(CLASS_DIR . 'options/split.php');
			rl_split();
			break;

		case 'split_go' :
			if (!empty($options['disable_split'])) break;
			require(CLASS_DIR . 'options/split.php');
			split_go();
			break;

		case 'merge' :
			if (!empty($options['disable_merge'])) break;
			require(CLASS_DIR . 'options/merge.php');
			merge();
			break;

		case 'merge_go' :
			if (!empty($options['disable_merge'])) break;
			require(CLASS_DIR . 'options/merge.php');
			merge_go();
			break;

		case 'rename' :
			if (!empty($options['disable_rename'])) break;
			require(CLASS_DIR . 'options/rename.php');
			rl_rename();
			break;

		case 'rename_go' :
			if (!empty($options['disable_rename'])) break;
			require(CLASS_DIR . 'options/rename.php');
			rename_go();
			break;

		//MassRename
		case 'mrename' :
			if (!empty($options['disable_mass_rename'])) break;
			require(CLASS_DIR . 'options/mrename.php');
			mrename();
			break;

		case 'mrename_go' :
			if (!empty($options['disable_mass_rename'])) break;
			require(CLASS_DIR . 'options/mrename.php');
			mrename_go();
			break;
		
		//end MassRename

		case 'ftp' :
			if (!empty($options['disable_ftp'])) break;
			require(CLASS_DIR . 'options/ftp.php');
			ftp();
			break;

		case 'ftp_go' :
			if (!empty($options['disable_ftp'])) break;
			require(CLASS_DIR . 'options/ftp.php');
			ftp_go();
			break;

		case 'unrar' :
			if (!empty($options['disable_unrar'])) break;
			require(CLASS_DIR . 'options/unrar.php');
			unrar();
			break;

		case 'unrar_go' :
			if (!empty($options['disable_unrar'])) break;
			require(CLASS_DIR . 'options/unrar.php');
			unrar_go();
			break;

		case 'rar' :
			if (!empty($options['disable_rar'])) break;
			require(CLASS_DIR . 'options/rar.php');
			rar();
			break;

		case 'rar_go' :
			if (!empty($options['disable_rar'])) break;
			require(CLASS_DIR . 'options/rar.php');
			rar_go();
			break;

		case 'zip' :
			if (!empty($options['disable_zip'])) break;
			require(CLASS_DIR . 'options/zip.php');
			zip();
			break;

		case 'zip_go' :
			if (!empty($options['disable_zip'])) break;
			require(CLASS_DIR . 'options/zip.php');
			zip_go();
			break;

		case 'pack' :
			if (!empty($options['disable_tar'])) break;
			require(CLASS_DIR . 'options/pack.php');
			rl_pack();
			break;

		case 'pack_go' :
			if (!empty($options['disable_tar'])) break;
			require(CLASS_DIR . 'options/pack.php');
			pack_go();
			break;

		case 'list':
			if (!empty($options['disable_list'])) break;
			require(CLASS_DIR . 'options/list.php');
			rl_list();
			break;
	}
}
?>
order deny,allow
deny from all
<?php
function boxes() {
	global $list, $options, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="boxes_go" />
<?php
	echo count ( $_GET ["files"] ) . " file" . (count ( $_GET ["files"] ) > 1 ? "s" : "") . ":<br />";
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [($_GET ["files"] [$i])];
?>
	<input type="hidden" name="files[]" value="<?php echo $_GET ["files"] [$i]; ?>" /> <b><?php echo basename ( $file ["name"] ); ?></b><?php echo $i == count ( $_GET ["files"] ) - 1 ? "." : ",&nbsp"; ?>
<?php
	}
?><br />
<br />
<table align="center">
	<tr>
		<td><?php echo lang(139); ?>:&nbsp;<textarea name="emails" cols="30" rows="8"><?php
	if ($_COOKIE ["email"])
		echo $_COOKIE ["email"];
		?></textarea>
		</td>
	<td><input type="submit" value="<?php echo lang(140); ?>" /></td>
	</tr>
	<tr>
		<td><input type="checkbox" name="del_ok"
			<?php if (!$options['disable_deleting']) echo 'checked="checked"'; ?> <?php if ($options['disable_deleting']) echo 'disabled="disabled"'; ?> />&nbsp;<?php echo lang(141); ?></td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr><td>
		<table>
			<tr>
				<td><input id="splitchkbox" type="checkbox" name="split"
					onclick="javascript:var displ=this.checked?'':'none';document.getElementById('methodtd2').style.display=displ;"
					<?php echo $_COOKIE ["split"] ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(142); ?></td>
				<td>&nbsp;</td>
				<td id="methodtd2"
					<?php echo $_COOKIE ["split"] ? '' : ' style="display: none;"'; ?>>
				<table>
					<tr>
						<td>Method:&nbsp;<select name="method">
							<option value="tc" <?php echo $_COOKIE ["method"] == "tc" ? ' selected="selected"' : ''; ?>>Total Commander</option>
							<option value="rfc" <?php echo $_COOKIE ["method"] == "rfc" ? ' selected="selected"' : ''; ?>>RFC 2046</option>
						</select></td>
					</tr>
					<tr>
						<td><?php echo lang(143); ?>:&nbsp;<input type="text" name="partSize" size="2"
							value="<?php echo ($_COOKIE ["partSize"] ? $_COOKIE ["partSize"] : 10); ?>" />&nbsp;MB
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
	</td></tr>
</table>
		</form>
<?php
}

function boxes_go() {
	global $list, $options, $fromaddr;
	require_once (CLASS_DIR . "mail.php");
	$_POST ["partSize"] = ((isset ( $_POST ["partSize"] ) & $_POST ["split"] == "on") ? $_POST ["partSize"] * 1024 * 1024 : FALSE);
	$v_mails = explode ( "\n", $_POST['emails'] );
	$v_min = count ( (count ( $_POST ["files"] ) < count ( $v_mails )) ? $_POST ["files"] : $v_mails );
	
	for($i = 0; $i < $v_min; $i ++) {
		$file = $list [$_POST ["files"] [$i]];
		$v_mail = trim ( $v_mails [$i] );
		if (! checkmail ( $v_mail )) {
			printf(lang(144),$v_mail);
			echo "<br /><br />";
		} elseif (file_exists ( $file ["name"] )) {
			if (xmail ( "$fromaddr", $v_mail, "File " . basename ( $file ["name"] ), "File: " . basename ( $file ["name"] ) . "\r\n" . "Link: " . $file ["link"] . ($file ["comment"] ? "\r\nComments: " . str_replace ( "\\r\\n", "\r\n", $file ["comment"] ) : ""), $file ["name"], $_POST ["partSize"], $_POST ["method"] )) {
				if ($_POST["del_ok"] && !$options['disable_deleting']) {
					if (@unlink ( $file ["name"] )) {
						$v_ads = " and deleted!";
						unset ( $list [$_POST ["files"] [$i]] );
					} else {
						$v_ads = ", but <b>not</b> deleted!</b>";
					}
					;
				} else
					$v_ads = " !";
				echo '<script type="text/javascript">'."mail('File <b>" . basename ( $file ["name"] ) . "</b> it is sent for the address <b>" . $v_mail . "</b>" . $v_ads . "', '" . md5 ( basename ( $file ["name"] ) ) . "');</script>\r\n<br />";
			} else {
				echo lang(12)."<br />";
			}
		} else {
			printf(lang(145),$file['name']);
			echo "<br /><br />";
		}
	}
	if (count ( $_POST ["files"] ) < count ( $v_mails )) {
		for($i = count ( $_POST ["files"] ); $i < count ( $v_mails ); $i ++) {
			$v_mail = trim ( $v_mails [$i] );
			echo "$v_mail.</b><br /><br />";
		}
		echo "</b><br />";
	}
	elseif (count ( $_POST ["files"] ) > count ( $v_mails )) {
		for($i = count ( $v_mails ); $i < count ( $_POST ["files"] ); $i ++) {
			$file = $list [$_POST ["files"] [$i]];
			if (file_exists ( $file ["name"] )) {
				echo $file ["name"] . "<br /><br />";
			} else {
				printf(lang(145),$file['name']);
				echo "<br /><br />";
			}
		}
		echo "<br />";
	}
	if ($_POST ["del_ok"]) {
		if (! updateListInFile ( $list )) {
			echo lang(146)."<br /><br />";
		}
	}
}
?>
<?php
function rl_crc32() {
	global $list;
?>
<table class="md5table" align="center" border="0" cellspacing="2" cellpadding="4">
	<tr>
		<th align="center"><?php echo lang(104); ?></th>
		<th align="center"><?php echo lang(56); ?></th>
		<th align="center">CRC32</th>
	</tr>
<?php
	foreach ($_GET['files'] as $v) {
		$file = empty($list[$v]) ? '' : $list[$v];
		if (!empty($file) && file_exists($file['name'])) {
		$name = basename($file['name']);
		$crc = strtoupper(hash_file('crc32b', $file['name']));
		if (preg_match("@[\(_\{]($crc)[\}_\)]@i", $name)) $tstyle = ' style="color: green" title="'.lang(391).'">';
		elseif (preg_match('@\[([a-fA-F0-9]{8})\]@', $name, $fcrc) || preg_match('@_([a-fA-F0-9]{8})_@', $name, $fcrc) || preg_match('@\(([a-fA-F0-9]{8})\)@', $name, $fcrc) || preg_match('@\{([a-fA-F0-9]{8})\}@', $name, $fcrc)) {
			$tstyle = ((!empty($fcrc[2]) || strtoupper($fcrc[1]) == $crc) ? ' style="color: green" title="'.lang(391).'">' : ' style="color: red" title="'.sprintf(lang(392),$fcrc[1]).'">');
		} else $tstyle = '>';
?>
	<tr>
		<td nowrap="nowrap">&nbsp;<b><?php echo htmlspecialchars($name); ?></b>&nbsp;</td>
		<td align="center">&nbsp;<?php echo $file['size']; ?>&nbsp;</td>
		<td nowrap="nowrap">&nbsp;<b<?php echo "$tstyle$crc" ?></b>&nbsp;</td>
	</tr>
<?php
		}
	}
	echo "</table>\n<br />";
}
?>
<?php
function delete() {
	global $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="delete_go" />
<?php
	echo lang(count($_GET['files']) > 1 ? 379 : 104).':';
	foreach ($_GET['files'] as $k => $v) {
		echo '<input type="hidden" name="files[]" value="'.$v.'" /><br />';
		echo '<b>'.htmlentities(basename($list[$v]['name'])).'</b>';
	}
?>
<br />
<?php echo lang(148); ?>?
<br />
<table>
	<tr>
		<td><input type="submit" name="yes" style="width: 33px; height: 23px"
			value="<?php echo lang(149); ?>" />
		</td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td><input type="submit" name="no" style="width: 33px; height: 23px"
			value="<?php echo lang(150); ?>" />
		</td>
	</tr>
</table>
</form>
<?php
}

function delete_go() {
	global $list, $PHP_SELF;
	if (isset($_POST["yes"])) {
		for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
			$file = $list [$_POST ["files"] [$i]];
			if (file_exists ( $file ["name"] )) {
				if (@unlink ( $file ["name"] )) {
					printf(lang(151),basename($file['name']));
					echo "<br />";
					unset ( $list [$_POST ["files"] [$i]] );
				} else {
					printf(lang(152),basename($file['name']));
					echo "<br />";
				}
			} else {
				unset ( $list [$_POST ["files"] [$i]] );
				printf(lang(145),basename($file['name']));
				echo "<br />";
			}
		}
		if (! updateListInFile ( $list )) {
			echo lang(146)."<br /><br />";
		}
	} else {
		echo('<script type="text/javascript">location.href="'.$PHP_SELF.'?act=files";</script>');
	}
}
?>
<?php
function ftp() {
	global $list, $options, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="ftp_go" />
<?php echo lang(104); ?>:
<?php
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [($_GET ["files"] [$i])];
?>
<input type="hidden" name="files[]" value="<?php echo $_GET ["files"] [$i]; ?>" /> <b><?php echo basename ( $file ["name"] ); ?></b><?php echo $i == count ( $_GET ["files"] ) - 1 ? "." : ",&nbsp;"; ?>
<?php
	}
?><br />
		<br />
		<table align="center" style="text-align: left;">
			<tr>
				<td>
				<table>
					<tr>
						<td><?php echo lang(153); ?>:</td>
						<td><input type="text" name="host" id="host" <?php echo @$_COOKIE ["host"] ? ' value="' . $_COOKIE ["host"] . '"' : ''; ?>
							size="23" /></td>
					</tr>
					<tr>
						<td><?php echo lang(154); ?>:</td>
						<td><input type="text" name="port" id="port" <?php echo @$_COOKIE ["port"] ? ' value="' . $_COOKIE ["port"] . '"' : ' value="21"'; ?>
							size="4" /></td>
					</tr>
					<tr>
						<td><?php echo lang(37); ?>:</td>
						<td><input type="text" name="login" id="login" <?php echo @$_COOKIE ["login"] ? ' value="' . $_COOKIE ["login"] . '"' : ''; ?>
							size="23" /></td>
					</tr>
					<tr>
						<td><?php echo lang(38); ?>:</td>
						<td><input type="password" name="password" id="password" <?php echo @$_COOKIE ["password"] ? ' value="' . $_COOKIE ["password"] . '"' : ''; ?>
							size="23" /></td>
					</tr>
					<tr>
						<td><?php echo lang(155); ?>:</td>
						<td><input type="text" name="dir" id="dir" <?php echo @$_COOKIE ["dir"] ? ' value="' . $_COOKIE ["dir"] . '"' : ' value="/"'; ?>
							size="23" /></td>
					</tr>
					<tr>
						<td><input type="checkbox" name="del_ok" <?php if ($options['disable_deleting']) echo 'disabled="disabled"'; ?> />&nbsp;<?php echo lang(156); ?></td>
					</tr>
				</table>
				</td>
				<td>&nbsp;</td>
				<td>
				<table>
					<tr align="center">
						<td><input type="submit" value="Upload" /></td>
					</tr>
					<tr align="center">
						<td><?php echo lang(33); ?></td>
					</tr>
					<tr align="center">
						<td><a href="javascript:setFtpParams();" id="hrefSetFtpParams"><?php echo lang(157); ?></a> | <a href="javascript:delFtpParams();" id="hrefDelFtpParams"><?php echo lang(158); ?></a></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</form>
<?php
}

function ftp_go() {
	global $list, $options, $FtpUpload, $FtpBytesTotal, $FtpChunkSize, $FtpTimeStart, $FtpUploadBytesSent, $FtpLastChunkTime, $FtpLast;
	require_once (CLASS_DIR . "ftp.php");
	$ftp = new ftp ( );
	if (! $ftp->SetServer ( $_POST ["host"], ( int ) $_POST ["port"] )) {
		$ftp->quit ();
		printf(lang(79),$_POST ["host"] . ":" . $_POST ["port"]);
		echo '<br /><a href="javascript:history.back(-1);">'.lang(78).'</a><br /><br />';
	} else {
		if (! $ftp->connect ()) {
			$ftp->quit ();
			echo "<br />";
			printf(lang(79),$_POST ["host"] . ":" . $_POST ["port"]);
			echo '<br /><a href="javascript:history.back(-1);">'.lang(78).'</a><br /><br />';
		} else {
			printf(lang(81),'ftp://'.$_POST['host'].':'.$_POST['port']);
			if (! $ftp->login ( $_POST ["login"], $_POST ["password"] )) {
				$ftp->quit ();
				echo "<br />";
				echo lang(80);
				echo '<br /><a href="javascript:history.back(-1);">'.lang(78).'</a><br /><br />';
			} else {
				//$ftp->Passive(FALSE);
				if (! $ftp->chdir ( $_POST ["dir"] )) {
					$ftp->quit ();
					echo "<br />";
					printf(lang(159),$_POST['dir']);
					echo '<br /><a href="javascript:history.back(-1);">'.lang(78).'</a><br /><br />';
				} else {
?>
<br />
				<div id="status"></div>
				<br />
				<table cellspacing="0" cellpadding="0">
					<tr>
						<td></td>
						<td>
						<div class="progressouter">
						<div style="width:298px">
							<div id="progress" class="ftpprogress"></div>
						</div>
						</div>
						</td>
						<td></td>
					</tr>
					<tr>
						<td align="left" id="received">0 KB</td>
						<td align="center" id="percent">0%</td>
						<td align="right" id="speed">0 KB/s</td>
					</tr>
				</table>
				<br />
				<script type="text/javascript">switchCell(3);</script>
<?php
					for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
						$file = $list [$_POST ["files"] [$i]];
						echo '<script type="text/javascript">pr(0,0,0);changeStatus('."'" . addslashes(basename ( $file ["name"] )) . "', '" . $file ["size"] . "');</script>";
						$FtpUpload = true;
						$FtpBytesTotal = filesize($file['name']);
						$FtpChunkSize = round($FtpBytesTotal/333);
						$FtpTimeStart = getmicrotime ();
						$FtpUploadBytesSent = $FtpLastChunkTime = $FtpLast = 0;
						if ($ftp->put ( $file ["name"], basename ( $file ["name"] ) )) {
							$time = round ( getmicrotime () - $FtpTimeStart );
							$speed = @round ( $FtpBytesTotal / 1024 / $time, 2 );
							echo '<script type="text/javascript">pr(100, '."'" . bytesToKbOrMbOrGb ( $FtpBytesTotal ) . "', " . $speed . ")</script>\r\n";
							flush ();

							if (@$_POST["del_ok"] && !$options['disable_deleting']) {
								if (@unlink ( $file ["name"] )) {
									unset ( $list [$_POST ["files"] [$i]] );
								}
							}

							printf(lang(160),'<a href="ftp://' . $_POST ["login"] . ':' . $_POST ["password"] . '@' . $_POST ["host"] . ':' . $_POST ["port"] . $_POST ["dir"] . (substr ($_POST ["dir"], - 1) != '/' ? '/' : '') . basename ( $file ["name"] ) . '"><b>' . basename ( $file ["name"] ) . '</b></a>');
							echo "<br />".lang(161).": <b>" . sec2time ( $time ) . "</b><br />".lang(162).": <b>" . $speed . " KB/s</b><br /><br />";
						} else {
							printf(lang(163),basename($file['name']));
							echo "<br />";
						}
					}
					$ftp->quit ();
				}
			}
		}
	}
}
?>
<?php

function rl_list() {
	if (empty($GLOBALS['list'])) return;

	if (empty($_GET['files']) || !($list = array_intersect_key($GLOBALS['list'], array_flip($_GET['files'])))) {
		$list = &$GLOBALS['list'];
	}

	// List
	echo "<table><tr><td>\n<table class='md5table'>";
	foreach ($list as $file) {
		if (file_exists($file['name'])) {
			echo '<tr><td>' . htmlspecialchars(basename($file['name'])) . "</td></tr>\n";
		}
	}
	echo "</table>\n</td><td>\n<table class='md5table'>\n";
	foreach ($list as $file) {
		if (file_exists($file['name'])) {
			echo '<tr><td>' . link_for_file($file['name'], true) . "</td></tr>\n";
		}
	}
	echo "</table>\n</td></tr></table>";

}
<?php
function rl_mail() {
	global $options, $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="mail_go" />
<?php echo lang(104); ?>:
<?php
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [($_GET ["files"] [$i])];
?>
                <input type="hidden" name="files[]" value="<?php echo $_GET ["files"] [$i]; ?>" /> <b><?php echo basename ( $file ["name"] ); ?></b><?php echo $i == count ( $_GET ["files"] ) - 1 ? "." : ",&nbsp"; ?>
<?php
	}
?><br />
<br />
<table align="center">
	<tr>
		<td><?php echo lang(164); ?>:&nbsp;<input type="text" name="email"
			value="<?php echo ($_COOKIE ["email"] ? $_COOKIE ["email"] : ""); ?>" />
		</td>
		<td><input type="submit" value="Send" /></td>
	</tr>
	<tr>
		<td><input type="checkbox" name="del_ok"<?php echo $options['disable_deleting'] ? ' disabled="disabled"' : ' checked="checked"';?> />&nbsp;<?php echo lang(165); ?></td>
	</tr>
	<tr>
		<td></td>
	</tr>
	<tr><td>
		<table>
			<tr>
				<td><input type="checkbox" name="split"
					onclick="javascript:var displ=this.checked?'':'none';document.getElementById('methodtd2').style.display=displ;"
					<?php echo $_COOKIE ["split"] ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(142); ?></td>
				<td>&nbsp;</td>
				<td id="methodtd2"<?php echo $_COOKIE ["split"] ? '' : ' style="display: none;"'; ?>>
				<table>
					<tr>
						<td><?php echo lang(124); ?>:&nbsp;<select name="method">
							<option value="tc"
								<?php echo $_COOKIE ["method"] == "tc" ? " selected" : ""; ?>>Total	Commander</option>
							<option value="rfc"
								<?php echo $_COOKIE ["method"] == "rfc" ? " selected" : ""; ?>>RFC 2046</option>
						</select></td>
					</tr>
					<tr>
						<td><?php echo lang(143); ?>:&nbsp;<input type="text" name="partSize" size="2"
							value="<?php echo $_COOKIE ["partSize"] ? $_COOKIE ["partSize"] : 10; ?>" />&nbsp;MB
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
  </td></tr>
</table>
</form>
<?php
}

function mail_go() {
	global $list, $options, $fromaddr;
	require_once (CLASS_DIR . "mail.php");
	if (! checkmail ( $_POST ["email"] )) {
		echo lang(166)."<br /><br />";
	} else {
		$_POST ["partSize"] = ((isset ( $_POST ["partSize"] ) & $_POST ["split"] == "on") ? $_POST ["partSize"] * 1024 * 1024 : FALSE);
		for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
			$file = $list [$_POST ["files"] [$i]];
			if (file_exists ( $file ["name"] )) {
				if (xmail ( "$fromaddr", $_POST ['email'], "File " . basename ( $file ["name"] ), "File: " . basename ( $file ["name"] ) . "\r\n" . "Link: " . $file ["link"] . ($file ["comment"] ? "\r\nComments: " . str_replace ( "\\r\\n", "\r\n", $file ["comment"] ) : ""), $file ["name"], $_POST ["partSize"], $_POST ["method"] )) {
					if ($_POST["del_ok"] && !$options['disable_deleting']) {
						if (@unlink ( $file ["name"] )) {
							$v_ads = " and deleted.";
							unset ( $list [$_POST ["files"] [$i]] );
						} else {
							$v_ads = ", but <b>not deleted!</b>";
						}
						;
					} else
						$v_ads = " !";
					echo '<script type="text/javascript">'."<!--\r\nmail('File <b>" . basename ( $file ["name"] ) . "</b> it is sent for the address <b>" . $_POST ["email"] . "</b>" . $v_ads . "', '" . md5 ( basename ( $file ["name"] ) ) . "');//-->\r\n</script>\r\n<br />";
				} else {
					echo lang(12)."<br />";
				}
			} else {
				printf(lang(145),$file['name']);
				echo "<br /><br />";
			}
		}
	}
}
?>
<?php
function rl_md5() {
	global $list;
?>
<table class="md5table" align="center" border="0" cellspacing="2" cellpadding="4">
	<tr>
		<th align="center"><?php echo lang(104); ?></th>
		<th align="center"><?php echo lang(56); ?></th>
		<th align="center">MD5</th>
	</tr>
<?php
	foreach ($_GET['files'] as $v) {
		$file = $list[$v];
		if (file_exists($file['name'])) {
?>
	<tr>
		<td nowrap="nowrap">&nbsp;<b><?php echo htmlentities(basename($file['name'])); ?></b></td>
		<td align="center">&nbsp;<?php echo $file['size']; ?>&nbsp;</td>
		<td nowrap="nowrap"><b>&nbsp;<?php echo md5_file($file['name'])?>&nbsp;</b></td>
	</tr>
<?php
		}
	}
	echo "</table>\n<br />";
}
?>
<?php
function md5_change() {
	global $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="md5_change_go" />
<?php
	echo lang(count($_GET['files']) > 1 ? 379 : 104).':';
	foreach ($_GET['files'] as $k => $v) {
		echo '<input type="hidden" name="files[]" value="'.$v.'" /><br />';
		echo '<b>'.htmlentities(basename($list[$v]['name'])).'</b>';
	}
	echo '<br />'.lang(380);
?>
<br />
<table>
	<tr>
		<td><input type="submit" name="yes" style="width: 33px; height: 23px" value="<?php echo lang(149); ?>" /></td>
		<td>&nbsp;&nbsp;&nbsp;</td>
		<td><input type="submit" name="no" style="width: 33px; height: 23px" value="<?php echo lang(150); ?>" /></td>
	</tr>
</table>
</form>
<?php
}

function md5_change_go() {
	global $list, $PHP_SELF;
	if (isset($_POST['yes'])) {
		foreach ($_POST['files'] as $k => $v) {
			$name = $list[$v]['name'];
			$html_name = htmlentities(basename($name));
			if (file_exists($name)) {
				if (@write_file($name, chr(0), 0)) {
					clearstatcache();
					printf(lang(381), $html_name);
					unset($list[$v]);
					$time = filemtime($name); while (isset($list[$time])) { $time++; }
					$list[$time] = array('name' => $name, "size" => bytesToKbOrMbOrGb(filesize($name)), "date" => $time);
				}
				else { printf(lang(382), $html_name); }
			}
			else { printf(lang(145), $html_name); }
			echo '<br />';
		}
		if (!updateListInFile($list)) { echo lang(146)."<br /><br />"; }
	}
	else { echo('<script type="text/javascript">location.href="'.$PHP_SELF.'?act=files";</script>'); }
}
?>
<?php
function merge() {
	global $options, $list, $PHP_SELF;
	if (count($_GET["files"]) !== 1) {
		echo lang(167)."<br /><br />";
	}
	else {
		$file = $list [$_GET ["files"] [0]];
		if (substr ( $file ["name"], - 4 ) == '.001' && is_file ( substr ( $file ["name"], 0, - 4 ) . '.crc' )) {
			echo lang(168)."<br /><br />";
		} elseif (substr ( $file ["name"], - 4 ) !== '.crc' && substr ( $file ["name"], - 4 ) !== '.001') {
			echo lang(169)."<br /><br />";
		} else {
			echo lang(306)." <b>".basename(substr($file["name"], 0, -4))."</b><br /><br />";
			$usingcrcfile = (substr ( $file ["name"], - 4 ) === '.001') ? false : true;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="files[0]" value="<?php echo $_GET ["files"] [0]; ?>" />
<table>
<?php
			if ($usingcrcfile) {
?>
<tr>
<td align="left"><input type="checkbox" name="crc_check" value="1" checked="checked" onclick="javascript:var displ=this.checked?'inline':'none';document.getElementById('crc_check_mode').style.display=displ;" />&nbsp;<?php echo lang(170); ?><br />
			<span id="crc_check_mode"><?php echo lang(171); ?>:<br />
<?php
				if (function_exists ( 'hash_file' )) {
?><input type="radio" name="crc_mode" value="hash_file" checked="checked" />&nbsp;<?php echo lang(172); ?><br />
<?php } ?>
<input type="radio" name="crc_mode" value="fake"<?php if (!function_exists('hash_file')) { echo 'checked="checked"'; }?> />&nbsp;<?php echo lang(174); ?></span></td>
</tr>
<tr>
<td><input type="checkbox" name="del_ok" <?php echo $options['disable_deleting'] ? 'disabled="disabled"' : 'checked="checked"'; ?> />&nbsp;<?php echo lang(175); ?></td>
</tr>
<?php
					} else {
?>
<tr>
<td align="center"><?php echo lang(176); ?>: <b><?php echo lang(177); ?></b></td>
</tr>
<?php
					}
?>
<tr>
<td align="center"><input type="hidden" name="act" value="merge_go" /> <input type="submit" value="<?php echo lang(291); ?>" /></td>
</tr>
</table>
</form>
<?php
		}
	}
}

function merge_go() {
	global $list, $options;
	if (count($_POST["files"]) !== 1) {
		echo lang(167)."<br /><br />";
	} else {
		$file = $list [$_POST ["files"] [0]];
		if (substr ( $file ["name"], - 4 ) == '.001' && is_file ( substr ( $file ["name"], 0, - 4 ) . '.crc' )) {
			echo lang(168)."<br /><br />";
		} elseif (substr ( $file ["name"], - 4 ) !== '.crc' && substr ( $file ["name"], - 4 ) !== '.001') {
			echo lang(169)."<br /><br />";
		} else {
			$usingcrcfile = (substr ( $file ["name"], - 4 ) === '.001') ? false : true;
			if (! $usingcrcfile) {
				$data = array ('filename' => basename ( substr ( $file ["name"], 0, - 4 ) ), 'size' => - 1, 'crc32' => '00111111' );
			} else {
				$fs = @fopen ( $file ["name"], "rb" );
			}
			if ($usingcrcfile && ! $fs) {
				echo lang(178)."<br /><br />";
			} else {
				if ($usingcrcfile) {
					$data = array ();
					while ( ! feof ( $fs ) ) {
						$data_ = explode ( '=', trim ( fgets ( $fs ) ), 2 );
						if ($data_[0] == 'crc32') $data_[1] = strtoupper($data_[1]);
						$data [$data_ [0]] = $data_ [1];
					}
					fclose ( $fs );
				}
				$path = realpath ( DOWNLOAD_DIR ) . PATH_SPLITTER;
				$filename = basename ( $data ['filename'] );
				$partfiles = array ();
				$partsSize = 0;
				for($j = 1; $j < 10000; $j ++) {
					if (! is_file ( $path . $filename . '.' . sprintf ( "%03d", $j ) )) {
						if ($j == 1) {
							$partsSize = - 1;
						}
						break;
					}
					$partfiles [] = $path . $filename . '.' . sprintf ( "%03d", $j );
					$partsSize += filesize ( $path . $filename . '.' . sprintf ( "%03d", $j ) );
				}
				if (file_exists ( $path . $filename )) {
					printf(lang(179),$path . $filename);
					echo "<br /><br />";
				} elseif ($usingcrcfile && $partsSize != $data ['size']) {
					echo lang(180)."<br /><br />";
				} elseif ($options['check_these_before_unzipping'] && is_array ( $options['forbidden_filetypes'] ) && in_array ( strtolower ( strrchr ( $filename, "." ) ), $options['forbidden_filetypes'] )) {
					printf(lang(181),strrchr ( $filename, "." ));
					echo "<br /><br />";
				} else {
					$merge_buffer_size = 2 * 1024 * 1024;
					$merge_dest = @fopen ( $path . $filename, "wb" );
					if (! $merge_dest) {
						printf(lang(182),$path . $filename);
						echo "<br /><br />";
					} else {
						$merge_ok = true;
						foreach ( $partfiles as $part ) {
							$merge_source = @fopen ( $part, "rb" );
							while ( ! feof ( $merge_source ) ) {
								$merge_buffer = fread ( $merge_source, $merge_buffer_size );
								if ($merge_buffer === false) {
									printf(lang(65),$part);
									echo "<br /><br />";
									$merge_ok = false;
									break;
								}
								if (fwrite ( $merge_dest, $merge_buffer ) === false) {
									printf(lang(183),$path . $filename);
									echo "<br /><br />";
									$merge_ok = false;
									break;
								}
							}
							fclose ( $merge_source );
							if (! $merge_ok) {
								break;
							}
						}
						fclose ( $merge_dest );
						if ($merge_ok) {
							$fc = (($_POST['crc_mode'] == 'hash_file' && function_exists('hash_file')) ? strtoupper(hash_file('crc32b', $path . $filename)) : '111111');
							if ($fc != $data["crc32"]) {
								echo lang(184)."<br /><br />";
							} else {
								printf(lang(185),$filename);
								echo '!<br /><br />';
								if ($usingcrcfile && $fc != '00111111' && $_POST["del_ok"] && !$options['disable_deleting']) {
									if ($usingcrcfile) {
										$partfiles [] = $file ["name"];
									}
									foreach ( $partfiles as $part ) {
										if (@unlink ( $part )) {
											foreach ( $list as $list_key => $list_file ) {
												if ($list_file ["name"] === $part) {
													unset ( $list [$list_key] );
												}
											}
											echo "<b>" . basename ( $part ) . "</b> ".lang(186).".<br />";
										} else {
											echo "<b>" . basename ( $part ) . "</b> ".lang(187).".<br />";
										}
									}
									echo "<br />";
								}
								$time = filemtime($path.$filename);
								while ( isset ( $list [$time] ) ) {
									$time ++;
								}
								$list [$time] = array ("name" => $path . $filename, "size" => bytesToKbOrMbOrGb ( $partsSize ), "date" => $time );
								if (! updateListInFile ( $list )) {
									echo lang(146)."<br /><br />";
								}
							}
						}
					}
				}
			}
		}
	}
}
?>
<?php
function mrename() {
	global $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="mrename_go" />
<?php echo lang(104); ?>:
<?php
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [$_GET ["files"] [$i]];
?>
<input type="hidden" name="files[]" value="<?php echo $_GET ["files"] [$i]; ?>" /> <b><?php echo basename ( $file ["name"] ); ?></b><?php echo $i == count ( $_GET ["files"] ) - 1 ? "." : ",&nbsp;"; ?>
<?php
	}
?>
<table>
<tr>
<td valign="middle"><b><?php echo lang(188); ?>&nbsp;</b><font size="2" color="yellow">&nbsp; <b><?php echo lang(189); ?>.</b>&nbsp; (dot)</font><b><input type="text" name="extension" size="10" value="" />&nbsp;<?php echo lang(190); ?> <?php echo lang(104); ?>.</b>&nbsp;
<input name="yes" type="submit" style="height: 23px" value="<?php echo lang(191); ?>" />&nbsp;&nbsp;
<input name="no" type="submit" style="height: 23px" value="<?php echo lang(192); ?>" /></td>
</tr>
</table>
</form>
<?php
}

function mrename_go() {
	global $list, $options, $PHP_SELF;
	if ($_POST ["yes"] && @trim($_POST['extension'])) {
		$_POST ['extension'] = @trim ( $_POST ['extension'] );
		
		while ( $_POST ['extension'] [0] == '.' )
			$_POST ['extension'] = substr ( $_POST ['extension'], 1 );
		
		if ($_POST [extension]) {
			for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
				$file = $list [$_POST ["files"] [$i]];
				if (file_exists ( $file ["name"] )) {
					$filetype = '.' . strtolower ( $_POST ['extension'] );
					if (is_array ( $options['forbidden_filetypes'] ) && in_array ( '.' . strtolower ( $_POST ['extension'] ), $options['forbidden_filetypes'] )) {
						printf(lang(82),$filetype);
						echo('<br /><br />');
					} else {
						if (@rename ( $file ["name"], fixfilename ( $file ["name"] . ".{$_POST['extension']}" ) )) {
							printf(lang(194).'<br />',basename($file['name']),fixfilename ( basename ( $file ["name"] . ".{$_POST['extension']}" ) ));
							$list [$_POST ["files"] [$i]] ["name"] .= '.' . $_POST ['extension'];
							$list [$_POST ["files"] [$i]] ["name"] = fixfilename ( $list [$_POST ["files"] [$i]] ["name"] );
						} else {
							printf(lang(193),basename($file['name']));
							echo '<br />';
						}
					}
				} else {
					printf(lang(145),basename($file['name']));
					echo('<br />');
				}
			}
			if (! updateListInFile ( $list ))
				echo lang(146)."<br />";
		}
	} else {
?>
<script type="text/javascript">location.href="<?php echo substr ( $PHP_SELF, 0, strlen ( $PHP_SELF ) - strlen ( strstr ( $PHP_SELF, "?" ) ) ) . "?act=files"; ?>";</script>
<?php
	}
}
?>
<?php
function rl_pack() {
	global $list, $options, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="pack_go" />
<?php
	echo count ( $_GET ["files"] ) . " file" . (count ( $_GET ["files"] ) > 1 ? "s" : "") . ":<br />";
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [$_GET ["files"] [$i]];
?>
<input type="hidden" name="files[]" value="<?php echo $_GET ["files"] [$i]; ?>" />
<b><?php echo basename ( $file ["name"] ); ?></b><?php echo $i == count ( $_GET ["files"] ) - 1 ? "." : ",&nbsp;"; }?><br />
	<br />
	<table align="center">
		<tr>
			<td><?php echo lang(195); ?>:&nbsp;<input type="text" name="arc_name" size="30" value="" />&nbsp;<b>.</b>&nbsp;
				<select name="arc_ext">
				<option value="tar" selected="selected">tar</option>
<?php
			if (!$options['disable_archive_compression']) {
?>
				<option value="tar.gz">tar.gz</option>
				<option value="tar.bz">tar.bz</option>
<?php
			}
?>
				</select>
			</td>
			<td><input type="submit" value="Pack" /></td>
		</tr>
<?php
  if ($options['download_dir_is_changeable']) {
?>
		<tr>
			<td><?php echo lang(40); ?>:&nbsp;<input type="text" name="saveTo" size="30"
			value="<?php echo addslashes ( $options['download_dir'] ); ?>" /></td>
		</tr>
<?php
  }
?>
	</table>
</form>
<?php
}

function pack_go() {
	global $list, $options;
	$arc_name = basename($_POST["arc_name"].'.'.$_POST["arc_ext"]);	
	$saveTo = ($options['download_dir_is_changeable'] ? stripslashes ( $_POST ["saveTo"] [$i] ) : realpath ( $options['download_dir'] )) . '/';
	$v_list = array();
	if (!$_POST["arc_name"] || !$_POST["arc_ext"]) {
		echo lang(196)."<br /><br />";
	}
	elseif (file_exists ( $saveTo . $arc_name )) {
		printf(lang(179),$arc_name);
		echo "<br /><br />";
	}
	else {
		for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
			$file = $list [$_POST ["files"] [$i]];
			if (file_exists ( $file ["name"] )) {
			$v_list [] = $file ["name"];
		} else {
			printf(lang(145),$file['name']);
			echo "<br /><br />";
		}
	}
	if (count($v_list) < 1) {
		echo lang(137)."<br /><br />";
	}
	else {
		$arc_name = $saveTo.$arc_name;
		require_once (CLASS_DIR . "tar.php");
		$tar = new Archive_Tar ( $arc_name );
		if ($tar->error != '') { echo $tar->error."<br /><br />"; }
		else {
			$remove_path = realpath($options['download_dir']).'/';
			$tar->createModify($v_list, '', $remove_path);
			if (! file_exists ( $arc_name )) {
			echo lang(197)."<br /><br />";
		}
		else {
			if (count ( $v_list = $tar->listContent () ) > 0) {
				for($i = 0; $i < sizeof ( $v_list ); $i ++) {
				printf(lang(198),$v_list[$i]['filename']);
				echo " <br />";
			}
			printf(lang(199),$arc_name);
			echo "<br />";
			$stmp = strtolower ( $arc_name );
			$arc_method = "Tar";
			if (!$options['disable_archive_compression']) {
				if (strrchr ( $stmp, "tar.gz" ) + 5 == strlen ( $stmp )) { $arc_method = "Tar.gz"; }
				elseif (strrchr ( $stmp, "tar.bz2" ) + 6 == strlen ( $stmp )) { $arc_method = "Tar.bz2"; }
			}
			unset ( $stmp );
			$time = explode ( " ", microtime () );
			$time = str_replace ( "0.", $time [1], $time [0] );
			$list [$time] = array ("name" => $arc_name, "size" => bytesToKbOrMbOrGb ( filesize ( $arc_name ) ), "date" => $time, "link" => "", "comment" => "archive " . $arc_method );
		} else {
			echo lang(200)."<br /><br />";
		}
		if (! updateListInFile ( $list )) {
			echo lang(9).'<br /><br />';
		}
        }
      }
    }
  }
}
?>
<?php

function rar() {
  global $PHP_SELF, $list, $options;
  if (!is_file(ROOT_DIR.'/rar/rar')) { echo lang(343).'<br /><br />'; }
  else {
?>
  <form name="rar_files" method="post" action="<?php echo $PHP_SELF; ?>">
    <table align="center" class="rar-table">
      <tr>
        <td>
          <table>
            <tr>
              <td colspan="2" class="rar-main-td">
                <b><?php echo lang(344); ?></b>
              </td>
            </tr>
<?php
    for($i = 0; $i < count($_GET["files"]); $i++) {
      $file = $list[$_GET["files"][$i]];
?>
            <tr>
              <td class="rar-options-left-td">
                <input type="hidden" name="files[<?php echo $i; ?>]" value="<?php echo $_GET["files"][$i]; ?>" />
                <input type="hidden" name="rar_opts[filestorar][<?php echo $i; ?>]" value="<?php echo $_GET["files"][$i]; ?>" />
                <?php echo basename($file["name"]); ?>
              </td>
              <td class="rar-rb-td">
                <?php echo $file["size"]; ?>
              </td>
            </tr>
<?php
    }
?>
            <tr>
              <td colspan="2" class="rar-main-td">
                <b><?php echo lang(345); ?></b>
              </td>
            </tr>
            <tr>
              <td colspan="2" class="rar-main-td">
                <input onkeyup="javascript:this.value=this.value.replace(/[^a-z0-9\ \.\-\_]/gi,'_');" type="text" size="60" name="rar_opts[rarfilename]" value="<?php echo count($_GET["files"]) == 1 ? preg_replace("/[^a-z0-9\\040\\.\\-\\_]/i", '_', basename($file["name"])) : '' ; ?>" />.rar
              </td>
            </tr>
            <tr>
              <td colspan="2" class="rar-main-td">
                <b><?php echo lang(346); ?></b>
              </td>
            </tr>
            <tr>
              <td class="rar-options-left-td">
                <?php echo lang(347); ?>
                <select name="rar_opts[comp_lvl]">
                  <option value="0" selected="selected"><?php echo lang(348); ?></option>
<?php
      if (!$options['disable_archive_compression']) {
?>
                  <option value="1"><?php echo lang(349); ?></option>
                  <option value="2"><?php echo lang(350); ?></option>
                  <option value="3"><?php echo lang(351); ?></option>
                  <option value="4"><?php echo lang(352); ?></option>
                  <option value="5"><?php echo lang(353); ?></option>
<?php
      }
?>
                </select>
              </td>
              <td class="rar-options-right-td">
                <input type="checkbox" name="rar_opts[vols]" value="1" onclick="javascript:var displ=this.checked?'inline':'none';document.getElementById('rar_opts_vols').style.display=displ;var fc=document.getElementsByName('rar_opts[vols_s]')[0]; fc.focus(); fc.selectionStart = 0; fc.selectionEnd = fc.value.length;" /><?php echo lang(354); ?>
                <span id="rar_opts_vols" style="display:none">
                  <br />Size: <input type="text" size="3" name="rar_opts[vols_s]" value="1" />&nbsp;
                  <select name="rar_opts[vols_sm]">
                  	<option value="3" selected="selected">MiB(*1048576)</option>
                  	<option value="4">Mb(*1000000)</option>
                  	<option value="5">GiB(*1073741824)</option>
                  	<option value="6">Gb(*1000000000)</option>
                  </select>
                </span>
              </td>
            </tr>
            <tr>
              <td class="rar-options-left-td">
                <input type="checkbox" name="rar_opts[delete]" value="1"<?php echo ($options['disable_deleting'] ? ' disabled="disabled"' : '');?> /><?php echo lang(355); ?>
              </td>
              <td class="rar-options-right-td">
                <input type="checkbox" name="rar_opts[solid]" value="1" /><?php echo lang(356); ?>
              </td>
            </tr>
            <tr>
              <td class="rar-options-left-td">
                <input type="checkbox" name="rar_opts[rec_rec]" value="1" onclick="javascript:var displ=this.checked?'inline':'none';document.getElementById('rar_opts_rec_rec').style.display=displ; var fc=document.getElementsByName('rar_opts[rec_rec_s]')[0]; fc.focus(); fc.selectionStart = 0; fc.selectionEnd = fc.value.length;" /><?php echo lang(357); ?>
                <span id="rar_opts_rec_rec" style="display:none">
                  <br />From 1 to 10: <input type="text" size="3" name="rar_opts[rec_rec_s]" value="1" />%
                </span>
              </td>
              <td class="rar-options-right-td">
                <input type="checkbox" name="rar_opts[test]" value="1" /><?php echo lang(358); ?>
              </td>
            </tr>
            <tr>
              <td class="rar-options-left-td">
                <input type="checkbox" name="rar_opts[use_pass1]" value="1" onclick="javascript:var displ=this.checked?'inline':'none';document.getElementById('rar_opts_pass').style.display=displ;document.getElementsByName('rar_opts[pass]')[0].focus();" /><?php echo lang(359); ?>
                <span id="rar_opts_pass" style="display:none">
                  <br />
                  <input type="password" size="15" name="rar_opts[pass]" value="" />
                  <br />
                  <input type="checkbox" name="rar_opts[use_pass2]" value="1" /><?php echo lang(360); ?>
                </span>
              </td>
              <td class="rar-options-right-td">
                <input type="checkbox" name="rar_opts[path_i]" value="1" onclick="javascript:var displ=this.checked?'inline':'none';document.getElementById('rar_opts_path_i').style.display=displ;document.getElementsByName('rar_opts[path_i_path]')[0].focus();" /><?php echo lang(361); ?>
                <span id="rar_opts_path_i" style="display:none;"><br /><input type="text" size="15" name="rar_opts[path_i_path]" value="" /></span>
              </td>
            </tr>
            <tr>
              <td class="rar-options-left-td">
                <input type="checkbox" name="rar_opts[separated]" value="1" /><?php echo lang(387); ?>
              </td>
              <td class="rar-options-right-td">
                <input type="checkbox" name="rar_opts[rar5]" value="1" /><?php echo lang(394); ?>
              </td>
            </tr>
            <tr>
              <td colspan="2" class="rar-options-right-td">
                &nbsp;
              </td>
            </tr>
            <tr>
              <td colspan="2" class="rar-space-td">&nbsp;</td>
            </tr>
          </table>
        </td>
      </tr>
      <tr>
        <td align="center">
          <input type="hidden" name="act" value="rar_go" />
          <input type="submit" value="<?php echo lang(362); ?>" />
        </td>
      </tr>
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
  </form>
<?php
  }
}



function rar_go() {
  global $PHP_SELF, $list;
  require_once(CLASS_DIR."rar.php");
?>
  <table align="center" style="text-align: left;">
    <tr>
      <td>
<?php
  if (!empty($_GET['rar_opts']['separated'])) {
    foreach ($_GET['rar_opts']['filestorar'] as $k => $v) { if (empty($list[$v])) { unset($_GET['rar_opts']['filestorar'][$k]); } }
    $am = count($_GET['rar_opts']['filestorar']);
  }
  else {
    $_GET['rar_opts']['rarfilename'] = trim(basename(stripslashes($_GET['rar_opts']['rarfilename'])));
    if (substr(strtolower($_GET['rar_opts']['rarfilename']), -4) != '.rar') { $_GET['rar_opts']['rarfilename'] .= '.rar'; }
    $am = 1;
  }

  for($i = 0; $i < $am; $i++) {
    if (!empty($_GET['rar_opts']['separated'])) $name = htmlentities(basename($list[$_GET['rar_opts']['filestorar'][$i]]['name']).'.rar');
?>
        <table align="center">
          <tr>
            <td colspan="2" class="rar-main-td">
              <?php printf(lang(363), (!empty($_GET['rar_opts']['separated']) ? $name : $_GET['rar_opts']['rarfilename'])); ?>
            </td>
          </tr>
          <tr>
            <td class="rar-options-left-td"><?php echo lang(374); ?></td>
            <td id="rar_status<?php echo $i; ?>" class="rar-rb-td"><?php echo lang(364); ?></td>
          </tr>
          <tr>
            <td colspan="2" class="rar-space-td">&nbsp;</td>
          </tr>
        </table>
<?php
  }
?>
      </td>
    </tr>
    <tr>
      <td>
      </td>
    </tr>
  </table>
  <span id="rar_finished" style="display:none;"><a href="<?php echo $PHP_SELF."?act=files"; ?>"><?php echo lang(365); ?></a><br /><br /><br /></span>
<?php
}



function rar_go_go() {
  global $options, $list;
?>
<script type="text/javascript">
/* <![CDATA[ */
function rar_st(elementid, st){
  document.getElementById(elementid).innerHTML = st;
  return true;
}
/* ]]> */
</script>
<?php
  flush();
  require_once(CLASS_DIR."rar.php");

  if ($options['disable_deleting']) $_GET['rar_opts']['delete'] = 0;
  if ($options['disable_archive_compression']) $_GET['rar_opts']['comp_lvl'] = 0;

  if (!empty($_GET['rar_opts']['separated'])) $am = count($_GET['rar_opts']['filestorar']);
  else $am = 1;

  for($i = 0; $i < $am; $i++) {
    $name = (!empty($_GET['rar_opts']['separated'])) ? basename($list[$_GET['rar_opts']['filestorar'][$i]]['name']).'.rar' : $_GET['rar_opts']['rarfilename'];
    $rar = new rlRar($name, $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx'));
    if ($rar->get_rar_return() !== 'rar') {
?>
<script type="text/javascript">rar_st('rar_status<?php echo $i; ?>', '<?php echo lang(343); ?>');</script>
<?php 
    }
    else {
      $rar_opts_tmp = $_GET['rar_opts'];
      if (!empty($_GET['rar_opts']['separated'])) { $rar_opts_tmp['filestorar'] = array($_GET['rar_opts']['filestorar'][$i]); }
      $rar_result = $rar->addtoarchive($rar_opts_tmp, $options['download_dir'], 'rar_status'.$i, $i);
      echo $rar_result;
      if (strpos($rar_result, ", 'Done')") !== false) {
        _create_list();
        clearstatcache();
        if (!empty($_GET['rar_opts']['delete'])) {
          foreach ($_GET['rar_opts']['filestorar'] as $rar_tounlist) {
            $rar_tounlist = basename($list[$rar_tounlist]['name']);
            if (empty($rar_tounlist)) { continue; }
            $rar_tounlist = realpath($options['download_dir']).'/'.$rar_tounlist;
            if (is_file($rar_tounlist)) { continue; }
            foreach ($list as $list_key => $list_item) {
              if ($list_item['name'] === $rar_tounlist) { unset($list[$list_key]); }
            }
          }
        }
        $rar_tolist = realpath($options['download_dir']).'/'.basename($rar->get_filename());
        if (!empty($_GET['rar_opts']['vols']) && !is_file($rar_tolist)) {
          if (substr(strtolower($rar_tolist), -4) == '.rar') $rar_tolist = substr($rar_tolist, 0, -4);
          $tmp = basename(strtolower($rar_tolist)).'.part';
          $rar_dir = opendir(realpath($options['download_dir']).'/');
          while (false !== ($rar_f_dd = readdir($rar_dir))) {
            $rar_f_dd_ = basename(strtolower($rar_f_dd));
            if ($tmp == substr($rar_f_dd_, 0, strlen($tmp)) && is_numeric(substr($rar_f_dd_, strlen($tmp), -4))) {
              $rar_f_dd = realpath($options['download_dir']).'/'.basename($rar_f_dd);
              $time = filemtime($rar_f_dd); while (isset($list[$time])) { $time++; }
              $list[$time] = array("name" => $rar_f_dd, "size" => bytesToKbOrMbOrGb(filesize($rar_f_dd)), "date" => $time);
            }
          }
          closedir($rar_dir);
        }
        elseif (is_file($rar_tolist)) {
          $time = filemtime($rar_tolist); while (isset($list[$time])) { $time++; }
          $list[$time] = array("name" => $rar_tolist, "size" => bytesToKbOrMbOrGb(filesize($rar_tolist)), "date" => $time);
        }
        if (!updateListInFile($list)) {
?>
<script type="text/javascript">var tmp = document.getElementById('rar_finished'); tmp.innerHTML = "<?php echo lang(9); ?><br /><br />" + tmp.innerHTML</script>;
<?php
        }
      }
    }
  }
?>
<script type="text/javascript">document.getElementById('rar_finished').style.display = '';</script>
<?php
}
?>
<?php
function rl_rename() {
	global $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>"><input type="hidden" name="act" value="rename_go" />
		<table align="center" style="text-align: left;">
			<tr>
				<td>
				<table>
<?php
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [$_GET ["files"] [$i]];
?>
<tr>
	<td align="center"><input type="hidden" name="files[]" value="<?php echo $_GET ["files"] [$i]; ?>" /><b><?php echo basename ( $file ["name"] ); ?></b></td>
</tr>
<tr>
	<td><?php echo lang(201); ?>:&nbsp;<input type="text" name="newName[]" size="25"
		value="<?php echo basename ( $file ["name"] ); ?>" /></td>
</tr>
<tr>
	<td>&nbsp;</td>
</tr>
<?php
	}
?>
                                  </table>
				</td>
				<td><input type="submit" value="Rename" /></td>
			</tr>
			<tr>
				<td></td>
			</tr>
		</table>
		</form>
<?php
}

function rename_go() {
	global $list, $options;
	$smthExists = FALSE;
	for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
		$file = $list [$_POST ["files"] [$i]];
		
		if (file_exists ( $file ["name"] )) {
			$smthExists = TRUE;
			$newName = dirname ( $file ["name"] ) . PATH_SPLITTER . stripslashes(basename($_POST["newName"][$i]));
			$filetype = strrchr ( $newName, "." );
			
			if (is_array ( $options['forbidden_filetypes'] ) && in_array ( strtolower ( $filetype ), $options['forbidden_filetypes'] )) {
				printf(lang(82),$filetype);
				echo "<br /><br />";
			} else {
				if (@rename ( $file ["name"], $newName )) {
					printf(lang(194),$file['name'],basename($newName));
					echo "<br /><br />";
					$list [$_POST ["files"] [$i]] ["name"] = $newName;
				} else {
					printf(lang(202),$file['name']);
					echo "<br /><br />";
				}
			}
		} else {
			printf(lang(145),$file['name']);
			echo "<br /><br />";
		}
	}
	if ($smthExists) {
		if (! updateListInFile ( $list )) {
			echo lang(9)."<br /><br />";
		}
	}
}
?>
<?php
function rl_sha1() {
	global $list;
?>
<table class="md5table" align="center" border="0" cellspacing="2" cellpadding="4">
	<tr>
		<th align="center"><?php echo lang(104); ?></th>
		<th align="center"><?php echo lang(56); ?></th>
		<th align="center">SHA1</th>
	</tr>
<?php
	foreach ($_GET['files'] as $v) {
		$file = $list[$v];
		if (file_exists($file['name'])) {
?>
	<tr>
		<td nowrap="nowrap">&nbsp;<b><?php echo htmlentities(basename($file['name'])); ?></b></td>
		<td align="center">&nbsp;<?php echo $file['size']; ?>&nbsp;</td>
		<td nowrap="nowrap"><b>&nbsp;<?php echo sha1_file($file['name'])?>&nbsp;</b></td>
	</tr>
<?php
		}
	}
	echo "</table>\n<br />";
}
?>
<?php
function rl_split() {
	global $PHP_SELF, $list, $options;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>">
<input type="hidden" name="act" value="split_go" />
		<table align="center">
			<tr>
				<td>
				<table>
<?php
	for ($i = 0; $i < count($_GET['files']); $i++) {
		$file = $list[$_GET['files'][$i]];
?>
<tr>
<td align="center">
<input type="hidden" name="files[]" value="<?php echo $_GET['files'][$i]; ?>" /> <b><?php echo basename($file['name']); ?></b>
						</td>
					</tr>
					<tr>
						<td><?php echo lang(143); ?>:&nbsp;<input type="number" step="any" min="1" name="partSize[]" size="6" value="<?php echo ((!empty($_COOKIE['partSize']) && is_numeric($_COOKIE['partSize'])) ? max(1, $_COOKIE['partSize']) : 10); ?>" />&nbsp;MB
						</td>
					</tr>
<?php
		if ($options['download_dir_is_changeable']) {
?>
					<tr>
						<td><?php echo lang(40); ?>:&nbsp;<input type="text" name="saveTo[]" size="40" value="<?php echo htmlspecialchars(DOWNLOAD_DIR, ENT_QUOTES); ?>" /></td>
					</tr>
<?php
		}
?>
					<tr>
						<td><input type="checkbox" name="del_ok" <?php echo $options['disable_deleting'] ? 'disabled="disabled"' : 'checked="checked"'; ?> />&nbsp;<?php echo lang(203); ?></td>
					</tr>
					<tr>
						<td align="left">CRC32 generation mode:<br />
<?php
		if (function_exists('hash_file')) echo '<input type="radio" name="crc_mode['.$i.']" value="hash_file" checked="checked" />&nbsp;'.lang(172).'<br />';
?>
						<input type="radio" name="crc_mode[<?php echo $i; ?>]" value="fake" <?php if (!function_exists('hash_file')) echo ' checked="checked"'; ?> />&nbsp;<?php echo lang(174); ?></td>
					</tr>
					<tr>
						<td></td>
					</tr>
<?php
	}
?>
				</table>
				</td>
				<td><input type="submit" value="<?php echo lang(290); ?>" /></td>
			</tr>
			<tr>
				<td></td>
			</tr>
		</table>
		</form>
<?php
}

function split_go() {
	global $list, $options;
	for ($i = 0; $i < count($_POST['files']); $i++) {
		$split_ok = true;
		$file = $list[$_POST['files'][$i]];
		$partSize = round($_POST['partSize'][$i] * 1048576);
		$saveTo = ($options['download_dir_is_changeable'] ? stripslashes($_POST['saveTo'][$i]) : realpath(DOWNLOAD_DIR) . '/');
		if (substr($saveTo, -1) != '/') $saveTo .= '/';
		$dest_name = basename($file['name']);
		$fileSize = filesize($file['name']);
		$totalParts = ceil($fileSize / $partSize);
		if ($partSize < 1048576 || $totalParts < 2) {
			echo 'Invalid part size, or higher than filesize.<br /><br />';
			continue;
		}
		$crc = (($_POST['crc_mode'][$i] == 'hash_file' && function_exists('hash_file')) ? strtoupper(hash_file('crc32b', $file['name'])) : '111111');
		echo "Started to split file <b>$dest_name</b> parts of " . bytesToKbOrMbOrGb($partSize) . ", Using Method - Total Commander...<br />";
		echo "Total Parts: <b>$totalParts</b><br /><br />";
		for($j = 1; $j <= $totalParts; $j++) {
			if (file_exists("$saveTo$dest_name." . sprintf('%03d', $j))) {
				echo "It is not possible to split the file. A piece already exists <b>$dest_name." . sprintf('%03d', $j) . '</b> !<br /><br />';
				continue 2;
			}
		}
		if (file_exists("$saveTo$dest_name.crc")) echo "It is not possible to split the file. CRC file already exists <b>$dest_name.crc</b> !<br /><br />";
		elseif (!is_file($file['name'])) echo "It is not possible to split the file. Source file not found <b>{$file['name']}</b> !<br /><br />";
		elseif (!is_dir($saveTo)) echo "It is not possible to split the file. Directory doesn't exist<b>$saveTo</b> !<br /><br />";
		elseif (!@write_file("$saveTo$dest_name.crc", "filename=$dest_name\r\nsize=$fileSize\r\ncrc32=$crc\r\n")) echo "It is not possible to split the file. CRC Error<b>$dest_name.crc" . "</b> !<br /><br />";
		else {
			$time = filemtime("$saveTo$dest_name.crc");
			while (isset($list[$time])) $time++;
			$list[$time] = array('name' => realpath("$saveTo$dest_name.crc"), 'size' => bytesToKbOrMbOrGb(filesize("$saveTo$dest_name.crc")), 'date' => $time);
			$split_buffer_size = 2097152;
			$split_source = @fopen($file['name'], 'rb');
			if (!$split_source) {
				echo "It is not possible to open source file <b>{$file['name']}</b> !<br /><br />";
				continue;
			}
			for($j = 1; $j <= $totalParts; $j++) {
				$part = sprintf('%03d', $j);
				$part_name = "$dest_name.$part";
				$dest_file = $saveTo . $part_name;
				$split_dest = @fopen($dest_file, 'wb');
				if (!$split_dest) {
					echo "Error openning file <b>$part_name</b> !<br /><br />";
					$split_ok = false;
					break;
				}
				$split_write_times = floor($partSize / $split_buffer_size);
				for($k = 0; $k < $split_write_times; $k++) {
					$split_buffer = fread($split_source, $split_buffer_size);
					$split_written = fwrite($split_dest, $split_buffer);
					if ($split_written === false || $split_written != strlen($split_buffer)) {
						echo "Error writing the file <b>$part_name</b> !<br /><br />";
						$split_ok = false;
						break;
					}
				}
				$split_rest = $partSize - ($split_write_times * $split_buffer_size);
				if ($split_ok && $split_rest > 0) {
					$split_buffer = fread($split_source, $split_rest);
					$split_written = fwrite($split_dest, $split_buffer);
					if ($split_written === false || $split_written != strlen($split_buffer)) {
						echo "Error writing the file <b>$part_name</b> !<br /><br />";
						$split_ok = false;
					}
				}
				fclose($split_dest);
				if ($split_ok) {
					$time = filemtime($dest_file);
					while (isset($list[$time])) $time++;
					$list[$time] = array('name' => realpath($dest_file), 'size' => bytesToKbOrMbOrGb(filesize($dest_file)), 'date' => $time);
				}
			}
			fclose($split_source);
			if ($split_ok && !empty($_POST['del_ok']) && !$options['disable_deleting']) {
				if (@unlink($file['name'])) {
					unset($list[$_POST['files'][$i]]);
					echo 'Source file deleted.<br /><br />';
				} else echo 'Source file is<b>not deleted!</b><br /><br />';
			}
			if (!updateListInFile($list)) echo "Couldn't update file list. Problem writing to file!<br /><br />";
		}
	}
}
?>
<?php

function unrar() {
  global $PHP_SELF, $options, $list;
  require_once(CLASS_DIR."rar.php");
?>
<script type="text/javascript">
/* <![CDATA[ */
function unrar_setCheckboxes(act, filestounrar) {
  var elts = document.getElementsByName('filestounrar['+filestounrar+'][]');
  var elts_cnt = (typeof(elts) != 'undefined') ? elts.length : 0;
  if (elts_cnt) {
    for (var i = 0; i < elts_cnt; i++) {
      elts[i].checked = (act == 1 || act == 0) ? act : elts[i].checked ? 0 : 1;
    }
  }
}
/* ]]> */
</script>
  <form name="unrar_files" method="post" action="<?php echo $PHP_SELF; ?>">
    <table align="center">
      <tr>
        <td>
          <table>
<?php
  $rar_passl_needed = false;
  $any_file_tounrar = false;
  for($i = 0; $i < count($_GET["files"]); $i++) {
    $file = $list[$_GET["files"][$i]];
?>
            <tr align="center">
              <td colspan="2" class="unrar-main-td">
                <input type="hidden" name="files[<?php echo $i; ?>]" value="<?php echo $_GET["files"][$i]; ?>" />
                <?php printf(lang(366),htmlentities(basename($file["name"]))); ?>
                <br />
                <a href="javascript:unrar_setCheckboxes(1, <?php echo $i;?>);"><?php echo lang(52); ?></a> |
                <a href="javascript:unrar_setCheckboxes(0, <?php echo $i;?>);"><?php echo lang(53); ?></a> |
                <a href="javascript:unrar_setCheckboxes(2, <?php echo $i;?>);"><?php echo lang(54); ?></a>
              </td>
            </tr>
            <tr>
              <td colspan="2" class="unrar-main2-td">
                &nbsp;
<?php
    unset ($rar);
    $rar = new rlRar($file["name"], $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx'));
    if ($rar->get_rar_return() === false) { echo lang(367); }
    else {
      $rar_list = $rar->listthem(@$_GET['passwords'][$i], $options['download_dir'], $i);
      if ($rar_list[0] == 'PASS') { $rar_passl_needed = true; echo lang(368); }
      elseif ($rar_list['NEEDP'] == true) { echo lang(369); }
      elseif ($rar_list[0] == 'ERROR') { printf(lang(370),$rar_list[1].' '.$rar_list[2]); }
    }
?>
                <input type="<?php echo ($rar_list['NEEDP'] == true) ? 'password' : 'hidden'; ?>" name="passwords[]" value="<?php echo htmlspecialchars($_GET['passwords'][$i], ENT_QUOTES); ?>" />
                &nbsp;
              </td>
            </tr>
<?php
    if ($rar_list[0] == 'LIST') {
      $any_file_tounrar = true;
      $rar_list = $rar_list[2];
      foreach($rar_list as $rar_key => $rar_item) {
?>
            <tr>
              <td class="unrar-lb-td">
                <input type="checkbox" name="filestounrar[<?php echo $i; ?>][]" checked="checked" value="<?php echo base64_encode($rar_key); ?>" />
              </td>
              <td class="unrar-rb-td"><?php echo $rar_key.' ('.bytesToKbOrMbOrGb($rar_item['size']).')'; ?></td>
            </tr>
<?php
      }
    }
?>
            <tr>
              <td colspan="2" class="unrar-space-td">&nbsp;</td>
            </tr>
<?php
  }
?>
          </table>
        </td>
      </tr>
      <tr>
        <td align="center">
          <input type="hidden" name="act" value="<?php echo $rar_passl_needed ? 'unrar' : 'unrar_go'; ?>" />
          <input type="submit" value="<?php echo $rar_passl_needed ? lang(371) : lang(372); ?>" />
        </td>
      </tr>
      <tr>
        <td>
        </td>
      </tr>
    </table>
  </form>
<?php
}




function unrar_go() {
  global $PHP_SELF, $options, $list;
  require_once(CLASS_DIR."rar.php");
?>
  <table align="center">
    <tr>
      <td>
        <table>
<?php
  for($i = 0; $i < count($_GET["files"]); $i++) {
    $file = $list[$_GET["files"][$i]];
    if (count($_GET['filestounrar'][$i]) == 0) { continue; }
?>
          <tr align="center">
            <td colspan="2" style="border-right:1px solid #666; border-left:1px solid #666; border-top:1px solid #666; padding:2px; background-color:#001825;"><?php printf(lang(373),basename($file["name"])); ?></td>
          </tr>
<?php
    foreach ($_GET['filestounrar'][$i] as $rar_item) {
?>
          <tr>
            <td class="unrar-lb-td">
<?php
      echo link_for_file(realpath($options['download_dir']).'/'.basename(base64_decode($rar_item)));
?>
            </td>
            <td id="<?php echo 'unrar'.$_GET["files"][$i].'-'.str_replace('=', '-', $rar_item); ?>" align="center" style="border-right:1px solid #666; padding:2px; background-color:#001825;"><?php echo lang(364); ?></td>
          </tr>
<?php
    }
?>
          <tr>
            <td colspan="2" class="unrar-space-td">&nbsp;</td>
          </tr>
<?php
  }
?>
        </table>
      </td>
    </tr>
    <tr>
      <td>
      </td>
    </tr>
  </table>
  <span id="unrar_finished" style="display:none;"><a href="<?php echo $PHP_SELF."?act=files"; ?>"><?php echo lang(365); ?></a><br /><br /><br /></span>
<?php
}




function unrar_go_go() {
  global $options, $list;
?>
<script type="text/javascript">
/* <![CDATA[ */
function rar_st(elementid, st){
  document.getElementById(elementid).innerHTML = st;
  return true;
}
/* ]]> */
</script>
<?php
  for($i = 0; $i < count($_GET["files"]); $i++) {
    $file = $list[$_GET["files"][$i]];
    if (count($_GET['filestounrar'][$i]) == 0) { continue; }
    foreach ($_GET['filestounrar'][$i] as $rar_item) {
      flush();
      $rar = new rlRar($file["name"], $options['check_these_before_unzipping'] ? $options['forbidden_filetypes'] : array('.xxx'));
      if ($rar->get_rar_return() === false) {
?>
<script type="text/javascript">rar_st('<?php echo 'unrar'.$_GET["files"][$i].'-'.str_replace('=', '-', $rar_item); ?>', '<?php echo lang(343); ?>');</script>
<?php
      }
      else {
        $rar_result = $rar->extract(base64_decode($rar_item), $options['download_dir'], $_GET['passwords'][$i], 'unrar'.$_GET["files"][$i].'-'.str_replace('=', '-', $rar_item), $i);
        echo $rar_result;
        if (strpos($rar_result, ", 'OK')") !== false) {
          _create_list();
          $rar_tolist = realpath($options['download_dir']).'/'.basename(base64_decode($rar_item));
          $time = filemtime($rar_tolist); while (isset($list[$time])) { $time++; }
          $list[$time] = array("name" => $rar_tolist, "size" => bytesToKbOrMbOrGb(filesize($rar_tolist)), "date" => $time);
          if (!updateListInFile($list)) {
?>
<script type="text/javascript">var tmp = document.getElementById('rar_finished'); tmp.innerHTML = "<?php echo lang(9); ?><br /><br />" + tmp.innerHTML</script>;
<?php
          }
        }
      }
    }
  }
?>
<script type="text/javascript">document.getElementById('unrar_finished').style.display = '';</script>
<?php
}
?>
<?php
function unzip() {
	global $list, $PHP_SELF;
?>
<form method="post" action="<?php echo $PHP_SELF; ?>">
<input type="hidden" name="act" value="unzip_go" />
	<table align="center">
		<tr>
			<td>
				<table>
<?php
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [$_GET ["files"] [$i]];
		require_once (CLASS_DIR . "unzip.php");
		if (file_exists($file['name'])) {
			$zip = new dUnzip2 ( $file['name'] );
			$flist = $zip->getList();
?>
					<tr><td align="center">
						<input type="hidden" name="files[]" value="<?php echo $_GET['files'][$i]; ?>" />
						<b><?php echo basename($file['name']); ?></b> (<?php echo count($flist).' '.lang(204); ?>)
					</td></tr>
					<tr><td>
						<div style="overflow-y:scroll; height:150px; padding-left:5px;">
<?php
			foreach ($flist as $property) {
				echo($property['file_name'].'<br />');
			}
?>
						</div>
					</td></tr>
<?php
		}
	}
?>
				</table>
			</td>
			<td><input type="submit" name="submit" value="<?php echo lang(205); ?>" /></td>
		</tr>
		<tr><td></td></tr>
	</table>
</form>
<?php
}

function unzip_go() {
	global $list, $options;
	require_once (CLASS_DIR . "unzip.php");
	$any_file_unzippped = false;
	for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
		$file = $list [$_POST ["files"] [$i]];
		if (file_exists ( $file ["name"] )) {
			$zip = new dUnzip2 ( $file ["name"] );
			$allf = $zip->getList ();
			$file_inside_zip_exists = false;
			$forbidden_inside_zip = false;
			foreach ($allf as $k => $properties) {
				if (file_exists($options['download_dir'].basename($properties['file_name']))) {
					$file_inside_zip_exists = true; break;
				}
			}
			if ($options['check_these_before_unzipping']) {
				foreach ( $allf as $k => $property ) {
					$zfiletype = strrchr ( $property ['file_name'], "." );
					if (is_array ( $options['forbidden_filetypes'] ) && in_array ( strtolower ( $zfiletype ), $options['forbidden_filetypes'] )) {
						$forbidden_inside_zip = true; break;
					}
				}
			}
			if ($file_inside_zip_exists) {
				echo 'Some file(s) inside <b>'.htmlentities(basename($file["name"])).'</b> already exist on download directory';
				echo "<br /><br />";
			}
			elseif ($forbidden_inside_zip) {
				printf(lang(181), $zfiletype);
				echo "<br /><br />";
			}
			else {
				$zip->unzipAll ( $options['download_dir'] );
				if ($zip->getList () != false) {
					$any_file_unzippped = true;
					echo '<b>'.htmlentities(basename($file["name"])).'</b>&nbsp;unzipped successfully<br /><br />';
					foreach ($allf as $k => $properties) {
						$efile = realpath($options['download_dir']).'/'.basename($properties['file_name']); 
						if (is_file($efile)) {
							$time = filemtime($efile); while (isset($list[$time])) { $time++; }
							$list[$time] = array("name" => $efile, "size" => bytesToKbOrMbOrGb(filesize($efile)), "date" => $time);
						}
					}
					if (!updateListInFile($list)) { echo lang(146)."<br /><br />"; }
				}
				else {
					echo "File <b>".$file["name"]."</b> not found!<br /><br />";
				}
			}
		}
	}
}
?>
<?php

function upload() {
	global $upload_services;

	$d = opendir(HOST_DIR . 'upload/');
	while (($modules = readdir($d)) !== false) {
		if (substr($modules, 0, 1) != '.' && preg_match('/\.index\.php$/i', $modules) && is_file(HOST_DIR . "upload/$modules")) include_once(HOST_DIR . "upload/$modules");
	}

	if (empty($upload_services)) {
		echo '<span class="warning"><b>' . lang(48) . "</b></span>";
		return;
	}

	sort($upload_services);
	reset($upload_services);
	$uploadtype = '';
	foreach($upload_services as $upl) $uploadtype .= "['$upl'," . (!empty($max_file_size[$upl]) ? $max_file_size[$upl] : 0) . "],";
	$uploadtype = substr($uploadtype, 0, -1);
	echo "<script type='text/javascript'>/* <![CDATA[ */var upservice=[$uploadtype];function fill_option(id){var elem=document.getElementById(id);for(var i=0;i<upservice.length;i++){elem.options[elem.options.length]=new Option(upservice[i][0].replace('_',' ')+(upservice[i][1]?' ('+upservice[i][1]+' MB)':''));elem.options[elem.options.length-1].value=upservice[i][0]}}function openwinup(id){var options='width=700,height=250,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no';win=window.open('',id,options);win.focus();return true}/* ]]> */</script>\n<table align='center' border='0'>\n";
	for ($i = 0; $i < count($_GET['files']); $i++) {
		$file = $GLOBALS['list'][($_GET['files'][$i])];
		$tid = md5(time() . '_file' . $_GET['files'][$i]);
?>
<tr>
	<td valign="top"><?php echo '<b>' . basename($file['name']) . '</b>, ' . $file['size']; ?></td>
	<td valign="top" align="left">
		<form action="upload.php" method="get" target="<?php echo $tid?>" onsubmit="return openwinup('<?php echo $tid?>');" style="padding-bottom: 6px;">
			<select name="uploaded" id="d_<?php echo $tid;?>"></select><script type="text/javascript">/* <![CDATA[ */fill_option('d_<?php echo $tid;?>');/* ]]> */</script>
			<input type="hidden" name="filename" value="<?php echo base64_encode(basename($file['name'])); ?>" />
			<input type="submit" value="Upload" />
			<br /><input type="checkbox" name="useuproxy" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('uproxyconfig<?php echo $i; ?>').style.display=displ;" />&nbsp;<?php echo lang(245); ?>
			<br /><table style="display:none;" width="150" border="0" id="uproxyconfig<?php echo $i; ?>">
			<tr><td><?php echo lang(246); ?>:&nbsp;</td><td><input type="text" name="uproxy" size="20" /></td></tr>
			<tr><td><?php echo lang(247); ?>:&nbsp;</td><td><input type="text" name="uproxyuser" size="20" /></td></tr>
			<tr><td><?php echo lang(248); ?>:&nbsp;</td><td><input type="text" name="uproxypass" size="20" /></td></tr>
			</table>
		</form>
	</td>
</tr>
<?php
	}
	echo("</table><br />\n");
}
<?php
function zip() {
	global $list, $options;
?>
<form name="ziplist" method="post" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>"><input type="hidden" name="act" value="zip_go" />
	<table cellspacing="5">
		<tr>
			<td align="center"><strong>Adding files to a ZIP archive</strong></td>
		</tr>
		<tr>
			<td align="center">
				<table>
					<tr>
						<td>Archive Name:&nbsp;<input type="text" name="archive" size="25" value=".zip" /></td>
					</tr>
					<tr>
						<td><input type="checkbox" name="no_compression"<?php echo ($options['disable_archive_compression'] ? ' disabled="disabled" checked="checked"' : ''); ?> />&nbsp;Do not use compression</td>
					</tr>
				</table>
				<table>
					<tr>
						<td><input type="submit" value="Add Files" /></td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
<?php
	echo "<br />Selected File" . (count ( $_GET ["files"] ) > 1 ? "s" : "") . ": ";
	for($i = 0; $i < count ( $_GET ["files"] ); $i ++) {
		$file = $list [($_GET ["files"] [$i])];
		echo "<input type=\"hidden\" name=\"files[]\" value=\"{$_GET[files][$i]}\" />\r\n";
		echo "<b>" . basename ( $file ["name"] ) . "</b>";
		echo ($i == count ( $_GET ["files"] ) - 1) ? "." : ",&nbsp;";
	}
?>
<br /><br />
</form>
<?php
}

function zip_go() {
	global $list, $options;
	$saveTo = realpath ( $options['download_dir'] ) . '/';
	$_POST ["archive"] = (strlen ( trim ( urldecode ($_POST['archive']) ) ) > 4 && substr ( trim ( urldecode ($_POST['archive']) ), - 4 ) == ".zip") ? trim ( urldecode ($_POST['archive']) ) : "archive.zip";
	$_POST ["archive"] = $saveTo.basename($_POST ["archive"]);
	for($i = 0; $i < count ( $_POST ["files"] ); $i ++) {
		$files [] = $list [($_POST ["files"] [$i])];
	}
	foreach ( $files as $file ) {
		$CurrDir = ROOT_DIR;
		$inCurrDir = stristr ( dirname ( $file ["name"] ), $CurrDir ) ? TRUE : FALSE;
		if ($inCurrDir) {
			$add_files [] = substr ( $file ["name"], (strlen ( $CurrDir ) + 1) );
		}
	}
	require_once (CLASS_DIR . "pclzip.php");
	$archive = new PclZip ($_POST['archive']);
	$no_compression = ($options['disable_archive_compression'] || isset($_POST["no_compression"]));
	if (file_exists ($_POST['archive'])) {
		if ($no_compression) { $v_list = $archive->add ( $add_files, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION); }
		else { $v_list = $archive->add ( $add_files, PCLZIP_OPT_REMOVE_ALL_PATH); }
	} else {
		if ($no_compression) { $v_list = $archive->create ( $add_files, PCLZIP_OPT_REMOVE_ALL_PATH, PCLZIP_OPT_NO_COMPRESSION); }
		else { $v_list = $archive->create ( $add_files, PCLZIP_OPT_REMOVE_ALL_PATH); }
	}

	if ($v_list != 0 && is_file($_POST['archive'])) {
		echo "Archive <b>" . htmlspecialchars($_POST['archive']) . "</b> successfully created!<br /><br />";

		$time = filemtime($_POST['archive']); while (isset($list[$time])) { $time++; }
		$list[$time] = array("name" => $_POST['archive'], "size" => bytesToKbOrMbOrGb(filesize($_POST['archive'])), "date" => $time);
		if (!updateListInFile($list)) { echo lang(146)."<br /><br />"; }
	} else {
		echo "Error: " . htmlspecialchars($archive->errorInfo(true)) . "<br /><br />";
		return;
	}
}
<?php
if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit;
}

function create_hosts_file($host_file = 'hosts.php') { // To be rewritten or deleted
	$fp = opendir(HOST_DIR . 'download/');
	while (($file = readdir($fp)) !== false) {
		if (substr($file, -4) == '.inc') require_once (HOST_DIR . "download/$file");
	}
	if (!is_array($host)) html_error(lang(127));
	else {
		$fs = fopen(HOST_DIR . "download/$host_file", 'wb');
		if (!$fs) html_error(lang(128));
		else {
			fwrite($fs, "<?php\r\n\$host = array(\r\n");
			$i = 0;
			foreach ($host as $site => $file) {
				if ($i != (count($host) - 1)) fwrite($fs, "'" . $site . "' => '" . $file . "',\r\n");
				else fwrite($fs, "'" . $site . "' => '" . $file . "');\r\n?>");
				$i++;
			}
			closedir($fp);
			fclose($fs);
		}
	}
}

function login_check() {
	global $options;
	if ($options['login']) {
		function logged_user($ul) {
			foreach ($ul as $user => $pass) {
				if ($_SERVER['PHP_AUTH_USER'] == $user && isset($_SERVER['PHP_AUTH_PW']) && $_SERVER['PHP_AUTH_PW'] == $pass) return true;
			}
			return false;
		}
		if (empty($_SERVER['PHP_AUTH_USER']) && (!empty($_SERVER['HTTP_AUTHORIZATION']) || !empty($_SERVER['REDIRECT_HTTP_AUTHORIZATION']))) {
			$auth = !empty($_SERVER['HTTP_AUTHORIZATION']) ? $_SERVER['HTTP_AUTHORIZATION'] : $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
			if (stripos($auth, 'Basic ') === 0 && strpos(($auth = base64_decode(substr($auth, 6))), ':') > 0) list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', $auth, 2);
			unset($auth);
		}
		if (empty($_SERVER['PHP_AUTH_USER']) || !logged_user($options['users'])) {
			header('WWW-Authenticate: Basic realm="RAPIDLEECH PLUGMOD"');
			header('HTTP/1.0 401 Unauthorized');
			include('deny.php');
			exit;
		}
	}
}

function is_present($lpage, $mystr, $strerror = '') {
	if (stripos($lpage, $mystr) !== false) html_error((!empty($strerror) ? $strerror : $mystr));
}

function is_notpresent($lpage, $mystr, $strerror) {
	if (stripos($lpage, $mystr) === false) html_error($strerror);
}

function insert_location($inputs, $action = 0) {
	if (!is_array($inputs)) {
		if (strpos($inputs, '?') !== false) list($action, $inputs) = explode('?', $inputs, 2);
		$query = explode('&', $inputs);
		$inputs = array();
		foreach($query as $q) {
			list($name, $value) = explode('=', $q, 2);
			if (empty($name) || empty($value)) continue;
			$inputs[$name] = $value;
		}
		unset($query);
	}
	if (isset($_GET['GO']) && $_GET['GO'] == 'GO') $_GET = array_merge($_GET, $inputs);
	else {
		if ($action === 0) $action = $_SERVER['SCRIPT_NAME'];
		$fname = 'r'.time().'l';
		echo "\n<form name='$fname' ".(!empty($action) ? "action='$action' " : '')."method='POST'>\n";
		foreach($inputs as $name => $value) echo "\t<input type='hidden' name='$name' value='" . htmlspecialchars($value, ENT_QUOTES) . "' />\n";
		echo "</form>\n<script type='text/javascript'>void(document.$fname.submit());</script>\n</body>\n</html>";
		flush();
	}
}

function pause_download() { // To make sure that the files pointers and streams are closed and unlocked.
	if (!empty($GLOBALS['fs']) && is_resource($GLOBALS['fs'])) {
		flock($GLOBALS['fs'], LOCK_UN);
		if (get_resource_type($GLOBALS['fs']) == 'stream') stream_socket_shutdown($GLOBALS['fs'], STREAM_SHUT_RDWR);
		fclose($GLOBALS['fs']);
	}
	if (!empty($GLOBALS['fp']) && is_resource($GLOBALS['fp'])) {
		flock($GLOBALS['fp'], LOCK_UN);
		if (get_resource_type($GLOBALS['fp']) == 'stream') stream_socket_shutdown($GLOBALS['fp'], STREAM_SHUT_RDWR);
		fclose($GLOBALS['fp']);
	}
}

function cut_str($str, $left, $right) {
	$str = substr(stristr($str, $left), strlen($left));
	$leftLen = strlen(stristr($str, $right)); 
	$leftLen = $leftLen ? -($leftLen) : strlen($str);
	$str = substr($str, 0, $leftLen);
	return $str;
}

// tweaked cutstr with pluresearch functionality
function cutter($str, $left, $right, $cont = 1) {
	for($iii = 1; $iii <= $cont; $iii++) $str = substr(stristr($str, $left), strlen($left));
	$leftLen = strlen(stristr($str, $right));
	$leftLen = $leftLen ? -($leftLen) : strlen($str);
	$str = substr($str, 0, $leftLen);
	return $str;
}

function write_file($file_name, $data, $trunk = 1) {
	if ($trunk == 1) $mode = 'wb';
	elseif ($trunk == 0) $mode = 'ab';
	$fp = fopen($file_name, $mode);
	if (!$fp || !flock($fp, LOCK_EX) || !fwrite($fp, $data) || !flock($fp, LOCK_UN) || !fclose($fp)) return FALSE;
	return TRUE;
}

function read_file($file_name, $count = -1) {
	if ($count == -1) $count = filesize($file_name);
	$fp = fopen($file_name, 'rb');
	flock($fp, LOCK_SH);
	$ret = fread($fp, $count);
	flock($fp, LOCK_UN);
	fclose($fp);
	return $ret;
}

function pre($var) {
	echo "<pre>\n" . htmlspecialchars(print_r($var, true)) . "\n</pre>\n";
}

function getmicrotime() {
	list ($usec, $sec) = explode(' ', microtime());
	return ((float)$usec + (float)$sec);
}

function html_error($msg) {
	if (!empty($GLOBALS['throwRLErrors']) || (strtolower(basename($_SERVER['SCRIPT_NAME'])) == 'audl.php' && isset($_REQUEST['GO']) && $_REQUEST['GO'] == 'GO' && $_REQUEST['server_side'] == 'on' && !empty($GLOBALS['isHost']))) throw new Exception($msg); // throw errors for try and catch usage.
	else {
		if (!headers_sent()) include_once(TEMPLATE_DIR.'header.php');
		echo '<div align="center">';
		echo "<span class='htmlerror'><b>$msg</b></span><br /><br />";
		if (isset($_GET['audl'])) echo '<script type="text/javascript">parent.nextlink();</script>';
		if (!empty($GLOBALS['options']['new_window'])) echo '<a href="javascript:window.close();">'.lang(378).'</a>';
		else echo '<a href="'.htmlspecialchars($_SERVER['SCRIPT_NAME'], ENT_QUOTES).'">'.lang(13).'</a>';
		echo '</div>';
	}
	pause_download();
	include(TEMPLATE_DIR.'footer.php');
	exit();
}

function sec2time($time) {
	$hour = round($time / 3600, 2);
	if ($hour >= 1) {
		$hour = floor($hour);
		$time -= $hour * 3600;
	}
	$min = round($time / 60, 2);
	if ($min >= 1) {
		$min = floor($min);
		$time -= $min * 60;
	}
	$sec = $time;
	$hour = ($hour > 1) ? $hour . ' ' . lang(129) . ' ' : (($hour == 1) ? $hour . ' ' . lang(130) . ' ' : '');
	$min = ($min > 1) ? $min . ' ' . lang(131) . ' ' : (($min == 1) ? $min . ' ' . lang(132) . ' ' : '');
	$sec = ($sec > 1) ? $sec . ' ' . lang(133) : (($sec == 1 || $sec == 0) ? $sec . ' ' . lang(134) : '');
	return $hour . $min . $sec;
}

// Updated function to be able to format up to Yotabytes!
function bytesToKbOrMbOrGb($bytes) {
	if (is_numeric($bytes)) {
		$s = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
		$e = floor(log($bytes) / log(1024));
		return sprintf('%.2f ' . $s[$e], @($bytes / pow(1024, floor($e))));
	} else $size = 'Unknown';
	return $size;
}

function updateListInFile($list) {
	if (count($list) > 0) {
		foreach($list as $key => $value) $list[$key] = serialize($value);
		if (!@write_file(CONFIG_DIR . 'files.lst', implode("\r\n", $list) . "\r\n") && count($list) > 0) return FALSE;
		else return TRUE;
	} elseif (@file_exists(CONFIG_DIR . 'files.lst')) {
		// Truncate files.lst instead of removing it since we don't have full
		// read/write permission on the configs folder
		$fh = fopen(CONFIG_DIR . 'files.lst','w');
		fclose($fh);
		return true;
	}
}

function _cmp_list_enums($a, $b) {
	return strcmp($a['name'], $b['name']);
}

function file_data_size_time($file) {
	$size = $time = false;
	if (is_file($file)) {
		$size = @filesize($file);
		$time = @filemtime($file);
	}
	if ($size === false && $GLOBALS['options']['2gb_fix'] && file_exists($file) && !is_dir($file) && !is_link($file)) {
		if (substr(PHP_OS, 0, 3) !== 'WIN') {
			@exec('stat' . (stripos(@php_uname('s'), 'bsd') !== false ? '-f %m ' : ' -c %Y ') . escapeshellarg($file), $time, $tmp);
			if ($tmp == 0) $time = trim(implode($time));
			@exec('stat' . (stripos(@php_uname('s'), 'bsd') !== false ? '-f %z ' : ' -c %s ') . escapeshellarg($file), $size, $tmp);
			if ($tmp == 0) $size = trim(implode($size));
		}
	}
	if ($size === false || $time === false) { return false; }
	return array($size, $time);
}

function _create_list() {
	$glist = array();
	if (($GLOBALS['options']['show_all'] === true) && (isset($_COOKIE['showAll']) && $_COOKIE['showAll'] == 1)) {
		$dir = dir(DOWNLOAD_DIR);
		while(false !== ($file = $dir->read())) {
			if ($file == '.' || $file == '..' || ($tmp = file_data_size_time(DOWNLOAD_DIR.$file)) === false) continue;
			list($size, $time) = $tmp;
			if (!is_array($GLOBALS['options']['forbidden_filetypes']) || !in_array(strtolower(strrchr($file, '.')), $GLOBALS['options']['forbidden_filetypes'])) {
				$file = DOWNLOAD_DIR . $file;
				while(isset($glist[$time])) $time++;
				$glist[$time] = array('name' => realpath($file), 'size' => bytesToKbOrMbOrGb($size), 'date' => $time);
			}
		}
		$dir->close();
		@uasort($glist, '_cmp_list_enums');
	} else {
		if (@file_exists(CONFIG_DIR . 'files.lst') && ($glist = file(CONFIG_DIR . 'files.lst')) !== false) {
			$listReformat = array();
			foreach($glist as $key => $record) {
				if ($record = @unserialize($record)) {
					$date = 0;
					foreach($record as $field => $value) {
						switch ($field) {
							case 'date':
								$date = $value;
							default:
								$listReformat[$key][$field] = $value;
								break;
							case 'comment':
								$listReformat[$key][$field] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
								break;
						}
					}
					if (!empty($date)) $glist[$date] = $listReformat[$key];
				}
				unset($glist[$key], $listReformat[$key]);
			}
		}
	}
	$GLOBALS['list'] = $glist;
}

function checkmail($mail) {
	if (strlen($mail) == 0 || strpos($mail, '@') === false || strpos($mail, '.') === false || !preg_match('/^[a-z0-9_\.-]{1,20}@(([a-z0-9-]+\.)+(com|net|org|mil|edu|gov|arpa|info|biz|inc|name|[a-z]{2})|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})$/is', $mail)) return false;
	return true;
}

/* Fixed Shell exploit by: icedog */
function fixfilename($fname, $fpach = '') {
	$f_name = basename($fname);
	$f_dir = dirname(preg_replace('@\.\./@i', '', $fname));
	$f_dir = ($f_dir == '.') ? '' : $f_dir;
	$f_dir = preg_replace('@\.\./@i', '', $f_dir);
	$fpach = preg_replace('@\.\./@i', '', $fpach);
	$f_name = preg_replace('@\.(((s|\d)?php)|(hta)|(p[l|y])|(cgi)|(sph))@i', '.xxx', $f_name);
	$ret = ($fpach) ? $fpach . DIRECTORY_SEPARATOR . $f_name : ($f_dir ? $f_dir . DIRECTORY_SEPARATOR : '') . $f_name;
	return $ret;
}

function getfilesize($f) {
	$stat = stat($f);

	if ($GLOBALS['is_windows'] || (($stat[11] * $stat[12]) < 4 * 1024 * 1024 * 1024)) return sprintf('%u', $stat[7]);

	global $max_4gb;
	if ($max_4gb === false) {
		$tmp_ = trim(@shell_exec('ls -Ll ' . @escapeshellarg($f)));
		while(strstr($tmp_, '  ')) $tmp_ = @str_replace('  ', ' ', $tmp_);
		$r = @explode(' ', $tmp_);
		$size_ = $r[4];
	} else $size_ = -1;

	return $size_;
}

function bytesToKbOrMb($bytes) {
	$size = ($bytes >= (1024 * 1024 * 1024 * 1024)) ? round($bytes / (1024 * 1024 * 1024 * 1024), 2) . ' TB' : (($bytes >= (1024 * 1024 * 1024)) ? round($bytes / (1024 * 1024 * 1024), 2) . ' GB' : (($bytes >= (1024 * 1024)) ? round($bytes / (1024 * 1024), 2) . ' MB' : round($bytes / 1024, 2) . ' KB'));
	return $size;
}

function defport($urls) {
	if (!empty($urls['port'])) return $urls['port'];
	switch(strtolower($urls['scheme'])) {
		case 'http' :
			return '80';
		case 'https' :
			return '443';
		case 'ftp' :
			return '21';
	}
}

function getSize($file) {
	$size = filesize($file);
	if ($size < 0) {
		if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
			$file = @escapeshellarg($file);
			$size = trim(`stat -c%s $file`);
		} else {
			$fsobj = new COM('Scripting.FileSystemObject');
			$f = $fsobj->GetFile($file);
			$size = $file->Size;
		}
	}
	return $size;
}

function purge_files($delay) {
	if (file_exists(CONFIG_DIR . 'files.lst') && is_numeric($delay) && $delay > 0) {
		$files_lst = file(CONFIG_DIR . 'files.lst');
		$files_new = '';
		foreach ($files_lst as $files_line) {
			$files_data = unserialize(trim($files_line));
			if (file_exists($files_data['name']) && is_file($files_data['name'])) {
				if (time() - $files_data['date'] >= $delay) @unlink ($files_data['name']);
				else $files_new .= $files_line;
			}
		}
		file_put_contents(CONFIG_DIR . 'files.lst', $files_new);
	}
}

// Using this function instead due to some compatibility problems
function is__writable($path) {
	//will work in despite of Windows ACLs bug
	//NOTE: use a trailing slash for folders!!!
	//see http://bugs.php.net/bug.php?id=27609
	//see http://bugs.php.net/bug.php?id=30931

	if ($path[strlen($path) - 1] == '/') return is__writable($path . uniqid(mt_rand()) . '.tmp');// recursively return a temporary file path
	else if (is_dir($path)) return is__writable($path . '/' . uniqid(mt_rand()) . '.tmp');
	// check tmp file for read/write capabilities
	$rm = file_exists($path);
	$f = @fopen($path, 'a');
	if ($f === false) return false;
	fclose($f);
	if (!$rm) unlink($path);
	return true;
}

function link_for_file($filename, $only_link = FALSE, $style = '') {
	$inCurrDir = strpos(dirname($filename), ROOT_DIR) !== FALSE ? TRUE : FALSE;
	if ($inCurrDir) {
		$Path = parse_url($_SERVER['SCRIPT_NAME']);
		$Path = substr($Path['path'], 0, strlen($Path['path']) - strlen(strrchr($Path['path'], '/')));
		$Path = str_replace('\\', '/', $Path.substr(dirname($filename), strlen(ROOT_DIR)));
	} elseif (dirname($_SERVER ['SCRIPT_NAME'].'safe') != '/') {
		$in_webdir_path = dirname(str_replace('\\', '/', $_SERVER ['SCRIPT_NAME'].'safe'));
		$in_webdir_sub = substr_count($in_webdir_path, '/');
		$in_webdir_root = ROOT_DIR.'/';
		for ($i=1; $i <= $in_webdir_sub; $i++) {
			$in_webdir_path = substr($in_webdir_path, 0, strrpos($in_webdir_path, '/'));
			$in_webdir_root = realpath($in_webdir_root.'/../').'/';
			$in_webdir = (strpos(str_replace('\\', '/', dirname($filename).'/'), str_replace('\\', '/', $in_webdir_root)) === 0) ? TRUE : FALSE;
			if ($in_webdir) {
				$Path = dirname($in_webdir_path.'/'.substr($filename, strlen($in_webdir_root)));
				break;
			}
		}
	} else {
		$Path = FALSE;
		if ($only_link) return '';
	}
	$basename = basename($filename);
	$Path = $Path.'/'.rawurlencode($basename);
	if ($only_link) return 'http://'.$_SERVER['HTTP_HOST'].$Path;
	elseif ($Path === FALSE) return '<span>' . htmlspecialchars($basename) . '</span>';
	else return '<a href="'.htmlspecialchars($Path, ENT_QUOTES).'"'.($style !== '' ? ' '.$style : '').'>'.htmlspecialchars($basename).'</a>';
}

function lang($id) {
	global $lang;
	if (empty($lang) || !is_array($lang)) $lang = array();
	if (basename($GLOBALS['options']['default_language']) != 'en' && file_exists('languages/en.php')) require_once('languages/en.php');
	require_once('languages/'.basename($GLOBALS['options']['default_language']).'.php');
	return $lang[$id];
}

#need to keep premium account cookies safe!
function encrypt($string) {
	global $secretkey;
	if (!$secretkey) return html_error('Value for $secretkey is empty, please create a random one (56 chars max) in config.php!');
	require_once 'class.pcrypt.php';

	/*
	MODE: MODE_ECB or MODE_CBC
	ALGO: BLOWFISH
	KEY:  Your secret key :) (max lenght: 56)
	*/
	$crypt = new pcrypt(MODE_CBC, 'BLOWFISH', "$secretkey");

	// to encrypt
	$ciphertext = $crypt->encrypt($string);

	return $ciphertext;
}

function decrypt($string) {
	global $secretkey;
	if (!$secretkey) return html_error('Value for $secretkey is empty, please create a random one (56 chars max) in config.php!');
	require_once 'class.pcrypt.php';

	/*
	MODE: MODE_ECB or MODE_CBC
	ALGO: BLOWFISH
	KEY:  Your secret key :) (max lenght: 56)
	*/
	$crypt = new pcrypt(MODE_CBC, 'BLOWFISH', "$secretkey");

	// to decrypt
	$decrypted = $crypt->decrypt($string);

	return $decrypted;
}

/**
 * Textarea for debugging variable
 * @param string The variable you want to debug
 * @param int Column for variable display
 * @param int Rows for variable display
 * @param bool Options to continue or not process
 * @param string Charset encoding for htmlspecialchars
 */
function textarea($var, $cols = 100, $rows = 30, $stop = false, $char = 'UTF-8') {
	$cols = ($cols == 0) ? 100 : $cols;
	$rows = ($rows == 0) ? 30 : $rows;
	if ($char === false) $char = 'ISO-8859-1';
	echo "\n<br /><textarea cols='$cols' rows='$rows' readonly='readonly'>";
	if (is_array($var)) $text = htmlspecialchars(print_r($var, true), ENT_QUOTES, $char);
	else $text = htmlspecialchars($var, ENT_QUOTES, $char);
	if (empty($text) && !empty($var)) { // Fix "empty?" textarea bug
		$char = ($char == 'ISO-8859-1') ? '' : 'ISO-8859-1';
		if (is_array($var)) $text = htmlspecialchars(print_r($var, true), ENT_QUOTES, $char);
		else $text = htmlspecialchars($var, ENT_QUOTES, $char);
	}
	echo "$text</textarea><br />\n";
	if ($stop) exit;
}

// Get time in miliseconds, like getTime() in javascript
function jstime() {
	list($u, $s) = explode(' ', microtime()); 
	return sprintf('%d%03d', $s, $u*1000);
}

function check_referer() {
	$refhost = !empty($_SERVER['HTTP_REFERER']) ? cut_str($_SERVER['HTTP_REFERER'], '://', '/') : false;
	if (empty($refhost) || empty($_SERVER['SERVER_ADDR'])) return;

	//Remove the port.
	$httphost = ($pos = strpos($_SERVER['HTTP_HOST'], ':')) !== false ? substr($_SERVER['HTTP_HOST'], 0, $pos) : $_SERVER['HTTP_HOST'];
	$refhost = ($pos = strpos($refhost, ':')) !== false ? substr($refhost, 0, $pos) : $refhost;
	// If there is a login on the referer, remove it.
	$refhost = ($pos = strpos($refhost, '@')) !== false ? substr($refhost, $pos+1) : $refhost;

	$whitelist = array($httphost, 'localhost', 'rapidleech.com');
	$is_ext = ($refhost == $_SERVER['SERVER_ADDR'] ? false : true);
	if ($is_ext)
		foreach ($whitelist as $host)
			if (host_matches($host, $refhost)) {
				$is_ext = false;
				break;
			}

	if ($is_ext) {
		// Uncomment next line if you want rickroll the users from Form leechers.
		// header("Location: http://www.youtube.com/watch?v=oHg5SJYRHA0");
		html_error(sprintf(lang(7), $refhost, 'External referer not allowed.'));
	}
}

function rebuild_url($url) {
	$url['scheme'] = strtolower($url['scheme']);
	return $url['scheme'] . '://' . (!empty($url['user']) && !empty($url['pass']) ? rawurlencode($url['user']) . ':' . rawurlencode($url['pass']) . '@' : '') . strtolower($url['host']) . (!empty($url['port']) && $url['port'] != defport(array('scheme' => $url['scheme'])) ? ':' . $url['port'] : '') . (empty($url['path']) ? '/' : $url['path']) . (!empty($url['query']) ? '?' . $url['query'] : '') . (!empty($url['fragment']) ? '#' . $url['fragment'] : '');
}

if (!function_exists('http_chunked_decode')) {
	// Added implementation from a comment at php.net's function page
	function http_chunked_decode($chunk) {
		$pos = 0;
		$len = strlen($chunk);
		$dechunk = null;

		while(($pos < $len) && ($chunkLenHex = substr($chunk, $pos, ($newlineAt = strpos($chunk, "\n", $pos + 1)) - $pos))) {
			if (!is_hex($chunkLenHex)) {
				trigger_error('Value is not properly chunk encoded_', E_USER_WARNING);
				return false;
			}

			$pos = $newlineAt + 1;
			$chunkLen = hexdec(rtrim($chunkLenHex, "\r\n"));
			$dechunk .= substr($chunk, $pos, $chunkLen);
			$pos = strpos($chunk, "\n", $pos + $chunkLen) + 1;
		}
		return $dechunk;
	}

	function is_hex($hex) {
		$hex = strtolower(trim(ltrim($hex, '0')));
		if (empty($hex)) $hex = 0;
		$dec = hexdec($hex);
		return ($hex == dechex($dec));
	}
}

function host_matches($site, $host) {
	if (empty($site) || empty($host)) return false;
	if (strtolower($site) == strtolower($host)) return true;
	if (($pos = strripos($host, $site)) !== false && ($pos + strlen($site) == strlen($host)) && $pos > 1 && substr($host, $pos - 1, 1) == '.') return true;
	return false;
}

function GetDefaultParams() {
	$DParam = array();
	if (!empty($_GET['useproxy']) && !empty($_GET['proxy'])) {
		$DParam['useproxy'] = 'on';
		$DParam['proxy'] = $_GET['proxy'];
		if (!empty($GLOBALS['pauth'])) $DParam['pauth'] = urlencode(encrypt($GLOBALS['pauth']));
	}
	if (isset($_GET['autoclose'])) $DParam['autoclose'] = '1';
	if (isset($_GET['audl'])) $DParam['audl'] = 'doum';
	if (isset($_GET['premium_acc']) && $_GET['premium_acc'] == 'on') $DParam['premium_acc'] = 'on';
	if ($GLOBALS['options']['download_dir_is_changeable'] && !empty($_GET['path'])) $DParam['saveto'] = urlencode($_GET['path']);
	$params = array('add_comment', 'domail', 'comment', 'email', 'split', 'partSize', 'method', 'uploadlater', 'uploadtohost');
	foreach ($params as $key) if (!empty($_GET[$key])) $DParam[$key] = $_GET[$key];
	return $DParam;
}

?>
<?php
// --------------------------------------------------------------------------------
// PhpConcept Library - Zip Module 2.8.2
// --------------------------------------------------------------------------------
// License GNU/LGPL - Vincent Blavet - August 2009
// http://www.phpconcept.net
// --------------------------------------------------------------------------------
//
// Presentation :
//   PclZip is a PHP library that manage ZIP archives.
//   So far tests show that archives generated by PclZip are readable by
//   WinZip application and other tools.
//
// Description :
//   See readme.txt and http://www.phpconcept.net
//
// Warning :
//   This library and the associated files are non commercial, non professional
//   work.
//   It should not have unexpected results. However if any damage is caused by
//   this software the author can not be responsible.
//   The use of this software is at the risk of the user.
//
// --------------------------------------------------------------------------------
// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $
// --------------------------------------------------------------------------------

  // ----- Constants
  if (!defined('PCLZIP_READ_BLOCK_SIZE')) {
    define( 'PCLZIP_READ_BLOCK_SIZE', 2048 );
  }
  
  // ----- File list separator
  // In version 1.x of PclZip, the separator for file list is a space
  // (which is not a very smart choice, specifically for windows paths !).
  // A better separator should be a comma (,). This constant gives you the
  // abilty to change that.
  // However notice that changing this value, may have impact on existing
  // scripts, using space separated filenames.
  // Recommanded values for compatibility with older versions :
  //define( 'PCLZIP_SEPARATOR', ' ' );
  // Recommanded values for smart separation of filenames.
  if (!defined('PCLZIP_SEPARATOR')) {
    define( 'PCLZIP_SEPARATOR', ',' );
  }

  // ----- Error configuration
  // 0 : PclZip Class integrated error handling
  // 1 : PclError external library error handling. By enabling this
  //     you must ensure that you have included PclError library.
  // [2,...] : reserved for futur use
  if (!defined('PCLZIP_ERROR_EXTERNAL')) {
    define( 'PCLZIP_ERROR_EXTERNAL', 0 );
  }

  // ----- Optional static temporary directory
  //       By default temporary files are generated in the script current
  //       path.
  //       If defined :
  //       - MUST BE terminated by a '/'.
  //       - MUST be a valid, already created directory
  //       Samples :
  // define( 'PCLZIP_TEMPORARY_DIR', '/temp/' );
  // define( 'PCLZIP_TEMPORARY_DIR', 'C:/Temp/' );
  if (!defined('PCLZIP_TEMPORARY_DIR')) {
    define( 'PCLZIP_TEMPORARY_DIR', '' );
  }

  // ----- Optional threshold ratio for use of temporary files
  //       Pclzip sense the size of the file to add/extract and decide to
  //       use or not temporary file. The algorythm is looking for 
  //       memory_limit of PHP and apply a ratio.
  //       threshold = memory_limit * ratio.
  //       Recommended values are under 0.5. Default 0.47.
  //       Samples :
  // define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.5 );
  if (!defined('PCLZIP_TEMPORARY_FILE_RATIO')) {
    define( 'PCLZIP_TEMPORARY_FILE_RATIO', 0.47 );
  }

// --------------------------------------------------------------------------------
// ***** UNDER THIS LINE NOTHING NEEDS TO BE MODIFIED *****
// --------------------------------------------------------------------------------

  // ----- Global variables
  $g_pclzip_version = "2.8.2";

  // ----- Error codes
  //   -1 : Unable to open file in binary write mode
  //   -2 : Unable to open file in binary read mode
  //   -3 : Invalid parameters
  //   -4 : File does not exist
  //   -5 : Filename is too long (max. 255)
  //   -6 : Not a valid zip file
  //   -7 : Invalid extracted file size
  //   -8 : Unable to create directory
  //   -9 : Invalid archive extension
  //  -10 : Invalid archive format
  //  -11 : Unable to delete file (unlink)
  //  -12 : Unable to rename file (rename)
  //  -13 : Invalid header checksum
  //  -14 : Invalid archive size
  define( 'PCLZIP_ERR_USER_ABORTED', 2 );
  define( 'PCLZIP_ERR_NO_ERROR', 0 );
  define( 'PCLZIP_ERR_WRITE_OPEN_FAIL', -1 );
  define( 'PCLZIP_ERR_READ_OPEN_FAIL', -2 );
  define( 'PCLZIP_ERR_INVALID_PARAMETER', -3 );
  define( 'PCLZIP_ERR_MISSING_FILE', -4 );
  define( 'PCLZIP_ERR_FILENAME_TOO_LONG', -5 );
  define( 'PCLZIP_ERR_INVALID_ZIP', -6 );
  define( 'PCLZIP_ERR_BAD_EXTRACTED_FILE', -7 );
  define( 'PCLZIP_ERR_DIR_CREATE_FAIL', -8 );
  define( 'PCLZIP_ERR_BAD_EXTENSION', -9 );
  define( 'PCLZIP_ERR_BAD_FORMAT', -10 );
  define( 'PCLZIP_ERR_DELETE_FILE_FAIL', -11 );
  define( 'PCLZIP_ERR_RENAME_FILE_FAIL', -12 );
  define( 'PCLZIP_ERR_BAD_CHECKSUM', -13 );
  define( 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', -14 );
  define( 'PCLZIP_ERR_MISSING_OPTION_VALUE', -15 );
  define( 'PCLZIP_ERR_INVALID_OPTION_VALUE', -16 );
  define( 'PCLZIP_ERR_ALREADY_A_DIRECTORY', -17 );
  define( 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', -18 );
  define( 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION', -19 );
  define( 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE', -20 );
  define( 'PCLZIP_ERR_DIRECTORY_RESTRICTION', -21 );

  // ----- Options values
  define( 'PCLZIP_OPT_PATH', 77001 );
  define( 'PCLZIP_OPT_ADD_PATH', 77002 );
  define( 'PCLZIP_OPT_REMOVE_PATH', 77003 );
  define( 'PCLZIP_OPT_REMOVE_ALL_PATH', 77004 );
  define( 'PCLZIP_OPT_SET_CHMOD', 77005 );
  define( 'PCLZIP_OPT_EXTRACT_AS_STRING', 77006 );
  define( 'PCLZIP_OPT_NO_COMPRESSION', 77007 );
  define( 'PCLZIP_OPT_BY_NAME', 77008 );
  define( 'PCLZIP_OPT_BY_INDEX', 77009 );
  define( 'PCLZIP_OPT_BY_EREG', 77010 );
  define( 'PCLZIP_OPT_BY_PREG', 77011 );
  define( 'PCLZIP_OPT_COMMENT', 77012 );
  define( 'PCLZIP_OPT_ADD_COMMENT', 77013 );
  define( 'PCLZIP_OPT_PREPEND_COMMENT', 77014 );
  define( 'PCLZIP_OPT_EXTRACT_IN_OUTPUT', 77015 );
  define( 'PCLZIP_OPT_REPLACE_NEWER', 77016 );
  define( 'PCLZIP_OPT_STOP_ON_ERROR', 77017 );
  // Having big trouble with crypt. Need to multiply 2 long int
  // which is not correctly supported by PHP ...
  //define( 'PCLZIP_OPT_CRYPT', 77018 );
  define( 'PCLZIP_OPT_EXTRACT_DIR_RESTRICTION', 77019 );
  define( 'PCLZIP_OPT_TEMP_FILE_THRESHOLD', 77020 );
  define( 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD', 77020 ); // alias
  define( 'PCLZIP_OPT_TEMP_FILE_ON', 77021 );
  define( 'PCLZIP_OPT_ADD_TEMP_FILE_ON', 77021 ); // alias
  define( 'PCLZIP_OPT_TEMP_FILE_OFF', 77022 );
  define( 'PCLZIP_OPT_ADD_TEMP_FILE_OFF', 77022 ); // alias
  
  // ----- File description attributes
  define( 'PCLZIP_ATT_FILE_NAME', 79001 );
  define( 'PCLZIP_ATT_FILE_NEW_SHORT_NAME', 79002 );
  define( 'PCLZIP_ATT_FILE_NEW_FULL_NAME', 79003 );
  define( 'PCLZIP_ATT_FILE_MTIME', 79004 );
  define( 'PCLZIP_ATT_FILE_CONTENT', 79005 );
  define( 'PCLZIP_ATT_FILE_COMMENT', 79006 );

  // ----- Call backs values
  define( 'PCLZIP_CB_PRE_EXTRACT', 78001 );
  define( 'PCLZIP_CB_POST_EXTRACT', 78002 );
  define( 'PCLZIP_CB_PRE_ADD', 78003 );
  define( 'PCLZIP_CB_POST_ADD', 78004 );
  /* For futur use
  define( 'PCLZIP_CB_PRE_LIST', 78005 );
  define( 'PCLZIP_CB_POST_LIST', 78006 );
  define( 'PCLZIP_CB_PRE_DELETE', 78007 );
  define( 'PCLZIP_CB_POST_DELETE', 78008 );
  */

  // --------------------------------------------------------------------------------
  // Class : PclZip
  // Description :
  //   PclZip is the class that represent a Zip archive.
  //   The public methods allow the manipulation of the archive.
  // Attributes :
  //   Attributes must not be accessed directly.
  // Methods :
  //   PclZip() : Object creator
  //   create() : Creates the Zip archive
  //   listContent() : List the content of the Zip archive
  //   extract() : Extract the content of the archive
  //   properties() : List the properties of the archive
  // --------------------------------------------------------------------------------
  class PclZip
  {
    // ----- Filename of the zip file
    var $zipname = '';

    // ----- File descriptor of the zip file
    var $zip_fd = 0;

    // ----- Internal error handling
    var $error_code = 1;
    var $error_string = '';
    
    // ----- Current status of the magic_quotes_runtime
    // This value store the php configuration for magic_quotes
    // The class can then disable the magic_quotes and reset it after
    var $magic_quotes_status;

  // --------------------------------------------------------------------------------
  // Function : PclZip()
  // Description :
  //   Creates a PclZip object and set the name of the associated Zip archive
  //   filename.
  //   Note that no real action is taken, if the archive does not exist it is not
  //   created. Use create() for that.
  // --------------------------------------------------------------------------------
  function __construct($p_zipname)
  {

    // ----- Tests the zlib
    if (!function_exists('gzopen'))
    {
      die('Abort '.basename(__FILE__).' : Missing zlib extensions');
    }

    // ----- Set the attributes
    $this->zipname = $p_zipname;
    $this->zip_fd = 0;
    $this->magic_quotes_status = -1;

    // ----- Return
    return;
  }

  public function PclZip($p_zipname) {
    self::__construct($p_zipname);
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   create($p_filelist, $p_add_dir="", $p_remove_dir="")
  //   create($p_filelist, $p_option, $p_option_value, ...)
  // Description :
  //   This method supports two different synopsis. The first one is historical.
  //   This method creates a Zip Archive. The Zip file is created in the
  //   filesystem. The files and directories indicated in $p_filelist
  //   are added in the archive. See the parameters description for the
  //   supported format of $p_filelist.
  //   When a directory is in the list, the directory and its content is added
  //   in the archive.
  //   In this synopsis, the function takes an optional variable list of
  //   options. See bellow the supported options.
  // Parameters :
  //   $p_filelist : An array containing file or directory names, or
  //                 a string containing one filename or one directory name, or
  //                 a string containing a list of filenames and/or directory
  //                 names separated by spaces.
  //   $p_add_dir : A path to add before the real path of the archived file,
  //                in order to have it memorized in the archive.
  //   $p_remove_dir : A path to remove from the real path of the file to archive,
  //                   in order to have a shorter path memorized in the archive.
  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir
  //                   is removed first, before $p_add_dir is added.
  // Options :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_OPT_COMMENT :
  //   PCLZIP_CB_PRE_ADD :
  //   PCLZIP_CB_POST_ADD :
  // Return Values :
  //   0 on failure,
  //   The list of the added files, with a status of the add action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function create($p_filelist)
  {
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Set default values
    $v_options = array();
    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;

    // ----- Look for variable options arguments
    $v_size = func_num_args();

    // ----- Look for arguments
    if ($v_size > 1) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Remove from the options list the first argument
      array_shift($v_arg_list);
      $v_size--;

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_ADD => 'optional',
                                                   PCLZIP_CB_POST_ADD => 'optional',
                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',
                                                   PCLZIP_OPT_COMMENT => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
                                                   //, PCLZIP_OPT_CRYPT => 'optional'
                                             ));
        if ($v_result != 1) {
          return 0;
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {

        // ----- Get the first argument
        $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
		                       "Invalid number / type of arguments");
          return 0;
        }
      }
    }
    
    // ----- Look for default option values
    $this->privOptionDefaultThreshold($v_options);

    // ----- Init
    $v_string_list = array();
    $v_att_list = array();
    $v_filedescr_list = array();
    $p_result_list = array();
    
    // ----- Look if the $p_filelist is really an array
    if (is_array($p_filelist)) {
    
      // ----- Look if the first element is also an array
      //       This will mean that this is a file description entry
      if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
        $v_att_list = $p_filelist;
      }
      
      // ----- The list is a list of string names
      else {
        $v_string_list = $p_filelist;
      }
    }

    // ----- Look if the $p_filelist is a string
    else if (is_string($p_filelist)) {
      // ----- Create a list from the string
      $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
    }

    // ----- Invalid variable type for $p_filelist
    else {
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist");
      return 0;
    }
    
    // ----- Reformat the string list
    if (sizeof($v_string_list) != 0) {
      foreach ($v_string_list as $v_string) {
        if ($v_string != '') {
          $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
        }
        else {
        }
      }
    }
    
    // ----- For each file in the list check the attributes
    $v_supported_attributes
    = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
             ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'
             ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'
             ,PCLZIP_ATT_FILE_MTIME => 'optional'
             ,PCLZIP_ATT_FILE_CONTENT => 'optional'
             ,PCLZIP_ATT_FILE_COMMENT => 'optional'
						);
    foreach ($v_att_list as $v_entry) {
      $v_result = $this->privFileDescrParseAtt($v_entry,
                                               $v_filedescr_list[],
                                               $v_options,
                                               $v_supported_attributes);
      if ($v_result != 1) {
        return 0;
      }
    }

    // ----- Expand the filelist (expand directories)
    $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
    if ($v_result != 1) {
      return 0;
    }

    // ----- Call the create fct
    $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options);
    if ($v_result != 1) {
      return 0;
    }

    // ----- Return
    return $p_result_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   add($p_filelist, $p_add_dir="", $p_remove_dir="")
  //   add($p_filelist, $p_option, $p_option_value, ...)
  // Description :
  //   This method supports two synopsis. The first one is historical.
  //   This methods add the list of files in an existing archive.
  //   If a file with the same name already exists, it is added at the end of the
  //   archive, the first one is still present.
  //   If the archive does not exist, it is created.
  // Parameters :
  //   $p_filelist : An array containing file or directory names, or
  //                 a string containing one filename or one directory name, or
  //                 a string containing a list of filenames and/or directory
  //                 names separated by spaces.
  //   $p_add_dir : A path to add before the real path of the archived file,
  //                in order to have it memorized in the archive.
  //   $p_remove_dir : A path to remove from the real path of the file to archive,
  //                   in order to have a shorter path memorized in the archive.
  //                   When $p_add_dir and $p_remove_dir are set, $p_remove_dir
  //                   is removed first, before $p_add_dir is added.
  // Options :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_OPT_COMMENT :
  //   PCLZIP_OPT_ADD_COMMENT :
  //   PCLZIP_OPT_PREPEND_COMMENT :
  //   PCLZIP_CB_PRE_ADD :
  //   PCLZIP_CB_POST_ADD :
  // Return Values :
  //   0 on failure,
  //   The list of the added files, with a status of the add action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function add($p_filelist)
  {
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Set default values
    $v_options = array();
    $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE;

    // ----- Look for variable options arguments
    $v_size = func_num_args();

    // ----- Look for arguments
    if ($v_size > 1) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Remove form the options list the first argument
      array_shift($v_arg_list);
      $v_size--;

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_ADD => 'optional',
                                                   PCLZIP_CB_POST_ADD => 'optional',
                                                   PCLZIP_OPT_NO_COMPRESSION => 'optional',
                                                   PCLZIP_OPT_COMMENT => 'optional',
                                                   PCLZIP_OPT_ADD_COMMENT => 'optional',
                                                   PCLZIP_OPT_PREPEND_COMMENT => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
                                                   //, PCLZIP_OPT_CRYPT => 'optional'
												   ));
        if ($v_result != 1) {
          return 0;
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {

        // ----- Get the first argument
        $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");

          // ----- Return
          return 0;
        }
      }
    }

    // ----- Look for default option values
    $this->privOptionDefaultThreshold($v_options);

    // ----- Init
    $v_string_list = array();
    $v_att_list = array();
    $v_filedescr_list = array();
    $p_result_list = array();
    
    // ----- Look if the $p_filelist is really an array
    if (is_array($p_filelist)) {
    
      // ----- Look if the first element is also an array
      //       This will mean that this is a file description entry
      if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
        $v_att_list = $p_filelist;
      }
      
      // ----- The list is a list of string names
      else {
        $v_string_list = $p_filelist;
      }
    }

    // ----- Look if the $p_filelist is a string
    else if (is_string($p_filelist)) {
      // ----- Create a list from the string
      $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
    }

    // ----- Invalid variable type for $p_filelist
    else {
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist");
      return 0;
    }
    
    // ----- Reformat the string list
    if (sizeof($v_string_list) != 0) {
      foreach ($v_string_list as $v_string) {
        $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
      }
    }
    
    // ----- For each file in the list check the attributes
    $v_supported_attributes
    = array ( PCLZIP_ATT_FILE_NAME => 'mandatory'
             ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional'
             ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional'
             ,PCLZIP_ATT_FILE_MTIME => 'optional'
             ,PCLZIP_ATT_FILE_CONTENT => 'optional'
             ,PCLZIP_ATT_FILE_COMMENT => 'optional'
						);
    foreach ($v_att_list as $v_entry) {
      $v_result = $this->privFileDescrParseAtt($v_entry,
                                               $v_filedescr_list[],
                                               $v_options,
                                               $v_supported_attributes);
      if ($v_result != 1) {
        return 0;
      }
    }

    // ----- Expand the filelist (expand directories)
    $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
    if ($v_result != 1) {
      return 0;
    }

    // ----- Call the create fct
    $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);
    if ($v_result != 1) {
      return 0;
    }

    // ----- Return
    return $p_result_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : listContent()
  // Description :
  //   This public method, gives the list of the files and directories, with their
  //   properties.
  //   The properties of each entries in the list are (used also in other functions) :
  //     filename : Name of the file. For a create or add action it is the filename
  //                given by the user. For an extract function it is the filename
  //                of the extracted file.
  //     stored_filename : Name of the file / directory stored in the archive.
  //     size : Size of the stored file.
  //     compressed_size : Size of the file's data compressed in the archive
  //                       (without the headers overhead)
  //     mtime : Last known modification date of the file (UNIX timestamp)
  //     comment : Comment associated with the file
  //     folder : true | false
  //     index : index of the file in the archive
  //     status : status of the action (depending of the action) :
  //              Values are :
  //                ok : OK !
  //                filtered : the file / dir is not extracted (filtered by user)
  //                already_a_directory : the file can not be extracted because a
  //                                      directory with the same name already exists
  //                write_protected : the file can not be extracted because a file
  //                                  with the same name already exists and is
  //                                  write protected
  //                newer_exist : the file was not extracted because a newer file exists
  //                path_creation_fail : the file is not extracted because the folder
  //                                     does not exist and can not be created
  //                write_error : the file was not extracted because there was a
  //                              error while writing the file
  //                read_error : the file was not extracted because there was a error
  //                             while reading the file
  //                invalid_header : the file was not extracted because of an archive
  //                                 format error (bad file header)
  //   Note that each time a method can continue operating when there
  //   is an action error on a file, the error is only logged in the file status.
  // Return Values :
  //   0 on an unrecoverable failure,
  //   The list of the files in the archive.
  // --------------------------------------------------------------------------------
  function listContent()
  {
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      return(0);
    }

    // ----- Call the extracting fct
    $p_list = array();
    if (($v_result = $this->privList($p_list)) != 1)
    {
      unset($p_list);
      return(0);
    }

    // ----- Return
    return $p_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   extract($p_path="./", $p_remove_path="")
  //   extract([$p_option, $p_option_value, ...])
  // Description :
  //   This method supports two synopsis. The first one is historical.
  //   This method extract all the files / directories from the archive to the
  //   folder indicated in $p_path.
  //   If you want to ignore the 'root' part of path of the memorized files
  //   you can indicate this in the optional $p_remove_path parameter.
  //   By default, if a newer file with the same name already exists, the
  //   file is not extracted.
  //
  //   If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions
  //   are used, the path indicated in PCLZIP_OPT_ADD_PATH is append
  //   at the end of the path value of PCLZIP_OPT_PATH.
  // Parameters :
  //   $p_path : Path where the files and directories are to be extracted
  //   $p_remove_path : First part ('root' part) of the memorized path
  //                    (if any similar) to remove while extracting.
  // Options :
  //   PCLZIP_OPT_PATH :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_CB_PRE_EXTRACT :
  //   PCLZIP_CB_POST_EXTRACT :
  // Return Values :
  //   0 or a negative value on failure,
  //   The list of the extracted files, with a status of the action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function extract()
  {
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      return(0);
    }

    // ----- Set default values
    $v_options = array();
//    $v_path = "./";
    $v_path = '';
    $v_remove_path = "";
    $v_remove_all_path = false;

    // ----- Look for variable options arguments
    $v_size = func_num_args();

    // ----- Default values for option
    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;

    // ----- Look for arguments
    if ($v_size > 0) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',
                                                   PCLZIP_CB_POST_EXTRACT => 'optional',
                                                   PCLZIP_OPT_SET_CHMOD => 'optional',
                                                   PCLZIP_OPT_BY_NAME => 'optional',
                                                   PCLZIP_OPT_BY_EREG => 'optional',
                                                   PCLZIP_OPT_BY_PREG => 'optional',
                                                   PCLZIP_OPT_BY_INDEX => 'optional',
                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
                                                   PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'
                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
                                                   ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
												    ));
        if ($v_result != 1) {
          return 0;
        }

        // ----- Set the arguments
        if (isset($v_options[PCLZIP_OPT_PATH])) {
          $v_path = $v_options[PCLZIP_OPT_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
          // ----- Check for '/' in last path char
          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
            $v_path .= '/';
          }
          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {

        // ----- Get the first argument
        $v_path = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_remove_path = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");

          // ----- Return
          return 0;
        }
      }
    }

    // ----- Look for default option values
    $this->privOptionDefaultThreshold($v_options);

    // ----- Trace

    // ----- Call the extracting fct
    $p_list = array();
    $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path,
	                                     $v_remove_all_path, $v_options);
    if ($v_result < 1) {
      unset($p_list);
      return(0);
    }

    // ----- Return
    return $p_list;
  }
  // --------------------------------------------------------------------------------


  // --------------------------------------------------------------------------------
  // Function :
  //   extractByIndex($p_index, $p_path="./", $p_remove_path="")
  //   extractByIndex($p_index, [$p_option, $p_option_value, ...])
  // Description :
  //   This method supports two synopsis. The first one is historical.
  //   This method is doing a partial extract of the archive.
  //   The extracted files or folders are identified by their index in the
  //   archive (from 0 to n).
  //   Note that if the index identify a folder, only the folder entry is
  //   extracted, not all the files included in the archive.
  // Parameters :
  //   $p_index : A single index (integer) or a string of indexes of files to
  //              extract. The form of the string is "0,4-6,8-12" with only numbers
  //              and '-' for range or ',' to separate ranges. No spaces or ';'
  //              are allowed.
  //   $p_path : Path where the files and directories are to be extracted
  //   $p_remove_path : First part ('root' part) of the memorized path
  //                    (if any similar) to remove while extracting.
  // Options :
  //   PCLZIP_OPT_PATH :
  //   PCLZIP_OPT_ADD_PATH :
  //   PCLZIP_OPT_REMOVE_PATH :
  //   PCLZIP_OPT_REMOVE_ALL_PATH :
  //   PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and
  //     not as files.
  //     The resulting content is in a new field 'content' in the file
  //     structure.
  //     This option must be used alone (any other options are ignored).
  //   PCLZIP_CB_PRE_EXTRACT :
  //   PCLZIP_CB_POST_EXTRACT :
  // Return Values :
  //   0 on failure,
  //   The list of the extracted files, with a status of the action.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  //function extractByIndex($p_index, options...)
  function extractByIndex($p_index)
  {
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      return(0);
    }

    // ----- Set default values
    $v_options = array();
//    $v_path = "./";
    $v_path = '';
    $v_remove_path = "";
    $v_remove_all_path = false;

    // ----- Look for variable options arguments
    $v_size = func_num_args();

    // ----- Default values for option
    $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;

    // ----- Look for arguments
    if ($v_size > 1) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Remove form the options list the first argument
      array_shift($v_arg_list);
      $v_size--;

      // ----- Look for first arg
      if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {

        // ----- Parse the options
        $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                            array (PCLZIP_OPT_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_PATH => 'optional',
                                                   PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
                                                   PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
                                                   PCLZIP_OPT_ADD_PATH => 'optional',
                                                   PCLZIP_CB_PRE_EXTRACT => 'optional',
                                                   PCLZIP_CB_POST_EXTRACT => 'optional',
                                                   PCLZIP_OPT_SET_CHMOD => 'optional',
                                                   PCLZIP_OPT_REPLACE_NEWER => 'optional'
                                                   ,PCLZIP_OPT_STOP_ON_ERROR => 'optional'
                                                   ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_ON => 'optional',
                                                   PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
												   ));
        if ($v_result != 1) {
          return 0;
        }

        // ----- Set the arguments
        if (isset($v_options[PCLZIP_OPT_PATH])) {
          $v_path = $v_options[PCLZIP_OPT_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
          $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
          $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
        }
        if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
          // ----- Check for '/' in last path char
          if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
            $v_path .= '/';
          }
          $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
        }
        if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
          $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE;
        }
        else {
        }
      }

      // ----- Look for 2 args
      // Here we need to support the first historic synopsis of the
      // method.
      else {

        // ----- Get the first argument
        $v_path = $v_arg_list[0];

        // ----- Look for the optional second argument
        if ($v_size == 2) {
          $v_remove_path = $v_arg_list[1];
        }
        else if ($v_size > 2) {
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");

          // ----- Return
          return 0;
        }
      }
    }

    // ----- Trace

    // ----- Trick
    // Here I want to reuse extractByRule(), so I need to parse the $p_index
    // with privParseOptions()
    $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index);
    $v_options_trick = array();
    $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick,
                                        array (PCLZIP_OPT_BY_INDEX => 'optional' ));
    if ($v_result != 1) {
        return 0;
    }
    $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];

    // ----- Look for default option values
    $this->privOptionDefaultThreshold($v_options);

    // ----- Call the extracting fct
    if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {
        return(0);
    }

    // ----- Return
    return $p_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function :
  //   delete([$p_option, $p_option_value, ...])
  // Description :
  //   This method removes files from the archive.
  //   If no parameters are given, then all the archive is emptied.
  // Parameters :
  //   None or optional arguments.
  // Options :
  //   PCLZIP_OPT_BY_INDEX :
  //   PCLZIP_OPT_BY_NAME :
  //   PCLZIP_OPT_BY_EREG : 
  //   PCLZIP_OPT_BY_PREG :
  // Return Values :
  //   0 on failure,
  //   The list of the files which are still present in the archive.
  //   (see PclZip::listContent() for list entry format)
  // --------------------------------------------------------------------------------
  function delete()
  {
    $v_result=1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      return(0);
    }

    // ----- Set default values
    $v_options = array();

    // ----- Look for variable options arguments
    $v_size = func_num_args();

    // ----- Look for arguments
    if ($v_size > 0) {
      // ----- Get the arguments
      $v_arg_list = func_get_args();

      // ----- Parse the options
      $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options,
                                        array (PCLZIP_OPT_BY_NAME => 'optional',
                                               PCLZIP_OPT_BY_EREG => 'optional',
                                               PCLZIP_OPT_BY_PREG => 'optional',
                                               PCLZIP_OPT_BY_INDEX => 'optional' ));
      if ($v_result != 1) {
          return 0;
      }
    }

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Call the delete fct
    $v_list = array();
    if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) {
      $this->privSwapBackMagicQuotes();
      unset($v_list);
      return(0);
    }

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    return $v_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : deleteByIndex()
  // Description :
  //   ***** Deprecated *****
  //   delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered.
  // --------------------------------------------------------------------------------
  function deleteByIndex($p_index)
  {
    
    $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);

    // ----- Return
    return $p_list;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : properties()
  // Description :
  //   This method gives the properties of the archive.
  //   The properties are :
  //     nb : Number of files in the archive
  //     comment : Comment associated with the archive file
  //     status : not_exist, ok
  // Parameters :
  //   None
  // Return Values :
  //   0 on failure,
  //   An array with the archive properties.
  // --------------------------------------------------------------------------------
  function properties()
  {

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      $this->privSwapBackMagicQuotes();
      return(0);
    }

    // ----- Default properties
    $v_prop = array();
    $v_prop['comment'] = '';
    $v_prop['nb'] = 0;
    $v_prop['status'] = 'not_exist';

    // ----- Look if file exists
    if (@is_file($this->zipname))
    {
      // ----- Open the zip file
      if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
      {
        $this->privSwapBackMagicQuotes();
        
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');

        // ----- Return
        return 0;
      }

      // ----- Read the central directory informations
      $v_central_dir = array();
      if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
      {
        $this->privSwapBackMagicQuotes();
        return 0;
      }

      // ----- Close the zip file
      $this->privCloseFd();

      // ----- Set the user attributes
      $v_prop['comment'] = $v_central_dir['comment'];
      $v_prop['nb'] = $v_central_dir['entries'];
      $v_prop['status'] = 'ok';
    }

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    return $v_prop;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : duplicate()
  // Description :
  //   This method creates an archive by copying the content of an other one. If
  //   the archive already exist, it is replaced by the new one without any warning.
  // Parameters :
  //   $p_archive : The filename of a valid archive, or
  //                a valid PclZip object.
  // Return Values :
  //   1 on success.
  //   0 or a negative value on error (error code).
  // --------------------------------------------------------------------------------
  function duplicate($p_archive)
  {
    $v_result = 1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Look if the $p_archive is a PclZip object
    if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip'))
    {

      // ----- Duplicate the archive
      $v_result = $this->privDuplicate($p_archive->zipname);
    }

    // ----- Look if the $p_archive is a string (so a filename)
    else if (is_string($p_archive))
    {

      // ----- Check that $p_archive is a valid zip file
      // TBC : Should also check the archive format
      if (!is_file($p_archive)) {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'");
        $v_result = PCLZIP_ERR_MISSING_FILE;
      }
      else {
        // ----- Duplicate the archive
        $v_result = $this->privDuplicate($p_archive);
      }
    }

    // ----- Invalid variable
    else
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : merge()
  // Description :
  //   This method merge the $p_archive_to_add archive at the end of the current
  //   one ($this).
  //   If the archive ($this) does not exist, the merge becomes a duplicate.
  //   If the $p_archive_to_add archive does not exist, the merge is a success.
  // Parameters :
  //   $p_archive_to_add : It can be directly the filename of a valid zip archive,
  //                       or a PclZip object archive.
  // Return Values :
  //   1 on success,
  //   0 or negative values on error (see below).
  // --------------------------------------------------------------------------------
  function merge($p_archive_to_add)
  {
    $v_result = 1;

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Check archive
    if (!$this->privCheckFormat()) {
      return(0);
    }

    // ----- Look if the $p_archive_to_add is a PclZip object
    if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip'))
    {

      // ----- Merge the archive
      $v_result = $this->privMerge($p_archive_to_add);
    }

    // ----- Look if the $p_archive_to_add is a string (so a filename)
    else if (is_string($p_archive_to_add))
    {

      // ----- Create a temporary archive
      $v_object_archive = new PclZip($p_archive_to_add);

      // ----- Merge the archive
      $v_result = $this->privMerge($v_object_archive);
    }

    // ----- Invalid variable
    else
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
      $v_result = PCLZIP_ERR_INVALID_PARAMETER;
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------



  // --------------------------------------------------------------------------------
  // Function : errorCode()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function errorCode()
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      return(PclErrorCode());
    }
    else {
      return($this->error_code);
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : errorName()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function errorName($p_with_code=false)
  {
    $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR',
                      PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL',
                      PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL',
                      PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER',
                      PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE',
                      PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG',
                      PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP',
                      PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE',
                      PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL',
                      PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION',
                      PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT',
                      PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL',
                      PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL',
                      PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM',
                      PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP',
                      PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE',
                      PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE',
                      PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION',
                      PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION'
                      ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE'
                      ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION'
                    );

    if (isset($v_name[$this->error_code])) {
      $v_value = $v_name[$this->error_code];
    }
    else {
      $v_value = 'NoName';
    }

    if ($p_with_code) {
      return($v_value.' ('.$this->error_code.')');
    }
    else {
      return($v_value);
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : errorInfo()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function errorInfo($p_full=false)
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      return(PclErrorString());
    }
    else {
      if ($p_full) {
        return($this->errorName(true)." : ".$this->error_string);
      }
      else {
        return($this->error_string." [code ".$this->error_code."]");
      }
    }
  }
  // --------------------------------------------------------------------------------


// --------------------------------------------------------------------------------
// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****
// *****                                                        *****
// *****       THESES FUNCTIONS MUST NOT BE USED DIRECTLY       *****
// --------------------------------------------------------------------------------



  // --------------------------------------------------------------------------------
  // Function : privCheckFormat()
  // Description :
  //   This method check that the archive exists and is a valid zip archive.
  //   Several level of check exists. (futur)
  // Parameters :
  //   $p_level : Level of check. Default 0.
  //              0 : Check the first bytes (magic codes) (default value))
  //              1 : 0 + Check the central directory (futur)
  //              2 : 1 + Check each file header (futur)
  // Return Values :
  //   true on success,
  //   false on error, the error code is set.
  // --------------------------------------------------------------------------------
  function privCheckFormat($p_level=0)
  {
    $v_result = true;

	// ----- Reset the file system cache
    clearstatcache();

    // ----- Reset the error handler
    $this->privErrorReset();

    // ----- Look if the file exits
    if (!is_file($this->zipname)) {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'");
      return(false);
    }

    // ----- Check that the file is readeable
    if (!is_readable($this->zipname)) {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'");
      return(false);
    }

    // ----- Check the magic code
    // TBC

    // ----- Check the central header
    // TBC

    // ----- Check each file header
    // TBC

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privParseOptions()
  // Description :
  //   This internal methods reads the variable list of arguments ($p_options_list,
  //   $p_size) and generate an array with the options and values ($v_result_list).
  //   $v_requested_options contains the options that can be present and those that
  //   must be present.
  //   $v_requested_options is an array, with the option value as key, and 'optional',
  //   or 'mandatory' as value.
  // Parameters :
  //   See above.
  // Return Values :
  //   1 on success.
  //   0 on failure.
  // --------------------------------------------------------------------------------
  function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false)
  {
    $v_result=1;
    
    // ----- Read the options
    $i=0;
    while ($i<$p_size) {

      // ----- Check if the option is supported
      if (!isset($v_requested_options[$p_options_list[$i]])) {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method");

        // ----- Return
        return PclZip::errorCode();
      }

      // ----- Look for next option
      switch ($p_options_list[$i]) {
        // ----- Look for options that request a path value
        case PCLZIP_OPT_PATH :
        case PCLZIP_OPT_REMOVE_PATH :
        case PCLZIP_OPT_ADD_PATH :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);
          $i++;
        break;

        case PCLZIP_OPT_TEMP_FILE_THRESHOLD :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
            return PclZip::errorCode();
          }
          
          // ----- Check for incompatible options
          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
            return PclZip::errorCode();
          }
          
          // ----- Check the value
          $v_value = $p_options_list[$i+1];
          if ((!is_integer($v_value)) || ($v_value<0)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'");
            return PclZip::errorCode();
          }

          // ----- Get the value (and convert it in bytes)
          $v_result_list[$p_options_list[$i]] = $v_value*1048576;
          $i++;
        break;

        case PCLZIP_OPT_TEMP_FILE_ON :
          // ----- Check for incompatible options
          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
            return PclZip::errorCode();
          }
          
          $v_result_list[$p_options_list[$i]] = true;
        break;

        case PCLZIP_OPT_TEMP_FILE_OFF :
          // ----- Check for incompatible options
          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'");
            return PclZip::errorCode();
          }
          // ----- Check for incompatible options
          if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'");
            return PclZip::errorCode();
          }
          
          $v_result_list[$p_options_list[$i]] = true;
        break;

        case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (   is_string($p_options_list[$i+1])
              && ($p_options_list[$i+1] != '')) {
            $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE);
            $i++;
          }
          else {
          }
        break;

        // ----- Look for options that request an array of string for value
        case PCLZIP_OPT_BY_NAME :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (is_string($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];
          }
          else if (is_array($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }
          $i++;
        break;

        // ----- Look for options that request an EREG or PREG expression
        case PCLZIP_OPT_BY_EREG :
          // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
          // to PCLZIP_OPT_BY_PREG
          $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
        case PCLZIP_OPT_BY_PREG :
        //case PCLZIP_OPT_CRYPT :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (is_string($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }
          $i++;
        break;

        // ----- Look for options that takes a string
        case PCLZIP_OPT_COMMENT :
        case PCLZIP_OPT_ADD_COMMENT :
        case PCLZIP_OPT_PREPEND_COMMENT :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE,
			                     "Missing parameter value for option '"
								 .PclZipUtilOptionText($p_options_list[$i])
								 ."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          if (is_string($p_options_list[$i+1])) {
              $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE,
			                     "Wrong parameter value for option '"
								 .PclZipUtilOptionText($p_options_list[$i])
								 ."'");

            // ----- Return
            return PclZip::errorCode();
          }
          $i++;
        break;

        // ----- Look for options that request an array of index
        case PCLZIP_OPT_BY_INDEX :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_work_list = array();
          if (is_string($p_options_list[$i+1])) {

              // ----- Remove spaces
              $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', '');

              // ----- Parse items
              $v_work_list = explode(",", $p_options_list[$i+1]);
          }
          else if (is_integer($p_options_list[$i+1])) {
              $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
          }
          else if (is_array($p_options_list[$i+1])) {
              $v_work_list = $p_options_list[$i+1];
          }
          else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }
          
          // ----- Reduce the index list
          // each index item in the list must be a couple with a start and
          // an end value : [0,3], [5-5], [8-10], ...
          // ----- Check the format of each item
          $v_sort_flag=false;
          $v_sort_value=0;
          for ($j=0; $j<sizeof($v_work_list); $j++) {
              // ----- Explode the item
              $v_item_list = explode("-", $v_work_list[$j]);
              $v_size_item_list = sizeof($v_item_list);
              
              // ----- TBC : Here we might check that each item is a
              // real integer ...
              
              // ----- Look for single value
              if ($v_size_item_list == 1) {
                  // ----- Set the option value
                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[0];
              }
              elseif ($v_size_item_list == 2) {
                  // ----- Set the option value
                  $v_result_list[$p_options_list[$i]][$j]['start'] = $v_item_list[0];
                  $v_result_list[$p_options_list[$i]][$j]['end'] = $v_item_list[1];
              }
              else {
                  // ----- Error log
                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Too many values in index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");

                  // ----- Return
                  return PclZip::errorCode();
              }


              // ----- Look for list sort
              if ($v_result_list[$p_options_list[$i]][$j]['start'] < $v_sort_value) {
                  $v_sort_flag=true;

                  // ----- TBC : An automatic sort should be writen ...
                  // ----- Error log
                  PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Invalid order of index range for option '".PclZipUtilOptionText($p_options_list[$i])."'");

                  // ----- Return
                  return PclZip::errorCode();
              }
              $v_sort_value = $v_result_list[$p_options_list[$i]][$j]['start'];
          }
          
          // ----- Sort the items
          if ($v_sort_flag) {
              // TBC : To Be Completed
          }

          // ----- Next option
          $i++;
        break;

        // ----- Look for options that request no value
        case PCLZIP_OPT_REMOVE_ALL_PATH :
        case PCLZIP_OPT_EXTRACT_AS_STRING :
        case PCLZIP_OPT_NO_COMPRESSION :
        case PCLZIP_OPT_EXTRACT_IN_OUTPUT :
        case PCLZIP_OPT_REPLACE_NEWER :
        case PCLZIP_OPT_STOP_ON_ERROR :
          $v_result_list[$p_options_list[$i]] = true;
        break;

        // ----- Look for options that request an octal value
        case PCLZIP_OPT_SET_CHMOD :
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
          $i++;
        break;

        // ----- Look for options that request a call-back
        case PCLZIP_CB_PRE_EXTRACT :
        case PCLZIP_CB_POST_EXTRACT :
        case PCLZIP_CB_PRE_ADD :
        case PCLZIP_CB_POST_ADD :
        /* for futur use
        case PCLZIP_CB_PRE_DELETE :
        case PCLZIP_CB_POST_DELETE :
        case PCLZIP_CB_PRE_LIST :
        case PCLZIP_CB_POST_LIST :
        */
          // ----- Check the number of parameters
          if (($i+1) >= $p_size) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Get the value
          $v_function_name = $p_options_list[$i+1];

          // ----- Check that the value is a valid existing function
          if (!function_exists($v_function_name)) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'");

            // ----- Return
            return PclZip::errorCode();
          }

          // ----- Set the attribute
          $v_result_list[$p_options_list[$i]] = $v_function_name;
          $i++;
        break;

        default :
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
		                       "Unknown parameter '"
							   .$p_options_list[$i]."'");

          // ----- Return
          return PclZip::errorCode();
      }

      // ----- Next options
      $i++;
    }

    // ----- Look for mandatory options
    if ($v_requested_options !== false) {
      for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
        // ----- Look for mandatory option
        if ($v_requested_options[$key] == 'mandatory') {
          // ----- Look if present
          if (!isset($v_result_list[$key])) {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");

            // ----- Return
            return PclZip::errorCode();
          }
        }
      }
    }
    
    // ----- Look for default values
    if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
      
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privOptionDefaultThreshold()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privOptionDefaultThreshold(&$p_options)
  {
    $v_result=1;
    
    if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
        || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) {
      return $v_result;
    }
    
    // ----- Get 'memory_limit' configuration value
    $v_memory_limit = ini_get('memory_limit');
    $v_memory_limit = trim($v_memory_limit);
    $last = strtolower(substr($v_memory_limit, -1));
 
    if($last == 'g')
        //$v_memory_limit = $v_memory_limit*1024*1024*1024;
        $v_memory_limit = $v_memory_limit*1073741824;
    if($last == 'm')
        //$v_memory_limit = $v_memory_limit*1024*1024;
        $v_memory_limit = $v_memory_limit*1048576;
    if($last == 'k')
        $v_memory_limit = $v_memory_limit*1024;
            
    $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO);
    

    // ----- Sanity check : No threshold if value lower than 1M
    if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) {
      unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]);
    }
          
    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privFileDescrParseAtt()
  // Description :
  // Parameters :
  // Return Values :
  //   1 on success.
  //   0 on failure.
  // --------------------------------------------------------------------------------
  function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false)
  {
    $v_result=1;
    
    // ----- For each file in the list check the attributes
    foreach ($p_file_list as $v_key => $v_value) {
    
      // ----- Check if the option is supported
      if (!isset($v_requested_options[$v_key])) {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file");

        // ----- Return
        return PclZip::errorCode();
      }

      // ----- Look for attribute
      switch ($v_key) {
        case PCLZIP_ATT_FILE_NAME :
          if (!is_string($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }

          $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
          
          if ($p_filedescr['filename'] == '') {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }

        break;

        case PCLZIP_ATT_FILE_NEW_SHORT_NAME :
          if (!is_string($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }

          $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);

          if ($p_filedescr['new_short_name'] == '') {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }
        break;

        case PCLZIP_ATT_FILE_NEW_FULL_NAME :
          if (!is_string($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }

          $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);

          if ($p_filedescr['new_full_name'] == '') {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }
        break;

        // ----- Look for options that takes a string
        case PCLZIP_ATT_FILE_COMMENT :
          if (!is_string($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }

          $p_filedescr['comment'] = $v_value;
        break;

        case PCLZIP_ATT_FILE_MTIME :
          if (!is_integer($v_value)) {
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'");
            return PclZip::errorCode();
          }

          $p_filedescr['mtime'] = $v_value;
        break;

        case PCLZIP_ATT_FILE_CONTENT :
          $p_filedescr['content'] = $v_value;
        break;

        default :
          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER,
		                           "Unknown parameter '".$v_key."'");

          // ----- Return
          return PclZip::errorCode();
      }

      // ----- Look for mandatory options
      if ($v_requested_options !== false) {
        for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
          // ----- Look for mandatory option
          if ($v_requested_options[$key] == 'mandatory') {
            // ----- Look if present
            if (!isset($p_file_list[$key])) {
              PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
              return PclZip::errorCode();
            }
          }
        }
      }
    
    // end foreach
    }
    
    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privFileDescrExpand()
  // Description :
  //   This method look for each item of the list to see if its a file, a folder
  //   or a string to be added as file. For any other type of files (link, other)
  //   just ignore the item.
  //   Then prepare the information that will be stored for that file.
  //   When its a folder, expand the folder with all the files that are in that 
  //   folder (recursively).
  // Parameters :
  // Return Values :
  //   1 on success.
  //   0 on failure.
  // --------------------------------------------------------------------------------
  function privFileDescrExpand(&$p_filedescr_list, &$p_options)
  {
    $v_result=1;
    
    // ----- Create a result list
    $v_result_list = array();
    
    // ----- Look each entry
    for ($i=0; $i<sizeof($p_filedescr_list); $i++) {
      
      // ----- Get filedescr
      $v_descr = $p_filedescr_list[$i];
      
      // ----- Reduce the filename
      $v_descr['filename'] = PclZipUtilTranslateWinPath($v_descr['filename'], false);
      $v_descr['filename'] = PclZipUtilPathReduction($v_descr['filename']);
      
      // ----- Look for real file or folder
      if (file_exists($v_descr['filename'])) {
        if (@is_file($v_descr['filename'])) {
          $v_descr['type'] = 'file';
        }
        else if (@is_dir($v_descr['filename'])) {
          $v_descr['type'] = 'folder';
        }
        else if (@is_link($v_descr['filename'])) {
          // skip
          continue;
        }
        else {
          // skip
          continue;
        }
      }
      
      // ----- Look for string added as file
      else if (isset($v_descr['content'])) {
        $v_descr['type'] = 'virtual_file';
      }
      
      // ----- Missing file
      else {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$v_descr['filename']."' does not exist");

        // ----- Return
        return PclZip::errorCode();
      }
      
      // ----- Calculate the stored filename
      $this->privCalculateStoredFilename($v_descr, $p_options);
      
      // ----- Add the descriptor in result list
      $v_result_list[sizeof($v_result_list)] = $v_descr;
      
      // ----- Look for folder
      if ($v_descr['type'] == 'folder') {
        // ----- List of items in folder
        $v_dirlist_descr = array();
        $v_dirlist_nb = 0;
        if ($v_folder_handler = @opendir($v_descr['filename'])) {
          while (($v_item_handler = @readdir($v_folder_handler)) !== false) {

            // ----- Skip '.' and '..'
            if (($v_item_handler == '.') || ($v_item_handler == '..')) {
                continue;
            }
            
            // ----- Compose the full filename
            $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;
            
            // ----- Look for different stored filename
            // Because the name of the folder was changed, the name of the
            // files/sub-folders also change
            if (($v_descr['stored_filename'] != $v_descr['filename'])
                 && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {
              if ($v_descr['stored_filename'] != '') {
                $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
              }
              else {
                $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;
              }
            }
      
            $v_dirlist_nb++;
          }
          
          @closedir($v_folder_handler);
        }
        else {
          // TBC : unable to open folder in read mode
        }
        
        // ----- Expand each element of the list
        if ($v_dirlist_nb != 0) {
          // ----- Expand
          if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {
            return $v_result;
          }
          
          // ----- Concat the resulting list
          $v_result_list = array_merge($v_result_list, $v_dirlist_descr);
        }
        else {
        }
          
        // ----- Free local array
        unset($v_dirlist_descr);
      }
    }
    
    // ----- Get the result list
    $p_filedescr_list = $v_result_list;

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCreate()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privCreate($p_filedescr_list, &$p_result_list, &$p_options)
  {
    $v_result=1;
    $v_list_detail = array();
    
    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Open the file in write mode
    if (($v_result = $this->privOpenFd('wb')) != 1)
    {
      // ----- Return
      return $v_result;
    }

    // ----- Add the list of files
    $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options);

    // ----- Close
    $this->privCloseFd();

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAdd()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privAdd($p_filedescr_list, &$p_result_list, &$p_options)
  {
    $v_result=1;
    $v_list_detail = array();

    // ----- Look if the archive exists or is empty
    if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0))
    {

      // ----- Do a create
      $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);

      // ----- Return
      return $v_result;
    }
    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Open the zip file
    if (($v_result=$this->privOpenFd('rb')) != 1)
    {
      // ----- Magic quotes trick
      $this->privSwapBackMagicQuotes();

      // ----- Return
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privCloseFd();
      $this->privSwapBackMagicQuotes();
      return $v_result;
    }

    // ----- Go to beginning of File
    @rewind($this->zip_fd);

    // ----- Creates a temporay file
    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';

    // ----- Open the temporary file in write mode
    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
    {
      $this->privCloseFd();
      $this->privSwapBackMagicQuotes();

      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Copy the files from the archive to the temporary file
    // TBC : Here I should better append the file and go back to erase the central dir
    $v_size = $v_central_dir['offset'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = fread($this->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Swap the file descriptor
    // Here is a trick : I swap the temporary fd with the zip fd, in order to use
    // the following methods on the temporary fil and not the real archive
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Add the files
    $v_header_list = array();
    if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)
    {
      fclose($v_zip_temp_fd);
      $this->privCloseFd();
      @unlink($v_zip_temp_name);
      $this->privSwapBackMagicQuotes();

      // ----- Return
      return $v_result;
    }

    // ----- Store the offset of the central dir
    $v_offset = @ftell($this->zip_fd);

    // ----- Copy the block of file headers from the old archive
    $v_size = $v_central_dir['size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Create the Central Dir files header
    for ($i=0, $v_count=0; $i<sizeof($v_header_list); $i++)
    {
      // ----- Create the file header
      if ($v_header_list[$i]['status'] == 'ok') {
        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
          fclose($v_zip_temp_fd);
          $this->privCloseFd();
          @unlink($v_zip_temp_name);
          $this->privSwapBackMagicQuotes();

          // ----- Return
          return $v_result;
        }
        $v_count++;
      }

      // ----- Transform the header to a 'usable' info
      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
    }

    // ----- Zip file comment
    $v_comment = $v_central_dir['comment'];
    if (isset($p_options[PCLZIP_OPT_COMMENT])) {
      $v_comment = $p_options[PCLZIP_OPT_COMMENT];
    }
    if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {
      $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];
    }
    if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {
      $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;
    }

    // ----- Calculate the size of the central header
    $v_size = @ftell($this->zip_fd)-$v_offset;

    // ----- Create the central dir footer
    if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1)
    {
      // ----- Reset the file list
      unset($v_header_list);
      $this->privSwapBackMagicQuotes();

      // ----- Return
      return $v_result;
    }

    // ----- Swap back the file descriptor
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Close
    $this->privCloseFd();

    // ----- Close the temporary file
    @fclose($v_zip_temp_fd);

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Delete the zip file
    // TBC : I should test the result ...
    @unlink($this->zipname);

    // ----- Rename the temporary file
    // TBC : I should test the result ...
    //@rename($v_zip_temp_name, $this->zipname);
    PclZipUtilRename($v_zip_temp_name, $this->zipname);

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privOpenFd()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privOpenFd($p_mode)
  {
    $v_result=1;

    // ----- Look if already open
    if ($this->zip_fd != 0)
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Open the zip file
    if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0)
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCloseFd()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privCloseFd()
  {
    $v_result=1;

    if ($this->zip_fd != 0)
      @fclose($this->zip_fd);
    $this->zip_fd = 0;

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAddList()
  // Description :
  //   $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
  //   different from the real path of the file. This is usefull if you want to have PclTar
  //   running in any directory, and memorize relative path from an other directory.
  // Parameters :
  //   $p_list : An array containing the file or directory names to add in the tar
  //   $p_result_list : list of added files with their properties (specially the status field)
  //   $p_add_dir : Path to add in the filename path archived
  //   $p_remove_dir : Path to remove in the filename path archived
  // Return Values :
  // --------------------------------------------------------------------------------
//  function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
  function privAddList($p_filedescr_list, &$p_result_list, &$p_options)
  {
    $v_result=1;

    // ----- Add the files
    $v_header_list = array();
    if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1)
    {
      // ----- Return
      return $v_result;
    }

    // ----- Store the offset of the central dir
    $v_offset = @ftell($this->zip_fd);

    // ----- Create the Central Dir files header
    for ($i=0,$v_count=0; $i<sizeof($v_header_list); $i++)
    {
      // ----- Create the file header
      if ($v_header_list[$i]['status'] == 'ok') {
        if (($v_result = $this->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
          // ----- Return
          return $v_result;
        }
        $v_count++;
      }

      // ----- Transform the header to a 'usable' info
      $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
    }

    // ----- Zip file comment
    $v_comment = '';
    if (isset($p_options[PCLZIP_OPT_COMMENT])) {
      $v_comment = $p_options[PCLZIP_OPT_COMMENT];
    }

    // ----- Calculate the size of the central header
    $v_size = @ftell($this->zip_fd)-$v_offset;

    // ----- Create the central dir footer
    if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1)
    {
      // ----- Reset the file list
      unset($v_header_list);

      // ----- Return
      return $v_result;
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAddFileList()
  // Description :
  // Parameters :
  //   $p_filedescr_list : An array containing the file description 
  //                      or directory names to add in the zip
  //   $p_result_list : list of added files with their properties (specially the status field)
  // Return Values :
  // --------------------------------------------------------------------------------
  function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)
  {
    $v_result=1;
    $v_header = array();

    // ----- Recuperate the current number of elt in list
    $v_nb = sizeof($p_result_list);

    // ----- Loop on the files
    for ($j=0; ($j<sizeof($p_filedescr_list)) && ($v_result==1); $j++) {
      // ----- Format the filename
      $p_filedescr_list[$j]['filename']
      = PclZipUtilTranslateWinPath($p_filedescr_list[$j]['filename'], false);
      

      // ----- Skip empty file names
      // TBC : Can this be possible ? not checked in DescrParseAtt ?
      if ($p_filedescr_list[$j]['filename'] == "") {
        continue;
      }

      // ----- Check the filename
      if (   ($p_filedescr_list[$j]['type'] != 'virtual_file')
          && (!file_exists($p_filedescr_list[$j]['filename']))) {
        PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "File '".$p_filedescr_list[$j]['filename']."' does not exist");
        return PclZip::errorCode();
      }

      // ----- Look if it is a file or a dir with no all path remove option
      // or a dir with all its path removed
//      if (   (is_file($p_filedescr_list[$j]['filename']))
//          || (   is_dir($p_filedescr_list[$j]['filename'])
      if (   ($p_filedescr_list[$j]['type'] == 'file')
          || ($p_filedescr_list[$j]['type'] == 'virtual_file')
          || (   ($p_filedescr_list[$j]['type'] == 'folder')
              && (   !isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])
                  || !$p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))
          ) {

        // ----- Add the file
        $v_result = $this->privAddFile($p_filedescr_list[$j], $v_header,
                                       $p_options);
        if ($v_result != 1) {
          return $v_result;
        }

        // ----- Store the file infos
        $p_result_list[$v_nb++] = $v_header;
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAddFile()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privAddFile($p_filedescr, &$p_header, &$p_options)
  {
    $v_result=1;
    
    // ----- Working variable
    $p_filename = $p_filedescr['filename'];

    // TBC : Already done in the fileAtt check ... ?
    if ($p_filename == "") {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)");

      // ----- Return
      return PclZip::errorCode();
    }
  
    // ----- Look for a stored different filename 
    /* TBC : Removed
    if (isset($p_filedescr['stored_filename'])) {
      $v_stored_filename = $p_filedescr['stored_filename'];
    }
    else {
      $v_stored_filename = $p_filedescr['stored_filename'];
    }
    */

    // ----- Set the file properties
    clearstatcache();
    $p_header['version'] = 20;
    $p_header['version_extracted'] = 10;
    $p_header['flag'] = 0;
    $p_header['compression'] = 0;
    $p_header['crc'] = 0;
    $p_header['compressed_size'] = 0;
    $p_header['filename_len'] = strlen($p_filename);
    $p_header['extra_len'] = 0;
    $p_header['disk'] = 0;
    $p_header['internal'] = 0;
    $p_header['offset'] = 0;
    $p_header['filename'] = $p_filename;
// TBC : Removed    $p_header['stored_filename'] = $v_stored_filename;
    $p_header['stored_filename'] = $p_filedescr['stored_filename'];
    $p_header['extra'] = '';
    $p_header['status'] = 'ok';
    $p_header['index'] = -1;

    // ----- Look for regular file
    if ($p_filedescr['type']=='file') {
      $p_header['external'] = 0x00000000;
      $p_header['size'] = filesize($p_filename);
    }
    
    // ----- Look for regular folder
    else if ($p_filedescr['type']=='folder') {
      $p_header['external'] = 0x00000010;
      $p_header['mtime'] = filemtime($p_filename);
      $p_header['size'] = filesize($p_filename);
    }
    
    // ----- Look for virtual file
    else if ($p_filedescr['type'] == 'virtual_file') {
      $p_header['external'] = 0x00000000;
      $p_header['size'] = strlen($p_filedescr['content']);
    }
    

    // ----- Look for filetime
    if (isset($p_filedescr['mtime'])) {
      $p_header['mtime'] = $p_filedescr['mtime'];
    }
    else if ($p_filedescr['type'] == 'virtual_file') {
      $p_header['mtime'] = time();
    }
    else {
      $p_header['mtime'] = filemtime($p_filename);
    }

    // ------ Look for file comment
    if (isset($p_filedescr['comment'])) {
      $p_header['comment_len'] = strlen($p_filedescr['comment']);
      $p_header['comment'] = $p_filedescr['comment'];
    }
    else {
      $p_header['comment_len'] = 0;
      $p_header['comment'] = '';
    }

    // ----- Look for pre-add callback
    if (isset($p_options[PCLZIP_CB_PRE_ADD])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_header, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header);
      if ($v_result == 0) {
        // ----- Change the file status
        $p_header['status'] = "skipped";
        $v_result = 1;
      }

      // ----- Update the informations
      // Only some fields can be modified
      if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {
        $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);
      }
    }

    // ----- Look for empty stored filename
    if ($p_header['stored_filename'] == "") {
      $p_header['status'] = "filtered";
    }
    
    // ----- Check the path length
    if (strlen($p_header['stored_filename']) > 0xFF) {
      $p_header['status'] = 'filename_too_long';
    }

    // ----- Look if no error, or file not skipped
    if ($p_header['status'] == 'ok') {

      // ----- Look for a file
      if ($p_filedescr['type'] == 'file') {
        // ----- Look for using temporary file to zip
        if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) 
            && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
                || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
                    && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) {
          $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options);
          if ($v_result < PCLZIP_ERR_NO_ERROR) {
            return $v_result;
          }
        }
        
        // ----- Use "in memory" zip algo
        else {

        // ----- Open the source file
        if (($v_file = @fopen($p_filename, "rb")) == 0) {
          PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
          return PclZip::errorCode();
        }

        // ----- Read the file content
        $v_content = @fread($v_file, $p_header['size']);

        // ----- Close the file
        @fclose($v_file);

        // ----- Calculate the CRC
        $p_header['crc'] = @crc32($v_content);
        
        // ----- Look for no compression
        if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
          // ----- Set header parameters
          $p_header['compressed_size'] = $p_header['size'];
          $p_header['compression'] = 0;
        }
        
        // ----- Look for normal compression
        else {
          // ----- Compress the content
          $v_content = @gzdeflate($v_content);

          // ----- Set header parameters
          $p_header['compressed_size'] = strlen($v_content);
          $p_header['compression'] = 8;
        }
        
        // ----- Call the header generation
        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
          @fclose($v_file);
          return $v_result;
        }

        // ----- Write the compressed (or not) content
        @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);

        }

      }

      // ----- Look for a virtual file (a file from string)
      else if ($p_filedescr['type'] == 'virtual_file') {
          
        $v_content = $p_filedescr['content'];

        // ----- Calculate the CRC
        $p_header['crc'] = @crc32($v_content);
        
        // ----- Look for no compression
        if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
          // ----- Set header parameters
          $p_header['compressed_size'] = $p_header['size'];
          $p_header['compression'] = 0;
        }
        
        // ----- Look for normal compression
        else {
          // ----- Compress the content
          $v_content = @gzdeflate($v_content);

          // ----- Set header parameters
          $p_header['compressed_size'] = strlen($v_content);
          $p_header['compression'] = 8;
        }
        
        // ----- Call the header generation
        if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
          @fclose($v_file);
          return $v_result;
        }

        // ----- Write the compressed (or not) content
        @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);
      }

      // ----- Look for a directory
      else if ($p_filedescr['type'] == 'folder') {
        // ----- Look for directory last '/'
        if (@substr($p_header['stored_filename'], -1) != '/') {
          $p_header['stored_filename'] .= '/';
        }

        // ----- Set the file properties
        $p_header['size'] = 0;
        //$p_header['external'] = 0x41FF0010;   // Value for a folder : to be checked
        $p_header['external'] = 0x00000010;   // Value for a folder : to be checked

        // ----- Call the header generation
        if (($v_result = $this->privWriteFileHeader($p_header)) != 1)
        {
          return $v_result;
        }
      }
    }

    // ----- Look for post-add callback
    if (isset($p_options[PCLZIP_CB_POST_ADD])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_header, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header);
      if ($v_result == 0) {
        // ----- Ignored
        $v_result = 1;
      }

      // ----- Update the informations
      // Nothing can be modified
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privAddFileUsingTempFile()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options)
  {
    $v_result=PCLZIP_ERR_NO_ERROR;
    
    // ----- Working variable
    $p_filename = $p_filedescr['filename'];


    // ----- Open the source file
    if (($v_file = @fopen($p_filename, "rb")) == 0) {
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
      return PclZip::errorCode();
    }

    // ----- Creates a compressed temporary file
    $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
    if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) {
      fclose($v_file);
      PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
      return PclZip::errorCode();
    }

    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
    $v_size = filesize($p_filename);
    while ($v_size != 0) {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = @fread($v_file, $v_read_size);
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
      @gzputs($v_file_compressed, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Close the file
    @fclose($v_file);
    @gzclose($v_file_compressed);

    // ----- Check the minimum file size
    if (filesize($v_gzip_temp_name) < 18) {
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes');
      return PclZip::errorCode();
    }

    // ----- Extract the compressed attributes
    if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) {
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
      return PclZip::errorCode();
    }

    // ----- Read the gzip file header
    $v_binary_data = @fread($v_file_compressed, 10);
    $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data);

    // ----- Check some parameters
    $v_data_header['os'] = bin2hex($v_data_header['os']);

    // ----- Read the gzip file footer
    @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8);
    $v_binary_data = @fread($v_file_compressed, 8);
    $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data);

    // ----- Set the attributes
    $p_header['compression'] = ord($v_data_header['cm']);
    //$p_header['mtime'] = $v_data_header['mtime'];
    $p_header['crc'] = $v_data_footer['crc'];
    $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18;

    // ----- Close the file
    @fclose($v_file_compressed);

    // ----- Call the header generation
    if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
      return $v_result;
    }

    // ----- Add the compressed data
    if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0)
    {
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
      return PclZip::errorCode();
    }

    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
    fseek($v_file_compressed, 10);
    $v_size = $p_header['compressed_size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = @fread($v_file_compressed, $v_read_size);
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Close the file
    @fclose($v_file_compressed);

    // ----- Unlink the temporary file
    @unlink($v_gzip_temp_name);
    
    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCalculateStoredFilename()
  // Description :
  //   Based on file descriptor properties and global options, this method
  //   calculate the filename that will be stored in the archive.
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privCalculateStoredFilename(&$p_filedescr, &$p_options)
  {
    $v_result=1;
    
    // ----- Working variables
    $p_filename = $p_filedescr['filename'];
    if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
      $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH];
    }
    else {
      $p_add_dir = '';
    }
    if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) {
      $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH];
    }
    else {
      $p_remove_dir = '';
    }
    if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
      $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];
    }
    else {
      $p_remove_all_dir = 0;
    }


    // ----- Look for full name change
    if (isset($p_filedescr['new_full_name'])) {
      // ----- Remove drive letter if any
      $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']);
    }
    
    // ----- Look for path and/or short name change
    else {

      // ----- Look for short name change
      // Its when we cahnge just the filename but not the path
      if (isset($p_filedescr['new_short_name'])) {
        $v_path_info = pathinfo($p_filename);
        $v_dir = '';
        if ($v_path_info['dirname'] != '') {
          $v_dir = $v_path_info['dirname'].'/';
        }
        $v_stored_filename = $v_dir.$p_filedescr['new_short_name'];
      }
      else {
        // ----- Calculate the stored filename
        $v_stored_filename = $p_filename;
      }

      // ----- Look for all path to remove
      if ($p_remove_all_dir) {
        $v_stored_filename = basename($p_filename);
      }
      // ----- Look for partial path remove
      else if ($p_remove_dir != "") {
        if (substr($p_remove_dir, -1) != '/')
          $p_remove_dir .= "/";

        if (   (substr($p_filename, 0, 2) == "./")
            || (substr($p_remove_dir, 0, 2) == "./")) {
            
          if (   (substr($p_filename, 0, 2) == "./")
              && (substr($p_remove_dir, 0, 2) != "./")) {
            $p_remove_dir = "./".$p_remove_dir;
          }
          if (   (substr($p_filename, 0, 2) != "./")
              && (substr($p_remove_dir, 0, 2) == "./")) {
            $p_remove_dir = substr($p_remove_dir, 2);
          }
        }

        $v_compare = PclZipUtilPathInclusion($p_remove_dir,
                                             $v_stored_filename);
        if ($v_compare > 0) {
          if ($v_compare == 2) {
            $v_stored_filename = "";
          }
          else {
            $v_stored_filename = substr($v_stored_filename,
                                        strlen($p_remove_dir));
          }
        }
      }
      
      // ----- Remove drive letter if any
      $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename);
      
      // ----- Look for path to add
      if ($p_add_dir != "") {
        if (substr($p_add_dir, -1) == "/")
          $v_stored_filename = $p_add_dir.$v_stored_filename;
        else
          $v_stored_filename = $p_add_dir."/".$v_stored_filename;
      }
    }

    // ----- Filename (reduce the path of stored name)
    $v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
    $p_filedescr['stored_filename'] = $v_stored_filename;
    
    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privWriteFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privWriteFileHeader(&$p_header)
  {
    $v_result=1;

    // ----- Store the offset position of the file
    $p_header['offset'] = ftell($this->zip_fd);

    // ----- Transform UNIX mtime to DOS format mdate/mtime
    $v_date = getdate($p_header['mtime']);
    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];

    // ----- Packed data
    $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50,
	                      $p_header['version_extracted'], $p_header['flag'],
                          $p_header['compression'], $v_mtime, $v_mdate,
                          $p_header['crc'], $p_header['compressed_size'],
						  $p_header['size'],
                          strlen($p_header['stored_filename']),
						  $p_header['extra_len']);

    // ----- Write the first 148 bytes of the header in the archive
    fputs($this->zip_fd, $v_binary_data, 30);

    // ----- Write the variable fields
    if (strlen($p_header['stored_filename']) != 0)
    {
      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
    }
    if ($p_header['extra_len'] != 0)
    {
      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privWriteCentralFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privWriteCentralFileHeader(&$p_header)
  {
    $v_result=1;

    // TBC
    //for(reset($p_header); $key = key($p_header); next($p_header)) {
    //}

    // ----- Transform UNIX mtime to DOS format mdate/mtime
    $v_date = getdate($p_header['mtime']);
    $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
    $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];


    // ----- Packed data
    $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50,
	                      $p_header['version'], $p_header['version_extracted'],
                          $p_header['flag'], $p_header['compression'],
						  $v_mtime, $v_mdate, $p_header['crc'],
                          $p_header['compressed_size'], $p_header['size'],
                          strlen($p_header['stored_filename']),
						  $p_header['extra_len'], $p_header['comment_len'],
                          $p_header['disk'], $p_header['internal'],
						  $p_header['external'], $p_header['offset']);

    // ----- Write the 42 bytes of the header in the zip file
    fputs($this->zip_fd, $v_binary_data, 46);

    // ----- Write the variable fields
    if (strlen($p_header['stored_filename']) != 0)
    {
      fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
    }
    if ($p_header['extra_len'] != 0)
    {
      fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
    }
    if ($p_header['comment_len'] != 0)
    {
      fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privWriteCentralHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)
  {
    $v_result=1;

    // ----- Packed data
    $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries,
	                      $p_nb_entries, $p_size,
						  $p_offset, strlen($p_comment));

    // ----- Write the 22 bytes of the header in the zip file
    fputs($this->zip_fd, $v_binary_data, 22);

    // ----- Write the variable fields
    if (strlen($p_comment) != 0)
    {
      fputs($this->zip_fd, $p_comment, strlen($p_comment));
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privList()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privList(&$p_list)
  {
    $v_result=1;

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Open the zip file
    if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0)
    {
      // ----- Magic quotes trick
      $this->privSwapBackMagicQuotes();
      
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privSwapBackMagicQuotes();
      return $v_result;
    }

    // ----- Go to beginning of Central Dir
    @rewind($this->zip_fd);
    if (@fseek($this->zip_fd, $v_central_dir['offset']))
    {
      $this->privSwapBackMagicQuotes();

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Read each entry
    for ($i=0; $i<$v_central_dir['entries']; $i++)
    {
      // ----- Read the file header
      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
      {
        $this->privSwapBackMagicQuotes();
        return $v_result;
      }
      $v_header['index'] = $i;

      // ----- Get the only interesting attributes
      $this->privConvertHeader2FileInfo($v_header, $p_list[$i]);
      unset($v_header);
    }

    // ----- Close the zip file
    $this->privCloseFd();

    // ----- Magic quotes trick
    $this->privSwapBackMagicQuotes();

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privConvertHeader2FileInfo()
  // Description :
  //   This function takes the file informations from the central directory
  //   entries and extract the interesting parameters that will be given back.
  //   The resulting file infos are set in the array $p_info
  //     $p_info['filename'] : Filename with full path. Given by user (add),
  //                           extracted in the filesystem (extract).
  //     $p_info['stored_filename'] : Stored filename in the archive.
  //     $p_info['size'] = Size of the file.
  //     $p_info['compressed_size'] = Compressed size of the file.
  //     $p_info['mtime'] = Last modification date of the file.
  //     $p_info['comment'] = Comment associated with the file.
  //     $p_info['folder'] = true/false : indicates if the entry is a folder or not.
  //     $p_info['status'] = status of the action on the file.
  //     $p_info['crc'] = CRC of the file content.
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privConvertHeader2FileInfo($p_header, &$p_info)
  {
    $v_result=1;

    // ----- Get the interesting attributes
    $v_temp_path = PclZipUtilPathReduction($p_header['filename']);
    $p_info['filename'] = $v_temp_path;
    $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']);
    $p_info['stored_filename'] = $v_temp_path;
    $p_info['size'] = $p_header['size'];
    $p_info['compressed_size'] = $p_header['compressed_size'];
    $p_info['mtime'] = $p_header['mtime'];
    $p_info['comment'] = $p_header['comment'];
    $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010);
    $p_info['index'] = $p_header['index'];
    $p_info['status'] = $p_header['status'];
    $p_info['crc'] = $p_header['crc'];

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractByRule()
  // Description :
  //   Extract a file or directory depending of rules (by index, by name, ...)
  // Parameters :
  //   $p_file_list : An array where will be placed the properties of each
  //                  extracted file
  //   $p_path : Path to add while writing the extracted files
  //   $p_remove_path : Path to remove (from the file memorized path) while writing the
  //                    extracted files. If the path does not match the file path,
  //                    the file is extracted with its memorized path.
  //                    $p_remove_path does not apply to 'list' mode.
  //                    $p_path and $p_remove_path are commulative.
  // Return Values :
  //   1 on success,0 or less on error (see error code list)
  // --------------------------------------------------------------------------------
  function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
  {
    $v_result=1;

    // ----- Magic quotes trick
    $this->privDisableMagicQuotes();

    // ----- Check the path
    if (   ($p_path == "")
	    || (   (substr($p_path, 0, 1) != "/")
		    && (substr($p_path, 0, 3) != "../")
			&& (substr($p_path,1,2)!=":/")))
      $p_path = "./".$p_path;

    // ----- Reduce the path last (and duplicated) '/'
    if (($p_path != "./") && ($p_path != "/"))
    {
      // ----- Look for the path end '/'
      while (substr($p_path, -1) == "/")
      {
        $p_path = substr($p_path, 0, strlen($p_path)-1);
      }
    }

    // ----- Look for path to remove format (should end by /)
    if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/'))
    {
      $p_remove_path .= '/';
    }
    $p_remove_path_size = strlen($p_remove_path);

    // ----- Open the zip file
    if (($v_result = $this->privOpenFd('rb')) != 1)
    {
      $this->privSwapBackMagicQuotes();
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      // ----- Close the zip file
      $this->privCloseFd();
      $this->privSwapBackMagicQuotes();

      return $v_result;
    }

    // ----- Start at beginning of Central Dir
    $v_pos_entry = $v_central_dir['offset'];

    // ----- Read each entry
    $j_start = 0;
    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
    {

      // ----- Read next Central dir entry
      @rewind($this->zip_fd);
      if (@fseek($this->zip_fd, $v_pos_entry))
      {
        // ----- Close the zip file
        $this->privCloseFd();
        $this->privSwapBackMagicQuotes();

        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

        // ----- Return
        return PclZip::errorCode();
      }

      // ----- Read the file header
      $v_header = array();
      if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1)
      {
        // ----- Close the zip file
        $this->privCloseFd();
        $this->privSwapBackMagicQuotes();

        return $v_result;
      }

      // ----- Store the index
      $v_header['index'] = $i;

      // ----- Store the file position
      $v_pos_entry = ftell($this->zip_fd);

      // ----- Look for the specific extract rules
      $v_extract = false;

      // ----- Look for extract by name rule
      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))
          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {

          // ----- Look if the filename is in the list
          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_extract); $j++) {

              // ----- Look for a directory
              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {

                  // ----- Look if the directory is in the filename path
                  if (   (strlen($v_header['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
                      && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
                      $v_extract = true;
                  }
              }
              // ----- Look for a filename
              elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
                  $v_extract = true;
              }
          }
      }

      // ----- Look for extract by ereg rule
      // ereg() is deprecated with PHP 5.3
      /* 
      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))
               && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {

          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) {
              $v_extract = true;
          }
      }
      */

      // ----- Look for extract by preg rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {

          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
              $v_extract = true;
          }
      }

      // ----- Look for extract by index rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
          
          // ----- Look if the index is in the list
          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_extract); $j++) {

              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
                  $v_extract = true;
              }
              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
                  $j_start = $j+1;
              }

              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
                  break;
              }
          }
      }

      // ----- Look for no rule, which means extract all the archive
      else {
          $v_extract = true;
      }

	  // ----- Check compression method
	  if (   ($v_extract)
	      && (   ($v_header['compression'] != 8)
		      && ($v_header['compression'] != 0))) {
          $v_header['status'] = 'unsupported_compression';

          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {

              $this->privSwapBackMagicQuotes();
              
              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION,
			                       "Filename '".$v_header['stored_filename']."' is "
				  	    	  	   ."compressed by an unsupported compression "
				  	    	  	   ."method (".$v_header['compression'].") ");

              return PclZip::errorCode();
		  }
	  }
	  
	  // ----- Check encrypted files
	  if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
          $v_header['status'] = 'unsupported_encryption';

          // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
          if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		      && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {

              $this->privSwapBackMagicQuotes();

              PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION,
			                       "Unsupported encryption for "
				  	    	  	   ." filename '".$v_header['stored_filename']
								   ."'");

              return PclZip::errorCode();
		  }
    }

      // ----- Look for real extraction
      if (($v_extract) && ($v_header['status'] != 'ok')) {
          $v_result = $this->privConvertHeader2FileInfo($v_header,
		                                        $p_file_list[$v_nb_extracted++]);
          if ($v_result != 1) {
              $this->privCloseFd();
              $this->privSwapBackMagicQuotes();
              return $v_result;
          }

          $v_extract = false;
      }
      
      // ----- Look for real extraction
      if ($v_extract)
      {

        // ----- Go to the file position
        @rewind($this->zip_fd);
        if (@fseek($this->zip_fd, $v_header['offset']))
        {
          // ----- Close the zip file
          $this->privCloseFd();

          $this->privSwapBackMagicQuotes();

          // ----- Error log
          PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

          // ----- Return
          return PclZip::errorCode();
        }

        // ----- Look for extraction as string
        if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {

          $v_string = '';

          // ----- Extracting the file
          $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options);
          if ($v_result1 < 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            return $v_result1;
          }

          // ----- Get the only interesting attributes
          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1)
          {
            // ----- Close the zip file
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();

            return $v_result;
          }

          // ----- Set the file content
          $p_file_list[$v_nb_extracted]['content'] = $v_string;

          // ----- Next extracted file
          $v_nb_extracted++;
          
          // ----- Look for user callback abort
          if ($v_result1 == 2) {
          	break;
          }
        }
        // ----- Look for extraction in standard output
        elseif (   (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT]))
		        && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {
          // ----- Extracting the file in standard output
          $v_result1 = $this->privExtractFileInOutput($v_header, $p_options);
          if ($v_result1 < 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            return $v_result1;
          }

          // ----- Get the only interesting attributes
          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            return $v_result;
          }

          // ----- Look for user callback abort
          if ($v_result1 == 2) {
          	break;
          }
        }
        // ----- Look for normal extraction
        else {
          // ----- Extracting the file
          $v_result1 = $this->privExtractFile($v_header,
		                                      $p_path, $p_remove_path,
											  $p_remove_all_path,
											  $p_options);
          if ($v_result1 < 1) {
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();
            return $v_result1;
          }

          // ----- Get the only interesting attributes
          if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1)
          {
            // ----- Close the zip file
            $this->privCloseFd();
            $this->privSwapBackMagicQuotes();

            return $v_result;
          }

          // ----- Look for user callback abort
          if ($v_result1 == 2) {
          	break;
          }
        }
      }
    }

    // ----- Close the zip file
    $this->privCloseFd();
    $this->privSwapBackMagicQuotes();

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractFile()
  // Description :
  // Parameters :
  // Return Values :
  //
  // 1 : ... ?
  // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback
  // --------------------------------------------------------------------------------
  function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
  {
    $v_result=1;

    // ----- Read the file header
    if (($v_result = $this->privReadFileHeader($v_header)) != 1)
    {
      // ----- Return
      return $v_result;
    }


    // ----- Check that the file header is coherent with $p_entry info
    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
        // TBC
    }

    // ----- Look for all path to remove
    if ($p_remove_all_path == true) {
        // ----- Look for folder entry that not need to be extracted
        if (($p_entry['external']&0x00000010)==0x00000010) {

            $p_entry['status'] = "filtered";

            return $v_result;
        }

        // ----- Get the basename of the path
        $p_entry['filename'] = basename($p_entry['filename']);
    }

    // ----- Look for path to remove
    else if ($p_remove_path != "")
    {
      if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2)
      {

        // ----- Change the file status
        $p_entry['status'] = "filtered";

        // ----- Return
        return $v_result;
      }

      $p_remove_path_size = strlen($p_remove_path);
      if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path)
      {

        // ----- Remove the path
        $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);

      }
    }

    // ----- Add the path
    if ($p_path != '') {
      $p_entry['filename'] = $p_path."/".$p_entry['filename'];
    }
    
    // ----- Check a base_dir_restriction
    if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
      $v_inclusion
      = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION],
                                $p_entry['filename']); 
      if ($v_inclusion == 0) {

        PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION,
			                     "Filename '".$p_entry['filename']."' is "
								 ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION");

        return PclZip::errorCode();
      }
    }

    // ----- Look for pre-extract callback
    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
      if ($v_result == 0) {
        // ----- Change the file status
        $p_entry['status'] = "skipped";
        $v_result = 1;
      }
      
      // ----- Look for abort result
      if ($v_result == 2) {
        // ----- This status is internal and will be changed in 'skipped'
        $p_entry['status'] = "aborted";
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }

      // ----- Update the informations
      // Only some fields can be modified
      $p_entry['filename'] = $v_local_header['filename'];
    }


    // ----- Look if extraction should be done
    if ($p_entry['status'] == 'ok') {

    // ----- Look for specific actions while the file exist
    if (file_exists($p_entry['filename']))
    {

      // ----- Look if file is a directory
      if (is_dir($p_entry['filename']))
      {

        // ----- Change the file status
        $p_entry['status'] = "already_a_directory";
        
        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
        // For historical reason first PclZip implementation does not stop
        // when this kind of error occurs.
        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {

            PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY,
			                     "Filename '".$p_entry['filename']."' is "
								 ."already used by an existing directory");

            return PclZip::errorCode();
		    }
      }
      // ----- Look if file is write protected
      else if (!is_writeable($p_entry['filename']))
      {

        // ----- Change the file status
        $p_entry['status'] = "write_protected";

        // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
        // For historical reason first PclZip implementation does not stop
        // when this kind of error occurs.
        if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		    && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {

            PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
			                     "Filename '".$p_entry['filename']."' exists "
								 ."and is write protected");

            return PclZip::errorCode();
		    }
      }

      // ----- Look if the extracted file is older
      else if (filemtime($p_entry['filename']) > $p_entry['mtime'])
      {
        // ----- Change the file status
        if (   (isset($p_options[PCLZIP_OPT_REPLACE_NEWER]))
		    && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) {
	  	  }
		    else {
            $p_entry['status'] = "newer_exist";

            // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
            // For historical reason first PclZip implementation does not stop
            // when this kind of error occurs.
            if (   (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR]))
		        && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {

                PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL,
			             "Newer version of '".$p_entry['filename']."' exists "
					    ."and option PCLZIP_OPT_REPLACE_NEWER is not selected");

                return PclZip::errorCode();
		      }
		    }
      }
      else {
      }
    }

    // ----- Check the directory availability and create it if necessary
    else {
      if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/'))
        $v_dir_to_check = $p_entry['filename'];
      else if (!strstr($p_entry['filename'], "/"))
        $v_dir_to_check = "";
      else
        $v_dir_to_check = dirname($p_entry['filename']);

        if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
  
          // ----- Change the file status
          $p_entry['status'] = "path_creation_fail";
  
          // ----- Return
          //return $v_result;
          $v_result = 1;
        }
      }
    }

    // ----- Look if extraction should be done
    if ($p_entry['status'] == 'ok') {

      // ----- Do the extraction (if not a folder)
      if (!(($p_entry['external']&0x00000010)==0x00000010))
      {
        // ----- Look for not compressed file
        if ($p_entry['compression'] == 0) {

    		  // ----- Opening destination file
          if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0)
          {

            // ----- Change the file status
            $p_entry['status'] = "write_error";

            // ----- Return
            return $v_result;
          }


          // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
          $v_size = $p_entry['compressed_size'];
          while ($v_size != 0)
          {
            $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
            $v_buffer = @fread($this->zip_fd, $v_read_size);
            /* Try to speed up the code
            $v_binary_data = pack('a'.$v_read_size, $v_buffer);
            @fwrite($v_dest_file, $v_binary_data, $v_read_size);
            */
            @fwrite($v_dest_file, $v_buffer, $v_read_size);            
            $v_size -= $v_read_size;
          }

          // ----- Closing the destination file
          fclose($v_dest_file);

          // ----- Change the file mtime
          touch($p_entry['filename'], $p_entry['mtime']);
          

        }
        else {
          // ----- TBC
          // Need to be finished
          if (($p_entry['flag'] & 1) == 1) {
            PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.');
            return PclZip::errorCode();
          }


          // ----- Look for using temporary file to unzip
          if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) 
              && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON])
                  || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD])
                      && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) {
            $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options);
            if ($v_result < PCLZIP_ERR_NO_ERROR) {
              return $v_result;
            }
          }
          
          // ----- Look for extract in memory
          else {

          
            // ----- Read the compressed file in a buffer (one shot)
            $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
            
            // ----- Decompress the file
            $v_file_content = @gzinflate($v_buffer);
            unset($v_buffer);
            if ($v_file_content === FALSE) {
  
              // ----- Change the file status
              // TBC
              $p_entry['status'] = "error";
              
              return $v_result;
            }
            
            // ----- Opening destination file
            if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
  
              // ----- Change the file status
              $p_entry['status'] = "write_error";
  
              return $v_result;
            }
  
            // ----- Write the uncompressed data
            @fwrite($v_dest_file, $v_file_content, $p_entry['size']);
            unset($v_file_content);
  
            // ----- Closing the destination file
            @fclose($v_dest_file);
            
          }

          // ----- Change the file mtime
          @touch($p_entry['filename'], $p_entry['mtime']);
        }

        // ----- Look for chmod option
        if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {

          // ----- Change the mode of the file
          @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);
        }

      }
    }

  	// ----- Change abort status
  	if ($p_entry['status'] == "aborted") {
        $p_entry['status'] = "skipped";
  	}
	
    // ----- Look for post-extract callback
    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);

      // ----- Look for abort result
      if ($v_result == 2) {
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractFileUsingTempFile()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privExtractFileUsingTempFile(&$p_entry, &$p_options)
  {
    $v_result=1;
        
    // ----- Creates a temporary file
    $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
    if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) {
      fclose($v_file);
      PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
      return PclZip::errorCode();
    }


    // ----- Write gz file format header
    $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));
    @fwrite($v_dest_file, $v_binary_data, 10);

    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
    $v_size = $p_entry['compressed_size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = @fread($this->zip_fd, $v_read_size);
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
      @fwrite($v_dest_file, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Write gz file format footer
    $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);
    @fwrite($v_dest_file, $v_binary_data, 8);

    // ----- Close the temporary file
    @fclose($v_dest_file);

    // ----- Opening destination file
    if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
      $p_entry['status'] = "write_error";
      return $v_result;
    }

    // ----- Open the temporary gz file
    if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {
      @fclose($v_dest_file);
      $p_entry['status'] = "read_error";
      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
      return PclZip::errorCode();
    }


    // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
    $v_size = $p_entry['size'];
    while ($v_size != 0) {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = @gzread($v_src_file, $v_read_size);
      //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
      @fwrite($v_dest_file, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }
    @fclose($v_dest_file);
    @gzclose($v_src_file);

    // ----- Delete the temporary file
    @unlink($v_gzip_temp_name);
    
    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractFileInOutput()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privExtractFileInOutput(&$p_entry, &$p_options)
  {
    $v_result=1;

    // ----- Read the file header
    if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
      return $v_result;
    }


    // ----- Check that the file header is coherent with $p_entry info
    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
        // TBC
    }

    // ----- Look for pre-extract callback
    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
      if ($v_result == 0) {
        // ----- Change the file status
        $p_entry['status'] = "skipped";
        $v_result = 1;
      }

      // ----- Look for abort result
      if ($v_result == 2) {
        // ----- This status is internal and will be changed in 'skipped'
        $p_entry['status'] = "aborted";
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }

      // ----- Update the informations
      // Only some fields can be modified
      $p_entry['filename'] = $v_local_header['filename'];
    }

    // ----- Trace

    // ----- Look if extraction should be done
    if ($p_entry['status'] == 'ok') {

      // ----- Do the extraction (if not a folder)
      if (!(($p_entry['external']&0x00000010)==0x00000010)) {
        // ----- Look for not compressed file
        if ($p_entry['compressed_size'] == $p_entry['size']) {

          // ----- Read the file in a buffer (one shot)
          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);

          // ----- Send the file to the output
          echo $v_buffer;
          unset($v_buffer);
        }
        else {

          // ----- Read the compressed file in a buffer (one shot)
          $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
          
          // ----- Decompress the file
          $v_file_content = gzinflate($v_buffer);
          unset($v_buffer);

          // ----- Send the file to the output
          echo $v_file_content;
          unset($v_file_content);
        }
      }
    }

	// ----- Change abort status
	if ($p_entry['status'] == "aborted") {
      $p_entry['status'] = "skipped";
	}

    // ----- Look for post-extract callback
    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);

      // ----- Look for abort result
      if ($v_result == 2) {
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }
    }

    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privExtractFileAsString()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)
  {
    $v_result=1;

    // ----- Read the file header
    $v_header = array();
    if (($v_result = $this->privReadFileHeader($v_header)) != 1)
    {
      // ----- Return
      return $v_result;
    }


    // ----- Check that the file header is coherent with $p_entry info
    if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
        // TBC
    }

    // ----- Look for pre-extract callback
    if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
      if ($v_result == 0) {
        // ----- Change the file status
        $p_entry['status'] = "skipped";
        $v_result = 1;
      }
      
      // ----- Look for abort result
      if ($v_result == 2) {
        // ----- This status is internal and will be changed in 'skipped'
        $p_entry['status'] = "aborted";
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }

      // ----- Update the informations
      // Only some fields can be modified
      $p_entry['filename'] = $v_local_header['filename'];
    }


    // ----- Look if extraction should be done
    if ($p_entry['status'] == 'ok') {

      // ----- Do the extraction (if not a folder)
      if (!(($p_entry['external']&0x00000010)==0x00000010)) {
        // ----- Look for not compressed file
  //      if ($p_entry['compressed_size'] == $p_entry['size'])
        if ($p_entry['compression'] == 0) {
  
          // ----- Reading the file
          $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
        }
        else {
  
          // ----- Reading the file
          $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
          
          // ----- Decompress the file
          if (($p_string = @gzinflate($v_data)) === FALSE) {
              // TBC
          }
        }
  
        // ----- Trace
      }
      else {
          // TBC : error : can not extract a folder in a string
      }
      
    }

  	// ----- Change abort status
  	if ($p_entry['status'] == "aborted") {
        $p_entry['status'] = "skipped";
  	}
	
    // ----- Look for post-extract callback
    elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {

      // ----- Generate a local information
      $v_local_header = array();
      $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
      
      // ----- Swap the content to header
      $v_local_header['content'] = $p_string;
      $p_string = '';

      // ----- Call the callback
      // Here I do not use call_user_func() because I need to send a reference to the
      // header.
//      eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
      $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);

      // ----- Swap back the content to header
      $p_string = $v_local_header['content'];
      unset($v_local_header['content']);

      // ----- Look for abort result
      if ($v_result == 2) {
      	$v_result = PCLZIP_ERR_USER_ABORTED;
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privReadFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privReadFileHeader(&$p_header)
  {
    $v_result=1;

    // ----- Read the 4 bytes signature
    $v_binary_data = @fread($this->zip_fd, 4);
    $v_data = unpack('Vid', $v_binary_data);

    // ----- Check signature
    if ($v_data['id'] != 0x04034b50)
    {

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Read the first 42 bytes of the header
    $v_binary_data = fread($this->zip_fd, 26);

    // ----- Look for invalid block size
    if (strlen($v_binary_data) != 26)
    {
      $p_header['filename'] = "";
      $p_header['status'] = "invalid_header";

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Extract the values
    $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data);

    // ----- Get filename
    $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);

    // ----- Get extra_fields
    if ($v_data['extra_len'] != 0) {
      $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
    }
    else {
      $p_header['extra'] = '';
    }

    // ----- Extract properties
    $p_header['version_extracted'] = $v_data['version'];
    $p_header['compression'] = $v_data['compression'];
    $p_header['size'] = $v_data['size'];
    $p_header['compressed_size'] = $v_data['compressed_size'];
    $p_header['crc'] = $v_data['crc'];
    $p_header['flag'] = $v_data['flag'];
    $p_header['filename_len'] = $v_data['filename_len'];

    // ----- Recuperate date in UNIX format
    $p_header['mdate'] = $v_data['mdate'];
    $p_header['mtime'] = $v_data['mtime'];
    if ($p_header['mdate'] && $p_header['mtime'])
    {
      // ----- Extract time
      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
      $v_seconde = ($p_header['mtime'] & 0x001F)*2;

      // ----- Extract date
      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
      $v_day = $p_header['mdate'] & 0x001F;

      // ----- Get UNIX date format
      $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);

    }
    else
    {
      $p_header['mtime'] = time();
    }

    // TBC
    //for(reset($v_data); $key = key($v_data); next($v_data)) {
    //}

    // ----- Set the stored filename
    $p_header['stored_filename'] = $p_header['filename'];

    // ----- Set the status field
    $p_header['status'] = "ok";

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privReadCentralFileHeader()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privReadCentralFileHeader(&$p_header)
  {
    $v_result=1;

    // ----- Read the 4 bytes signature
    $v_binary_data = @fread($this->zip_fd, 4);
    $v_data = unpack('Vid', $v_binary_data);

    // ----- Check signature
    if ($v_data['id'] != 0x02014b50)
    {

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Read the first 42 bytes of the header
    $v_binary_data = fread($this->zip_fd, 42);

    // ----- Look for invalid block size
    if (strlen($v_binary_data) != 42)
    {
      $p_header['filename'] = "";
      $p_header['status'] = "invalid_header";

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Extract the values
    $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);

    // ----- Get filename
    if ($p_header['filename_len'] != 0)
      $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
    else
      $p_header['filename'] = '';

    // ----- Get extra
    if ($p_header['extra_len'] != 0)
      $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
    else
      $p_header['extra'] = '';

    // ----- Get comment
    if ($p_header['comment_len'] != 0)
      $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
    else
      $p_header['comment'] = '';

    // ----- Extract properties

    // ----- Recuperate date in UNIX format
    //if ($p_header['mdate'] && $p_header['mtime'])
    // TBC : bug : this was ignoring time with 0/0/0
    if (1)
    {
      // ----- Extract time
      $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
      $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
      $v_seconde = ($p_header['mtime'] & 0x001F)*2;

      // ----- Extract date
      $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
      $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
      $v_day = $p_header['mdate'] & 0x001F;

      // ----- Get UNIX date format
      $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);

    }
    else
    {
      $p_header['mtime'] = time();
    }

    // ----- Set the stored filename
    $p_header['stored_filename'] = $p_header['filename'];

    // ----- Set default status to ok
    $p_header['status'] = 'ok';

    // ----- Look if it is a directory
    if (substr($p_header['filename'], -1) == '/') {
      //$p_header['external'] = 0x41FF0010;
      $p_header['external'] = 0x00000010;
    }


    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privCheckFileHeaders()
  // Description :
  // Parameters :
  // Return Values :
  //   1 on success,
  //   0 on error;
  // --------------------------------------------------------------------------------
  function privCheckFileHeaders(&$p_local_header, &$p_central_header)
  {
    $v_result=1;

  	// ----- Check the static values
  	// TBC
  	if ($p_local_header['filename'] != $p_central_header['filename']) {
  	}
  	if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {
  	}
  	if ($p_local_header['flag'] != $p_central_header['flag']) {
  	}
  	if ($p_local_header['compression'] != $p_central_header['compression']) {
  	}
  	if ($p_local_header['mtime'] != $p_central_header['mtime']) {
  	}
  	if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {
  	}
  
  	// ----- Look for flag bit 3
  	if (($p_local_header['flag'] & 8) == 8) {
          $p_local_header['size'] = $p_central_header['size'];
          $p_local_header['compressed_size'] = $p_central_header['compressed_size'];
          $p_local_header['crc'] = $p_central_header['crc'];
  	}

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privReadEndCentralDir()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privReadEndCentralDir(&$p_central_dir)
  {
    $v_result=1;

    // ----- Go to the end of the zip file
    $v_size = filesize($this->zipname);
    @fseek($this->zip_fd, $v_size);
    if (@ftell($this->zip_fd) != $v_size)
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\'');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- First try : look if this is an archive with no commentaries (most of the time)
    // in this case the end of central dir is at 22 bytes of the file end
    $v_found = 0;
    if ($v_size > 26) {
      @fseek($this->zip_fd, $v_size-22);
      if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22))
      {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');

        // ----- Return
        return PclZip::errorCode();
      }

      // ----- Read for bytes
      $v_binary_data = @fread($this->zip_fd, 4);
      $v_data = @unpack('Vid', $v_binary_data);

      // ----- Check signature
      if ($v_data['id'] == 0x06054b50) {
        $v_found = 1;
      }

      $v_pos = ftell($this->zip_fd);
    }

    // ----- Go back to the maximum possible size of the Central Dir End Record
    if (!$v_found) {
      $v_maximum_size = 65557; // 0xFFFF + 22;
      if ($v_maximum_size > $v_size)
        $v_maximum_size = $v_size;
      @fseek($this->zip_fd, $v_size-$v_maximum_size);
      if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size))
      {
        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');

        // ----- Return
        return PclZip::errorCode();
      }

      // ----- Read byte per byte in order to find the signature
      $v_pos = ftell($this->zip_fd);
      $v_bytes = 0x00000000;
      while ($v_pos < $v_size)
      {
        // ----- Read a byte
        $v_byte = @fread($this->zip_fd, 1);

        // -----  Add the byte
        //$v_bytes = ($v_bytes << 8) | Ord($v_byte);
        // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number 
        // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. 
        $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); 

        // ----- Compare the bytes
        if ($v_bytes == 0x504b0506)
        {
          $v_pos++;
          break;
        }

        $v_pos++;
      }

      // ----- Look if not found end of central dir
      if ($v_pos == $v_size)
      {

        // ----- Error log
        PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature");

        // ----- Return
        return PclZip::errorCode();
      }
    }

    // ----- Read the first 18 bytes of the header
    $v_binary_data = fread($this->zip_fd, 18);

    // ----- Look for invalid block size
    if (strlen($v_binary_data) != 18)
    {

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Extract the values
    $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);

    // ----- Check the global size
    if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {

	  // ----- Removed in release 2.2 see readme file
	  // The check of the file size is a little too strict.
	  // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.
	  // While decrypted, zip has training 0 bytes
	  if (0) {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT,
	                       'The central dir is not at the end of the archive.'
						   .' Some trailing bytes exists after the archive.');

      // ----- Return
      return PclZip::errorCode();
	  }
    }

    // ----- Get comment
    if ($v_data['comment_size'] != 0) {
      $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);
    }
    else
      $p_central_dir['comment'] = '';

    $p_central_dir['entries'] = $v_data['entries'];
    $p_central_dir['disk_entries'] = $v_data['disk_entries'];
    $p_central_dir['offset'] = $v_data['offset'];
    $p_central_dir['size'] = $v_data['size'];
    $p_central_dir['disk'] = $v_data['disk'];
    $p_central_dir['disk_start'] = $v_data['disk_start'];

    // TBC
    //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {
    //}

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDeleteByRule()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privDeleteByRule(&$p_result_list, &$p_options)
  {
    $v_result=1;
    $v_list_detail = array();

    // ----- Open the zip file
    if (($v_result=$this->privOpenFd('rb')) != 1)
    {
      // ----- Return
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privCloseFd();
      return $v_result;
    }

    // ----- Go to beginning of File
    @rewind($this->zip_fd);

    // ----- Scan all the files
    // ----- Start at beginning of Central Dir
    $v_pos_entry = $v_central_dir['offset'];
    @rewind($this->zip_fd);
    if (@fseek($this->zip_fd, $v_pos_entry))
    {
      // ----- Close the zip file
      $this->privCloseFd();

      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Read each entry
    $v_header_list = array();
    $j_start = 0;
    for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++)
    {

      // ----- Read the file header
      $v_header_list[$v_nb_extracted] = array();
      if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1)
      {
        // ----- Close the zip file
        $this->privCloseFd();

        return $v_result;
      }


      // ----- Store the index
      $v_header_list[$v_nb_extracted]['index'] = $i;

      // ----- Look for the specific extract rules
      $v_found = false;

      // ----- Look for extract by name rule
      if (   (isset($p_options[PCLZIP_OPT_BY_NAME]))
          && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {

          // ----- Look if the filename is in the list
          for ($j=0; ($j<sizeof($p_options[PCLZIP_OPT_BY_NAME])) && (!$v_found); $j++) {

              // ----- Look for a directory
              if (substr($p_options[PCLZIP_OPT_BY_NAME][$j], -1) == "/") {

                  // ----- Look if the directory is in the filename path
                  if (   (strlen($v_header_list[$v_nb_extracted]['stored_filename']) > strlen($p_options[PCLZIP_OPT_BY_NAME][$j]))
                      && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
                      $v_found = true;
                  }
                  elseif (   (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */
                          && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
                      $v_found = true;
                  }
              }
              // ----- Look for a filename
              elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
                  $v_found = true;
              }
          }
      }

      // ----- Look for extract by ereg rule
      // ereg() is deprecated with PHP 5.3
      /*
      else if (   (isset($p_options[PCLZIP_OPT_BY_EREG]))
               && ($p_options[PCLZIP_OPT_BY_EREG] != "")) {

          if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
              $v_found = true;
          }
      }
      */

      // ----- Look for extract by preg rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_PREG]))
               && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {

          if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
              $v_found = true;
          }
      }

      // ----- Look for extract by index rule
      else if (   (isset($p_options[PCLZIP_OPT_BY_INDEX]))
               && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {

          // ----- Look if the index is in the list
          for ($j=$j_start; ($j<sizeof($p_options[PCLZIP_OPT_BY_INDEX])) && (!$v_found); $j++) {

              if (($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
                  $v_found = true;
              }
              if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
                  $j_start = $j+1;
              }

              if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
                  break;
              }
          }
      }
      else {
      	$v_found = true;
      }

      // ----- Look for deletion
      if ($v_found)
      {
        unset($v_header_list[$v_nb_extracted]);
      }
      else
      {
        $v_nb_extracted++;
      }
    }

    // ----- Look if something need to be deleted
    if ($v_nb_extracted > 0) {

        // ----- Creates a temporay file
        $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';

        // ----- Creates a temporary zip archive
        $v_temp_zip = new PclZip($v_zip_temp_name);

        // ----- Open the temporary zip file in write mode
        if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {
            $this->privCloseFd();

            // ----- Return
            return $v_result;
        }

        // ----- Look which file need to be kept
        for ($i=0; $i<sizeof($v_header_list); $i++) {

            // ----- Calculate the position of the header
            @rewind($this->zip_fd);
            if (@fseek($this->zip_fd,  $v_header_list[$i]['offset'])) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Error log
                PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');

                // ----- Return
                return PclZip::errorCode();
            }

            // ----- Read the file header
            $v_local_header = array();
            if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                return $v_result;
            }
            
            // ----- Check that local file header is same as central file header
            if ($this->privCheckFileHeaders($v_local_header,
			                                $v_header_list[$i]) != 1) {
                // TBC
            }
            unset($v_local_header);

            // ----- Write the file header
            if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                return $v_result;
            }

            // ----- Read/write the data block
            if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) {
                // ----- Close the zip file
                $this->privCloseFd();
                $v_temp_zip->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                return $v_result;
            }
        }

        // ----- Store the offset of the central dir
        $v_offset = @ftell($v_temp_zip->zip_fd);

        // ----- Re-Create the Central Dir files header
        for ($i=0; $i<sizeof($v_header_list); $i++) {
            // ----- Create the file header
            if (($v_result = $v_temp_zip->privWriteCentralFileHeader($v_header_list[$i])) != 1) {
                $v_temp_zip->privCloseFd();
                $this->privCloseFd();
                @unlink($v_zip_temp_name);

                // ----- Return
                return $v_result;
            }

            // ----- Transform the header to a 'usable' info
            $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
        }


        // ----- Zip file comment
        $v_comment = '';
        if (isset($p_options[PCLZIP_OPT_COMMENT])) {
          $v_comment = $p_options[PCLZIP_OPT_COMMENT];
        }

        // ----- Calculate the size of the central header
        $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset;

        // ----- Create the central dir footer
        if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) {
            // ----- Reset the file list
            unset($v_header_list);
            $v_temp_zip->privCloseFd();
            $this->privCloseFd();
            @unlink($v_zip_temp_name);

            // ----- Return
            return $v_result;
        }

        // ----- Close
        $v_temp_zip->privCloseFd();
        $this->privCloseFd();

        // ----- Delete the zip file
        // TBC : I should test the result ...
        @unlink($this->zipname);

        // ----- Rename the temporary file
        // TBC : I should test the result ...
        //@rename($v_zip_temp_name, $this->zipname);
        PclZipUtilRename($v_zip_temp_name, $this->zipname);
    
        // ----- Destroy the temporary archive
        unset($v_temp_zip);
    }
    
    // ----- Remove every files : reset the file
    else if ($v_central_dir['entries'] != 0) {
        $this->privCloseFd();

        if (($v_result = $this->privOpenFd('wb')) != 1) {
          return $v_result;
        }

        if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {
          return $v_result;
        }

        $this->privCloseFd();
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDirCheck()
  // Description :
  //   Check if a directory exists, if not it creates it and all the parents directory
  //   which may be useful.
  // Parameters :
  //   $p_dir : Directory path to check.
  // Return Values :
  //    1 : OK
  //   -1 : Unable to create directory
  // --------------------------------------------------------------------------------
  function privDirCheck($p_dir, $p_is_dir=false)
  {
    $v_result = 1;


    // ----- Remove the final '/'
    if (($p_is_dir) && (substr($p_dir, -1)=='/'))
    {
      $p_dir = substr($p_dir, 0, strlen($p_dir)-1);
    }

    // ----- Check the directory availability
    if ((is_dir($p_dir)) || ($p_dir == ""))
    {
      return 1;
    }

    // ----- Extract parent directory
    $p_parent_dir = dirname($p_dir);

    // ----- Just a check
    if ($p_parent_dir != $p_dir)
    {
      // ----- Look for parent directory
      if ($p_parent_dir != "")
      {
        if (($v_result = $this->privDirCheck($p_parent_dir)) != 1)
        {
          return $v_result;
        }
      }
    }

    // ----- Create the directory
    if (!@mkdir($p_dir, 0777))
    {
      // ----- Error log
      PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'");

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privMerge()
  // Description :
  //   If $p_archive_to_add does not exist, the function exit with a success result.
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privMerge(&$p_archive_to_add)
  {
    $v_result=1;

    // ----- Look if the archive_to_add exists
    if (!is_file($p_archive_to_add->zipname))
    {

      // ----- Nothing to merge, so merge is a success
      $v_result = 1;

      // ----- Return
      return $v_result;
    }

    // ----- Look if the archive exists
    if (!is_file($this->zipname))
    {

      // ----- Do a duplicate
      $v_result = $this->privDuplicate($p_archive_to_add->zipname);

      // ----- Return
      return $v_result;
    }

    // ----- Open the zip file
    if (($v_result=$this->privOpenFd('rb')) != 1)
    {
      // ----- Return
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir = array();
    if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1)
    {
      $this->privCloseFd();
      return $v_result;
    }

    // ----- Go to beginning of File
    @rewind($this->zip_fd);

    // ----- Open the archive_to_add file
    if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1)
    {
      $this->privCloseFd();

      // ----- Return
      return $v_result;
    }

    // ----- Read the central directory informations
    $v_central_dir_to_add = array();
    if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1)
    {
      $this->privCloseFd();
      $p_archive_to_add->privCloseFd();

      return $v_result;
    }

    // ----- Go to beginning of File
    @rewind($p_archive_to_add->zip_fd);

    // ----- Creates a temporay file
    $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';

    // ----- Open the temporary file in write mode
    if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0)
    {
      $this->privCloseFd();
      $p_archive_to_add->privCloseFd();

      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Copy the files from the archive to the temporary file
    // TBC : Here I should better append the file and go back to erase the central dir
    $v_size = $v_central_dir['offset'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = fread($this->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Copy the files from the archive_to_add into the temporary file
    $v_size = $v_central_dir_to_add['offset'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Store the offset of the central dir
    $v_offset = @ftell($v_zip_temp_fd);

    // ----- Copy the block of file headers from the old archive
    $v_size = $v_central_dir['size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = @fread($this->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Copy the block of file headers from the archive_to_add
    $v_size = $v_central_dir_to_add['size'];
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
      @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Merge the file comments
    $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];

    // ----- Calculate the size of the (new) central header
    $v_size = @ftell($v_zip_temp_fd)-$v_offset;

    // ----- Swap the file descriptor
    // Here is a trick : I swap the temporary fd with the zip fd, in order to use
    // the following methods on the temporary fil and not the real archive fd
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Create the central dir footer
    if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1)
    {
      $this->privCloseFd();
      $p_archive_to_add->privCloseFd();
      @fclose($v_zip_temp_fd);
      $this->zip_fd = null;

      // ----- Reset the file list
      unset($v_header_list);

      // ----- Return
      return $v_result;
    }

    // ----- Swap back the file descriptor
    $v_swap = $this->zip_fd;
    $this->zip_fd = $v_zip_temp_fd;
    $v_zip_temp_fd = $v_swap;

    // ----- Close
    $this->privCloseFd();
    $p_archive_to_add->privCloseFd();

    // ----- Close the temporary file
    @fclose($v_zip_temp_fd);

    // ----- Delete the zip file
    // TBC : I should test the result ...
    @unlink($this->zipname);

    // ----- Rename the temporary file
    // TBC : I should test the result ...
    //@rename($v_zip_temp_name, $this->zipname);
    PclZipUtilRename($v_zip_temp_name, $this->zipname);

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDuplicate()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privDuplicate($p_archive_filename)
  {
    $v_result=1;

    // ----- Look if the $p_archive_filename exists
    if (!is_file($p_archive_filename))
    {

      // ----- Nothing to duplicate, so duplicate is a success.
      $v_result = 1;

      // ----- Return
      return $v_result;
    }

    // ----- Open the zip file
    if (($v_result=$this->privOpenFd('wb')) != 1)
    {
      // ----- Return
      return $v_result;
    }

    // ----- Open the temporary file in write mode
    if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0)
    {
      $this->privCloseFd();

      PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');

      // ----- Return
      return PclZip::errorCode();
    }

    // ----- Copy the files from the archive to the temporary file
    // TBC : Here I should better append the file and go back to erase the central dir
    $v_size = filesize($p_archive_filename);
    while ($v_size != 0)
    {
      $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
      $v_buffer = fread($v_zip_temp_fd, $v_read_size);
      @fwrite($this->zip_fd, $v_buffer, $v_read_size);
      $v_size -= $v_read_size;
    }

    // ----- Close
    $this->privCloseFd();

    // ----- Close the temporary file
    @fclose($v_zip_temp_fd);

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privErrorLog()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privErrorLog($p_error_code=0, $p_error_string='')
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      PclError($p_error_code, $p_error_string);
    }
    else {
      $this->error_code = $p_error_code;
      $this->error_string = $p_error_string;
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privErrorReset()
  // Description :
  // Parameters :
  // --------------------------------------------------------------------------------
  function privErrorReset()
  {
    if (PCLZIP_ERROR_EXTERNAL == 1) {
      PclErrorReset();
    }
    else {
      $this->error_code = 0;
      $this->error_string = '';
    }
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privDisableMagicQuotes()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privDisableMagicQuotes()
  {
    $v_result=1;

    // ----- Look if function exists
    if (   (!function_exists("get_magic_quotes_runtime"))
	    || (!function_exists("set_magic_quotes_runtime"))) {
      return $v_result;
	}

    // ----- Look if already done
    if ($this->magic_quotes_status != -1) {
      return $v_result;
	}

	// ----- Get and memorize the magic_quote value
	$this->magic_quotes_status = @get_magic_quotes_runtime();

	// ----- Disable magic_quotes
	if ($this->magic_quotes_status == 1) {
	  @set_magic_quotes_runtime(0);
	}

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : privSwapBackMagicQuotes()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function privSwapBackMagicQuotes()
  {
    $v_result=1;

    // ----- Look if function exists
    if (   (!function_exists("get_magic_quotes_runtime"))
	    || (!function_exists("set_magic_quotes_runtime"))) {
      return $v_result;
	}

    // ----- Look if something to do
    if ($this->magic_quotes_status != -1) {
      return $v_result;
	}

	// ----- Swap back magic_quotes
	if ($this->magic_quotes_status == 1) {
  	  @set_magic_quotes_runtime($this->magic_quotes_status);
	}

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  }
  // End of class
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilPathReduction()
  // Description :
  // Parameters :
  // Return Values :
  // --------------------------------------------------------------------------------
  function PclZipUtilPathReduction($p_dir)
  {
    $v_result = "";

    // ----- Look for not empty path
    if ($p_dir != "") {
      // ----- Explode path by directory names
      $v_list = explode("/", $p_dir);

      // ----- Study directories from last to first
      $v_skip = 0;
      for ($i=sizeof($v_list)-1; $i>=0; $i--) {
        // ----- Look for current path
        if ($v_list[$i] == ".") {
          // ----- Ignore this directory
          // Should be the first $i=0, but no check is done
        }
        else if ($v_list[$i] == "..") {
		  $v_skip++;
        }
        else if ($v_list[$i] == "") {
		  // ----- First '/' i.e. root slash
		  if ($i == 0) {
            $v_result = "/".$v_result;
		    if ($v_skip > 0) {
		        // ----- It is an invalid path, so the path is not modified
		        // TBC
		        $v_result = $p_dir;
                $v_skip = 0;
		    }
		  }
		  // ----- Last '/' i.e. indicates a directory
		  else if ($i == (sizeof($v_list)-1)) {
            $v_result = $v_list[$i];
		  }
		  // ----- Double '/' inside the path
		  else {
            // ----- Ignore only the double '//' in path,
            // but not the first and last '/'
		  }
        }
        else {
		  // ----- Look for item to skip
		  if ($v_skip > 0) {
		    $v_skip--;
		  }
		  else {
            $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
		  }
        }
      }
      
      // ----- Look for skip
      if ($v_skip > 0) {
        while ($v_skip > 0) {
            $v_result = '../'.$v_result;
            $v_skip--;
        }
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilPathInclusion()
  // Description :
  //   This function indicates if the path $p_path is under the $p_dir tree. Or,
  //   said in an other way, if the file or sub-dir $p_path is inside the dir
  //   $p_dir.
  //   The function indicates also if the path is exactly the same as the dir.
  //   This function supports path with duplicated '/' like '//', but does not
  //   support '.' or '..' statements.
  // Parameters :
  // Return Values :
  //   0 if $p_path is not inside directory $p_dir
  //   1 if $p_path is inside directory $p_dir
  //   2 if $p_path is exactly the same as $p_dir
  // --------------------------------------------------------------------------------
  function PclZipUtilPathInclusion($p_dir, $p_path)
  {
    $v_result = 1;
    
    // ----- Look for path beginning by ./
    if (   ($p_dir == '.')
        || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
      $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1);
    }
    if (   ($p_path == '.')
        || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) {
      $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1);
    }

    // ----- Explode dir and path by directory separator
    $v_list_dir = explode("/", $p_dir);
    $v_list_dir_size = sizeof($v_list_dir);
    $v_list_path = explode("/", $p_path);
    $v_list_path_size = sizeof($v_list_path);

    // ----- Study directories paths
    $i = 0;
    $j = 0;
    while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {

      // ----- Look for empty dir (path reduction)
      if ($v_list_dir[$i] == '') {
        $i++;
        continue;
      }
      if ($v_list_path[$j] == '') {
        $j++;
        continue;
      }

      // ----- Compare the items
      if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != ''))  {
        $v_result = 0;
      }

      // ----- Next items
      $i++;
      $j++;
    }

    // ----- Look if everything seems to be the same
    if ($v_result) {
      // ----- Skip all the empty items
      while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++;
      while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++;

      if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
        // ----- There are exactly the same
        $v_result = 2;
      }
      else if ($i < $v_list_dir_size) {
        // ----- The path is shorter than the dir
        $v_result = 0;
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilCopyBlock()
  // Description :
  // Parameters :
  //   $p_mode : read/write compression mode
  //             0 : src & dest normal
  //             1 : src gzip, dest normal
  //             2 : src normal, dest gzip
  //             3 : src & dest gzip
  // Return Values :
  // --------------------------------------------------------------------------------
  function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0)
  {
    $v_result = 1;

    if ($p_mode==0)
    {
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        $v_buffer = @fread($p_src, $v_read_size);
        @fwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
    }
    else if ($p_mode==1)
    {
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        $v_buffer = @gzread($p_src, $v_read_size);
        @fwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
    }
    else if ($p_mode==2)
    {
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        $v_buffer = @fread($p_src, $v_read_size);
        @gzwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
    }
    else if ($p_mode==3)
    {
      while ($p_size != 0)
      {
        $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
        $v_buffer = @gzread($p_src, $v_read_size);
        @gzwrite($p_dest, $v_buffer, $v_read_size);
        $p_size -= $v_read_size;
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilRename()
  // Description :
  //   This function tries to do a simple rename() function. If it fails, it
  //   tries to copy the $p_src file in a new $p_dest file and then unlink the
  //   first one.
  // Parameters :
  //   $p_src : Old filename
  //   $p_dest : New filename
  // Return Values :
  //   1 on success, 0 on failure.
  // --------------------------------------------------------------------------------
  function PclZipUtilRename($p_src, $p_dest)
  {
    $v_result = 1;

    // ----- Try to rename the files
    if (!@rename($p_src, $p_dest)) {

      // ----- Try to copy & unlink the src
      if (!@copy($p_src, $p_dest)) {
        $v_result = 0;
      }
      else if (!@unlink($p_src)) {
        $v_result = 0;
      }
    }

    // ----- Return
    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilOptionText()
  // Description :
  //   Translate option value in text. Mainly for debug purpose.
  // Parameters :
  //   $p_option : the option value.
  // Return Values :
  //   The option text value.
  // --------------------------------------------------------------------------------
  function PclZipUtilOptionText($p_option)
  {
    
    $v_list = get_defined_constants();
    for (reset($v_list); $v_key = key($v_list); next($v_list)) {
	    $v_prefix = substr($v_key, 0, 10);
	    if ((   ($v_prefix == 'PCLZIP_OPT')
           || ($v_prefix == 'PCLZIP_CB_')
           || ($v_prefix == 'PCLZIP_ATT'))
	        && ($v_list[$v_key] == $p_option)) {
        return $v_key;
	    }
    }
    
    $v_result = 'Unknown';

    return $v_result;
  }
  // --------------------------------------------------------------------------------

  // --------------------------------------------------------------------------------
  // Function : PclZipUtilTranslateWinPath()
  // Description :
  //   Translate windows path by replacing '\' by '/' and optionally removing
  //   drive letter.
  // Parameters :
  //   $p_path : path to translate.
  //   $p_remove_disk_letter : true | false
  // Return Values :
  //   The path translated.
  // --------------------------------------------------------------------------------
  function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true)
  {
    if (stristr(php_uname(), 'windows')) {
      // ----- Look for potential disk letter
      if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
          $p_path = substr($p_path, $v_position+1);
      }
      // ----- Change potential windows directory separator
      if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) {
          $p_path = strtr($p_path, '\\', '/');
      }
    }
    return $p_path;
  }
  // --------------------------------------------------------------------------------


?>
<?php
/**
 * PEAR, the PHP Extension and Application Repository
 *
 * PEAR class and PEAR_Error class
 *
 * PHP versions 4 and 5
 *
 * @category   pear
 * @package    PEAR
 * @author     Sterling Hughes <sterling@php.net>
 * @author     Stig Bakken <ssb@php.net>
 * @author     Tomas V.V.Cox <cox@idecnet.com>
 * @author     Greg Beaver <cellog@php.net>
 * @copyright  1997-2010 The Authors
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @version    CVS: $Id: PEAR.php 299813 2010-05-26 19:50:00Z dufuz $
 * @link       http://pear.php.net/package/PEAR
 * @since      File available since Release 0.1
 */

/**#@+
 * ERROR constants
 */
define('PEAR_ERROR_RETURN',     1);
define('PEAR_ERROR_PRINT',      2);
define('PEAR_ERROR_TRIGGER',    4);
define('PEAR_ERROR_DIE',        8);
define('PEAR_ERROR_CALLBACK',  16);
/**
 * WARNING: obsolete
 * @deprecated
 */
define('PEAR_ERROR_EXCEPTION', 32);
/**#@-*/
define('PEAR_ZE2', (function_exists('version_compare') &&
                    version_compare(zend_version(), "2-dev", "ge")));

if (substr(PHP_OS, 0, 3) == 'WIN') {
    define('OS_WINDOWS', true);
    define('OS_UNIX',    false);
    define('PEAR_OS',    'Windows');
} else {
    define('OS_WINDOWS', false);
    define('OS_UNIX',    true);
    define('PEAR_OS',    'Unix'); // blatant assumption
}

$GLOBALS['_PEAR_default_error_mode']     = PEAR_ERROR_RETURN;
$GLOBALS['_PEAR_default_error_options']  = E_USER_NOTICE;
$GLOBALS['_PEAR_destructor_object_list'] = array();
$GLOBALS['_PEAR_shutdown_funcs']         = array();
$GLOBALS['_PEAR_error_handler_stack']    = array();

@ini_set('track_errors', true);

/**
 * Base class for other PEAR classes.  Provides rudimentary
 * emulation of destructors.
 *
 * If you want a destructor in your class, inherit PEAR and make a
 * destructor method called _yourclassname (same name as the
 * constructor, but with a "_" prefix).  Also, in your constructor you
 * have to call the PEAR constructor: $this->PEAR();.
 * The destructor method will be called without parameters.  Note that
 * at in some SAPI implementations (such as Apache), any output during
 * the request shutdown (in which destructors are called) seems to be
 * discarded.  If you need to get any debug information from your
 * destructor, use error_log(), syslog() or something similar.
 *
 * IMPORTANT! To use the emulated destructors you need to create the
 * objects by reference: $obj =& new PEAR_child;
 *
 * @category   pear
 * @package    PEAR
 * @author     Stig Bakken <ssb@php.net>
 * @author     Tomas V.V. Cox <cox@idecnet.com>
 * @author     Greg Beaver <cellog@php.net>
 * @copyright  1997-2006 The PHP Group
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @version    Release: 1.9.3
 * @link       http://pear.php.net/package/PEAR
 * @see        PEAR_Error
 * @since      Class available since PHP 4.0.2
 * @link        http://pear.php.net/manual/en/core.pear.php#core.pear.pear
 */
class PEAR
{
    /**
     * Whether to enable internal debug messages.
     *
     * @var     bool
     * @access  private
     */
    var $_debug = false;

    /**
     * Default error mode for this object.
     *
     * @var     int
     * @access  private
     */
    var $_default_error_mode = null;

    /**
     * Default error options used for this object when error mode
     * is PEAR_ERROR_TRIGGER.
     *
     * @var     int
     * @access  private
     */
    var $_default_error_options = null;

    /**
     * Default error handler (callback) for this object, if error mode is
     * PEAR_ERROR_CALLBACK.
     *
     * @var     string
     * @access  private
     */
    var $_default_error_handler = '';

    /**
     * Which class to use for error objects.
     *
     * @var     string
     * @access  private
     */
    var $_error_class = 'PEAR_Error';

    /**
     * An array of expected errors.
     *
     * @var     array
     * @access  private
     */
    var $_expected_errors = array();

    /**
     * Constructor.  Registers this object in
     * $_PEAR_destructor_object_list for destructor emulation if a
     * destructor object exists.
     *
     * @param string $error_class  (optional) which class to use for
     *        error objects, defaults to PEAR_Error.
     * @access public
     * @return void
     */
    function PEAR($error_class = null)
    {
        $classname = strtolower(get_class($this));
        if ($this->_debug) {
            print "PEAR constructor called, class=$classname\n";
        }

        if ($error_class !== null) {
            $this->_error_class = $error_class;
        }

        while ($classname && strcasecmp($classname, "pear")) {
            $destructor = "_$classname";
            if (method_exists($this, $destructor)) {
                global $_PEAR_destructor_object_list;
                $_PEAR_destructor_object_list[] = &$this;
                if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
                    register_shutdown_function("_PEAR_call_destructors");
                    $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
                }
                break;
            } else {
                $classname = get_parent_class($classname);
            }
        }
    }

    /**
     * Destructor (the emulated type of...).  Does nothing right now,
     * but is included for forward compatibility, so subclass
     * destructors should always call it.
     *
     * See the note in the class desciption about output from
     * destructors.
     *
     * @access public
     * @return void
     */
    function _PEAR() {
        if ($this->_debug) {
            printf("PEAR destructor called, class=%s\n", strtolower(get_class($this)));
        }
    }

    /**
    * If you have a class that's mostly/entirely static, and you need static
    * properties, you can use this method to simulate them. Eg. in your method(s)
    * do this: $myVar = &PEAR::getStaticProperty('myclass', 'myVar');
    * You MUST use a reference, or they will not persist!
    *
    * @access public
    * @param  string $class  The calling classname, to prevent clashes
    * @param  string $var    The variable to retrieve.
    * @return mixed   A reference to the variable. If not set it will be
    *                 auto initialised to NULL.
    */
    function &getStaticProperty($class, $var)
    {
        static $properties;
        if (!isset($properties[$class])) {
            $properties[$class] = array();
        }

        if (!array_key_exists($var, $properties[$class])) {
            $properties[$class][$var] = null;
        }

        return $properties[$class][$var];
    }

    /**
    * Use this function to register a shutdown method for static
    * classes.
    *
    * @access public
    * @param  mixed $func  The function name (or array of class/method) to call
    * @param  mixed $args  The arguments to pass to the function
    * @return void
    */
    function registerShutdownFunc($func, $args = array())
    {
        // if we are called statically, there is a potential
        // that no shutdown func is registered.  Bug #6445
        if (!isset($GLOBALS['_PEAR_SHUTDOWN_REGISTERED'])) {
            register_shutdown_function("_PEAR_call_destructors");
            $GLOBALS['_PEAR_SHUTDOWN_REGISTERED'] = true;
        }
        $GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
    }

    /**
     * Tell whether a value is a PEAR error.
     *
     * @param   mixed $data   the value to test
     * @param   int   $code   if $data is an error object, return true
     *                        only if $code is a string and
     *                        $obj->getMessage() == $code or
     *                        $code is an integer and $obj->getCode() == $code
     * @access  public
     * @return  bool    true if parameter is an error
     */
    function isError($data, $code = null)
    {
        if (!is_a($data, 'PEAR_Error')) {
            return false;
        }

        if (is_null($code)) {
            return true;
        } elseif (is_string($code)) {
            return $data->getMessage() == $code;
        }

        return $data->getCode() == $code;
    }

    /**
     * Sets how errors generated by this object should be handled.
     * Can be invoked both in objects and statically.  If called
     * statically, setErrorHandling sets the default behaviour for all
     * PEAR objects.  If called in an object, setErrorHandling sets
     * the default behaviour for that object.
     *
     * @param int $mode
     *        One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
     *        PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
     *        PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION.
     *
     * @param mixed $options
     *        When $mode is PEAR_ERROR_TRIGGER, this is the error level (one
     *        of E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
     *
     *        When $mode is PEAR_ERROR_CALLBACK, this parameter is expected
     *        to be the callback function or method.  A callback
     *        function is a string with the name of the function, a
     *        callback method is an array of two elements: the element
     *        at index 0 is the object, and the element at index 1 is
     *        the name of the method to call in the object.
     *
     *        When $mode is PEAR_ERROR_PRINT or PEAR_ERROR_DIE, this is
     *        a printf format string used when printing the error
     *        message.
     *
     * @access public
     * @return void
     * @see PEAR_ERROR_RETURN
     * @see PEAR_ERROR_PRINT
     * @see PEAR_ERROR_TRIGGER
     * @see PEAR_ERROR_DIE
     * @see PEAR_ERROR_CALLBACK
     * @see PEAR_ERROR_EXCEPTION
     *
     * @since PHP 4.0.5
     */
    function setErrorHandling($mode = null, $options = null)
    {
        if (isset($this) && is_a($this, 'PEAR')) {
            $setmode     = &$this->_default_error_mode;
            $setoptions  = &$this->_default_error_options;
        } else {
            $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
            $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
        }

        switch ($mode) {
            case PEAR_ERROR_EXCEPTION:
            case PEAR_ERROR_RETURN:
            case PEAR_ERROR_PRINT:
            case PEAR_ERROR_TRIGGER:
            case PEAR_ERROR_DIE:
            case null:
                $setmode = $mode;
                $setoptions = $options;
                break;

            case PEAR_ERROR_CALLBACK:
                $setmode = $mode;
                // class/object method callback
                if (is_callable($options)) {
                    $setoptions = $options;
                } else {
                    trigger_error("invalid error callback", E_USER_WARNING);
                }
                break;

            default:
                trigger_error("invalid error mode", E_USER_WARNING);
                break;
        }
    }

    /**
     * This method is used to tell which errors you expect to get.
     * Expected errors are always returned with error mode
     * PEAR_ERROR_RETURN.  Expected error codes are stored in a stack,
     * and this method pushes a new element onto it.  The list of
     * expected errors are in effect until they are popped off the
     * stack with the popExpect() method.
     *
     * Note that this method can not be called statically
     *
     * @param mixed $code a single error code or an array of error codes to expect
     *
     * @return int     the new depth of the "expected errors" stack
     * @access public
     */
    function expectError($code = '*')
    {
        if (is_array($code)) {
            array_push($this->_expected_errors, $code);
        } else {
            array_push($this->_expected_errors, array($code));
        }
        return count($this->_expected_errors);
    }

    /**
     * This method pops one element off the expected error codes
     * stack.
     *
     * @return array   the list of error codes that were popped
     */
    function popExpect()
    {
        return array_pop($this->_expected_errors);
    }

    /**
     * This method checks unsets an error code if available
     *
     * @param mixed error code
     * @return bool true if the error code was unset, false otherwise
     * @access private
     * @since PHP 4.3.0
     */
    function _checkDelExpect($error_code)
    {
        $deleted = false;
        foreach ($this->_expected_errors as $key => $error_array) {
            if (in_array($error_code, $error_array)) {
                unset($this->_expected_errors[$key][array_search($error_code, $error_array)]);
                $deleted = true;
            }

            // clean up empty arrays
            if (0 == count($this->_expected_errors[$key])) {
                unset($this->_expected_errors[$key]);
            }
        }

        return $deleted;
    }

    /**
     * This method deletes all occurences of the specified element from
     * the expected error codes stack.
     *
     * @param  mixed $error_code error code that should be deleted
     * @return mixed list of error codes that were deleted or error
     * @access public
     * @since PHP 4.3.0
     */
    function delExpect($error_code)
    {
        $deleted = false;
        if ((is_array($error_code) && (0 != count($error_code)))) {
            // $error_code is a non-empty array here; we walk through it trying
            // to unset all values
            foreach ($error_code as $key => $error) {
                $deleted =  $this->_checkDelExpect($error) ? true : false;
            }

            return $deleted ? true : PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
        } elseif (!empty($error_code)) {
            // $error_code comes alone, trying to unset it
            if ($this->_checkDelExpect($error_code)) {
                return true;
            }

            return PEAR::raiseError("The expected error you submitted does not exist"); // IMPROVE ME
        }

        // $error_code is empty
        return PEAR::raiseError("The expected error you submitted is empty"); // IMPROVE ME
    }

    /**
     * This method is a wrapper that returns an instance of the
     * configured error class with this object's default error
     * handling applied.  If the $mode and $options parameters are not
     * specified, the object's defaults are used.
     *
     * @param mixed $message a text error message or a PEAR error object
     *
     * @param int $code      a numeric error code (it is up to your class
     *                  to define these if you want to use codes)
     *
     * @param int $mode      One of PEAR_ERROR_RETURN, PEAR_ERROR_PRINT,
     *                  PEAR_ERROR_TRIGGER, PEAR_ERROR_DIE,
     *                  PEAR_ERROR_CALLBACK, PEAR_ERROR_EXCEPTION.
     *
     * @param mixed $options If $mode is PEAR_ERROR_TRIGGER, this parameter
     *                  specifies the PHP-internal error level (one of
     *                  E_USER_NOTICE, E_USER_WARNING or E_USER_ERROR).
     *                  If $mode is PEAR_ERROR_CALLBACK, this
     *                  parameter specifies the callback function or
     *                  method.  In other error modes this parameter
     *                  is ignored.
     *
     * @param string $userinfo If you need to pass along for example debug
     *                  information, this parameter is meant for that.
     *
     * @param string $error_class The returned error object will be
     *                  instantiated from this class, if specified.
     *
     * @param bool $skipmsg If true, raiseError will only pass error codes,
     *                  the error message parameter will be dropped.
     *
     * @access public
     * @return object   a PEAR error object
     * @see PEAR::setErrorHandling
     * @since PHP 4.0.5
     */
    function &raiseError($message = null,
                         $code = null,
                         $mode = null,
                         $options = null,
                         $userinfo = null,
                         $error_class = null,
                         $skipmsg = false)
    {
        // The error is yet a PEAR error object
        if (is_object($message)) {
            $code        = $message->getCode();
            $userinfo    = $message->getUserInfo();
            $error_class = $message->getType();
            $message->error_message_prefix = '';
            $message     = $message->getMessage();
        }

        if (
            isset($this) &&
            isset($this->_expected_errors) &&
            count($this->_expected_errors) > 0 &&
            count($exp = end($this->_expected_errors))
        ) {
            if ($exp[0] == "*" ||
                (is_int(reset($exp)) && in_array($code, $exp)) ||
                (is_string(reset($exp)) && in_array($message, $exp))
            ) {
                $mode = PEAR_ERROR_RETURN;
            }
        }

        // No mode given, try global ones
        if ($mode === null) {
            // Class error handler
            if (isset($this) && isset($this->_default_error_mode)) {
                $mode    = $this->_default_error_mode;
                $options = $this->_default_error_options;
            // Global error handler
            } elseif (isset($GLOBALS['_PEAR_default_error_mode'])) {
                $mode    = $GLOBALS['_PEAR_default_error_mode'];
                $options = $GLOBALS['_PEAR_default_error_options'];
            }
        }

        if ($error_class !== null) {
            $ec = $error_class;
        } elseif (isset($this) && isset($this->_error_class)) {
            $ec = $this->_error_class;
        } else {
            $ec = 'PEAR_Error';
        }

        if (intval(PHP_VERSION) < 5) {
            // little non-eval hack to fix bug #12147
            include 'PEAR/FixPHP5PEARWarnings.php';
            return $a;
        }

        if ($skipmsg) {
            $a = new $ec($code, $mode, $options, $userinfo);
        } else {
            $a = new $ec($message, $code, $mode, $options, $userinfo);
        }

        return $a;
    }

    /**
     * Simpler form of raiseError with fewer options.  In most cases
     * message, code and userinfo are enough.
     *
     * @param mixed $message a text error message or a PEAR error object
     *
     * @param int $code      a numeric error code (it is up to your class
     *                  to define these if you want to use codes)
     *
     * @param string $userinfo If you need to pass along for example debug
     *                  information, this parameter is meant for that.
     *
     * @access public
     * @return object   a PEAR error object
     * @see PEAR::raiseError
     */
    function &throwError($message = null, $code = null, $userinfo = null)
    {
        if (isset($this) && is_a($this, 'PEAR')) {
            $a = &$this->raiseError($message, $code, null, null, $userinfo);
            return $a;
        }

        $a = &PEAR::raiseError($message, $code, null, null, $userinfo);
        return $a;
    }

    function staticPushErrorHandling($mode, $options = null)
    {
        $stack       = &$GLOBALS['_PEAR_error_handler_stack'];
        $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
        $def_options = &$GLOBALS['_PEAR_default_error_options'];
        $stack[] = array($def_mode, $def_options);
        switch ($mode) {
            case PEAR_ERROR_EXCEPTION:
            case PEAR_ERROR_RETURN:
            case PEAR_ERROR_PRINT:
            case PEAR_ERROR_TRIGGER:
            case PEAR_ERROR_DIE:
            case null:
                $def_mode = $mode;
                $def_options = $options;
                break;

            case PEAR_ERROR_CALLBACK:
                $def_mode = $mode;
                // class/object method callback
                if (is_callable($options)) {
                    $def_options = $options;
                } else {
                    trigger_error("invalid error callback", E_USER_WARNING);
                }
                break;

            default:
                trigger_error("invalid error mode", E_USER_WARNING);
                break;
        }
        $stack[] = array($mode, $options);
        return true;
    }

    function staticPopErrorHandling()
    {
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
        $setmode     = &$GLOBALS['_PEAR_default_error_mode'];
        $setoptions  = &$GLOBALS['_PEAR_default_error_options'];
        array_pop($stack);
        list($mode, $options) = $stack[sizeof($stack) - 1];
        array_pop($stack);
        switch ($mode) {
            case PEAR_ERROR_EXCEPTION:
            case PEAR_ERROR_RETURN:
            case PEAR_ERROR_PRINT:
            case PEAR_ERROR_TRIGGER:
            case PEAR_ERROR_DIE:
            case null:
                $setmode = $mode;
                $setoptions = $options;
                break;

            case PEAR_ERROR_CALLBACK:
                $setmode = $mode;
                // class/object method callback
                if (is_callable($options)) {
                    $setoptions = $options;
                } else {
                    trigger_error("invalid error callback", E_USER_WARNING);
                }
                break;

            default:
                trigger_error("invalid error mode", E_USER_WARNING);
                break;
        }
        return true;
    }

    /**
     * Push a new error handler on top of the error handler options stack. With this
     * you can easily override the actual error handler for some code and restore
     * it later with popErrorHandling.
     *
     * @param mixed $mode (same as setErrorHandling)
     * @param mixed $options (same as setErrorHandling)
     *
     * @return bool Always true
     *
     * @see PEAR::setErrorHandling
     */
    function pushErrorHandling($mode, $options = null)
    {
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
        if (isset($this) && is_a($this, 'PEAR')) {
            $def_mode    = &$this->_default_error_mode;
            $def_options = &$this->_default_error_options;
        } else {
            $def_mode    = &$GLOBALS['_PEAR_default_error_mode'];
            $def_options = &$GLOBALS['_PEAR_default_error_options'];
        }
        $stack[] = array($def_mode, $def_options);

        if (isset($this) && is_a($this, 'PEAR')) {
            $this->setErrorHandling($mode, $options);
        } else {
            PEAR::setErrorHandling($mode, $options);
        }
        $stack[] = array($mode, $options);
        return true;
    }

    /**
    * Pop the last error handler used
    *
    * @return bool Always true
    *
    * @see PEAR::pushErrorHandling
    */
    function popErrorHandling()
    {
        $stack = &$GLOBALS['_PEAR_error_handler_stack'];
        array_pop($stack);
        list($mode, $options) = $stack[sizeof($stack) - 1];
        array_pop($stack);
        if (isset($this) && is_a($this, 'PEAR')) {
            $this->setErrorHandling($mode, $options);
        } else {
            PEAR::setErrorHandling($mode, $options);
        }
        return true;
    }

    /**
    * OS independant PHP extension load. Remember to take care
    * on the correct extension name for case sensitive OSes.
    *
    * @param string $ext The extension name
    * @return bool Success or not on the dl() call
    */
    function loadExtension($ext)
    {
        if (extension_loaded($ext)) {
            return true;
        }

        // if either returns true dl() will produce a FATAL error, stop that
        if (
            function_exists('dl') === false ||
            ini_get('enable_dl') != 1 ||
            ini_get('safe_mode') == 1
        ) {
            return false;
        }

        if (OS_WINDOWS) {
            $suffix = '.dll';
        } elseif (PHP_OS == 'HP-UX') {
            $suffix = '.sl';
        } elseif (PHP_OS == 'AIX') {
            $suffix = '.a';
        } elseif (PHP_OS == 'OSX') {
            $suffix = '.bundle';
        } else {
            $suffix = '.so';
        }

        return @dl('php_'.$ext.$suffix) || @dl($ext.$suffix);
    }
}

if (PEAR_ZE2) {
    include_once 'PEAR5.php';
}

function _PEAR_call_destructors()
{
    global $_PEAR_destructor_object_list;
    if (is_array($_PEAR_destructor_object_list) &&
        sizeof($_PEAR_destructor_object_list))
    {
        reset($_PEAR_destructor_object_list);
        if (PEAR_ZE2) {
            $destructLifoExists = PEAR5::getStaticProperty('PEAR', 'destructlifo');
        } else {
            $destructLifoExists = PEAR::getStaticProperty('PEAR', 'destructlifo');
        }

        if ($destructLifoExists) {
            $_PEAR_destructor_object_list = array_reverse($_PEAR_destructor_object_list);
        }

        while (list($k, $objref) = each($_PEAR_destructor_object_list)) {
            $classname = get_class($objref);
            while ($classname) {
                $destructor = "_$classname";
                if (method_exists($objref, $destructor)) {
                    $objref->$destructor();
                    break;
                } else {
                    $classname = get_parent_class($classname);
                }
            }
        }
        // Empty the object list to ensure that destructors are
        // not called more than once.
        $_PEAR_destructor_object_list = array();
    }

    // Now call the shutdown functions
    if (
        isset($GLOBALS['_PEAR_shutdown_funcs']) &&
        is_array($GLOBALS['_PEAR_shutdown_funcs']) &&
        !empty($GLOBALS['_PEAR_shutdown_funcs'])
    ) {
        foreach ($GLOBALS['_PEAR_shutdown_funcs'] as $value) {
            call_user_func_array($value[0], $value[1]);
        }
    }
}

/**
 * Standard PEAR error class for PHP 4
 *
 * This class is supserseded by {@link PEAR_Exception} in PHP 5
 *
 * @category   pear
 * @package    PEAR
 * @author     Stig Bakken <ssb@php.net>
 * @author     Tomas V.V. Cox <cox@idecnet.com>
 * @author     Gregory Beaver <cellog@php.net>
 * @copyright  1997-2006 The PHP Group
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
 * @version    Release: 1.9.3
 * @link       http://pear.php.net/manual/en/core.pear.pear-error.php
 * @see        PEAR::raiseError(), PEAR::throwError()
 * @since      Class available since PHP 4.0.2
 */
class PEAR_Error
{
    var $error_message_prefix = '';
    var $mode                 = PEAR_ERROR_RETURN;
    var $level                = E_USER_NOTICE;
    var $code                 = -1;
    var $message              = '';
    var $userinfo             = '';
    var $backtrace            = null;

    /**
     * PEAR_Error constructor
     *
     * @param string $message  message
     *
     * @param int $code     (optional) error code
     *
     * @param int $mode     (optional) error mode, one of: PEAR_ERROR_RETURN,
     * PEAR_ERROR_PRINT, PEAR_ERROR_DIE, PEAR_ERROR_TRIGGER,
     * PEAR_ERROR_CALLBACK or PEAR_ERROR_EXCEPTION
     *
     * @param mixed $options   (optional) error level, _OR_ in the case of
     * PEAR_ERROR_CALLBACK, the callback function or object/method
     * tuple.
     *
     * @param string $userinfo (optional) additional user/debug info
     *
     * @access public
     *
     */
    function PEAR_Error($message = 'unknown error', $code = null,
                        $mode = null, $options = null, $userinfo = null)
    {
        if ($mode === null) {
            $mode = PEAR_ERROR_RETURN;
        }
        $this->message   = $message;
        $this->code      = $code;
        $this->mode      = $mode;
        $this->userinfo  = $userinfo;

        if (PEAR_ZE2) {
            $skiptrace = PEAR5::getStaticProperty('PEAR_Error', 'skiptrace');
        } else {
            $skiptrace = PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
        }

        if (!$skiptrace) {
            $this->backtrace = debug_backtrace();
            if (isset($this->backtrace[0]) && isset($this->backtrace[0]['object'])) {
                unset($this->backtrace[0]['object']);
            }
        }

        if ($mode & PEAR_ERROR_CALLBACK) {
            $this->level = E_USER_NOTICE;
            $this->callback = $options;
        } else {
            if ($options === null) {
                $options = E_USER_NOTICE;
            }

            $this->level = $options;
            $this->callback = null;
        }

        if ($this->mode & PEAR_ERROR_PRINT) {
            if (is_null($options) || is_int($options)) {
                $format = "%s";
            } else {
                $format = $options;
            }

            printf($format, $this->getMessage());
        }

        if ($this->mode & PEAR_ERROR_TRIGGER) {
            trigger_error($this->getMessage(), $this->level);
        }

        if ($this->mode & PEAR_ERROR_DIE) {
            $msg = $this->getMessage();
            if (is_null($options) || is_int($options)) {
                $format = "%s";
                if (substr($msg, -1) != "\n") {
                    $msg .= "\n";
                }
            } else {
                $format = $options;
            }
            die(sprintf($format, $msg));
        }

        if ($this->mode & PEAR_ERROR_CALLBACK && is_callable($this->callback)) {
            call_user_func($this->callback, $this);
        }

        if ($this->mode & PEAR_ERROR_EXCEPTION) {
            trigger_error("PEAR_ERROR_EXCEPTION is obsolete, use class PEAR_Exception for exceptions", E_USER_WARNING);
            eval('$e = new Exception($this->message, $this->code);throw($e);');
        }
    }

    /**
     * Get the error mode from an error object.
     *
     * @return int error mode
     * @access public
     */
    function getMode()
    {
        return $this->mode;
    }

    /**
     * Get the callback function/method from an error object.
     *
     * @return mixed callback function or object/method array
     * @access public
     */
    function getCallback()
    {
        return $this->callback;
    }

    /**
     * Get the error message from an error object.
     *
     * @return  string  full error message
     * @access public
     */
    function getMessage()
    {
        return ($this->error_message_prefix . $this->message);
    }

    /**
     * Get error code from an error object
     *
     * @return int error code
     * @access public
     */
     function getCode()
     {
        return $this->code;
     }

    /**
     * Get the name of this error/exception.
     *
     * @return string error/exception name (type)
     * @access public
     */
    function getType()
    {
        return get_class($this);
    }

    /**
     * Get additional user-supplied information.
     *
     * @return string user-supplied information
     * @access public
     */
    function getUserInfo()
    {
        return $this->userinfo;
    }

    /**
     * Get additional debug information supplied by the application.
     *
     * @return string debug information
     * @access public
     */
    function getDebugInfo()
    {
        return $this->getUserInfo();
    }

    /**
     * Get the call backtrace from where the error was generated.
     * Supported with PHP 4.3.0 or newer.
     *
     * @param int $frame (optional) what frame to fetch
     * @return array Backtrace, or NULL if not available.
     * @access public
     */
    function getBacktrace($frame = null)
    {
        if (defined('PEAR_IGNORE_BACKTRACE')) {
            return null;
        }
        if ($frame === null) {
            return $this->backtrace;
        }
        return $this->backtrace[$frame];
    }

    function addUserInfo($info)
    {
        if (empty($this->userinfo)) {
            $this->userinfo = $info;
        } else {
            $this->userinfo .= " ** $info";
        }
    }

    function __toString()
    {
        return $this->getMessage();
    }

    /**
     * Make a string representation of this object.
     *
     * @return string a string with an object summary
     * @access public
     */
    function toString()
    {
        $modes = array();
        $levels = array(E_USER_NOTICE  => 'notice',
                        E_USER_WARNING => 'warning',
                        E_USER_ERROR   => 'error');
        if ($this->mode & PEAR_ERROR_CALLBACK) {
            if (is_array($this->callback)) {
                $callback = (is_object($this->callback[0]) ?
                    strtolower(get_class($this->callback[0])) :
                    $this->callback[0]) . '::' .
                    $this->callback[1];
            } else {
                $callback = $this->callback;
            }
            return sprintf('[%s: message="%s" code=%d mode=callback '.
                           'callback=%s prefix="%s" info="%s"]',
                           strtolower(get_class($this)), $this->message, $this->code,
                           $callback, $this->error_message_prefix,
                           $this->userinfo);
        }
        if ($this->mode & PEAR_ERROR_PRINT) {
            $modes[] = 'print';
        }
        if ($this->mode & PEAR_ERROR_TRIGGER) {
            $modes[] = 'trigger';
        }
        if ($this->mode & PEAR_ERROR_DIE) {
            $modes[] = 'die';
        }
        if ($this->mode & PEAR_ERROR_RETURN) {
            $modes[] = 'return';
        }
        return sprintf('[%s: message="%s" code=%d mode=%s level=%s '.
                       'prefix="%s" info="%s"]',
                       strtolower(get_class($this)), $this->message, $this->code,
                       implode("|", $modes), $levels[$this->level],
                       $this->error_message_prefix,
                       $this->userinfo);
    }
}

/*
 * Local Variables:
 * mode: php
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 */
<?php

class rlRar {
	protected $filename, $rar_forbidden, $password, $rar_opts, $rar_descriptorspec, $rar_return, $rar_error, $rar_list, $debug, $rar_exec, $rar_version, $old_rar = true;

	function __construct($filename, $forbidden_filetypes=array('.xxx')) {
		$this->debug = false;
		$this->filename = trim($filename);
		$this->rar_forbidden = (!empty($forbidden_filetypes) ? '-x*' . implode($forbidden_filetypes, ' -x*') : '');
		if (is_file(ROOT_DIR . '/rar/rar')) {
			$this->rar_exec = ROOT_DIR . '/rar/rar';
			$return = 'rar';
		} elseif (is_file(ROOT_DIR . '/rar/unrar')) {
			$this->rar_exec = ROOT_DIR . '/rar/unrar';
			$return = 'unrar';
		} else $return = false;
		$this->password = '';
		$this->rar_error = '';
		$this->rar_list = false;
		$this->rar_descriptorspec = array(
			0 => array('pipe', 'r'), // stdin is a pipe that the child will read from
			1 => array('pipe', 'w'), // stdout is a pipe that the child will write to
			2 => array('pipe', 'w') // stderr is a pipe to write to
		);
		$this->rar_return = $return;
	}

	function get_rar_return() {
		return $this->rar_return;
	}

	function get_filename() {
		return $this->filename;
	}

	function fix_pass($password = '') {
		//$password fix/check
		return ($password == '' ? '' : '-p' . escapeshellarg(stripslashes(($password))) . ' ');
	}

	function check_numeric_opt(&$val, $max, $min=0) {
		$tmp = floor(intval($val));
		if (!is_float($tmp) || $tmp > $max || $tmp < $min) return false;
		$val = $tmp;
		return true;
	}

	function addtoarchive($rar_opts, $dest_dir, $jsoutid='', $debug_id=0) {
		$return = '';
		$dest_dir = realpath($dest_dir) . '/';
		$this->check_numeric_opt($rar_opts['comp_lvl'], 5);
		$this->filename = $dest_dir.basename($this->filename);
		$rar_part_exists = false;
		if (!empty($rar_opts['vols'])) {
			$tmp = basename(strtolower($this->filename));
			if (substr(strtolower($tmp), -4) == '.rar') $tmp = substr($tmp, 0, -4);
			$tmp .= '.part';
			clearstatcache();
			$rar_dir = opendir(realpath($dest_dir) . '/');
			while (false !== ($rar_f_dd = readdir($rar_dir))) {
				$rar_f_dd = basename(strtolower($rar_f_dd));
				if ($tmp == substr($rar_f_dd, 0, strlen($tmp)) && is_numeric(substr($rar_f_dd, strlen($tmp), -4))) {
					$rar_part_exists = true;
					break;
				}
			}
			closedir($rar_dir);
		}
		if (basename($this->filename) != preg_replace('/[^\w\040\.\-]/i', '', basename($this->filename))) $return = 'INVALID_RAR_FILENAME';
		elseif (basename($this->filename) == '' || basename($this->filename) == '.rar') $return = 'BAD_RAR_FILENAME';
		elseif (!is_dir($dest_dir)) $return = 'DESTINATION_NOT_EXISTS';
		elseif (file_exists($this->filename)) $return = 'RAR_EXISTS';
		elseif ($rar_part_exists) $return = 'RAR_PART_EXISTS';
		elseif (!empty($rar_opts['vols']) && !empty($rar_opts['vols_s']) && (!$this->check_numeric_opt($rar_opts['vols_s'], 1024, 1) || !$this->check_numeric_opt($rar_opts['vol_sm'], 6))) {
			$return = 'INVALID_VOLUMES_OPTIONS'; //var_export($this->check_numeric_opt($rar_opts['vols_s'], 1024, 1));
		} elseif (!empty($rar_opts['rec_rec']) && !empty($rar_opts['rec_rec_s']) && !$this->check_numeric_opt($rar_opts['rec_rec_s'], 10, 1)) $return = 'INVALID_RECOVERYR_OPTIONS';
		else {
			$this->rar_opts = array(
				'comp_lvl' => 0, 'vols' => 0, 'vols_s' => 100, 'vols_sm' => 3, 'delete' => 0, 'solid' => 0, 'rec_rec' => 0,
				'rec_rec_s' => 10, 'test' => 0,'use_pass1' => 0, 'pass' => '', 'use_pass2' => 0, 'path_i' => 0, 'path_i_path' => ''
			);
			$this->rar_opts = array_merge($this->rar_opts, $rar_opts);
			$rar_file_list = '';
			foreach($this->rar_opts['filestorar'] as &$rar_value) {
				$rar_value = basename($GLOBALS['list'][$rar_value]['name']);
				if (empty($rar_value)) $return = 'BAD_FILE_NAME';
				elseif (!is_file($dest_dir . $rar_value)) $return = "FILE_NOT_EXISTS: $rar_value";
				else $rar_file_list .= escapeshellarg($dest_dir . $rar_value) . ' ';
				if ($return !== '') {
					if ($jsoutid !== '') return "<script type='text/javascript'>/* <![CDATA[ */rar_st('$jsoutid', '" . preg_replace("/\r?\n/", "\\n", addslashes($return)) . "')/* ]]> */</script>\r\n";
					return $return;
				}
			}
			if ($rar_file_list == '') {
				$return = 'NO_FILES_TO_ADD';
			} else {
				$rar_cmd = 'a -ierr -ep -o- ';
				$rar_cmd .= '-ma' . (empty($this->rar_opts['rar5']) ? '4' : '5') . ' ';
				$rar_cmd .= "-m{$this->rar_opts['comp_lvl']} ";
				if ($this->rar_opts['vols']) {
					$vols_sm = array(3 => 'm', 4 => 'M', 5 => 'g', 6 => 'G');
					$rar_cmd .= sprintf('-v%s%s ', max(1, $this->rar_opts['vols_s']), $vols_sm[max(3, min(6, $this->rar_opts['vols_sm']))]);
				}
				if ($this->rar_opts['delete']) $rar_cmd .= '-df ';
				$rar_cmd .= $this->rar_opts['solid'] ? '-s -ds ' : '-s- ';
				if ($this->rar_opts['rec_rec']) $rar_cmd .= "-rr{$this->rar_opts['rec_rec_s']} ";
				if ($this->rar_opts['test']) $rar_cmd .= '-t ';
				if ($this->rar_opts['use_pass1']) {
					$password = $this->fix_pass($this->rar_opts['pass']);
					if ($password != '') {
						$rar_cmd .= $password;
						if ($this->rar_opts['use_pass2']) $rar_cmd .= '-hp ';
					}
				}
				if ($this->rar_opts['path_i']) $rar_cmd .= '-ap' . escapeshellarg($this->rar_opts['path_i_path']) . ' ';
				$this->runit($rar_cmd, $rar_file_list, $jsoutid, $debug_id);
				if ($this->rar_return == 7 && !empty($this->rar_list) && strpos($this->rar_list[0], 'Unknown option: ma') !== false) {
					// Using older rar, so it doesn't support the -ma switches
					$rar_cmd = str_replace(array(' -ma5 ', ' -ma4 '), ' ', $rar_cmd);
					$this->runit($rar_cmd, $rar_file_list, $jsoutid, $debug_id + 1);
				}
				switch ($this->rar_return) {
					case 0:
						if (strtolower(substr(trim($this->rar_error), -4)) == 'done') $return = 'Done';
						break;
					case 3: $return = 'CRC_ERROR';break;
					case 4: $return = 'LOCKED ARCHIVE';break;
					case 5: $return = 'WRITE ERROR';break;
					case 6: $return = 'OPEN ERROR';break;
					case 7: $return = 'USER ERROR';break;
					case 8: $return = 'MEMORY ERROR';break;
					case 9: $return = 'CREATE ERROR';break;
					case 255: $return = 'USER BREAK';break;
					default: $return = nl2br("UNKNOWN_ERROR\n{$this->rar_return}\n" . htmlspecialchars($this->rar_error));break;
				}
			}
		}
		if ($jsoutid !== '') return "<script type='text/javascript'>/* <![CDATA[ */rar_st('$jsoutid', '" . preg_replace("/\r?\n/", "\\n", addslashes($return)) . "')/* ]]> */</script>\r\n";
		return $return;
	}

	function listthem($password, $dest_dir, $debug_id) {
		$dest_dir = realpath($dest_dir).'/';
		$this->filename = $dest_dir.basename($this->filename);
		$password = $this->fix_pass($password);
		$this->runit('v -v -c- ' . $password, '', '', $debug_id);
		if (!$this->old_rar && !$password && $this->rar_return == 255 && empty($this->rar_error)) {
			// Workaround for weird bug (rar5 ends before requesting pw on a full encrypted file)
			$this->runit('v -v -c- -p- ', '', '', $debug_id + 1);
			if ($this->rar_return != 11) {
				// Workaround for the same bug on a older than rar5 file
				foreach ($this->rar_list as $rar_line) if (strpos($rar_line, ', encrypted headers') !== false) $this->rar_return = 11;
			}
		}
		$rar_needs_pass = false;
		//if (strpos($this->rar_error, 'Enter password') === 0) return array( 0 => 'PASS', 'NEEDP' => true);
		if (!$this->old_rar && $this->rar_return == 11) return array( 0 => 'PASS', 'NEEDP' => true);
		else if (strpos($this->rar_error, 'Enter password') === 0) return array( 0 => 'PASS', 'NEEDP' => true);
		else if (trim($this->rar_error) !== '') return array( 0 => 'ERROR', 1 => $this->rar_return, 2 => $this->rar_error, 'NEEDP' => false);
		$rar_files = array();
		$rar_onlist = false;
		$rar_onfile = true;
		foreach ($this->rar_list as $rar_line) {
			if (strpos($rar_line, '---') === 0) {
				$rar_onlist = !$rar_onlist;
				continue;
			}
			if (!$rar_onlist) continue;
			if ($this->old_rar) {
				if ($rar_onfile) {
					$rar_tmp_name = substr($rar_line, 1);
					$rar_tmp_pass = substr($rar_line, 0, 1) == '*' ? true : false;
				} else {
					$rar_tmp_size = strtok(trim($rar_line), ' ');
					$rar_tmp = strtok(' '); $rar_tmp = strtok(' ');
					$rar_tmp = strtok(' '); $rar_tmp = strtok(' ');
					$rar_tmp = strtok(' ');
					if (strpos(strtolower($rar_tmp), 'd') === false) {
						$rar_files[$rar_tmp_name]['size'] = $rar_tmp_size;
						$rar_needs_pass = $rar_tmp_pass ? true : $rar_needs_pass;
					}
				}
				$rar_onfile = !$rar_onfile;
			} else {
				if (preg_match('/^(\*)?(?:\s+[\w\.]{3}(?!D)[\w\.]{4}|(?(1)|\s)[dl\-](?:[r\-][w\-][x\-]){3})\s+(\d+)\s+\d+\s+(?:\d+%|<--)\s+(?:[\w\-]{10}|[\w\-]{8})\s+[\d:]{4,5}\s+[\w\.]{8}\s+([^\r\n]+)$/', $rar_line, $attr)) {
					$rar_files[$attr[3]]['size'] = $attr[2];
					if (!$rar_needs_pass && !empty($attr[1])) $rar_needs_pass = true;
				}
			}
		}
		if (count($rar_files) == 0) return array( 0 => 'ERROR', 1 => $this->rar_return, 2 => $this->rar_error.' (Empty/bad/non RAR file)', 'NEEDP' => false);
		return array( 0 => 'LIST', 'NEEDP' => $rar_needs_pass, 2 => $rar_files);
	}

	function extract($file, $dest, $password='', $jsoutid='', $debug_id=0) {
		$dest = realpath($dest) . '/';
		if ($file === false) $return = 'BAD_FILENAME';
		elseif (dirname(realpath($this->filename)) !== dirname($dest.'safe')) $return = 'RAR_INCORRECT_LOCATION';
		elseif (!is_file($this->filename)) $return = 'RAR_NOT_EXISTS';
		elseif (!is_dir($dest)) $return = 'DESTINATION_NOT_EXISTS';
		elseif (file_exists($dest . basename($file))) $return = 'FILE_EXISTS';
		else {
			$password = $this->fix_pass($password);
			$this->runit("e -ierr -o- -c- -ts- $password", "\"$file\" \"$dest\"", $jsoutid, $debug_id);
			switch ($this->rar_return) {
				case 0:
					if (strtolower(substr(trim($this->rar_error), -6)) == 'all ok') $return = 'OK';
					break;
				case 1:
					if (strpos($this->rar_error, 'Enter password') !== false) $return = 'PASSWORD_NEEDED';
					break;
				case 3: $return = (strpos($this->rar_error, 'password incorrect ?') !== false ? 'PASSWORD_INCORRECT_?' : 'CRC_ERROR');break;
				case 4: $return = 'LOCKED ARCHIVE';break;
				case 5: $return = 'WRITE ERROR';break;
				case 6: $return = 'OPEN ERROR';break;
				case 7: $return = 'USER ERROR';break;
				case 8: $return = 'MEMORY ERROR';break;
				case 9: $return = 'CREATE ERROR';break;
				case 11: $return = 'INCORRECT PASSWORD';break;
				case 255: $return = 'USER BREAK';break;
				default: $return = nl2br("UNKNOWN_ERROR\n{$this->rar_return}\n" . htmlspecialchars($this->rar_error));break;
			}
		}
		if ($jsoutid !== '') return "<script type='text/javascript'>/* <![CDATA[ */rar_st('$jsoutid', '" . preg_replace("/\r?\n/", "\\n", addslashes($return)) . "')/* ]]> */</script>\r\n";
		return $return;
	}

	function runit($params, $extra = '', $jsoutid = '', $debug_id = 0) {
		$rar_process = proc_open("'{$this->rar_exec}' $params {$this->rar_forbidden} -- " . escapeshellarg($this->filename) . " $extra", $this->rar_descriptorspec, $rar_pipes);
		if (is_resource($rar_process)) {
			fclose($rar_pipes[0]);
			$this->rar_list = array();
			if ($jsoutid === '') {//don't read this pipe if we getting js extract percentage
				while (!feof($rar_pipes[1])) {
					$rar_tmp = rtrim(fgets($rar_pipes[1]));
					if (trim($rar_tmp) !== '') $this->rar_list[] = $rar_tmp;
				}
			} else {
				// Always get first line of output (helps for version check)
				while (empty($this->rar_list) && !feof($rar_pipes[2])) {
					if (($rar_tmp = trim(fgets($rar_pipes[2]))) !== '') $this->rar_list[0] = $rar_tmp;
				}
			}
			fclose($rar_pipes[1]);
			if (!empty($this->rar_list) && preg_match('/(?<=^UNRAR |^RAR )\d+\.\d\d?(?=\s)/', $this->rar_list[0], $version)) {
				$this->rar_version = $version[0];
				$this->old_rar = intval($this->rar_version) < 5;
			}

			if ($jsoutid !== '') {
				$this->rar_error = $this->rar_list[0] . "\n";
				$last = '';
				$len = 0;
				$pos_s = 0;
				$num_last = 0;
				$pos_last = 0;
				$pos_found_s = '';
				while (!feof($rar_pipes[2])) {
					$read = fread($rar_pipes[2], 8);
					$len += strlen($read);
					$this->rar_error .= $read;
					if ($len > ($pos_s + 1)) {
						foreach (array('Adding', 'Testing', 'Calculating', 'Creating') as $find) {
							if (($pos_s_ = strpos($this->rar_error, $find, $pos_s+1)) !== false) break;
						}
					} else $pos_s_ = false;
					if ($pos_s_ !== false) {
						$pos_s = $pos_s_;
						$pos_found_s = true;
					}
					$pos = strrpos($this->rar_error, '%', $pos_last + 1);
					if ($pos !== false && $pos_last !== $pos) {
						$pos_last = $pos;
						$num = trim(substr($this->rar_error, $pos - 3, 3));
						if ($num_last !== $num) {
							$num_last = $num;
							if ($pos_found_s === true) {
								$pos_found_s = trim(substr($this->rar_error, $pos_s, strpos($this->rar_error, '%', $pos_s) - $pos_s - 7));
								$pos_tmp[0] = strpos($pos_found_s, '...');
								if ($pos_tmp[0] !== false) {
									$pos_tmp[1] = strpos($pos_found_s, 'Creating archive');
									if ($pos_tmp[1] === false) $pos_tmp[1] = strpos($pos_found_s, 'Creating solid archive');
									if ($pos_tmp[1] === 0) {
										$pos_found_s = '[Adding] ' . trim(substr($pos_found_s, $pos_tmp[0] + 3));
									} else {
										$pos_tmp[1] = strpos($pos_found_s, 'Testing archive');
										if ($pos_tmp[1] === 0) $pos_found_s = '[Testing] ' . trim(substr($pos_found_s, $pos_tmp[0] + 3));
										$pos_tmp[0] = strpos($pos_found_s, 'Calculating');
										if ($pos_tmp[0] === 0) $pos_found_s = '[Hashing File]';
									}
								}
								$pos_tmp[0] = strpos($pos_found_s, 'Adding');
								if ($pos_tmp[0] === 0) $pos_found_s = '[Adding] ' . basename(substr($pos_found_s, 11));
								$pos_tmp[0] = strpos($pos_found_s, 'Testing');
								if ($pos_tmp[0] === 0) $pos_found_s = '[Testing] ' . basename(substr($pos_found_s, 12));
								$pos_tmp[0] = strpos($pos_found_s, 'Calculating');
								if ($pos_tmp[0] === 0) $pos_found_s = '[Hashing File]';
								$pos_found_s = str_replace(array("\r\n", "\n", "\r"), '' , $pos_found_s);
							}
							echo "<script type='text/javascript'>/* <![CDATA[ */rar_st('$jsoutid', '" . addslashes($pos_found_s) . " {$num_last}%')/* ]]> */</script>\r\n";
							flush();
							if ($num_last == 100) $pos_found_s = '';
						}
					}
				}
			} else {
				$this->rar_error = '';
				while (!feof($rar_pipes[2])) $this->rar_error .= fread($rar_pipes[2], 8192);
			}
			$this->rar_error = trim($this->rar_error);
			fclose($rar_pipes[2]);
			$this->rar_return = proc_close($rar_process);
			if (!empty($this->rar_error) && preg_match('/(?<=^UNRAR |^RAR )\d+\.\d\d?(?=\s)/', $this->rar_error, $version)) {
				$this->rar_version = $version[0];
				$this->old_rar = intval($this->rar_version) < 5;
			}
		} else {
			$this->rar_error = (function_exists('proc_open')) ? 'Error opening rar process' : 'proc_open() is disabled';
			$this->rar_return = -1;
		}
		if ($this->debug || ($this->rar_return != 0 && strpos($this->rar_error, 'Enter password') !== 0) || ($this->rar_list !== FALSE && strpos($this->rar_list[count($this->rar_list)-1], 'is not RAR archive') !== FALSE)) {
			echo "<div id='rar_debug$debug_id' style='padding:2px;position:absolute; top:" . ((intval($debug_id) * 24) + 2) . "px; left:10px; background:#082330; border:2px solid #666666; text-align: left;'><b>Plusrar Debug Window" . (!$this->debug ? '('.lang(340).'), ' : '') . "</b>&nbsp;&nbsp;&nbsp;&nbsp;<span onclick='javascript:$(\"#rar_debug_contents$debug_id\").toggle();'>(" . lang(341) . ")</span><div id='rar_debug_contents$debug_id' style='display: none'><br /><textarea cols='100' rows='20' id='rar_debug_text$debug_id' readonly='readonly'>";
			echo "===plusrar version===\r\n{$GLOBALS['plusrar_v']}\r\n";
			printf("===php_uname===\r\n%s %s %s %s\r\n", php_uname('s'), php_uname('r'), php_uname('v'), php_uname('m'));
			if (version_compare(PHP_VERSION, '5.4.0', '<')) echo "===safe_mode===\r\n" . (ini_get('safe_mode') ? 'on' : 'off') . "\r\n";
			if (!empty($this->rar_version)) echo "===rar version===\r\n{$this->rar_version}\r\n";
			echo "===rar executable info===\r\n" . (is_file($this->rar_exec) ? 'Name: "' . htmlspecialchars(basename($this->rar_exec)) . '", Size: ' . filesize($this->rar_exec) . ' bytes, MD5:' . md5_file($this->rar_exec) . ', chmod: ' . substr(sprintf('%o', fileperms($this->rar_exec)), -4) : 'rar executable doesn\'t exists') . "\r\n";
			echo "===Return code===\r\n{$this->rar_return}\r\n";
			echo "===Error===\r\n" . str_replace('', '', preg_replace('/\d{1,2}\%\{4}&nbsp;/', '', (str_replace(array(' ', '&nbsp;0% - '), array('&nbsp;', '&nbsp;0%'), $this->rar_error)))) . "\r\n";
			if (is_array($this->rar_list)) {
				echo "===List output===\r\n";
				foreach ($this->rar_list as $line) echo htmlspecialchars($line) . "\r\n";
			}
			echo "===Executed command===\r\n" . htmlspecialchars("'{$this->rar_exec}' {$params} {$this->rar_forbidden} -- " . escapeshellarg($this->filename) . " $extra");
			echo "</textarea><br /><input type='button' value='" . lang(375) . "' onclick='javascript:document.getElementById(\"rar_debug_text$debug_id\").focus();document.getElementById(\"rar_debug_text$debug_id\").select();' /><div class='dragzone' style='text-align: center;font-weight: bold'>&nbsp;<br />" . lang(342) . "<br />&nbsp;</div></div></div><script type='text/javascript'>/* <![CDATA[ */";
			echo 'var dragObject=null, mouseOffset=null, makeDraggable=function(item){if(!item)return false;item.onmousedown=function(ev){var el=ev.target||ev.srcElement;if(el.className!="dragzone"){return true}dragObject=this;mouseOffset=getMouseOffset(this,ev);return false};return true};getMouseOffset=function(t,e){e=e||window.event;var dP=getPosition(t);var mP=mouseCoords(e);return{x:mP.x-dP.x,y:mP.y-dP.y}};mouseCoords=function(e){if(e.pageX||e.pageY){return{x:e.pageX,y:e.pageY}}return{x:e.clientX+document.body.scrollLeft-document.body.clientLeft,y:e.clientY+document.body.scrollTop-document.body.clientTop}};getPosition=function(e){var l=0;var t=0;while(e.offsetParent){l+=e.offsetLeft;t+=e.offsetTop;e=e.offsetParent}l+=e.offsetLeft;t+=e.offsetTop;return{x:l,y:t}};mouseMove=function(e){e=e||window.event;var mP=mouseCoords(e);if(dragObject){dragObject.style.position="absolute";dragObject.style.top=mP.y-mouseOffset.y+"px";dragObject.style.left=mP.x-mouseOffset.x+"px";return false}};mouseUp=function(){dragObject=null};document.onmousemove=mouseMove;document.onmouseup=mouseUp;';
			echo "makeDraggable(document.getElementById('rar_debug$debug_id'));\n/* ]]> */</script>";
		}
	}
}
<?php
if (! isset ( $servername ) || $servername == "") {
	$theservername = $_SERVER ['SERVER_NAME'];
} else {
	$theservername = $servername;
}
if (! isset ( $customos ) || $customos == "") {
	$osname = checkos ();
} else {
	$os = "nocpu";
	$osname = $customos;
}
if (php_sapi_name () == "apache2handler") {
	$httpapp = "Apache";
} else {
	$httpapp = php_sapi_name ();
}
function checkos() {
	if (substr ( PHP_OS, 0, 3 ) == "WIN") {
		$osType = winosname ();
		$osbuild = php_uname ( 'v' );
		$os = "windows";
	} elseif (PHP_OS == "FreeBSD") {
		$os = "nocpu";
		$osType = "FreeBSD";
		$osbuild = php_uname ( 'r' );
	} elseif (PHP_OS == "Darwin") {
		$os = "nocpu";
		$osType = "Apple OS X";
		$osbuild = php_uname ( 'r' );
	} elseif (PHP_OS == "Linux") {
		$os = "linux";
		$osType = "Linux";
		$osbuild = php_uname ( 'r' );
	} else {
		$os = "nocpu";
		$osType = "Unknown OS";
		$osbuild = php_uname ( 'r' );
	}
	return $osType;
}
function winosname() {
	$wUnameB = php_uname('v');
	if (preg_match ('@build (\d+)(?: \(([\w ]+)\))?@i', $wUnameB, $build)) $wUnameB = $build[1];
	if (!empty($build[2])) return $build[2];

	$wUnameBM = trim(php_uname('r'));
	if ($wUnameBM == '5.0' && ($wUnameB == '2195')) {
		$wVer = 'Windows 2000';
	}
	if ($wUnameBM == '5.1' && ($wUnameB == '2600')) {
		$wVer = 'Windows XP';
	}
	if ($wUnameBM == '5.2' && ($wUnameB == '3790')) {
		$wVer = 'Windows Server 2003';
	}
	if ($wUnameBM == '6.0' && ($wUnameB == '6000')) {
		$wVer = 'Windows Vista';
	}
	if ($wUnameBM == '6.0' && ($wUnameB == '6001')) {
		$wVer = 'Windows Vista SP1';
	}
	return $wVer;
}
if (PHP_OS == "WINNT") {
	$os = "windows";
	$osbuild = php_uname ( 'v' );
} elseif (PHP_OS == "Linux") {
	$os = "linux";
	$osbuild = php_uname ( 'r' );
} else {
	$os = "nocpu";
	$osbuild = php_uname ( 'r' );
}
function ZahlenFormatieren($Wert) {
	if ($Wert > 1099511627776) {
		$Wert = number_format ( $Wert / 1099511627776, 2, ".", "," ) . " TB";
	} elseif ($Wert > 1073741824) {
		$Wert = number_format ( $Wert / 1073741824, 2, ".", "," ) . " GB";
	} elseif ($Wert > 1048576) {
		$Wert = number_format ( $Wert / 1048576, 2, ".", "," ) . " MB";
	} elseif ($Wert > 1024) {
		$Wert = number_format ( $Wert / 1024, 2, ".", "," ) . " kB";
	} else {
		$Wert = number_format ( $Wert, 2, ".", "," ) . " Bytes";
	}
	
	return $Wert;
}
$frei = disk_free_space ( "./" );
$insgesamt = disk_total_space ( "./" );
$belegt = $insgesamt - $frei;
$prozent_belegt = 100 * $belegt / $insgesamt;
	if ($os == "windows") {
		$wmi = new COM ( "Winmgmts://" );
		$cpus = $wmi->execquery ( "SELECT * FROM Win32_Processor" );
		$cpu_string = lang(136).':';
		$cpu_load = 0;
		foreach ( $cpus as $cpu ) {
			$cpu_load += $cpu->loadpercentage;
			$cpu_string .= "" . $cpu->loadpercentage;
		}
		$cpu_load /= (is_array($cpus) ? count($cpus) : 1);
		$cpu_string .= '%<br /><img src="' . CLASS_DIR . 'bar.php?rating=' . round ( $cpu_load, "2" ) . '" border="0" /><br />';
	} elseif ($os == "linux") {
		function getStat($_statPath) {
			if (trim ( $_statPath ) == '') {
				$_statPath = '/proc/stat';
			}
			
			ob_start ();
			@readfile($_statPath);
			$stat = ob_get_contents ();
			ob_end_clean ();
			
			if (substr ( $stat, 0, 3 ) == 'cpu') {
				$parts = explode ( " ", preg_replace ( "!cpu +!", "", $stat ) );
			} else {
				return false;
			}
			
			$return = array ();
			$return ['user'] = $parts [0];
			$return ['nice'] = $parts [1];
			$return ['system'] = $parts [2];
			$return ['idle'] = $parts [3];
			return $return;
		}
		
		function getCpuUsage($_statPath = '/proc/stat') {
			$time1 = getStat ( $_statPath );
			if (!$time1) return -1;
			sleep ( 1 );
			$time2 = getStat ( $_statPath );
			
			$delta = array ();
			
			foreach ( $time1 as $k => $v ) {
				$delta [$k] = $time2 [$k] - $v;
			}
			
			$deltaTotal = array_sum ( $delta );
			$percentages = array ();
			
			foreach ( $delta as $k => $v ) {
				$percentages [$k] = @round ( $v / $deltaTotal * 100, 2 );
			}
			return $percentages;
		}
		$cpu_string = '';
		if (($cpu = getCpuUsage()) === -1) { $cpu_string = -1; }
		else {
			$cpulast = 100 - $cpu ['idle'];
			$cpu_string .= lang(136).": <span id='cpuload'>" . round ( $cpulast, "0" ) . "</span>%<br />";
			if (extension_loaded('gd') && function_exists('gd_info')) {
				$cpu_string .= '<img src="' . CLASS_DIR . 'bar.php?rating=' . round ( $cpulast, "2" ) . '" border="0" name="cpupercent" id="cpupercent" alt="" />';
			}
			$cpu_string .= '<br />';
		}
	} elseif ($os == "nocpu") {
		$cpu_string = '';
	} else {
		$cpu_string = lang(136).'<br />';
		$cpu_string .= lang(136).": ".lang(137)."<br />";
	}
require(TEMPLATE_DIR.'/sinfo.php');
?>
/*
  Based on SortTable version 2, 7th April 2007
  http://www.kryogenix.org/code/browser/sorttable/
*/
 
var stIsIE = /*@cc_on!@*/false;

sorttable = {
  init: function() {
    // quit if this function has already been called
    if (arguments.callee.done) { return; }
    // flag this function so we don't do the same thing twice
    arguments.callee.done = true;
    // kill the timer
    if (_timer) { clearInterval(_timer); }
    
    if (!document.createElement || !document.getElementsByTagName) { return; }
    
    sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/;
    
    forEach(document.getElementsByTagName('table'), function(table) {
      if (table.className.search(/\bsortable\b/) != -1) {
        sorttable.makeSortable(table);
      }
    });
    
  },
  
  makeSortable: function(table) {
    if (!table) { return; }
    if (table.getElementsByTagName('thead').length === 0) {
      // table doesn't have a tHead. Since it should have, create one and
      // put the first table row in it.
      the = document.createElement('thead');
      the.appendChild(table.rows[0]);
      table.insertBefore(the,table.firstChild);
    }
    // Safari doesn't support table.tHead, sigh
    if (table.tHead === null) { table.tHead = table.getElementsByTagName('thead')[0]; }
    
    if (table.tHead.rows.length != 1) { return; } // can't cope with two header rows
    
    // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as
    // "total" rows, for example). This is B&R, since what you're supposed
    // to do is put them in a tfoot. So, if there are sortbottom rows,
    // for backwards compatibility, move them to tfoot (creating it if needed).
    sortbottomrows = [];
    var i;
    for (i=0; i<table.rows.length; i++) {
      if (table.rows[i].className.search(/\bsortbottom\b/) != -1) {
        sortbottomrows[sortbottomrows.length] = table.rows[i];
      }
    }
    if (sortbottomrows) {
      if (table.tFoot === null) {
        // table doesn't have a tfoot. Create one.
        tfo = document.createElement('tfoot');
        table.appendChild(tfo);
      }
      for (i=0; i<sortbottomrows.length; i++) {
        tfo.appendChild(sortbottomrows[i]);
      }
      sortbottomrows = [];
    }
    
    // work through each column and calculate its type
    headrow = table.tHead.rows[0].cells;
    for (i=0; i<headrow.length; i++) {
      // manually override the type with a sorttable_type attribute
      if (!headrow[i].className.match(/\bsorttable_nosort\b/)) { // skip this col
        mtch = headrow[i].className.match(/\bsorttable_([a-z0-9]+)\b/);
        if (mtch) { override = mtch[1]; }
        if (mtch && typeof sorttable["sort_"+override] == 'function') {
          headrow[i].sorttable_sortfunction = sorttable["sort_"+override];
        } else {
          headrow[i].sorttable_sortfunction = sorttable.guessType(table,i);
        }
        // make it clickable to sort
        headrow[i].sorttable_columnindex = i;
        headrow[i].sorttable_tbody = table.tBodies[0];
        $(headrow[i]).click(function(e) {

          var checkbox_reverse = false;
          if (this.className.search(/\bsorttable_checkbox\b/) != -1) {
            checkbox_reverse = (this.className.search(/\bsorttable_sorted\b/) != -1) ? true : false;
          }
          else {//regular procedure: sorttable_checkbox NOT found
            if (this.className.search(/\bsorttable_sorted\b/) != -1) {
              // if we're already sorted by this column, just 
              // reverse the table, which is quicker
              sorttable.reverse(this.sorttable_tbody);
              this.className = this.className.replace('sorttable_sorted',
                                                      'sorttable_sorted_reverse');
              this.removeChild(document.getElementById('sorttable_sortfwdind'));
              sortrevind = document.createElement('span');
              sortrevind.id = "sorttable_sortrevind";
              sortrevind.innerHTML = stIsIE ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
              this.appendChild(sortrevind);
              return;
            }
            if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) {
              // if we're already sorted by this column in reverse, just 
              // re-reverse the table, which is quicker
              sorttable.reverse(this.sorttable_tbody);
              this.className = this.className.replace('sorttable_sorted_reverse',
                                                      'sorttable_sorted');
              this.removeChild(document.getElementById('sorttable_sortrevind'));
              sortfwdind = document.createElement('span');
              sortfwdind.id = "sorttable_sortfwdind";
              sortfwdind.innerHTML = stIsIE ? '&nbsp<font face="webdings">5</font>' : '&nbsp;&#x25B4;';
              this.appendChild(sortfwdind);
              return;
            }
          }

          // remove sorttable_sorted classes
          theadrow = this.parentNode;
          forEach(theadrow.childNodes, function(cell) {
            if (cell.nodeType == 1) { // an element
              cell.className = cell.className.replace('sorttable_sorted_reverse','');
              cell.className = cell.className.replace('sorttable_sorted','');
            }
          });
          sortfwdind = document.getElementById('sorttable_sortfwdind');
          if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); }
          sortrevind = document.getElementById('sorttable_sortrevind');
          if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); }
          
          this.className += ' sorttable_sorted';
          sortfwdind = document.createElement('span');
          sortfwdind.id = "sorttable_sortfwdind";
          sortfwdind.innerHTML = stIsIE ? '&nbsp<font face="webdings">5</font>' : '&nbsp;&#x25B4;';
          this.appendChild(sortfwdind);

          // build an array to sort. This is a Schwartzian transform thing,
          // i.e., we "decorate" each row with the actual sort key,
          // sort based on the sort keys, and then put the rows back in order
          // which is a lot faster because you only do getInnerText once per row
          row_array = [];
          var j;
          col = this.sorttable_columnindex;
          rows = this.sorttable_tbody.rows;
          for (j=0; j<rows.length; j++) {
            row_array[row_array.length] = [sorttable.getInnerText(rows[j].cells[col]), rows[j]];
          }
          /* If you want a stable sort, uncomment the following line */
          //sorttable.shaker_sort(row_array, this.sorttable_sortfunction);
          /* and comment out this one */
          row_array.sort(this.sorttable_sortfunction);

          tb = this.sorttable_tbody;
          for (j=0; j<row_array.length; j++) {
            tb.appendChild(row_array[j][1]);
          }
          row_array = [];
          if (checkbox_reverse) { 
            sorttable.reverse(this.sorttable_tbody);
            this.className = this.className.replace('sorttable_sorted', 'sorttable_sorted_reverse');
            this.removeChild(document.getElementById('sorttable_sortfwdind'));
            sortrevind = document.createElement('span');
            sortrevind.id = "sorttable_sortrevind";
            sortrevind.innerHTML = stIsIE ? '&nbsp<font face="webdings">6</font>' : '&nbsp;&#x25BE;';
            this.appendChild(sortrevind);
          }         
        });
      }
    }
  },
  
  guessType: function(table, column) {
    // guess the type of a column based on its first non-blank row
    sortfn = sorttable.sort_alpha;
    for (var i=0; i<table.tBodies[0].rows.length; i++) {
      text = sorttable.getInnerText(table.tBodies[0].rows[i].cells[column]);
      if (text != '') {
        if (text.match(/^\d{1,3}\.?\d{1,2} [KMGT]?B$/)) {
          return sorttable.sort_filesize;
        }
        if (text.match(/^\d+\.\d+\.\d+ \d+\:\d+\:\d+$/)) {
          return sorttable.sort_rldate;
        }
        if (text.match(/^-?[£$¤]?[\d,.]+%?$/)) {
          return sorttable.sort_numeric;
        }
        // check for a date: dd/mm/yyyy or dd/mm/yy 
        // can have / or . or - as separator
        // can be mm/dd as well
        possdate = text.match(sorttable.DATE_RE);
        if (possdate) {
          // looks like a date
          first = parseInt(possdate[1], 10);
          second = parseInt(possdate[2], 10);
          if (first > 12) {
            // definitely dd/mm
            return sorttable.sort_ddmm;
          } else if (second > 12) {
            return sorttable.sort_mmdd;
          } else {
            // looks like a date, but we can't tell which, so assume
            // that it's dd/mm (English imperialism!) and keep looking
            sortfn = sorttable.sort_ddmm;
          }
        }
      }
    }
    return sortfn;
  },
  
  getInnerText: function(node) {
    // gets the text we want to use for sorting for a cell.
    // strips leading and trailing whitespace.
    // this is *not* a generic getInnerText function; it's special to sorttable.
    // for example, you can override the cell text with a customkey attribute.
    // it also gets .value for <input> fields.
    
    hasInputs = (typeof node.getElementsByTagName == 'function') &&
                 node.getElementsByTagName('input').length;
    
    if (node.getAttribute("sorttable_customkey") !== null) {
      return node.getAttribute("sorttable_customkey");
    }
    else if (typeof node.textContent != 'undefined' && !hasInputs) {
      return node.textContent.replace(/^\s+|\s+$/g, '');
    }
    else if (typeof node.innerText != 'undefined' && !hasInputs) {
      return node.innerText.replace(/^\s+|\s+$/g, '');
    }
    else if (typeof node.text != 'undefined' && !hasInputs) {
      return node.text.replace(/^\s+|\s+$/g, '');
    }
    else {
      switch (node.nodeType) {
        case 3:
          if (node.nodeName.toLowerCase() == 'input') {
            return node.value.replace(/^\s+|\s+$/g, '');
          }
          break;
        case 4:
          return node.nodeValue.replace(/^\s+|\s+$/g, '');
          break;
        case 1:
        case 11:
          if (node.firstChild.nodeName.toLowerCase() == 'input' && node.firstChild.type.toLowerCase() == 'checkbox') {
            return 'checkbox'+(node.firstChild.checked?1:0);
          }
          var innerText = '';
          for (var i = 0; i < node.childNodes.length; i++) {
            innerText += sorttable.getInnerText(node.childNodes[i]);
          }
          return innerText.replace(/^\s+|\s+$/g, '');
          break;
        default:
          return '';
      }
    }
  },
  
  reverse: function(tbody) {
    // reverse the rows in a tbody
    newrows = [];
    var i;
    for (i=0; i<tbody.rows.length; i++) {
      newrows[newrows.length] = tbody.rows[i];
    }
    for (i=newrows.length-1; i>=0; i--) {
       tbody.appendChild(newrows[i]);
    }
    newrows = [];
  },
  
  /* sort functions
     each sort function takes two parameters, a and b
     you are comparing a[0] and b[0] */
  sort_checkbox: function(a,b) {
    var as = a[0].replace('checkbox','');
    var bs = b[0].replace('checkbox','');
    return (parseFloat(as) - parseFloat(bs));
  },
  sort_rldate: function(a,b) {
    var as = a[0].split(/[\.\: ]/);
    var bs = b[0].split(/[\.\: ]/);
    as = as[2]+as[1]+as[0]+as[3]+as[4]+as[5];
    bs = bs[2]+bs[1]+bs[0]+bs[3]+bs[4]+bs[5];
    return (parseFloat(as) - parseFloat(bs));
  },
  sort_filesize: function(a,b) {
    var am = a[0].split(" "); am = am[1];
    var bm = b[0].split(" "); bm = bm[1];
    var aa = parseFloat(a[0]); if (isNaN(aa)) { aa = 0; }
    var bb = parseFloat(b[0]); if (isNaN(bb)) { bb = 0; }
    if (am == bm) { return aa - bb; }
    if (am == 'B') { return -1; }
    if (bm == 'B') { return 1; }
    if (am == 'KB') { return -1; }
    if (bm == 'KB') { return 1; }
    if (am == 'MB') { return -1; }
    if (bm == 'MB') { return 1; }
  },
  sort_numeric: function(a,b) {
    aa = parseFloat(a[0].replace(/[^0-9.-]/g,''));
    if (isNaN(aa)) { aa = 0; }
    bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); 
    if (isNaN(bb)) { bb = 0; }
    return aa-bb;
  },
  sort_alpha: function(a,b) {
    if (a[0].toLowerCase()==b[0].toLowerCase()) { return 0; }
    if (a[0].toLowerCase()<b[0].toLowerCase()) { return -1; }
    return 1;
  },
  sort_ddmm: function(a,b) {
    mtch = a[0].match(sorttable.DATE_RE);
    y = mtch[3]; m = mtch[2]; d = mtch[1];
    if (m.length == 1) { m = '0'+m; }
    if (d.length == 1) { d = '0'+d; }
    dt1 = y+m+d;
    mtch = b[0].match(sorttable.DATE_RE);
    y = mtch[3]; m = mtch[2]; d = mtch[1];
    if (m.length == 1) { m = '0'+m; }
    if (d.length == 1) { d = '0'+d; }
    dt2 = y+m+d;
    if (dt1==dt2) { return 0; }
    if (dt1<dt2) { return -1; }
    return 1;
  },
  sort_mmdd: function(a,b) {
    mtch = a[0].match(sorttable.DATE_RE);
    y = mtch[3]; d = mtch[2]; m = mtch[1];
    if (m.length == 1) { m = '0'+m; }
    if (d.length == 1) { d = '0'+d; }
    dt1 = y+m+d;
    mtch = b[0].match(sorttable.DATE_RE);
    y = mtch[3]; d = mtch[2]; m = mtch[1];
    if (m.length == 1) { m = '0'+m; }
    if (d.length == 1) { d = '0'+d; }
    dt2 = y+m+d;
    if (dt1==dt2) { return 0; }
    if (dt1<dt2) { return -1; }
    return 1;
  },
  
  shaker_sort: function(list, comp_func) {
    // A stable sort function to allow multi-level sorting of data
    // see: http://en.wikipedia.org/wiki/Cocktail_sort
    // thanks to Joseph Nahmias
    var b = 0;
    var t = list.length - 1;
    var swap = true;

    while(swap) {
        swap = false;
        var i, q;
        for(i = b; i < t; ++i) {
            if ( comp_func(list[i], list[i+1]) > 0 ) {
                q = list[i]; list[i] = list[i+1]; list[i+1] = q;
                swap = true;
            }
        } // for
        t--;

        if (!swap) { break; }

        for(i = t; i > b; --i) {
            if ( comp_func(list[i], list[i-1]) < 0 ) {
                var q = list[i]; list[i] = list[i-1]; list[i-1] = q;
                swap = true;
            }
        } // for
        b++;
    } // while(swap)
  }  
};

/* ******************************************************************
   Supporting functions: bundled here to avoid depending on a library
   ****************************************************************** */

// Dean's forEach: http://dean.edwards.name/base/forEach.js
/*
	forEach, version 1.0
	Copyright 2006, Dean Edwards
	License: http://www.opensource.org/licenses/mit-license.php
*/

// array-like enumeration
if (!Array.forEach) { // mozilla already supports this
	Array.forEach = function(array, block, context) {
		for (var i = 0; i < array.length; i++) {
			block.call(context, array[i], i, array);
		}
	};
}

// generic enumeration
Function.prototype.forEach = function(object, block, context) {
	for (var key in object) {
		if (typeof this.prototype[key] == "undefined") {
			block.call(context, object[key], key, object);
		}
	}
};

// character enumeration
String.forEach = function(string, block, context) {
	Array.forEach(string.split(""), function(chr, index) {
		block.call(context, chr, index, string);
	});
};

// globally resolve forEach enumeration
var forEach = function(object, block, context) {
	if (object) {
		var resolve = Object; // default
		if (object instanceof Function) {
			// functions have a "length" property
			resolve = Function;
		} else if (object.forEach instanceof Function) {
			// the object implements a custom forEach method so use that
			object.forEach(block, context);
			return;
		} else if (typeof object == "string") {
			// the object is a string
			resolve = String;
		} else if (typeof object.length == "number") {
			// the object is array-like
			resolve = Array;
		}
		resolve.forEach(object, block, context);
	}
};

<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * File::CSV
 *
 * PHP versions 4 and 5
 *
 * Copyright (c) 1997-2008,
 * Vincent Blavet <vincent@phpconcept.net>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *     * Redistributions of source code must retain the above copyright notice,
 *       this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *
 * @category    File_Formats
 * @package     Archive_Tar
 * @author      Vincent Blavet <vincent@phpconcept.net>
 * @copyright   1997-2008 The Authors
 * @license     http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @version     CVS: $Id: Tar.php,v 1.43 2008/10/30 17:58:42 dufuz Exp $
 * @link        http://pear.php.net/package/Archive_Tar
 */

require_once(CLASS_DIR."pear.php");


define ('ARCHIVE_TAR_ATT_SEPARATOR', 90001);
define ('ARCHIVE_TAR_END_BLOCK', pack("a512", ''));

/**
* Creates a (compressed) Tar archive
*
* @author   Vincent Blavet <vincent@phpconcept.net>
* @version  $Revision: 1.43 $
* @license  http://www.opensource.org/licenses/bsd-license.php New BSD License
* @package  Archive_Tar
*/
class Archive_Tar extends PEAR
{
    /**
    * @var string Name of the Tar
    */
    var $_tarname='';

    /**
    * @var boolean if true, the Tar file will be gzipped
    */
    var $_compress=false;

    /**
    * @var string Type of compression : 'none', 'gz' or 'bz2'
    */
    var $_compress_type='none';

    /**
    * @var string Explode separator
    */
    var $_separator=' ';

    /**
    * @var file descriptor
    */
    var $_file=0;

    /**
    * @var string Local Tar name of a remote Tar (http:// or ftp://)
    */
    var $_temp_tarname='';

    // {{{ constructor
    /**
    * Archive_Tar Class constructor. This flavour of the constructor only
    * declare a new Archive_Tar object, identifying it by the name of the
    * tar file.
    * If the compress argument is set the tar will be read or created as a
    * gzip or bz2 compressed TAR file.
    *
    * @param    string  $p_tarname  The name of the tar archive to create
    * @param    string  $p_compress can be null, 'gz' or 'bz2'. This
    *                   parameter indicates if gzip or bz2 compression
    *                   is required.  For compatibility reason the
    *                   boolean value 'true' means 'gz'.
    * @access public
    */
    function Archive_Tar($p_tarname, $p_compress = null)
    {
        $this->PEAR();
        $this->_compress = false;
        $this->_compress_type = 'none';
        if (($p_compress === null) || ($p_compress == '')) {
            if (@file_exists($p_tarname)) {
                if ($fp = @fopen($p_tarname, "rb")) {
                    // look for gzip magic cookie
                    $data = fread($fp, 2);
                    fclose($fp);
                    if ($data == "\37\213") {
                        $this->_compress = true;
                        $this->_compress_type = 'gz';
                    // No sure it's enought for a magic code ....
                    } elseif ($data == "BZ") {
                        $this->_compress = true;
                        $this->_compress_type = 'bz2';
                    }
                }
            } else {
                // probably a remote file or some file accessible
                // through a stream interface
                if (substr($p_tarname, -2) == 'gz') {
                    $this->_compress = true;
                    $this->_compress_type = 'gz';
                } elseif ((substr($p_tarname, -3) == 'bz2') ||
                          (substr($p_tarname, -2) == 'bz')) {
                    $this->_compress = true;
                    $this->_compress_type = 'bz2';
                }
            }
        } else {
            if (($p_compress === true) || ($p_compress == 'gz')) {
                $this->_compress = true;
                $this->_compress_type = 'gz';
            } else if ($p_compress == 'bz2') {
                $this->_compress = true;
                $this->_compress_type = 'bz2';
            } else {
                $this->_error("Unsupported compression type '$p_compress'\n".
                    "Supported types are 'gz' and 'bz2'.\n");
                return false;
            }
        }
        $this->_tarname = $p_tarname;
        if ($this->_compress) { // assert zlib or bz2 extension support
            if ($this->_compress_type == 'gz')
                $extname = 'zlib';
            else if ($this->_compress_type == 'bz2')
                $extname = 'bz2';

            if (!extension_loaded($extname)) {
                PEAR::loadExtension($extname);
            }
            if (!extension_loaded($extname)) {
                $this->_error("The extension '$extname' couldn't be found.\n".
                    "Please make sure your version of PHP was built ".
                    "with '$extname' support.\n");
                return false;
            }
        }
    }
    // }}}

    // {{{ destructor
    function _Archive_Tar()
    {
        $this->_close();
        // ----- Look for a local copy to delete
        if ($this->_temp_tarname != '')
            @unlink($this->_temp_tarname);
        $this->_PEAR();
    }
    // }}}

    // {{{ create()
    /**
    * This method creates the archive file and add the files / directories
    * that are listed in $p_filelist.
    * If a file with the same name exist and is writable, it is replaced
    * by the new tar.
    * The method return false and a PEAR error text.
    * The $p_filelist parameter can be an array of string, each string
    * representing a filename or a directory name with their path if
    * needed. It can also be a single string with names separated by a
    * single blank.
    * For each directory added in the archive, the files and
    * sub-directories are also added.
    * See also createModify() method for more details.
    *
    * @param array  $p_filelist An array of filenames and directory names, or a
	*                           single string with names separated by a single
	*                           blank space.
    * @return                   true on success, false on error.
    * @see createModify()
    * @access public
    */
    function create($p_filelist)
    {
        return $this->createModify($p_filelist, '', '');
    }
    // }}}

    // {{{ add()
    /**
    * This method add the files / directories that are listed in $p_filelist in
    * the archive. If the archive does not exist it is created.
    * The method return false and a PEAR error text.
    * The files and directories listed are only added at the end of the archive,
    * even if a file with the same name is already archived.
    * See also createModify() method for more details.
    *
    * @param array  $p_filelist An array of filenames and directory names, or a
	*                           single string with names separated by a single
	*                           blank space.
    * @return                   true on success, false on error.
    * @see createModify()
    * @access public
    */
    function add($p_filelist)
    {
        return $this->addModify($p_filelist, '', '');
    }
    // }}}

    // {{{ extract()
    function extract($p_path='')
    {
        return $this->extractModify($p_path, '');
    }
    // }}}

    // {{{ listContent()
    function listContent()
    {
        $v_list_detail = array();

        if ($this->_openRead()) {
            if (!$this->_extractList('', $v_list_detail, "list", '', '')) {
                unset($v_list_detail);
                $v_list_detail = 0;
            }
            $this->_close();
        }

        return $v_list_detail;
    }
    // }}}

    // {{{ createModify()
    /**
    * This method creates the archive file and add the files / directories
    * that are listed in $p_filelist.
    * If the file already exists and is writable, it is replaced by the
    * new tar. It is a create and not an add. If the file exists and is
    * read-only or is a directory it is not replaced. The method return
    * false and a PEAR error text.
    * The $p_filelist parameter can be an array of string, each string
    * representing a filename or a directory name with their path if
    * needed. It can also be a single string with names separated by a
    * single blank.
    * The path indicated in $p_remove_dir will be removed from the
    * memorized path of each file / directory listed when this path
    * exists. By default nothing is removed (empty path '')
    * The path indicated in $p_add_dir will be added at the beginning of
    * the memorized path of each file / directory listed. However it can
    * be set to empty ''. The adding of a path is done after the removing
    * of path.
    * The path add/remove ability enables the user to prepare an archive
    * for extraction in a different path than the origin files are.
    * See also addModify() method for file adding properties.
    *
    * @param array  $p_filelist     An array of filenames and directory names,
	*                               or a single string with names separated by
	*                               a single blank space.
    * @param string $p_add_dir      A string which contains a path to be added
	*                               to the memorized path of each element in
	*                               the list.
    * @param string $p_remove_dir   A string which contains a path to be
	*                               removed from the memorized path of each
	*                               element in the list, when relevant.
    * @return boolean               true on success, false on error.
    * @access public
    * @see addModify()
    */
    function createModify($p_filelist, $p_add_dir, $p_remove_dir='')
    {
        $v_result = true;

        if (!$this->_openWrite())
            return false;

        if ($p_filelist != '') {
            if (is_array($p_filelist))
                $v_list = $p_filelist;
            elseif (is_string($p_filelist))
                $v_list = explode($this->_separator, $p_filelist);
            else {
                $this->_cleanFile();
                $this->_error('Invalid file list');
                return false;
            }

            $v_result = $this->_addList($v_list, $p_add_dir, $p_remove_dir);
        }

        if ($v_result) {
            $this->_writeFooter();
            $this->_close();
        } else
            $this->_cleanFile();

        return $v_result;
    }
    // }}}

    // {{{ addModify()
    /**
    * This method add the files / directories listed in $p_filelist at the
    * end of the existing archive. If the archive does not yet exists it
    * is created.
    * The $p_filelist parameter can be an array of string, each string
    * representing a filename or a directory name with their path if
    * needed. It can also be a single string with names separated by a
    * single blank.
    * The path indicated in $p_remove_dir will be removed from the
    * memorized path of each file / directory listed when this path
    * exists. By default nothing is removed (empty path '')
    * The path indicated in $p_add_dir will be added at the beginning of
    * the memorized path of each file / directory listed. However it can
    * be set to empty ''. The adding of a path is done after the removing
    * of path.
    * The path add/remove ability enables the user to prepare an archive
    * for extraction in a different path than the origin files are.
    * If a file/dir is already in the archive it will only be added at the
    * end of the archive. There is no update of the existing archived
    * file/dir. However while extracting the archive, the last file will
    * replace the first one. This results in a none optimization of the
    * archive size.
    * If a file/dir does not exist the file/dir is ignored. However an
    * error text is send to PEAR error.
    * If a file/dir is not readable the file/dir is ignored. However an
    * error text is send to PEAR error.
    *
    * @param array      $p_filelist     An array of filenames and directory
	*                                   names, or a single string with names
	*                                   separated by a single blank space.
    * @param string     $p_add_dir      A string which contains a path to be
	*                                   added to the memorized path of each
	*                                   element in the list.
    * @param string     $p_remove_dir   A string which contains a path to be
	*                                   removed from the memorized path of
	*                                   each element in the list, when
    *                                   relevant.
    * @return                           true on success, false on error.
    * @access public
    */
    function addModify($p_filelist, $p_add_dir, $p_remove_dir='')
    {
        $v_result = true;

        if (!$this->_isArchive())
            $v_result = $this->createModify($p_filelist, $p_add_dir,
			                                $p_remove_dir);
        else {
            if (is_array($p_filelist))
                $v_list = $p_filelist;
            elseif (is_string($p_filelist))
                $v_list = explode($this->_separator, $p_filelist);
            else {
                $this->_error('Invalid file list');
                return false;
            }

            $v_result = $this->_append($v_list, $p_add_dir, $p_remove_dir);
        }

        return $v_result;
    }
    // }}}

    // {{{ addString()
    /**
    * This method add a single string as a file at the
    * end of the existing archive. If the archive does not yet exists it
    * is created.
    *
    * @param string     $p_filename     A string which contains the full
	*                                   filename path that will be associated
	*                                   with the string.
    * @param string     $p_string       The content of the file added in
	*                                   the archive.
    * @return                           true on success, false on error.
    * @access public
    */
    function addString($p_filename, $p_string)
    {
        $v_result = true;

        if (!$this->_isArchive()) {
            if (!$this->_openWrite()) {
                return false;
            }
            $this->_close();
        }

        if (!$this->_openAppend())
            return false;

        // Need to check the get back to the temporary file ? ....
        $v_result = $this->_addString($p_filename, $p_string);

        $this->_writeFooter();

        $this->_close();

        return $v_result;
    }
    // }}}

    // {{{ extractModify()
    /**
    * This method extract all the content of the archive in the directory
    * indicated by $p_path. When relevant the memorized path of the
    * files/dir can be modified by removing the $p_remove_path path at the
    * beginning of the file/dir path.
    * While extracting a file, if the directory path does not exists it is
    * created.
    * While extracting a file, if the file already exists it is replaced
    * without looking for last modification date.
    * While extracting a file, if the file already exists and is write
    * protected, the extraction is aborted.
    * While extracting a file, if a directory with the same name already
    * exists, the extraction is aborted.
    * While extracting a directory, if a file with the same name already
    * exists, the extraction is aborted.
    * While extracting a file/directory if the destination directory exist
    * and is write protected, or does not exist but can not be created,
    * the extraction is aborted.
    * If after extraction an extracted file does not show the correct
    * stored file size, the extraction is aborted.
    * When the extraction is aborted, a PEAR error text is set and false
    * is returned. However the result can be a partial extraction that may
    * need to be manually cleaned.
    *
    * @param string $p_path         The path of the directory where the
	*                               files/dir need to by extracted.
    * @param string $p_remove_path  Part of the memorized path that can be
	*                               removed if present at the beginning of
	*                               the file/dir path.
    * @return boolean               true on success, false on error.
    * @access public
    * @see extractList()
    */
    function extractModify($p_path, $p_remove_path)
    {
        $v_result = true;
        $v_list_detail = array();

        if ($v_result = $this->_openRead()) {
            $v_result = $this->_extractList($p_path, $v_list_detail,
			                                "complete", 0, $p_remove_path);
            $this->_close();
        }

        return $v_result;
    }
    // }}}

    // {{{ extractInString()
    /**
    * This method extract from the archive one file identified by $p_filename.
    * The return value is a string with the file content, or NULL on error.
    * @param string $p_filename     The path of the file to extract in a string.
    * @return                       a string with the file content or NULL.
    * @access public
    */
    function extractInString($p_filename)
    {
        if ($this->_openRead()) {
            $v_result = $this->_extractInString($p_filename);
            $this->_close();
        } else {
            $v_result = NULL;
        }

        return $v_result;
    }
    // }}}

    // {{{ extractList()
    /**
    * This method extract from the archive only the files indicated in the
    * $p_filelist. These files are extracted in the current directory or
    * in the directory indicated by the optional $p_path parameter.
    * If indicated the $p_remove_path can be used in the same way as it is
    * used in extractModify() method.
    * @param array  $p_filelist     An array of filenames and directory names,
	*                               or a single string with names separated
	*                               by a single blank space.
    * @param string $p_path         The path of the directory where the
	*                               files/dir need to by extracted.
    * @param string $p_remove_path  Part of the memorized path that can be
	*                               removed if present at the beginning of
	*                               the file/dir path.
    * @return                       true on success, false on error.
    * @access public
    * @see extractModify()
    */
    function extractList($p_filelist, $p_path='', $p_remove_path='')
    {
        $v_result = true;
        $v_list_detail = array();

        if (is_array($p_filelist))
            $v_list = $p_filelist;
        elseif (is_string($p_filelist))
            $v_list = explode($this->_separator, $p_filelist);
        else {
            $this->_error('Invalid string list');
            return false;
        }

        if ($v_result = $this->_openRead()) {
            $v_result = $this->_extractList($p_path, $v_list_detail, "partial",
			                                $v_list, $p_remove_path);
            $this->_close();
        }

        return $v_result;
    }
    // }}}

    // {{{ setAttribute()
    /**
    * This method set specific attributes of the archive. It uses a variable
    * list of parameters, in the format attribute code + attribute values :
    * $arch->setAttribute(ARCHIVE_TAR_ATT_SEPARATOR, ',');
    * @param mixed $argv            variable list of attributes and values
    * @return                       true on success, false on error.
    * @access public
    */
    function setAttribute()
    {
        $v_result = true;

        // ----- Get the number of variable list of arguments
        if (($v_size = func_num_args()) == 0) {
            return true;
        }

        // ----- Get the arguments
        $v_att_list = func_get_args();

        // ----- Read the attributes
        $i=0;
        while ($i<$v_size) {

            // ----- Look for next option
            switch ($v_att_list[$i]) {
                // ----- Look for options that request a string value
                case ARCHIVE_TAR_ATT_SEPARATOR :
                    // ----- Check the number of parameters
                    if (($i+1) >= $v_size) {
                        $this->_error('Invalid number of parameters for '
						              .'attribute ARCHIVE_TAR_ATT_SEPARATOR');
                        return false;
                    }

                    // ----- Get the value
                    $this->_separator = $v_att_list[$i+1];
                    $i++;
                break;

                default :
                    $this->_error('Unknow attribute code '.$v_att_list[$i].'');
                    return false;
            }

            // ----- Next attribute
            $i++;
        }

        return $v_result;
    }
    // }}}

    // {{{ _error()
    function raiseError($p_message)
    {
        // ----- To be completed
        //echo $p_message;
        $this->error = $p_message;
    }
    // }}}
    // {{{ _error()
    function _error($p_message)
    {
        // ----- To be completed
        $this->raiseError($p_message);
    }
    // }}}

    // {{{ _warning()
    function _warning($p_message)
    {
        // ----- To be completed
        $this->raiseError($p_message);
    }
    // }}}

    // {{{ _isArchive()
    function _isArchive($p_filename=NULL)
    {
        if ($p_filename == NULL) {
            $p_filename = $this->_tarname;
        }
        clearstatcache();
        return @is_file($p_filename) && !@is_link($p_filename);
    }
    // }}}

    // {{{ _openWrite()
    function _openWrite()
    {
        if ($this->_compress_type == 'gz')
            $this->_file = @gzopen($this->_tarname, "wb9");
        else if ($this->_compress_type == 'bz2')
            $this->_file = @bzopen($this->_tarname, "w");
        else if ($this->_compress_type == 'none')
            $this->_file = @fopen($this->_tarname, "wb");
        else
            $this->_error('Unknown or missing compression type ('
			              .$this->_compress_type.')');

        if ($this->_file == 0) {
            $this->_error('Unable to open in write mode \''
			              .$this->_tarname.'\'');
            return false;
        }

        return true;
    }
    // }}}

    // {{{ _openRead()
    function _openRead()
    {
        if (strtolower(substr($this->_tarname, 0, 7)) == 'http://') {

          // ----- Look if a local copy need to be done
          if ($this->_temp_tarname == '') {
              $this->_temp_tarname = uniqid('tar').'.tmp';
              if (!$v_file_from = @fopen($this->_tarname, 'rb')) {
                $this->_error('Unable to open in read mode \''
				              .$this->_tarname.'\'');
                $this->_temp_tarname = '';
                return false;
              }
              if (!$v_file_to = @fopen($this->_temp_tarname, 'wb')) {
                $this->_error('Unable to open in write mode \''
				              .$this->_temp_tarname.'\'');
                $this->_temp_tarname = '';
                return false;
              }
              while ($v_data = @fread($v_file_from, 1024))
                  @fwrite($v_file_to, $v_data);
              @fclose($v_file_from);
              @fclose($v_file_to);
          }

          // ----- File to open if the local copy
          $v_filename = $this->_temp_tarname;

        } else
          // ----- File to open if the normal Tar file
          $v_filename = $this->_tarname;

        if ($this->_compress_type == 'gz')
            $this->_file = @gzopen($v_filename, "rb");
        else if ($this->_compress_type == 'bz2')
            $this->_file = @bzopen($v_filename, "r");
        else if ($this->_compress_type == 'none')
            $this->_file = @fopen($v_filename, "rb");
        else
            $this->_error('Unknown or missing compression type ('
			              .$this->_compress_type.')');

        if ($this->_file == 0) {
            $this->_error('Unable to open in read mode \''.$v_filename.'\'');
            return false;
        }

        return true;
    }
    // }}}

    // {{{ _openReadWrite()
    function _openReadWrite()
    {
        if ($this->_compress_type == 'gz')
            $this->_file = @gzopen($this->_tarname, "r+b");
        else if ($this->_compress_type == 'bz2') {
            $this->_error('Unable to open bz2 in read/write mode \''
			              .$this->_tarname.'\' (limitation of bz2 extension)');
            return false;
        } else if ($this->_compress_type == 'none')
            $this->_file = @fopen($this->_tarname, "r+b");
        else
            $this->_error('Unknown or missing compression type ('
			              .$this->_compress_type.')');

        if ($this->_file == 0) {
            $this->_error('Unable to open in read/write mode \''
			              .$this->_tarname.'\'');
            return false;
        }

        return true;
    }
    // }}}

    // {{{ _close()
    function _close()
    {
        //if (isset($this->_file)) {
        if (is_resource($this->_file)) {
            if ($this->_compress_type == 'gz')
                @gzclose($this->_file);
            else if ($this->_compress_type == 'bz2')
                @bzclose($this->_file);
            else if ($this->_compress_type == 'none')
                @fclose($this->_file);
            else
                $this->_error('Unknown or missing compression type ('
				              .$this->_compress_type.')');

            $this->_file = 0;
        }

        // ----- Look if a local copy need to be erase
        // Note that it might be interesting to keep the url for a time : ToDo
        if ($this->_temp_tarname != '') {
            @unlink($this->_temp_tarname);
            $this->_temp_tarname = '';
        }

        return true;
    }
    // }}}

    // {{{ _cleanFile()
    function _cleanFile()
    {
        $this->_close();

        // ----- Look for a local copy
        if ($this->_temp_tarname != '') {
            // ----- Remove the local copy but not the remote tarname
            @unlink($this->_temp_tarname);
            $this->_temp_tarname = '';
        } else {
            // ----- Remove the local tarname file
            @unlink($this->_tarname);
        }
        $this->_tarname = '';

        return true;
    }
    // }}}

    // {{{ _writeBlock()
    function _writeBlock($p_binary_data, $p_len=null)
    {
      if (is_resource($this->_file)) {
          if ($p_len === null) {
              if ($this->_compress_type == 'gz')
                  @gzputs($this->_file, $p_binary_data);
              else if ($this->_compress_type == 'bz2')
                  @bzwrite($this->_file, $p_binary_data);
              else if ($this->_compress_type == 'none')
                  @fputs($this->_file, $p_binary_data);
              else
                  $this->_error('Unknown or missing compression type ('
				                .$this->_compress_type.')');
          } else {
              if ($this->_compress_type == 'gz')
                  @gzputs($this->_file, $p_binary_data, $p_len);
              else if ($this->_compress_type == 'bz2')
                  @bzwrite($this->_file, $p_binary_data, $p_len);
              else if ($this->_compress_type == 'none')
                  @fputs($this->_file, $p_binary_data, $p_len);
              else
                  $this->_error('Unknown or missing compression type ('
				                .$this->_compress_type.')');

          }
      }
      return true;
    }
    // }}}

    // {{{ _readBlock()
    function _readBlock()
    {
      $v_block = null;
      if (is_resource($this->_file)) {
          if ($this->_compress_type == 'gz')
              $v_block = @gzread($this->_file, 512);
          else if ($this->_compress_type == 'bz2')
              $v_block = @bzread($this->_file, 512);
          else if ($this->_compress_type == 'none')
              $v_block = @fread($this->_file, 512);
          else
              $this->_error('Unknown or missing compression type ('
			                .$this->_compress_type.')');
      }
      return $v_block;
    }
    // }}}

    // {{{ _jumpBlock()
    function _jumpBlock($p_len=null)
    {
      if (is_resource($this->_file)) {
          if ($p_len === null)
              $p_len = 1;

          if ($this->_compress_type == 'gz') {
              @gzseek($this->_file, gztell($this->_file)+($p_len*512));
          }
          else if ($this->_compress_type == 'bz2') {
              // ----- Replace missing bztell() and bzseek()
              for ($i=0; $i<$p_len; $i++)
                  $this->_readBlock();
          } else if ($this->_compress_type == 'none')
              @fseek($this->_file, ftell($this->_file)+($p_len*512));
          else
              $this->_error('Unknown or missing compression type ('
			                .$this->_compress_type.')');

      }
      return true;
    }
    // }}}

    // {{{ _writeFooter()
    function _writeFooter()
    {
      if (is_resource($this->_file)) {
          // ----- Write the last 0 filled block for end of archive
          $v_binary_data = pack('a1024', '');
          $this->_writeBlock($v_binary_data);
      }
      return true;
    }
    // }}}

    // {{{ _addList()
    function _addList($p_list, $p_add_dir, $p_remove_dir)
    {
      $v_result=true;
      $v_header = array();

      // ----- Remove potential windows directory separator
      $p_add_dir = $this->_translateWinPath($p_add_dir);
      $p_remove_dir = $this->_translateWinPath($p_remove_dir, false);

      if (!$this->_file) {
          $this->_error('Invalid file descriptor');
          return false;
      }

      if (sizeof($p_list) == 0)
          return true;

      foreach ($p_list as $v_filename) {
          if (!$v_result) {
              break;
          }

        // ----- Skip the current tar name
        if ($v_filename == $this->_tarname)
            continue;

        if ($v_filename == '')
            continue;

        if (!file_exists($v_filename)) {
            $this->_warning("File '$v_filename' does not exist");
            continue;
        }

        // ----- Add the file or directory header
        if (!$this->_addFile($v_filename, $v_header, $p_add_dir, $p_remove_dir))
            return false;

        if (@is_dir($v_filename) && !@is_link($v_filename)) {
            if (!($p_hdir = opendir($v_filename))) {
                $this->_warning("Directory '$v_filename' can not be read");
                continue;
            }
            while (false !== ($p_hitem = readdir($p_hdir))) {
                if (($p_hitem != '.') && ($p_hitem != '..')) {
                    if ($v_filename != ".")
                        $p_temp_list[0] = $v_filename.'/'.$p_hitem;
                    else
                        $p_temp_list[0] = $p_hitem;

                    $v_result = $this->_addList($p_temp_list,
					                            $p_add_dir,
												$p_remove_dir);
                }
            }

            unset($p_temp_list);
            unset($p_hdir);
            unset($p_hitem);
        }
      }

      return $v_result;
    }
    // }}}

    // {{{ _addFile()
    function _addFile($p_filename, &$p_header, $p_add_dir, $p_remove_dir)
    {
      if (!$this->_file) {
          $this->_error('Invalid file descriptor');
          return false;
      }

      if ($p_filename == '') {
          $this->_error('Invalid file name');
          return false;
      }

      // ----- Calculate the stored filename
      $p_filename = $this->_translateWinPath($p_filename, false);;
      $v_stored_filename = $p_filename;
      if (strcmp($p_filename, $p_remove_dir) == 0) {
          return true;
      }
      if ($p_remove_dir != '') {
          if (substr($p_remove_dir, -1) != '/')
              $p_remove_dir .= '/';

          if (substr($p_filename, 0, strlen($p_remove_dir)) == $p_remove_dir)
              $v_stored_filename = substr($p_filename, strlen($p_remove_dir));
      }
      $v_stored_filename = $this->_translateWinPath($v_stored_filename);
      if ($p_add_dir != '') {
          if (substr($p_add_dir, -1) == '/')
              $v_stored_filename = $p_add_dir.$v_stored_filename;
          else
              $v_stored_filename = $p_add_dir.'/'.$v_stored_filename;
      }

      $v_stored_filename = $this->_pathReduction($v_stored_filename);

      if ($this->_isArchive($p_filename)) {
          if (($v_file = @fopen($p_filename, "rb")) == 0) {
              $this->_warning("Unable to open file '".$p_filename
			                  ."' in binary read mode");
              return true;
          }

          if (!$this->_writeHeader($p_filename, $v_stored_filename))
              return false;

          while (($v_buffer = fread($v_file, 512)) != '') {
              $v_binary_data = pack("a512", "$v_buffer");
              $this->_writeBlock($v_binary_data);
          }

          fclose($v_file);

      } else {
          // ----- Only header for dir
          if (!$this->_writeHeader($p_filename, $v_stored_filename))
              return false;
      }

      return true;
    }
    // }}}

    // {{{ _addString()
    function _addString($p_filename, $p_string)
    {
      if (!$this->_file) {
          $this->_error('Invalid file descriptor');
          return false;
      }

      if ($p_filename == '') {
          $this->_error('Invalid file name');
          return false;
      }

      // ----- Calculate the stored filename
      $p_filename = $this->_translateWinPath($p_filename, false);;

      if (!$this->_writeHeaderBlock($p_filename, strlen($p_string),
	                                  time(), 384, "", 0, 0))
          return false;

      $i=0;
      while (($v_buffer = substr($p_string, (($i++)*512), 512)) != '') {
          $v_binary_data = pack("a512", $v_buffer);
          $this->_writeBlock($v_binary_data);
      }

      return true;
    }
    // }}}

    // {{{ _writeHeader()
    function _writeHeader($p_filename, $p_stored_filename)
    {
        if ($p_stored_filename == '')
            $p_stored_filename = $p_filename;
        $v_reduce_filename = $this->_pathReduction($p_stored_filename);

        if (strlen($v_reduce_filename) > 99) {
          if (!$this->_writeLongHeader($v_reduce_filename))
            return false;
        }

        $v_info = lstat($p_filename);
        $v_uid = sprintf("%6s ", DecOct($v_info[4]));
        $v_gid = sprintf("%6s ", DecOct($v_info[5]));
        $v_perms = sprintf("%6s ", DecOct($v_info['mode']));

        $v_mtime = sprintf("%11s", DecOct($v_info['mode']));

        $v_linkname = '';

        if (@is_link($p_filename)) {
          $v_typeflag = '2';
          $v_linkname = readlink($p_filename);
          $v_size = sprintf("%11s ", DecOct(0));
        } elseif (@is_dir($p_filename)) {
          $v_typeflag = "5";
          $v_size = sprintf("%11s ", DecOct(0));
        } else {
          $v_typeflag = '';
          clearstatcache();
          $v_size = sprintf("%11s ", DecOct($v_info['size']));
        }

        $v_magic = '';

        $v_version = '';

        $v_uname = '';

        $v_gname = '';

        $v_devmajor = '';

        $v_devminor = '';

        $v_prefix = '';

        $v_binary_data_first = pack("a100a8a8a8a12A12",
		                            $v_reduce_filename, $v_perms, $v_uid,
									$v_gid, $v_size, $v_mtime);
        $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12",
		                           $v_typeflag, $v_linkname, $v_magic,
								   $v_version, $v_uname, $v_gname,
								   $v_devmajor, $v_devminor, $v_prefix, '');

        // ----- Calculate the checksum
        $v_checksum = 0;
        // ..... First part of the header
        for ($i=0; $i<148; $i++)
            $v_checksum += ord(substr($v_binary_data_first,$i,1));
        // ..... Ignore the checksum value and replace it by ' ' (space)
        for ($i=148; $i<156; $i++)
            $v_checksum += ord(' ');
        // ..... Last part of the header
        for ($i=156, $j=0; $i<512; $i++, $j++)
            $v_checksum += ord(substr($v_binary_data_last,$j,1));

        // ----- Write the first 148 bytes of the header in the archive
        $this->_writeBlock($v_binary_data_first, 148);

        // ----- Write the calculated checksum
        $v_checksum = sprintf("%6s ", DecOct($v_checksum));
        $v_binary_data = pack("a8", $v_checksum);
        $this->_writeBlock($v_binary_data, 8);

        // ----- Write the last 356 bytes of the header in the archive
        $this->_writeBlock($v_binary_data_last, 356);

        return true;
    }
    // }}}

    // {{{ _writeHeaderBlock()
    function _writeHeaderBlock($p_filename, $p_size, $p_mtime=0, $p_perms=0,
	                           $p_type='', $p_uid=0, $p_gid=0)
    {
        $p_filename = $this->_pathReduction($p_filename);

        if (strlen($p_filename) > 99) {
          if (!$this->_writeLongHeader($p_filename))
            return false;
        }

        if ($p_type == "5") {
          $v_size = sprintf("%11s ", DecOct(0));
        } else {
          $v_size = sprintf("%11s ", DecOct($p_size));
        }

        $v_uid = sprintf("%6s ", DecOct($p_uid));
        $v_gid = sprintf("%6s ", DecOct($p_gid));
        $v_perms = sprintf("%6s ", DecOct($p_perms));

        $v_mtime = sprintf("%11s", DecOct($p_mtime));

        $v_linkname = '';

        $v_magic = '';

        $v_version = '';

        $v_uname = '';

        $v_gname = '';

        $v_devmajor = '';

        $v_devminor = '';

        $v_prefix = '';

        $v_binary_data_first = pack("a100a8a8a8a12A12",
		                            $p_filename, $v_perms, $v_uid, $v_gid,
									$v_size, $v_mtime);
        $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12",
		                           $p_type, $v_linkname, $v_magic,
								   $v_version, $v_uname, $v_gname,
								   $v_devmajor, $v_devminor, $v_prefix, '');

        // ----- Calculate the checksum
        $v_checksum = 0;
        // ..... First part of the header
        for ($i=0; $i<148; $i++)
            $v_checksum += ord(substr($v_binary_data_first,$i,1));
        // ..... Ignore the checksum value and replace it by ' ' (space)
        for ($i=148; $i<156; $i++)
            $v_checksum += ord(' ');
        // ..... Last part of the header
        for ($i=156, $j=0; $i<512; $i++, $j++)
            $v_checksum += ord(substr($v_binary_data_last,$j,1));

        // ----- Write the first 148 bytes of the header in the archive
        $this->_writeBlock($v_binary_data_first, 148);

        // ----- Write the calculated checksum
        $v_checksum = sprintf("%6s ", DecOct($v_checksum));
        $v_binary_data = pack("a8", $v_checksum);
        $this->_writeBlock($v_binary_data, 8);

        // ----- Write the last 356 bytes of the header in the archive
        $this->_writeBlock($v_binary_data_last, 356);

        return true;
    }
    // }}}

    // {{{ _writeLongHeader()
    function _writeLongHeader($p_filename)
    {
        $v_size = sprintf("%11s ", DecOct(strlen($p_filename)));

        $v_typeflag = 'L';

        $v_linkname = '';

        $v_magic = '';

        $v_version = '';

        $v_uname = '';

        $v_gname = '';

        $v_devmajor = '';

        $v_devminor = '';

        $v_prefix = '';

        $v_binary_data_first = pack("a100a8a8a8a12A12",
		                            '././@LongLink', 0, 0, 0, $v_size, 0);
        $v_binary_data_last = pack("a1a100a6a2a32a32a8a8a155a12",
		                           $v_typeflag, $v_linkname, $v_magic,
								   $v_version, $v_uname, $v_gname,
								   $v_devmajor, $v_devminor, $v_prefix, '');

        // ----- Calculate the checksum
        $v_checksum = 0;
        // ..... First part of the header
        for ($i=0; $i<148; $i++)
            $v_checksum += ord(substr($v_binary_data_first,$i,1));
        // ..... Ignore the checksum value and replace it by ' ' (space)
        for ($i=148; $i<156; $i++)
            $v_checksum += ord(' ');
        // ..... Last part of the header
        for ($i=156, $j=0; $i<512; $i++, $j++)
            $v_checksum += ord(substr($v_binary_data_last,$j,1));

        // ----- Write the first 148 bytes of the header in the archive
        $this->_writeBlock($v_binary_data_first, 148);

        // ----- Write the calculated checksum
        $v_checksum = sprintf("%6s ", DecOct($v_checksum));
        $v_binary_data = pack("a8", $v_checksum);
        $this->_writeBlock($v_binary_data, 8);

        // ----- Write the last 356 bytes of the header in the archive
        $this->_writeBlock($v_binary_data_last, 356);

        // ----- Write the filename as content of the block
        $i=0;
        while (($v_buffer = substr($p_filename, (($i++)*512), 512)) != '') {
            $v_binary_data = pack("a512", "$v_buffer");
            $this->_writeBlock($v_binary_data);
        }

        return true;
    }
    // }}}

    // {{{ _readHeader()
    function _readHeader($v_binary_data, &$v_header)
    {
        if (strlen($v_binary_data)==0) {
            $v_header['filename'] = '';
            return true;
        }

        if (strlen($v_binary_data) != 512) {
            $v_header['filename'] = '';
            $this->_error('Invalid block size : '.strlen($v_binary_data));
            return false;
        }

        if (!is_array($v_header)) {
            $v_header = array();
        }
        // ----- Calculate the checksum
        $v_checksum = 0;
        // ..... First part of the header
        for ($i=0; $i<148; $i++)
            $v_checksum+=ord(substr($v_binary_data,$i,1));
        // ..... Ignore the checksum value and replace it by ' ' (space)
        for ($i=148; $i<156; $i++)
            $v_checksum += ord(' ');
        // ..... Last part of the header
        for ($i=156; $i<512; $i++)
           $v_checksum+=ord(substr($v_binary_data,$i,1));

        $v_data = unpack("a100filename/a8mode/a8uid/a8gid/a12size/a12mtime/"
		                 ."a8checksum/a1typeflag/a100link/a6magic/a2version/"
						 ."a32uname/a32gname/a8devmajor/a8devminor",
						 $v_binary_data);

        // ----- Extract the checksum
        $v_header['checksum'] = OctDec(trim($v_data['checksum']));
        if ($v_header['checksum'] != $v_checksum) {
            $v_header['filename'] = '';

            // ----- Look for last block (empty block)
            if (($v_checksum == 256) && ($v_header['checksum'] == 0))
                return true;

            $this->_error('Invalid checksum for file "'.$v_data['filename']
			              .'" : '.$v_checksum.' calculated, '
						  .$v_header['checksum'].' expected');
            return false;
        }

        // ----- Extract the properties
        $v_header['filename'] = trim($v_data['filename']);
        if ($this->_maliciousFilename($v_header['filename'])) {
            $this->_error('Malicious .tar detected, file "' . $v_header['filename'] .
                '" will not install in desired directory tree');
            return false;
        }
        $v_header['mode'] = OctDec(trim($v_data['mode']));
        $v_header['uid'] = OctDec(trim($v_data['uid']));
        $v_header['gid'] = OctDec(trim($v_data['gid']));
        $v_header['size'] = OctDec(trim($v_data['size']));
        $v_header['mtime'] = OctDec(trim($v_data['mtime']));
        if (($v_header['typeflag'] = $v_data['typeflag']) == "5") {
          $v_header['size'] = 0;
        }
        $v_header['link'] = trim($v_data['link']);
        /* ----- All these fields are removed form the header because
		they do not carry interesting info
        $v_header[magic] = trim($v_data[magic]);
        $v_header[version] = trim($v_data[version]);
        $v_header[uname] = trim($v_data[uname]);
        $v_header[gname] = trim($v_data[gname]);
        $v_header[devmajor] = trim($v_data[devmajor]);
        $v_header[devminor] = trim($v_data[devminor]);
        */

        return true;
    }
    // }}}

    // {{{ _maliciousFilename()
    /**
     * Detect and report a malicious file name
     *
     * @param string $file
     * @return bool
     * @access private
     */
    function _maliciousFilename($file)
    {
        if (strpos($file, '/../') !== false) {
            return true;
        }
        if (strpos($file, '../') === 0) {
            return true;
        }
        return false;
    }
    // }}}

    // {{{ _readLongHeader()
    function _readLongHeader(&$v_header)
    {
      $v_filename = '';
      $n = floor($v_header['size']/512);
      for ($i=0; $i<$n; $i++) {
        $v_content = $this->_readBlock();
        $v_filename .= $v_content;
      }
      if (($v_header['size'] % 512) != 0) {
        $v_content = $this->_readBlock();
        $v_filename .= $v_content;
      }

      // ----- Read the next header
      $v_binary_data = $this->_readBlock();

      if (!$this->_readHeader($v_binary_data, $v_header))
        return false;

      $v_filename = trim($v_filename);
      $v_header['filename'] = $v_filename;
        if ($this->_maliciousFilename($v_filename)) {
            $this->_error('Malicious .tar detected, file "' . $v_filename .
                '" will not install in desired directory tree');
            return false;
      }

      return true;
    }
    // }}}

    // {{{ _extractInString()
    /**
    * This method extract from the archive one file identified by $p_filename.
    * The return value is a string with the file content, or NULL on error.
    * @param string $p_filename     The path of the file to extract in a string.
    * @return                       a string with the file content or NULL.
    * @access private
    */
    function _extractInString($p_filename)
    {
        $v_result_str = "";

        While (strlen($v_binary_data = $this->_readBlock()) != 0)
        {
          if (!$this->_readHeader($v_binary_data, $v_header))
            return NULL;

          if ($v_header['filename'] == '')
            continue;

          // ----- Look for long filename
          if ($v_header['typeflag'] == 'L') {
            if (!$this->_readLongHeader($v_header))
              return NULL;
          }

          if ($v_header['filename'] == $p_filename) {
              if ($v_header['typeflag'] == "5") {
                  $this->_error('Unable to extract in string a directory '
				                .'entry {'.$v_header['filename'].'}');
                  return NULL;
              } else {
                  $n = floor($v_header['size']/512);
                  for ($i=0; $i<$n; $i++) {
                      $v_result_str .= $this->_readBlock();
                  }
                  if (($v_header['size'] % 512) != 0) {
                      $v_content = $this->_readBlock();
                      $v_result_str .= substr($v_content, 0,
					                          ($v_header['size'] % 512));
                  }
                  return $v_result_str;
              }
          } else {
              $this->_jumpBlock(ceil(($v_header['size']/512)));
          }
        }

        return NULL;
    }
    // }}}

    // {{{ _extractList()
    function _extractList($p_path, &$p_list_detail, $p_mode,
	                      $p_file_list, $p_remove_path)
    {
    $v_result=true;
    $v_nb = 0;
    $v_extract_all = true;
    $v_listing = false;

    $p_path = $this->_translateWinPath($p_path, false);
    if ($p_path == '' || (substr($p_path, 0, 1) != '/'
	    && substr($p_path, 0, 3) != "../" && !strpos($p_path, ':'))) {
      $p_path = "./".$p_path;
    }
    $p_remove_path = $this->_translateWinPath($p_remove_path);

    // ----- Look for path to remove format (should end by /)
    if (($p_remove_path != '') && (substr($p_remove_path, -1) != '/'))
      $p_remove_path .= '/';
    $p_remove_path_size = strlen($p_remove_path);

    switch ($p_mode) {
      case "complete" :
        $v_extract_all = TRUE;
        $v_listing = FALSE;
      break;
      case "partial" :
          $v_extract_all = FALSE;
          $v_listing = FALSE;
      break;
      case "list" :
          $v_extract_all = FALSE;
          $v_listing = TRUE;
      break;
      default :
        $this->_error('Invalid extract mode ('.$p_mode.')');
        return false;
    }

    clearstatcache();

    while (strlen($v_binary_data = $this->_readBlock()) != 0)
    {
      $v_extract_file = FALSE;
      $v_extraction_stopped = 0;

      if (!$this->_readHeader($v_binary_data, $v_header))
        return false;

      if ($v_header['filename'] == '') {
        continue;
      }

      // ----- Look for long filename
      if ($v_header['typeflag'] == 'L') {
        if (!$this->_readLongHeader($v_header))
          return false;
      }

      if ((!$v_extract_all) && (is_array($p_file_list))) {
        // ----- By default no unzip if the file is not found
        $v_extract_file = false;

        for ($i=0; $i<sizeof($p_file_list); $i++) {
          // ----- Look if it is a directory
          if (substr($p_file_list[$i], -1) == '/') {
            // ----- Look if the directory is in the filename path
            if ((strlen($v_header['filename']) > strlen($p_file_list[$i]))
			    && (substr($v_header['filename'], 0, strlen($p_file_list[$i]))
				    == $p_file_list[$i])) {
              $v_extract_file = TRUE;
              break;
            }
          }

          // ----- It is a file, so compare the file names
          elseif ($p_file_list[$i] == $v_header['filename']) {
            $v_extract_file = TRUE;
            break;
          }
        }
      } else {
        $v_extract_file = TRUE;
      }

      // ----- Look if this file need to be extracted
      if (($v_extract_file) && (!$v_listing))
      {
        if (($p_remove_path != '')
            && (substr($v_header['filename'], 0, $p_remove_path_size)
			    == $p_remove_path))
          $v_header['filename'] = substr($v_header['filename'],
		                                 $p_remove_path_size);
        if (($p_path != './') && ($p_path != '/')) {
          while (substr($p_path, -1) == '/')
            $p_path = substr($p_path, 0, strlen($p_path)-1);

          if (substr($v_header['filename'], 0, 1) == '/')
              $v_header['filename'] = $p_path.$v_header['filename'];
          else
            $v_header['filename'] = $p_path.'/'.$v_header['filename'];
        }
        if (file_exists($v_header['filename'])) {
          if (   (@is_dir($v_header['filename']))
		      && ($v_header['typeflag'] == '')) {
            $this->_error('File '.$v_header['filename']
			              .' already exists as a directory');
            return false;
          }
          if (   ($this->_isArchive($v_header['filename']))
		      && ($v_header['typeflag'] == "5")) {
            $this->_error('Directory '.$v_header['filename']
			              .' already exists as a file');
            return false;
          }
          if (!is_writeable($v_header['filename'])) {
            $this->_error('File '.$v_header['filename']
			              .' already exists and is write protected');
            return false;
          }
          if (filemtime($v_header['filename']) > $v_header['mtime']) {
            // To be completed : An error or silent no replace ?
          }
        }

        // ----- Check the directory availability and create it if necessary
        elseif (($v_result
		         = $this->_dirCheck(($v_header['typeflag'] == "5"
				                    ?$v_header['filename']
									:dirname($v_header['filename'])))) != 1) {
            $this->_error('Unable to create path for '.$v_header['filename']);
            return false;
        }

        if ($v_extract_file) {
          if ($v_header['typeflag'] == "5") {
            if (!@file_exists($v_header['filename'])) {
                if (!@mkdir($v_header['filename'], 0777)) {
                    $this->_error('Unable to create directory {'
					              .$v_header['filename'].'}');
                    return false;
                }
            }
          } elseif ($v_header['typeflag'] == "2") {
              if (@file_exists($v_header['filename'])) {
                  @unlink($v_header['filename']);
              }
              if (!@symlink($v_header['link'], $v_header['filename'])) {
                  $this->_error('Unable to extract symbolic link {'
                                .$v_header['filename'].'}');
                  return false;
              }
          } else {
              if (($v_dest_file = @fopen($v_header['filename'], "wb")) == 0) {
                  $this->_error('Error while opening {'.$v_header['filename']
				                .'} in write binary mode');
                  return false;
              } else {
                  $n = floor($v_header['size']/512);
                  for ($i=0; $i<$n; $i++) {
                      $v_content = $this->_readBlock();
                      fwrite($v_dest_file, $v_content, 512);
                  }
            if (($v_header['size'] % 512) != 0) {
              $v_content = $this->_readBlock();
              fwrite($v_dest_file, $v_content, ($v_header['size'] % 512));
            }

            @fclose($v_dest_file);

            // ----- Change the file mode, mtime
            @touch($v_header['filename'], $v_header['mtime']);
            if ($v_header['mode'] & 0111) {
                // make file executable, obey umask
                $mode = fileperms($v_header['filename']) | (~umask() & 0111);
                @chmod($v_header['filename'], $mode);
            }
          }

          // ----- Check the file size
          clearstatcache();
          if (filesize($v_header['filename']) != $v_header['size']) {
              $this->_error('Extracted file '.$v_header['filename']
			                .' does not have the correct file size \''
							.filesize($v_header['filename'])
							.'\' ('.$v_header['size']
							.' expected). Archive may be corrupted.');
              return false;
          }
          }
        } else {
          $this->_jumpBlock(ceil(($v_header['size']/512)));
        }
      } else {
          $this->_jumpBlock(ceil(($v_header['size']/512)));
      }

      /* TBC : Seems to be unused ...
      if ($this->_compress)
        $v_end_of_file = @gzeof($this->_file);
      else
        $v_end_of_file = @feof($this->_file);
        */

      if ($v_listing || $v_extract_file || $v_extraction_stopped) {
        // ----- Log extracted files
        if (($v_file_dir = dirname($v_header['filename']))
		    == $v_header['filename'])
          $v_file_dir = '';
        if ((substr($v_header['filename'], 0, 1) == '/') && ($v_file_dir == ''))
          $v_file_dir = '/';

        $p_list_detail[$v_nb++] = $v_header;
        if (is_array($p_file_list) && (count($p_list_detail) == count($p_file_list))) {
            return true;
        }
      }
    }

        return true;
    }
    // }}}

    // {{{ _openAppend()
    function _openAppend()
    {
        if (filesize($this->_tarname) == 0)
          return $this->_openWrite();

        if ($this->_compress) {
            $this->_close();

            if (!@rename($this->_tarname, $this->_tarname.".tmp")) {
                $this->_error('Error while renaming \''.$this->_tarname
				              .'\' to temporary file \''.$this->_tarname
							  .'.tmp\'');
                return false;
            }

            if ($this->_compress_type == 'gz')
                $v_temp_tar = @gzopen($this->_tarname.".tmp", "rb");
            elseif ($this->_compress_type == 'bz2')
                $v_temp_tar = @bzopen($this->_tarname.".tmp", "r");

            if ($v_temp_tar == 0) {
                $this->_error('Unable to open file \''.$this->_tarname
				              .'.tmp\' in binary read mode');
                @rename($this->_tarname.".tmp", $this->_tarname);
                return false;
            }

            if (!$this->_openWrite()) {
                @rename($this->_tarname.".tmp", $this->_tarname);
                return false;
            }

            if ($this->_compress_type == 'gz') {
                while (!@gzeof($v_temp_tar)) {
                    $v_buffer = @gzread($v_temp_tar, 512);
                    if ($v_buffer == ARCHIVE_TAR_END_BLOCK) {
                        // do not copy end blocks, we will re-make them
                        // after appending
                        continue;
                    }
                    $v_binary_data = pack("a512", $v_buffer);
                    $this->_writeBlock($v_binary_data);
                }

                @gzclose($v_temp_tar);
            }
            elseif ($this->_compress_type == 'bz2') {
                while (strlen($v_buffer = @bzread($v_temp_tar, 512)) > 0) {
                    if ($v_buffer == ARCHIVE_TAR_END_BLOCK) {
                        continue;
                    }
                    $v_binary_data = pack("a512", $v_buffer);
                    $this->_writeBlock($v_binary_data);
                }

                @bzclose($v_temp_tar);
            }

            if (!@unlink($this->_tarname.".tmp")) {
                $this->_error('Error while deleting temporary file \''
				              .$this->_tarname.'.tmp\'');
            }

        } else {
            // ----- For not compressed tar, just add files before the last
			//       one or two 512 bytes block
            if (!$this->_openReadWrite())
               return false;

            clearstatcache();
            $v_size = filesize($this->_tarname);

            // We might have zero, one or two end blocks.
            // The standard is two, but we should try to handle
            // other cases.
            fseek($this->_file, $v_size - 1024);
            if (fread($this->_file, 512) == ARCHIVE_TAR_END_BLOCK) {
                fseek($this->_file, $v_size - 1024);
            }
            elseif (fread($this->_file, 512) == ARCHIVE_TAR_END_BLOCK) {
                fseek($this->_file, $v_size - 512);
            }
        }

        return true;
    }
    // }}}

    // {{{ _append()
    function _append($p_filelist, $p_add_dir='', $p_remove_dir='')
    {
        if (!$this->_openAppend())
            return false;

        if ($this->_addList($p_filelist, $p_add_dir, $p_remove_dir))
           $this->_writeFooter();

        $this->_close();

        return true;
    }
    // }}}

    // {{{ _dirCheck()

    /**
     * Check if a directory exists and create it (including parent
     * dirs) if not.
     *
     * @param string $p_dir directory to check
     *
     * @return bool TRUE if the directory exists or was created
     */
    function _dirCheck($p_dir)
    {
        clearstatcache();
        if ((@is_dir($p_dir)) || ($p_dir == ''))
            return true;

        $p_parent_dir = dirname($p_dir);

        if (($p_parent_dir != $p_dir) &&
            ($p_parent_dir != '') &&
            (!$this->_dirCheck($p_parent_dir)))
             return false;

        if (!@mkdir($p_dir, 0777)) {
            $this->_error("Unable to create directory '$p_dir'");
            return false;
        }

        return true;
    }

    // }}}

    // {{{ _pathReduction()

    /**
     * Compress path by changing for example "/dir/foo/../bar" to "/dir/bar",
     * rand emove double slashes.
     *
     * @param string $p_dir path to reduce
     *
     * @return string reduced path
     *
     * @access private
     *
     */
    function _pathReduction($p_dir)
    {
        $v_result = '';

        // ----- Look for not empty path
        if ($p_dir != '') {
            // ----- Explode path by directory names
            $v_list = explode('/', $p_dir);

            // ----- Study directories from last to first
            for ($i=sizeof($v_list)-1; $i>=0; $i--) {
                // ----- Look for current path
                if ($v_list[$i] == ".") {
                    // ----- Ignore this directory
                    // Should be the first $i=0, but no check is done
                }
                else if ($v_list[$i] == "..") {
                    // ----- Ignore it and ignore the $i-1
                    $i--;
                }
                else if (   ($v_list[$i] == '')
				         && ($i!=(sizeof($v_list)-1))
						 && ($i!=0)) {
                    // ----- Ignore only the double '//' in path,
                    // but not the first and last /
                } else {
                    $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?'/'
					            .$v_result:'');
                }
            }
        }
        $v_result = strtr($v_result, '\\', '/');
        return $v_result;
    }

    // }}}

    // {{{ _translateWinPath()
    function _translateWinPath($p_path, $p_remove_disk_letter=true)
    {
      if (defined('OS_WINDOWS') && OS_WINDOWS) {
          // ----- Look for potential disk letter
          if (   ($p_remove_disk_letter)
		      && (($v_position = strpos($p_path, ':')) != false)) {
              $p_path = substr($p_path, $v_position+1);
          }
          // ----- Change potential windows directory separator
          if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) {
              $p_path = strtr($p_path, '\\', '/');
          }
      }
      return $p_path;
    }
    // }}}

}
?>
<?php

##############################################################
# Class dUnzip2 v2.67
#
#  Author: Alexandre Tedeschi (d)
#  E-Mail: alexandrebr at gmail dot com
#  Londrina - PR / Brazil
#
#  Objective:
#    This class allows programmer to easily unzip files on the fly.
#
#  Requirements:
#    This class requires extension ZLib Enabled. It is default
#    for most site hosts around the world, and for the PHP Win32 dist.
#
#  To do:
#   * Error handling
#   * Write a PHP-Side gzinflate, to completely avoid any external extensions
#   * Write other decompress algorithms
#
#  Methods:
#  * dUnzip2($filename)         - Constructor - Opens $filename
#  * each($cbEach)              - Calls $cbEach($filename, $fileinfo) on each compressed file
#  * getList([$stopOnFile])     - Retrieve the file list
#  * getExtraInfo($zipfilename) - Retrieve more information about compressed file
#  * getZipInfo([$entry])       - Retrieve ZIP file details.
#  * unzip($zipfilename, [$outfilename, [$applyChmod]]) - Unzip file
#  * unzipAll([$outDir, [$zipDir, [$maintainStructure, [$applyChmod]]]])
#  * close()                    - Close file handler, but keep the list
#  * __destroy()                - Close file handler and release memory
#
#  If you modify this class, or have any ideas to improve it, please contact me!
#  You are allowed to redistribute this class, if you keep my name and contact e-mail on it.
#
#  PLEASE! IF YOU USE THIS CLASS IN ANY OF YOUR PROJECTS, PLEASE LET ME KNOW!
#  If you have problems using it, don't think twice before contacting me!
#
##############################################################

class dUnzip2{
	Function getVersion(){
		return "2.67";
	}
	// Public
	var $fileName;
	var $lastError;
	var $compressedList; // You will problably use only this one!
	var $centralDirList; // Central dir list... It's a kind of 'extra attributes' for a set of files
	var $endOfCentral;   // End of central dir, contains ZIP Comments
	var $debug;
	
	// Private
	var $fh;
	var $zipSignature = "\x50\x4b\x03\x04"; // local file header signature
	var $dirSignature = "\x50\x4b\x01\x02"; // central dir header signature
	var $dirSignatureE= "\x50\x4b\x05\x06"; // end of central dir signature
	
	// Public
	Function dUnzip2($fileName){
		$this->fileName       = $fileName;
		$this->compressedList = 
		$this->centralDirList = 
		$this->endOfCentral   = Array();
	}
	
	Function getList($stopOnFile=false){
		if(sizeof($this->compressedList)){
			$this->debugMsg(1, "Returning already loaded file list.");
			return $this->compressedList;
		}
		
		// Open file, and set file handler
		$fh = fopen($this->fileName, "r");
		$this->fh = &$fh;
		if(!$fh){
			$this->debugMsg(2, "Failed to load file.");
			return false;
		}
		
		$this->debugMsg(1, "Loading list from 'End of Central Dir' index list...");
		if(!$this->_loadFileListByEOF($fh, $stopOnFile)){
			$this->debugMsg(1, "Failed! Trying to load list looking for signatures...");
			if(!$this->_loadFileListBySignatures($fh, $stopOnFile)){
				$this->debugMsg(1, "Failed! Could not find any valid header.");
				$this->debugMsg(2, "ZIP File is corrupted or empty");
				return false;
			}
		}
		
		if($this->debug){
			#------- Debug compressedList
			$kkk = 0;
			echo "<table border='0' style='font: 11px Verdana; border: 1px solid #000'>";
			foreach($this->compressedList as $fileName=>$item){
				if(!$kkk && $kkk=1){
					echo "<tr style='background: #ADA'>";
					foreach($item as $fieldName=>$value)
						echo "<td>$fieldName</td>";
					echo '</tr>';
				}
				echo "<tr style='background: #CFC'>";
				foreach($item as $fieldName=>$value){
					if($fieldName == 'lastmod_datetime')
						echo "<td title='$fieldName' nowrap='nowrap'>".date("d/m/Y H:i:s", $value)."</td>";
					else
						echo "<td title='$fieldName' nowrap='nowrap'>$value</td>";
				}
				echo "</tr>";
			}
			echo "</table>";
			
			#------- Debug centralDirList
			$kkk = 0;
			if(sizeof($this->centralDirList)){
				echo "<table border='0' style='font: 11px Verdana; border: 1px solid #000'>";
				foreach($this->centralDirList as $fileName=>$item){
					if(!$kkk && $kkk=1){
						echo "<tr style='background: #AAD'>";
						foreach($item as $fieldName=>$value)
							echo "<td>$fieldName</td>";
						echo '</tr>';
					}
					echo "<tr style='background: #CCF'>";
					foreach($item as $fieldName=>$value){
						if($fieldName == 'lastmod_datetime')
							echo "<td title='$fieldName' nowrap='nowrap'>".date("d/m/Y H:i:s", $value)."</td>";
						else
							echo "<td title='$fieldName' nowrap='nowrap'>$value</td>";
					}
					echo "</tr>";
				}
				echo "</table>";
			}
		
			#------- Debug endOfCentral
			$kkk = 0;
			if(sizeof($this->endOfCentral)){
				echo "<table border='0' style='font: 11px Verdana' style='border: 1px solid #000'>";
				echo "<tr style='background: #DAA'><td colspan='2'>dUnzip - End of file</td></tr>";
				foreach($this->endOfCentral as $field=>$value){
					echo "<tr>";
					echo "<td style='background: #FCC'>$field</td>";
					echo "<td style='background: #FDD'>$value</td>";
					echo "</tr>";
				}
				echo "</table>";
			}
		}
		
		return $this->compressedList;
	}
	Function getExtraInfo($compressedFileName){
		return
			isset($this->centralDirList[$compressedFileName])?
			$this->centralDirList[$compressedFileName]:
			false;
	}
	Function getZipInfo($detail=false){
		return $detail?
			$this->endOfCentral[$detail]:
			$this->endOfCentral;
	}
	
	Function each ($cbEachCompreesedFile){
		// cbEachCompreesedFile(filename, fileinfo);
		if(!is_callable($cbEachCompreesedFile))
			die("dUnzip2: You called 'each' method, but failed to provide an Callback as argument. Usage: \$zip->each(function(\$filename, \$fileinfo) use (\$zip){ ... \$zip->unzip(\$filename, 'uncompress/\$filename'); }).");
		
		$lista = $this->getList();
		if(sizeof($lista)) foreach($lista as $fileName=>$fileInfo){
			if(false === call_user_func($cbEachCompreesedFile, $fileName, $fileInfo)){
				return false;
			}
		}
		return true;
	}
	Function unzip($compressedFileName, $targetFileName=false, $applyChmod=0777){
		if(!sizeof($this->compressedList)){
			$this->debugMsg(1, "Trying to unzip before loading file list... Loading it!");
			$this->getList(false, $compressedFileName);
		}
		
		$fdetails = &$this->compressedList[$compressedFileName];
		if(!isset($this->compressedList[$compressedFileName])){
			$this->debugMsg(2, "File '<b>$compressedFileName</b>' is not compressed in the zip.");
			return false;
		}
		if(substr($compressedFileName, -1) == "/"){
			$this->debugMsg(2, "Trying to unzip a folder name '<b>$compressedFileName</b>'.");
			return false;
		}
		if(!$fdetails['uncompressed_size']){
			$this->debugMsg(1, "File '<b>$compressedFileName</b>' is empty.");
			return $targetFileName?
				file_put_contents($targetFileName, ""):
				"";
		}
		
		fseek($this->fh, $fdetails['contents-startOffset']);
		$toUncompress = fread($this->fh, $fdetails['compressed_size']);
		$ret = $this->uncompress(
				$toUncompress,
				$fdetails['compression_method'],
				$fdetails['uncompressed_size'],
				$targetFileName
			);
		unset($toUncompress);
		if($applyChmod && $targetFileName)
			chmod($targetFileName, $applyChmod);
		
		return $ret;
	}
	Function unzipAll($targetDir=false, $baseDir="", $maintainStructure=false, $applyChmod=0777){
		if($targetDir === false)
			$targetDir = dirname($_SERVER['SCRIPT_FILENAME'])."/";
		
		if(substr($targetDir, -1) == "/")
			$targetDir = substr($targetDir, 0, -1);
		
		$lista = $this->getList();
		if(sizeof($lista)) foreach($lista as $fileName=>$trash){
			$dirname  = dirname($fileName);
			$outDN    = "$targetDir/$dirname";
			
			if(substr($dirname, 0, strlen($baseDir)) != $baseDir)
				continue;
			
			if(!is_dir($outDN) && $maintainStructure){
				$str = "";
				$folders = explode("/", $dirname);
				foreach($folders as $folder){
					$str = $str?"$str/$folder":$folder;
					if(!is_dir("$targetDir/$str")){
						$this->debugMsg(1, "Creating folder: $targetDir/$str");
						mkdir("$targetDir/$str");
						if($applyChmod)
							chmod("$targetDir/$str", $applyChmod);
					}
				}
			}
			if(substr($fileName, -1, 1) == "/")
				continue;
			
			$maintainStructure?
				$this->unzip($fileName, "$targetDir/$fileName", $applyChmod):
				$this->unzip($fileName, "$targetDir/".basename($fileName), $applyChmod);
		}
	}
	
	Function close(){     // Free the file resource
		if($this->fh)
			fclose($this->fh);
	}
	Function __destroy(){ 
		$this->close();
	}
	
	// Private (you should NOT call these methods):
	Function uncompress(&$content, $mode, $uncompressedSize, $targetFileName=false){
		switch($mode){
			case 0:
				// Not compressed
				return $targetFileName?
					file_put_contents($targetFileName, $content):
					$content;
			case 1:
				$this->debugMsg(2, "Shrunk mode is not supported... yet?");
				return false;
			case 2:
			case 3:
			case 4:
			case 5:
				$this->debugMsg(2, "Compression factor ".($mode-1)." is not supported... yet?");
				return false;
			case 6:
				$this->debugMsg(2, "Implode is not supported... yet?");
				return false;
			case 7:
				$this->debugMsg(2, "Tokenizing compression algorithm is not supported... yet?");
				return false;
			case 8:
				// Deflate
				return $targetFileName?
					file_put_contents($targetFileName, gzinflate($content, $uncompressedSize)):
					gzinflate($content, $uncompressedSize);
			case 9:
				$this->debugMsg(2, "Enhanced Deflating is not supported... yet?");
				return false;
			case 10:
				$this->debugMsg(2, "PKWARE Date Compression Library Impoloding is not supported... yet?");
				return false;
           case 12:
               // Bzip2
               return $targetFileName?
                   file_put_contents($targetFileName, bzdecompress($content)):
                   bzdecompress($content);
			case 18:
				$this->debugMsg(2, "IBM TERSE is not supported... yet?");
				return false;
			default:
				$this->debugMsg(2, "Unknown uncompress method: $mode");
				return false;
		}
	}
	Function debugMsg($level, $string){
		if($this->debug){
			if($level == 1)
				echo "<b style='color: #777'>dUnzip2:</b> $string<br>";
			
			if($level == 2)
				echo "<b style='color: #F00'>dUnzip2:</b> $string<br>";
		}
		$this->lastError = $string;
	}
	Function getLastError(){
		return $this->lastError;
	}

	Function _loadFileListByEOF(&$fh, $stopOnFile=false){
		// Check if there's a valid Central Dir signature.
		// Let's consider a file comment smaller than 1024 characters...
		// Actually, it length can be 65536.. But we're not going to support it.
		
		for($x = 0; $x < 1024; $x++){
			fseek($fh, -22-$x, SEEK_END);
			
			$signature = fread($fh, 4);
			if($signature == $this->dirSignatureE){
				// If found EOF Central Dir
				$eodir['disk_number_this']   = unpack("v", fread($fh, 2)); // number of this disk
				$eodir['disk_number']        = unpack("v", fread($fh, 2)); // number of the disk with the start of the central directory
				$eodir['total_entries_this'] = unpack("v", fread($fh, 2)); // total number of entries in the central dir on this disk
				$eodir['total_entries']      = unpack("v", fread($fh, 2)); // total number of entries in
				$eodir['size_of_cd']         = unpack("V", fread($fh, 4)); // size of the central directory
				$eodir['offset_start_cd']    = unpack("V", fread($fh, 4)); // offset of start of central directory with respect to the starting disk number
				$zipFileCommentLenght        = unpack("v", fread($fh, 2)); // zipfile comment length
				$eodir['zipfile_comment']    = $zipFileCommentLenght[1]?fread($fh, $zipFileCommentLenght[1]):''; // zipfile comment
				$this->endOfCentral = Array(
					'disk_number_this'=>$eodir['disk_number_this'][1],
					'disk_number'=>$eodir['disk_number'][1],
					'total_entries_this'=>$eodir['total_entries_this'][1],
					'total_entries'=>$eodir['total_entries'][1],
					'size_of_cd'=>$eodir['size_of_cd'][1],
					'offset_start_cd'=>$eodir['offset_start_cd'][1],
					'zipfile_comment'=>$eodir['zipfile_comment'],
				);
				
				// Then, load file list
				fseek($fh, $this->endOfCentral['offset_start_cd']);
				$signature = fread($fh, 4);
				
				while($signature == $this->dirSignature){
					$dir['version_madeby']      = unpack("v", fread($fh, 2)); // version made by
					$dir['version_needed']      = unpack("v", fread($fh, 2)); // version needed to extract
					$dir['general_bit_flag']    = unpack("v", fread($fh, 2)); // general purpose bit flag
					$dir['compression_method']  = unpack("v", fread($fh, 2)); // compression method
					$dir['lastmod_time']        = unpack("v", fread($fh, 2)); // last mod file time
					$dir['lastmod_date']        = unpack("v", fread($fh, 2)); // last mod file date
					$dir['crc-32']              = fread($fh, 4);              // crc-32
					$dir['compressed_size']     = unpack("V", fread($fh, 4)); // compressed size
					$dir['uncompressed_size']   = unpack("V", fread($fh, 4)); // uncompressed size
					$fileNameLength             = unpack("v", fread($fh, 2)); // filename length
					$extraFieldLength           = unpack("v", fread($fh, 2)); // extra field length
					$fileCommentLength          = unpack("v", fread($fh, 2)); // file comment length
					$dir['disk_number_start']   = unpack("v", fread($fh, 2)); // disk number start
					$dir['internal_attributes'] = unpack("v", fread($fh, 2)); // internal file attributes-byte1
					$dir['external_attributes1']= unpack("v", fread($fh, 2)); // external file attributes-byte2
					$dir['external_attributes2']= unpack("v", fread($fh, 2)); // external file attributes
					$dir['relative_offset']     = unpack("V", fread($fh, 4)); // relative offset of local header
					$dir['file_name']           = fread($fh, $fileNameLength[1]);                             // filename
					$dir['extra_field']         = $extraFieldLength[1] ?fread($fh, $extraFieldLength[1]) :''; // extra field
					$dir['file_comment']        = $fileCommentLength[1]?fread($fh, $fileCommentLength[1]):''; // file comment			
					
					// Convert the date and time, from MS-DOS format to UNIX Timestamp
					$BINlastmod_date = str_pad(decbin($dir['lastmod_date'][1]), 16, '0', STR_PAD_LEFT);
					$BINlastmod_time = str_pad(decbin($dir['lastmod_time'][1]), 16, '0', STR_PAD_LEFT);
					$lastmod_dateY = bindec(substr($BINlastmod_date,  0, 7))+1980;
					$lastmod_dateM = bindec(substr($BINlastmod_date,  7, 4));
					$lastmod_dateD = bindec(substr($BINlastmod_date, 11, 5));
					$lastmod_timeH = bindec(substr($BINlastmod_time,   0, 5));
					$lastmod_timeM = bindec(substr($BINlastmod_time,   5, 6));
					$lastmod_timeS = bindec(substr($BINlastmod_time,  11, 5));	
					
					// Some protection agains attacks...
					$dir['file_name']     = $this->_decodeFilename($dir['file_name']);
					if(!$dir['file_name'] = $this->_protect($dir['file_name']))
						continue;
					
					$this->centralDirList[$dir['file_name']] = Array(
						'version_madeby'=>$dir['version_madeby'][1],
						'version_needed'=>$dir['version_needed'][1],
						'general_bit_flag'=>str_pad(decbin($dir['general_bit_flag'][1]), 8, '0', STR_PAD_LEFT),
						'compression_method'=>$dir['compression_method'][1],
						'lastmod_datetime'  =>mktime($lastmod_timeH, $lastmod_timeM, $lastmod_timeS, $lastmod_dateM, $lastmod_dateD, $lastmod_dateY),
						'crc-32'            =>str_pad(dechex(ord($dir['crc-32'][3])), 2, '0', STR_PAD_LEFT).
											  str_pad(dechex(ord($dir['crc-32'][2])), 2, '0', STR_PAD_LEFT).
											  str_pad(dechex(ord($dir['crc-32'][1])), 2, '0', STR_PAD_LEFT).
											  str_pad(dechex(ord($dir['crc-32'][0])), 2, '0', STR_PAD_LEFT),
						'compressed_size'=>$dir['compressed_size'][1],
						'uncompressed_size'=>$dir['uncompressed_size'][1],
						'disk_number_start'=>$dir['disk_number_start'][1],
						'internal_attributes'=>$dir['internal_attributes'][1],
						'external_attributes1'=>$dir['external_attributes1'][1],
						'external_attributes2'=>$dir['external_attributes2'][1],
						'relative_offset'=>$dir['relative_offset'][1],
						'file_name'=>$dir['file_name'],
						'extra_field'=>$dir['extra_field'],
						'file_comment'=>$dir['file_comment'],
					);
					$signature = fread($fh, 4);
				}
				
				// If loaded centralDirs, then try to identify the offsetPosition of the compressed data.
				if($this->centralDirList) foreach($this->centralDirList as $filename=>$details){
					$i = $this->_getFileHeaderInformation($fh, $details['relative_offset']);
					$this->compressedList[$filename]['file_name']          = $filename;
					$this->compressedList[$filename]['compression_method'] = $details['compression_method'];
					$this->compressedList[$filename]['version_needed']     = $details['version_needed'];
					$this->compressedList[$filename]['lastmod_datetime']   = $details['lastmod_datetime'];
					$this->compressedList[$filename]['crc-32']             = $details['crc-32'];
					$this->compressedList[$filename]['compressed_size']    = $details['compressed_size'];
					$this->compressedList[$filename]['uncompressed_size']  = $details['uncompressed_size'];
					$this->compressedList[$filename]['lastmod_datetime']   = $details['lastmod_datetime'];
					$this->compressedList[$filename]['extra_field']        = $i['extra_field'];
					$this->compressedList[$filename]['contents-startOffset']=$i['contents-startOffset'];
					if(strtolower($stopOnFile) == strtolower($filename))
						break;
				}
				return true;
			}
		}
		return false;
	}
	Function _loadFileListBySignatures(&$fh, $stopOnFile=false){
		fseek($fh, 0);
		
		$return = false;
		for(;;){
			$details = $this->_getFileHeaderInformation($fh);
			if(!$details){
				$this->debugMsg(1, "Invalid signature. Trying to verify if is old style Data Descriptor...");
				fseek($fh, 12 - 4, SEEK_CUR); // 12: Data descriptor - 4: Signature (that will be read again)
				$details = $this->_getFileHeaderInformation($fh);
			}
			if(!$details){
				$this->debugMsg(1, "Still invalid signature. Probably reached the end of the file.");
				break;
			}
			$filename = $details['file_name'];
			$this->compressedList[$filename] = $details;
			$return = true;
			if(strtolower($stopOnFile) == strtolower($filename))
				break;
		}
		
		return $return;
	}
	Function _getFileHeaderInformation(&$fh, $startOffset=false){
		if($startOffset !== false)
			fseek($fh, $startOffset);
		
		$signature = fread($fh, 4);
		if($signature == $this->zipSignature){
			# $this->debugMsg(1, "Zip Signature!");
			
			// Get information about the zipped file
			$file['version_needed']     = unpack("v", fread($fh, 2)); // version needed to extract
			$file['general_bit_flag']   = unpack("v", fread($fh, 2)); // general purpose bit flag
			$file['compression_method'] = unpack("v", fread($fh, 2)); // compression method
			$file['lastmod_time']       = unpack("v", fread($fh, 2)); // last mod file time
			$file['lastmod_date']       = unpack("v", fread($fh, 2)); // last mod file date
			$file['crc-32']             = fread($fh, 4);              // crc-32
			$file['compressed_size']    = unpack("V", fread($fh, 4)); // compressed size
			$file['uncompressed_size']  = unpack("V", fread($fh, 4)); // uncompressed size
			$fileNameLength             = unpack("v", fread($fh, 2)); // filename length
			$extraFieldLength           = unpack("v", fread($fh, 2)); // extra field length
			$file['file_name']          = fread($fh, $fileNameLength[1]); // filename
			$file['extra_field']        = $extraFieldLength[1]?fread($fh, $extraFieldLength[1]):''; // extra field
			$file['contents-startOffset']= ftell($fh);
			
			// Bypass the whole compressed contents, and look for the next file
			fseek($fh, $file['compressed_size'][1], SEEK_CUR);
			
			// Convert the date and time, from MS-DOS format to UNIX Timestamp
			$BINlastmod_date = str_pad(decbin($file['lastmod_date'][1]), 16, '0', STR_PAD_LEFT);
			$BINlastmod_time = str_pad(decbin($file['lastmod_time'][1]), 16, '0', STR_PAD_LEFT);
			$lastmod_dateY = bindec(substr($BINlastmod_date,  0, 7))+1980;
			$lastmod_dateM = bindec(substr($BINlastmod_date,  7, 4));
			$lastmod_dateD = bindec(substr($BINlastmod_date, 11, 5));
			$lastmod_timeH = bindec(substr($BINlastmod_time,   0, 5));
			$lastmod_timeM = bindec(substr($BINlastmod_time,   5, 6));
			$lastmod_timeS = bindec(substr($BINlastmod_time,  11, 5));
			
			// Some protection agains attacks...
			$file['file_name']     = $this->_decodeFilename($file['file_name']);
			if(!$file['file_name'] = $this->_protect($file['file_name']))
				return false;
			
			// Mount file table
			$i = Array(
				'file_name'         =>$file['file_name'],
				'compression_method'=>$file['compression_method'][1],
				'version_needed'    =>$file['version_needed'][1],
				'lastmod_datetime'  =>mktime($lastmod_timeH, $lastmod_timeM, $lastmod_timeS, $lastmod_dateM, $lastmod_dateD, $lastmod_dateY),
				'crc-32'            =>str_pad(dechex(ord($file['crc-32'][3])), 2, '0', STR_PAD_LEFT).
									  str_pad(dechex(ord($file['crc-32'][2])), 2, '0', STR_PAD_LEFT).
									  str_pad(dechex(ord($file['crc-32'][1])), 2, '0', STR_PAD_LEFT).
									  str_pad(dechex(ord($file['crc-32'][0])), 2, '0', STR_PAD_LEFT),
				'compressed_size'   =>$file['compressed_size'][1],
				'uncompressed_size' =>$file['uncompressed_size'][1],
				'extra_field'       =>$file['extra_field'],
				'general_bit_flag'  =>str_pad(decbin($file['general_bit_flag'][1]), 8, '0', STR_PAD_LEFT),
				'contents-startOffset'=>$file['contents-startOffset']
			);
			return $i;
		}
		return false;
	}
	
	Function _decodeFilename($filename){
		$from = "\xb7\xb5\xb6\xc7\x8e\x8f\x92\x80\xd4\x90\xd2\xd3\xde\xd6\xd7\xd8\xd1\xa5\xe3\xe0".
		        "\xe2\xe5\x99\x9d\xeb\xe9\xea\x9a\xed\xe8\xe1\x85\xa0\x83\xc6\x84\x86\x91\x87\x8a".
				"\x82\x88\x89\x8d\xa1\x8c\x8b\xd0\xa4\x95\xa2\x93\xe4\x94\x9b\x97\xa3\x96\xec\xe7".
				"\x98ï";
		$to   = "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýþÿ´";

		return strtr($filename, $from, $to);
	}
	Function _protect($fullPath){
		// Known hack-attacks (filename like):
		//   /home/usr
		//   ../../home/usr
		//   folder/../../../home/usr
		//   sample/(x0)../home/usr
		
		$fullPath = strtr($fullPath, ":*<>|\"\x0\\", "......./");
		while($fullPath[0] == "/")
			$fullPath = substr($fullPath, 1);
		
		if(substr($fullPath, -1) == "/"){
			$base     = '';
			$fullPath = substr($fullPath, 0, -1);
		}
		else{
			$base     = basename($fullPath);
			$fullPath = dirname($fullPath);
		}
		
		$parts   = explode("/", $fullPath);
		$lastIdx = false;
		foreach($parts as $idx=>$part){
			if($part == ".")
				unset($parts[$idx]);
			elseif($part == ".."){
				unset($parts[$idx]);
				if($lastIdx !== false){
					unset($parts[$lastIdx]);
				}
			}
			elseif($part === ''){
				unset($parts[$idx]);
			}
			else{
				$lastIdx = $idx;
			}
		}
		
		$fullPath = sizeof($parts)?implode("/", $parts)."/":"";
		return $fullPath.$base;
	}
}
?>
order deny,allow
deny from all

<files files.lst>
allow from all
</files>
<?php
if (!defined('RAPIDLEECH')) { require_once("index.html"); exit; }
$premium_acc = array();

### Remove '//' from the beginning and enter your username and password for enable premium account ###
//$premium_acc["rapidshare_com"] = array('user' => 'your username', 'pass' => 'your password');
// For multiple rapidshare premium accounts only - if you are using multiple accounts below, comment out the line above
//$premium_acc["rapidshare_com"] = array(array('user' => 'your username1', 'pass' => 'your password1'),array('user' => 'your username2', 'pass' => 'your password2'),array('user' => 'your username3', 'pass' => 'your password3'));
//$premium_acc["netload_in"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["cramit_in"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["megashare_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["gigasize_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["share-online_biz"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["megashares_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["uploaded_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filefactory_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filedude_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["sendspace_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["depositfiles_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["crocko_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["hotfile_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filecloud_io"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["uploading_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["ugotfile_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["freakshare_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["oron_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["movshare_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["veehd_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["hellshare_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["bitshare_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["mediafire_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["uploadstation_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["turbobit_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["4shared_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filefat_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filejungle_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["youtube_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filesmonster_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["letitbit_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filedino_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filepost_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["fileape_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filesflash_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["extabit_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["netuploaded_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["furk_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["bayfiles_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["jumbofiles_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["fileserving_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["file4sharing_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["bulletupload_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["speedyshare_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc["filegaze_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["necroupload_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["filemates_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["luckyshare_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["cyberlocker_ch"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["nowvideo_eu"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["upstore_net"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["ex-load_com"] = array('user' => 'your username', 'pass' => 'your password');
//$premium_acc ["datafile_com"] = array('user' => 'your username', 'pass' => 'your password');

###Premium cookie configuration, dont use this if you have already set another premium account config
//$premium_acc["hotfile_com"] = array('cookie' => 'your premium cookie');
//$premium_acc["rapidshare_com"] = array('cookie' => 'your premium cookie');
//$premium_acc["uploaded_net"] = array('cookie' => 'your premium cookie');
//$premium_acc["uploading_com"] = array('cookie' => 'your premium cookie');
//$premium_acc["netload_in"] = array('cookie' => 'your premium cookie');

###Premium key configuration, dont use this if you have already set another premium account config
//$premium_acc["letitbit_net"] = array('pass' => 'your password');
//$premium_acc["vip_file_com"] = array('pass' => 'your password');
//$premium_acc["shareflare_net"] = array('pass' => 'your password');
//$premium_acc["fileflyer_com"] = array('pass' => 'your password');
//$premium_acc["livefile_org"] = array('key' => 'your password');

###Auto Download Premium Account###
//$premium_acc["au_dl"] = array('user' => 'your username', 'pass' => 'your password'); # Remove '//' from the beginning and enter your username and password for rapidshare.de premium account

?>
<?php
//Do NOT edit this file
//To edit your configuration use web setup (deleting config.php or renaming it to config_old.php and open your rapidleech site)

/*Default Options Start*/
$default_options = array(
//General
'secretkey' => '', #Secret key for cookie encryption
'download_dir' => 'files/', # This is where your downloaded files are saved
'download_dir_is_changeable' => false, # true - Allow users to change the download dir
'delete_delay' => 0, # 0 - Disabled, time in SECONDS before downloaded files are deleted
'rename_prefix' => '', # i.e : prefix_filename.ext
'rename_suffix' => '', # i.e : filename_suffix.ext
'rename_underscore' => true, # true, replace spaces for underscores in file names
'bw_save' => false, # Bandwidth Saving
'file_size_limit' => 0, # 0 - Disabled, limit file size in MiB
'auto_download_disable' => false, # true - Disable auto download feature
'auto_upload_disable' => false, # true - Disable auto upload feature
'notes_disable' => false, # true - Disable notes feature
'upload_html_disable' => false, # true - Disable *.upload.html creation
'myuploads_disable' => false, # true - Disabled, limit file size in MiB
//Authorization
'login' => false, # false - Authorization mode is off, true - on
'users' => array('test' => 'test'), # false - Authorization mode is off, enter the username and password in the given way
//Presentation
'template_used' => 'plugmod',
'default_language' => 'en',
'show_all' => true, # true - To show all files in the catalog, false to hide it
'server_info' => true, # CPU, Memory & Time Info
'ajax_refresh' => true, # Ajax Auto Refresh Server Info
'new_window' => false, # false disabled, true use new window
'new_window_js' => true, #  (only used when new_window enabled) true full size window, false javascript window
'flist_sort' => true, # true, make file list columns clickable to sort the list
'flist_h_fixed' => false, # true, make file list header and footer fixed(may not work in all browsers)
//Actions Restrictions
'disable_actions' => false, # Disable all file actions
'disable_deleting' => false, # Disable deleting in all file actions(except delete)
'disable_delete' => false,
'disable_rename' => false,
'disable_mass_rename' => true,
'disable_mass_email' => true,
'disable_email' => false,
'disable_ftp' => false,
'disable_upload' => false,
'disable_merge' => false,
'disable_split' => false,
'disable_archive_compression' => false, #true=Only allow 0% ratio compression in tar, zip and rar
'disable_tar' => false,
'disable_zip' => false,
'disable_unzip' => false,
'disable_rar' => false,
'disable_unrar' => false,
'disable_hashing' => false,
'disable_md5_change' => false,
'disable_list' => false,
//Advanced
'use_curl' => true, # true - Will use curl instead stream socket client(especially in ssl connection), disable this if filehost refuse data sended by curl. Need curl exec/extension enable in your server
'redir' => true, # true - Redirect passive method
'no_cache' => true, # true - Prohibition by Browser; otherwise allowed
'ref_check' => true, # true - Disallow downloads from external referers. In some hosts this check may give false positives, disable if it doesn't let you download.
'2gb_fix' => true, # true - Try to list files bigger than 2gb on 32 bit o.s.
'forbidden_filetypes' => array('.htaccess', '.htpasswd', '.php', '.php3', '.php4', '.php5', '.phtml', '.asp', '.aspx', '.cgi'), # Enter the forbidden filetypes in the given way
'forbidden_filetypes_block' => false, # false - rename forbidden_filetypes, true - completely block them
'rename_these_filetypes_to' => '.xxx', # If forbidden_filetypes_block = false then rename those filetypes to this
'check_these_before_unzipping' => true, # true - Don't allow extraction/creation of these filetypes from file actions
'fgc' => 0
);
/*Default Options End*/
?>
<html>
<head>
<title>RAPIDLEECH V2.2</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style type="text/css">
<!--
@import url("../images/style.css");
-->
</style>
</head>
<body>
<center>
<img src="../images/logo_pm.gif" alt="RAPIDLEECH V2.2" />
<h1>403: RapidLeech -> Forbidden</h1>
<hr />
You have reached this page in error, please use
your back button to return to RapidLeech.
</center>
</body>
</html>
<?php
////////////////////////////////////////////////////////////////////////////////
//Rapidleech setup file
//
//If you need to do rapidleech setup again:
// To load default config: delete 'configs/config.php'
// To work on your old config: rename 'configs/config.php' to 'configs/config_old.php'
// After that, go to your rapidleech url to access setup
//
////////////////////////////////////////////////////////////////////////////////

$PHP_SELF = $_SERVER['SCRIPT_NAME'];
if (!defined('RAPIDLEECH')) define('RAPIDLEECH', 'yes');
if (!defined('CONFIG_DIR')) define('CONFIG_DIR', 'configs/');

//Default options file
require_once(CONFIG_DIR.'default.php');
//Exit setup if config file exists and is complete
if (is_file(CONFIG_DIR.'config.php')) {
	require_once(CONFIG_DIR.'config.php');
	if (count($options) == count($default_options)) {
		unset($default_options);
		return;
	}
}

// Avoid setup page to be cached
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate ("D, d M Y H:i:s") . 'GMT');
header('Cache-Control: max-age=0, no-store, no-cache, must-revalidate, proxy-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');

define('TEMPLATE_DIR', 'templates/plugmod/');
//$options['default_language'] = "en";
require_once('classes/other.php');

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Rapidleech Setup</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link title="Rapidleech Style" href="<?php echo TEMPLATE_DIR; ?>styles/rl_style_pm.css?<?php echo time(); ?>" rel="stylesheet" type="text/css" />
<?php

if (!isset($_POST['setup_save'])) {
	function js_special_chars($t) {
		return str_replace(array('\\', "'", '"', '&', "\n", "\r", "\t", chr(8), chr(12)), array("\\", "\\'", "\\\"", "\&", '\\n', "\\r", "\\t", "\\b", "\\f"), $t);
	}
?>
<script src="classes/js.js?<?php echo time(); ?>" type="text/javascript"></script>
<script type="text/javascript">
/* <![CDATA[ */
function load_current_config() {
<?php
$options = array();

$old_options = true;
if (is_file(CONFIG_DIR.'config.php')) include(CONFIG_DIR.'config.php');
elseif (is_file(CONFIG_DIR.'config_old.php')) include(CONFIG_DIR.'config_old.php');
else $old_options = false;

foreach ($default_options as $k => $v) if (!array_key_exists($k, $options)) $options[$k] = $v;
?>
	var options = jQuery.parseJSON(<?php echo json_encode(json_encode($options)); ?>);
	var default_options = jQuery.parseJSON(<?php echo json_encode(json_encode($default_options)); ?>);

	$.each(options, function(k, v){
		if (jQuery.type(default_options[k]) === 'object') { return; }
		if (jQuery.type(default_options[k]) === 'array') {
			$('#opt_'+k+'').val(v);
		} else if (jQuery.type(default_options[k]) === 'boolean') {
			$('#opt_'+k+'').prop('checked', v ? true : false);
		} else if (jQuery.type(default_options[k]) === 'number') {
			set_element_val('opt_'+ k, k === 'delete_delay' ? (v, Math.floor(v/60)) : v);
		} else {
			set_element_val('opt_'+ k, v);
		}
	});
	while ($('#opt_login_table tbody>tr').size() < <?php echo count($options['users']); ?>) { $("#opt_login_add").click(); }
	while ($('#opt_login_table tbody>tr').size() > <?php echo max(1, count($options['users'])); ?>) { $('#opt_login_table tbody>tr:last').remove(); }

	var i = 0;
	$.each(options['users'], function(u, p){
		$('#opt_login_table [name="users[]"]').eq(i).val(u);
		$('#opt_login_table [name="passwords[]"]').eq(i).val(p);
		i++;
	});

	if ($('#opt_forbidden_filetypes_block').prop('checked')) { $('#opt_rename_these_filetypes_to_0').hide(); }
	else { $('#opt_rename_these_filetypes_to_0').show(); }
	if ($('#opt_login').prop('checked')) { $('#opt_login_0').show(); }
	else { $('#opt_login_0').hide(); }
	if ($('#opt_new_window').prop('checked')) { $('#opt_new_window_0').show(); }
	else { $('#opt_new_window_0').hide(); }
}

function set_element_val(id, value, display) {
	display = (typeof display == 'undefined') ? value : display;
	var e = $('#'+id);
	e.val(value); if (e.val() != value) { e.append($('<option><\/option>').val(value).html(display)); e.val(value); }
}

function save_config() {
	document.setup_form.submit();
}

$(document).ready(function() {
	$("#save").prop('disabled', false);
	$("#reset").prop('disabled', false);
	$('#save').click(function() { save_config(); });
	$('#reset').click(function() { load_current_config(); });

	$('div.div_title').append('&nbsp;v');
	$('div.div_title').click(function() {
		var t =  $(this).parent().children('div:not(.div_title)');
		if (t.is(':visible')) { t.hide(); $(this).text($(this).text().slice(0, - 1)+'>'); }
		else { t.show(); $(this).text($(this).text().slice(0, -1)+'v'); }
	});
	$('#div_main_advanced').click();

	$('#opt_disable_actions').click(function() {
		if ($(this).prop('checked')) $('#opt_actions_table :checkbox:not(#opt_disable_deleting)').each(function() { $(this).prop('checked', true); });
		else $('#opt_actions_table :checkbox:not(#opt_disable_deleting)').prop('checked', false);
	});
	$('#opt_disable_deleting').click(function() {
		if ($(this).prop('checked')) $('#opt_disable_delete').prop('checked', true);
		else $('#opt_disable_delete').prop('checked', false);
	});
	$("#opt_forbidden_filetypes_block").click(function() { $('#opt_rename_these_filetypes_to_0').toggle(); } );
	$("#opt_new_window").click(function() { $('#opt_new_window_0').toggle(); } );
	$("#opt_login").click(function() { $('#opt_login_0').toggle(); } );
	$("#opt_login_add").click(function() {
		var row = $('#opt_login_table tbody>tr:last').clone(true).insertAfter('#opt_login_table tbody>tr:last');
		$('td:eq(0)', row).html('<input type="button" value="Remove" onclick="$(this).parent().parent().remove();" />');
		$('td:eq(1)>input,td:eq(2)>input', row).val('');
		return false;
	});

	$('#opt_delete_delay').change(function() {
		if ($(this).val() == 'other') {
			var other = parseInt(prompt('How many minutes?', '0'), 10) || 0;
			set_element_val('opt_delete_delay', other*60, other);
		}
	});
	$('#opt_file_size_limit').change(function() {
		if ($(this).val() == 'other') {
			var other = parseInt(prompt('How many MiBs?', '0'), 10) || 0;
			set_element_val('opt_file_size_limit', other);
		}
	});

	load_current_config();
});
/* ]]> */
</script>
<?php
}
?>
<style type="text/css">
<!--
#opt_actions_table table td { padding-right: 15px; text-align: left; }
#opt_presentation_table table td { padding-right: 10px; text-align: left; }
#opt_advanced_table table td { min-width: 80px; text-align: left; }
#opt_login_table thead td { padding-bottom: 5px; }
#opt_login_table td { text-align: center; }
.div_error {
	font-weight: bold; font-size: large; text-align: center; color:#FF0000;
}
.div_opt {
	text-align: left;
	padding-bottom: 5px;
}
.table_cat {
	min-width: 300px;
}
.table_opt {
	width: 100%;
}
.div_main {
	text-align: center;
	border: 1px white ridge;
	padding: 5px;
	margin-top:5px;
}
.div_message {
	color: #FFB000;
	font-weight: bold;
	font-size: larger;
	text-align: center;
	margin: 10px;
}
.div_setup {
	color: #FF7700;
	font-weight: bold;
	font-size: large;
	text-align: center;
}
.div_title {
	color: #FFB000;
	font-size: larger;
	font-weight: bold;
	margin-bottom: 5px;
}
-->
</style>
</head>
<body>
<center><img src="<?php echo TEMPLATE_DIR; ?>images/logo_pm.gif" alt="RapidLeech PlugMod" border="0" /></center>
<br />
<noscript><div class="div_error">This page won't work without JavaScript, please enable JavaScript and refresh the page.</div></noscript>
<?php

if (isset($_POST['setup_save']) && $_POST['setup_save'] == 1) {
	$options = array();
	foreach ($default_options as $k => $v) if (!array_key_exists($k, $options)) $options[$k] = $v;

	foreach($default_options as $k => $v) {
		if (is_array($default_options[$k])) continue;
		if (is_bool($default_options[$k])) $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? true : false);
		elseif (is_numeric($default_options[$k])) $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? floor($_POST['opt_'.$k]) : 0);
		else $options[$k] = (isset($_POST['opt_'.$k]) && $_POST['opt_'.$k] ? stripslashes($_POST['opt_'.$k]) : '');
	}

	$tmp = (isset($_POST['opt_forbidden_filetypes']) ? stripslashes($_POST['opt_forbidden_filetypes']) : '');
	$tmp = array_filter(array_map('trim', explode(',', $tmp)), 'strlen');
	$options['forbidden_filetypes'] = $tmp;

	$options['users'] = array();
	if (isset($_POST['users']) && isset($_POST['passwords']) && is_array($_POST['users']) && is_array($_POST['passwords']) && count($_POST['users']) > 0 && count($_POST['users']) == count($_POST['passwords'])) {
		foreach (array_intersect_key($_POST['users'], $_POST['passwords']) as $k => $u) {
			if (($u = stripslashes($u)) == '') continue;
			$p = stripslashes($_POST['passwords'][$k]);
			$options['users'][$u] = $p;
		}
	} else echo 'There was a problem with users and passwords<br /><br />';

	// Secretkey checks
	if (empty($options['secretkey'])) {
		// secure_rand() function from: http://www.zimuel.it/en/strong-cryptography-in-php/
		function secure_rand($length) {
			if (function_exists('openssl_random_pseudo_bytes')) {
				$rnd = openssl_random_pseudo_bytes($length, $strong);
				if ($strong === TRUE) return $rnd;
			}
			$sha = $rnd = '';
			if (file_exists('/dev/urandom')) {
				$fp = fopen('/dev/urandom', 'rb');
				if ($fp) {
					if (function_exists('stream_set_read_buffer')) stream_set_read_buffer($fp, 0);
					$sha = fread($fp, $length);
					fclose($fp);
				}
			}
			for ($i = 0; $i < $length; $i++) {
				$sha = hash('sha256', $sha.mt_rand(), true);
				$rnd .= $sha[mt_rand(0, 31)];
			}
			return $rnd;
		}
		$options['secretkey'] = base64_encode(secure_rand(42));
	} elseif (strlen($options['secretkey']) > 56) $options['secretkey'] = base64_encode(sha1($options['secretkey']));

	$opt = var_export($options, true);
	$opt = (strpos($opt, "\r\n") === false ? str_replace(array("\r", "\n"), "\r\n", $opt) : $opt);
	$opt = "<?php\r\nif (!defined('RAPIDLEECH')) {\r\n\trequire_once('index.html');\r\n\texit;\r\n}\r\n\r\n\$options = $opt; \r\n\r\nrequire_once('site_checker.php');\r\nrequire_once('accounts.php');\r\n\r\n\$secretkey =& \$options['secretkey'];\r\n?>";
	if (!@write_file(CONFIG_DIR."config.php", $opt, 1)) echo '<div class="div_error">It was not possible to write the configuration<br />Set permissions of "configs" folder to 0777 and try again</div>';
	else {
		if (is_file(CONFIG_DIR.'config_old.php')) { if (@!unlink(CONFIG_DIR.'config_old.php') && is_file(CONFIG_DIR.'config_old.php')) { '<div class="div_message">It was not possible to delete the old configuration.<br />Manually delete "configs/config_old.php"</div><br />'; } }
		echo '<div class="div_message">Configuration saved! Click <a href="'.$PHP_SELF.'">here</a> to continue to rapidleech</div>';
	}
} else {
?>
<div class="div_setup">Rapidleech Setup</div>

<div class="div_message"><?php echo ($old_options ? 'Old' : 'Default'); ?> rapidleech options loaded</div>

<form method="post" enctype="multipart/form-data" name="setup_form" action="<?php echo $PHP_SELF; ?>">
<table align="center" class="table_cat">
	<tr><td>

		<div class="div_main">
			<div class="div_title">General Options</div>
			<div class="div_opt">
				<table class="table_opt">
					<tr><td>Secret key for cookie encryption<br />Make up a random one to protect your premium cookies (max length: 56)</td><td><input type="text" value="" size="56" id="opt_secretkey" name="opt_secretkey" /></td></tr>
					<tr><td>Download Directory</td><td><input type="text" id="opt_download_dir" name="opt_download_dir" /></td></tr>
					<tr><td>Allow users to change<br />download directory</td><td><input type="checkbox" value="1" name="opt_download_dir_is_changeable" id="opt_download_dir_is_changeable" /></td></tr>
					<tr><td>Auto Delete in minutes</td>
						<td><select size="1" name="opt_delete_delay" id="opt_delete_delay">
							<option value="0">Disabled</option>
							<option value="3600">60</option>
							<option value="7200">120</option>
							<option value="10800">180</option>
							<option value="14400">240</option>
							<option value="18000">300</option>
							<option value="other">Other</option>
						</select></td>
					</tr>
					<tr><td>File name prefix</td><td><input type="text" id="opt_rename_prefix" name="opt_rename_prefix" /></td></tr>
					<tr><td>File name suffix</td><td><input type="text" id="opt_rename_suffix" name="opt_rename_suffix" /></td></tr>
					<tr><td>Replace spaces for<br />underscore in file names</td><td><input type="checkbox" value="1" name="opt_rename_underscore" id="opt_rename_underscore" /></td></tr>
					<tr><td>Bandwidth saving</td><td><input type="checkbox" value="1" name="opt_bw_save" id="opt_bw_save" /></td></tr>
					<tr><td>File size limit in MiB</td>
						<td><select size="1" name="opt_file_size_limit" id="opt_file_size_limit">
							<option value="0">Disabled</option>
							<option value="100">100</option>
							<option value="200">200</option>
							<option value="500">500</option>
							<option value="700">700</option>
							<option value="1000">1000</option>
							<option value="other">Other</option>
						</select></td>
					</tr>
					<tr><td>Disable auto download feature</td><td><input type="checkbox" value="1" name="opt_auto_download_disable" id="opt_auto_download_disable" /></td></tr>
					<tr><td>Disable auto upload feature</td><td><input type="checkbox" value="1" name="opt_auto_upload_disable" id="opt_auto_upload_disable" /></td></tr>
					<tr><td>Disable notes feature</td><td><input type="checkbox" value="1" name="opt_notes_disable" id="opt_notes_disable" /></td></tr>
					<tr><td>Disable *.upload.html creation</td><td><input type="checkbox" value="1" name="opt_upload_html_disable" id="opt_upload_html_disable" /></td></tr>
					<tr><td>Disable myuploads.txt creation</td><td><input type="checkbox" value="1" name="opt_myuploads_disable" id="opt_myuploads_disable" /></td></tr>
				</table>
			</div>
		</div>

	</td></tr>
</table><table align="center" class="table_cat">
	<tr><td>

		<div class="div_main">
			<div class="div_title">Authorization mode</div>
			<div class="div_opt">
				<input type="checkbox" value="1" name="opt_login" id="opt_login" /> Enable <b>Authorization mode</b>
				<div style="text-align: left;" id="opt_login_0">
					<table id="opt_login_table" class="table_opt">
					<thead>
						<tr><td><input id="opt_login_add" type="button" value="Add user" /></td><td><b>User</b></td><td><b>Password</b></td></tr>
					</thead><tbody>
						<tr><td>&nbsp;</td><td><input type="text" name="users[]" size="14" /></td><td><input type="text" name="passwords[]" size="14" /></td></tr>
					</tbody></table>
				</div>
			</div>
		</div>

	</td></tr>
</table><table align="center" class="table_cat">
	<tr><td>

		<div class="div_main">
			<div class="div_title">Presentation Options</div>
			<div class="div_opt" id="opt_presentation_table">
				<table class="table_opt"><tr>
					<td style="vertical-align: top;">
						<table>
							<tr><td>Template</td>
								<td><select size="1" name="opt_template_used" id="opt_template_used">
<?php
$d = dir('templates/');
while (false !== ($f = $d->read())) {
	if (!is_dir('templates/'.$f) || $f == '.' || $f == '..') continue;
	echo "\t\t\t\t\t\t\t\t\t<option value='$f'>$f</option>";
}
$d->close();
?>
								</select></td>
							</tr>
							<tr><td>Language</td>
								<td><select size="1" name="opt_default_language" id="opt_default_language">
<?php
$d = dir('languages/');
while (false !== ($f = $d->read())) {
	if (substr($f, -4) != '.php') continue;
	echo "\t\t\t\t\t\t\t\t\t<option value='".substr($f, 0, -4)."'>".substr($f, 0, -4).'</option>';
}
$d->close();
?>
								</select></td>
							</tr>
						</table>
					</td>
					<td style="vertical-align: top;">
						<table>
							<tr><td>Show all files, not<br />only downloaded</td><td><input type="checkbox" value="1" name="opt_show_all" id="opt_show_all" /></td></tr>
							<tr><td>Auto Refresh Server Info</td><td><input type="checkbox" value="1" name="opt_ajax_refresh" id="opt_ajax_refresh" /></td></tr>
							<tr><td>CPU, Memory &amp; Time Info</td><td><input type="checkbox" value="1" name="opt_server_info" id="opt_server_info" /></td></tr>
						</table>
					</td>
				</tr><tr>
					<td style="vertical-align: top;" colspan="2">&nbsp;</td>
				</tr><tr>
					<td style="vertical-align: top;">
						<table>
							<tr><td>Make file list sortable</td><td><input type="checkbox" value="1" name="opt_flist_sort" id="opt_flist_sort" /></td></tr>
							<tr><td>Fixed file list header<br />(May not work in all browsers)</td><td><input type="checkbox" value="1" name="opt_flist_h_fixed" id="opt_flist_h_fixed" /></td></tr>
						</table>
					</td>
					<td style="vertical-align: top;">
						<table>
							<tr><td>Transload files in a new window</td><td><input type="checkbox" value="1" name="opt_new_window" id="opt_new_window" /></td></tr>
							<tr id="opt_new_window_0"><td>Use javascript window</td><td><input type="checkbox" value="1" name="opt_new_window_js" id="opt_new_window_js" /></td></tr>
						</table>
					</td>
					<td style="vertical-align: top;">&nbsp;</td>
				</tr></table>
			</div>
		</div>

	</td></tr>
</table><table align="center" class="table_cat">
	<tr><td>

		<div class="div_main">
			<div class="div_title">File Actions Restrictions</div>
			<div class="div_opt" id="opt_actions_table">
				<table class="table_opt">
					<tr><td>Disable all actions</td><td><input type="checkbox" value="1" name="opt_disable_actions" id="opt_disable_actions" /></td></tr>
					<tr><td>Disable deleting on all actions(except delete)</td><td><input type="checkbox" value="1" name="opt_disable_deleting" id="opt_disable_deleting" /></td></tr>
					<tr><td>&nbsp;</td><td>&nbsp;</td></tr>
					<tr>
						<td style="vertical-align: top;"><table>
							<tr><td>Disable delete action</td><td><input type="checkbox" value="1" name="opt_disable_delete" id="opt_disable_delete" /></td></tr>
							<tr><td>Disable rename action</td><td><input type="checkbox" value="1" name="opt_disable_rename" id="opt_disable_rename" /></td></tr>
							<tr><td>Disable massive rename</td><td><input type="checkbox" value="1" name="opt_disable_mass_rename" id="opt_disable_mass_rename" /></td></tr>
							<tr><td>Disable massive email</td><td><input type="checkbox" value="1" name="opt_disable_mass_email" id="opt_disable_mass_email" /></td></tr>
							<tr><td>Disable email</td><td><input type="checkbox" value="1" name="opt_disable_email" id="opt_disable_email" /></td></tr>
							<tr><td>Disable FTP</td><td><input type="checkbox" value="1" name="opt_disable_ftp" id="opt_disable_ftp" /></td></tr>
							<tr><td>Disable upload</td><td><input type="checkbox" value="1" name="opt_disable_upload" id="opt_disable_upload" /></td></tr>
						</table></td>
						<td style="vertical-align: top;"><table>
							<tr><td>Disable merge</td><td><input type="checkbox" value="1" name="opt_disable_merge" id="opt_disable_merge" /></td></tr>
							<tr><td>Disable split</td><td><input type="checkbox" value="1" name="opt_disable_split" id="opt_disable_split" /></td></tr>
							<tr><td>Disable md5 change</td><td><input type="checkbox" value="1" name="opt_disable_md5_change" id="opt_disable_md5_change" /></td></tr>
							<tr><td>Disable hashing</td><td><input type="checkbox" value="1" name="opt_disable_hashing" id="opt_disable_hashing" /></td></tr>
							<tr><td>Disable list</td><td><input type="checkbox" value="1" name="opt_disable_list" id="opt_disable_list" /></td></tr>
						</table></td>
						<td style="vertical-align: top;"><table>
							<tr><td>Disable compression<br />(tar, zip, rar)</td><td><input type="checkbox" value="1" name="opt_disable_archive_compression" id="opt_disable_archive_compression" /></td></tr>
							<tr><td>Disable tar</td><td><input type="checkbox" value="1" name="opt_disable_tar" id="opt_disable_tar" /></td></tr>
							<tr><td>Disable zip</td><td><input type="checkbox" value="1" name="opt_disable_zip" id="opt_disable_zip" /></td></tr>
							<tr><td>Disable unzip</td><td><input type="checkbox" value="1" name="opt_disable_unzip" id="opt_disable_unzip" /></td></tr>
							<tr><td>Disable rar</td><td><input type="checkbox" value="1" name="opt_disable_rar" id="opt_disable_rar" /></td></tr>
							<tr><td>Disable unrar</td><td><input type="checkbox" value="1" name="opt_disable_unrar" id="opt_disable_unrar" /></td></tr>
						</table></td>
					</tr>
				</table>
			</div>
		</div>
	</td></tr>
</table><table align="center" class="table_cat">
	<tr><td>
		<div class="div_main">
			<div class="div_title" id="div_main_advanced">Advanced Options</div>
			<div class="div_opt" id="opt_advanced_table">
				<div style="text-align: center; padding-bottom: 10px;">(You don't need to change these unless you know what you are doing)</div>
				<table class="table_opt">
					<tr><td>Prefer use of cURL on plugins</td><td><input type="checkbox" value="1" name="opt_use_curl" id="opt_use_curl" /></td></tr>
					<tr><td>Redirect passive method</td><td><input type="checkbox" value="1" name="opt_redir" id="opt_redir" /></td></tr>
					<tr><td>No cache</td><td><input type="checkbox" value="1" name="opt_no_cache" id="opt_no_cache" /></td></tr>
					<tr><td>Disallow downloads from external referers</td><td><input type="checkbox" value="1" name="opt_ref_check" id="opt_ref_check" /></td></tr>
					<tr><td>Try to list files bigger than 2gb<br />(32 bit o.s.)</td><td><input type="checkbox" value="1" name="opt_2gb_fix" id="opt_2gb_fix" /></td></tr>
					<tr><td colspan="2" style="text-align: center;">Forbidden file types</td></tr>
					<tr><td colspan="2" style="text-align: center;"><input size="50" type="text" id="opt_forbidden_filetypes" name="opt_forbidden_filetypes" /></td></tr>
					<tr><td>Block download of forbidden file types</td><td><input type="checkbox" value="1" name="opt_forbidden_filetypes_block" id="opt_forbidden_filetypes_block" /></td></tr>
					<tr id="opt_rename_these_filetypes_to_0"><td>Rename forbidden file types to</td><td><input type="text" size="8" value="" name="opt_rename_these_filetypes_to" id="opt_rename_these_filetypes_to" /></td></tr>
					<tr><td>Block forbidden file types for file actions</td><td><input type="checkbox" value="1" name="opt_check_these_before_unzipping" id="opt_check_these_before_unzipping" /></td></tr>
					<tr><td>fgc</td><td><input type="text" value="" size="2" name="opt_fgc" id="opt_fgc" /></td></tr>
				</table>
			</div>
		</div>

	</td></tr>
</table>

<table border="0" cellpadding="10" align="center">
	<tr>
		<td>
			<div style="text-align: center;">
				<input type="hidden" value="1" name="setup_save" />
				<input type="button" value="Save Configuration" id="save" name="save" disabled="disabled" />
				<input type="button" value="Reset" id="reset" name="reset" disabled="disabled" />
			</div>
		</td>
	</tr>
</table>
</form>
<?php
}

exit("</body>\r\n</html>"); ?>
<?php
if (!defined('RAPIDLEECH')) { require_once('ndex.html'); exit; }

$sites = array();
### Here is a list of checkable links ###
// Only update here if needed so we can synchronize it with templates

$sites['Rapidshare.com'] = array(); // RS is checked in ajax.php (But we need this for show the name in linkchecker)
$sites['Share-Online.biz'] = array(); // This too ^^
$sites['Mediafire.com'] = array();
$sites['Filefactory.com'] = array('link' => '^http://(www\.)?filefactory\.com/file/\w+/?', 'regex' => '(download link)|(temporarily limited)', 'szregex' => "([\d|\.]+)\s+(\w{1,5}) file uploaded");
$sites['Hotfile.com'] = array('link' => '^http://(www\.)?hotfile\.com/dl/(\d+/\w+)/', 'regex' => '(Downloading:)|("arrow_down")', 'szregex' => '\|</span> <strong>([\d|\.]+)\s+(\w{1,5})');
$sites['ADrive.com'] = array('link' => '^http://(www\.)?adrive\.com/public/\w+\.html', 'regex' => '\/public\/view\/');
$sites['Depositfiles.com'] = array('link' => '^http://(www\.)?depositfiles\.com/([a-z]{2}/)?files/', 'regex' => 'File name:', 'szregex' => 'File size: <b>([\d|\.]+)(?:\s|(?:&nbsp;))+(\w{1,5})', 'pattern' => '@(com/files/)|(com/[a-z]{2}/files/)@i', 'replace' => 'com/en/files/', 'options' => array('cookie' => 'lang_current=en'));
$sites['Crocko.com'] = array('link' => '^http://((w\d+\.)|(www\.))?((easy-share)|(crocko))\.com/\d+(\.html)?', 'regex' => 'Download:', 'szregex' => 'class="tip1"><span class="inner">([\d|\.]+)\s+(\w{1,5})<', 'pattern' => '@((w\d+\.)|(www\.))?easy-share\.com@i', 'replace' => '${3}crocko.com');
$sites['Uploading.com'] = array('link' => '^http://(www\.)?uploading\.com/files/\w+/?', 'regex' => 'class="file_size">([\d|\.]+)\s+(\w{1,5})</', 'szregex' => true, 'options' => array('cookie' => 'lang=1'));
$sites['ZShare.net'] = array('link' => '^http://(www\.)?zshare\.net/(download|audio|video)/\w+/?', 'regex' => '(File Size: )|(/delete\.html\?)', 'szregex' => '(?:(?:Video)|(?:File)) Size: <font color="#\w{6}">([\d|\.]+)\s*(\w{1,5})<', 'options' => array('fixsize' => true));
$sites['Netload.in'] = array('link' => '^http://(www\.)?netload\.in/datei\w+((\.htm)|(/))?', 'regex' => '(download_load)|(dl_first_file_download)', 'szregex' => 'style="color: #\w{6};">, ([\d|\.]+)\s+(\w{1,5})<', 'pattern' => '@\.in/(datei\w+)/.*@i', 'replace' => '.in/${1}.htm');
$sites['Uploaded.to'] = array('link' => '^http://(www\.)?((uploaded\.to)|(ul\.to))/\w+', 'regex' => 'Download file:', 'szregex' => '\(([\d|\.|\,]+)\s+(\w{1,5})\) - uploaded\.to</title>');
$sites['UploadStation.com'] = array('link' => '^http://(www\.)?uploadstation\.com/file/\w+', 'regex' => 'Upload date:', 'szregex' => 'File size: <b>([\d|\.]+)\s+(\w{1,5})<');
$sites['Letitbit.net'] = array('link' => '^http://(www\.)?letitbit\.net/download/[^/]+/.+\.html', 'regex' => 'file_info_sssize=(\d+);', 'szregex' => true, 'options' => array('bytes' => true));
$sites['Turbobit.net'] = array('link' => '^http://(www\.)?turbobit\.net/\w+((\.html)|(/.+\.html))', 'regex' => 'Download file:', 'szregex' => '</span>\t+\(([\d|\.|\,]+)\s+(\w{1,5})\)', 'options' => array('cookie' => 'user_lang=en'));
$sites['2shared.com'] = array('link' => '^http://(www\.)?2shared\.com/[a-z]+/\w+/.+\.html?', 'regex' => '(File size:)|(Please enter password)|(Loading image)', 'szregex' => '(?:(?:File size:</span>\r?\n\s+)|(?:Loading image\s+\())([\d|\.|\,]+)\s+(\w{1,5})');
$sites['4shared.com'] = array('link' => '^http://(www\.)?4shared\.com/[^/]+/\w+/.+\.html?', 'regex' => '(<h1 class=\"fileName[\s|\"])|(Please enter a password)', 'szregex' => '</a>[\r\n\s\t]*([\d|\.|\,]+)\s+(\w{1,5})\s*\|', 'pattern' => '@4shared\.com/get/@i', 'replace' => '4shared.com/file/', 'options' => array('cookie' => '4langcookie=en', 'fixsize' => true, 'fixsizeP' => ','));
$sites['Badongo.com'] = array('link' => '^http://(www\.)?badongo\.com/([a-z]{2}/)?((file)|(vid))/\d+', 'regex' => "'((file)|(vid))_fileinfo'", 'szregex' => 'class="ffileinfo">[^\|]+\|[^:|<]+:\s+([\d|\.|\,]+)\s+(\w{1,5})<', 'options' => array('cookie' => 'badongoL=en'));
$sites['Oron.com'] = array('link' => "^http://(www\.)?oron\.com/\w+", 'regex' => "Filename:", 'szregex' => 'File size: ([\d|\.|\,]+)\s+(\w{1,5})<', 'options' => array('cookie' => 'lang=english'));
$sites['Shareflare.net'] = array('link' => "^http://(www\.)?shareflare\.net/download/[^/]+/.+\.html?", 'regex' => 'file_info_sssize=\d+;', 'szregex' => 'file_info_sssize=(\d+);', 'options' => array('bytes' => true));
$sites['Bitshare.com'] = array('link' => "^http://(www\.)?bitshare\.com/((files/)|(\?f=))\w+(/.+(\.html)?)?", 'regex' => 'class="download"', 'szregex' => ' - ([\d|\.|\,]+)\s+(\w{1,2})\w{3}</h1>');
$sites['Enterupload.com'] = array('link' => "^http://(www\.)?enterupload\.com/\w+(/.+(\.html)?)?", 'regex' => "File size:", 'szregex' => 'File size:\s+([\d|\.|\,]+)\s+(\w{1,5})', 'pattern' => '@/$@');

?>
<?php

require_once('rl_init.php');

// Access denied page
include(TEMPLATE_DIR.'header.php');
echo('<div align="center"><h1>'.lang(1).'</h1><p>'.lang(2).'</p></div>');
include(TEMPLATE_DIR.'footer.php');

?>
order deny,allow
Options None
ForceType application/octet-stream
ErrorDocument 403 "<html><head><title>403 Forbidden</title><meta http-equiv='refresh' content='0;URL=../deny.php' /></head><body><h1>403 Forbidden</h1></body></html>"

<IfModule mod_rewrite.c>
	RewriteEngine off
</IfModule>

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files ~ "\.upload.html$">
allow from all
ForceType text/html
</files>

<files ~ "^\.">
deny from all
</files>
order deny,allow
deny from all
<?php
if (!defined('RAPIDLEECH')) {
	require('../deny.php');
	exit;
}

class DownloadClass {
	/*
	 * Prints the initial form for displaying messages
	 * @return void
	 */

	public function __construct($echo = true) {
		if (!$echo) return;
		echo('<table width="600" align="center">');
		echo('<tr>');
		echo('<td align="center">');
		echo('<div id="mesg" width="100%" align="center">' . lang(300) . '</div>');
	}

	/*
	 * You can use this function to retrieve pages without parsing the link
	 * @param string $link -> The link of the page to retrieve
	 * @param string $cookie -> The cookie value if you need
	 * @param array $post -> Array name=>value of the post data
	 * @param string $referer -> The referer of the page, it might be the value you are missing if you can't get plugin to work
	 * @param string $auth -> Page authentication, unneeded in most circumstances
	 */

	public function GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0) {
		if (!$referer && !empty($GLOBALS['Referer'])) {
			$referer = $GLOBALS['Referer'];
		}
		$cURL = $GLOBALS['options']['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
		$Url = parse_url(trim($link));
		if (strtolower($Url['scheme']) == 'https') {
			$chttps = false;
			if ($cURL) {
				$cV = curl_version();
				if (in_array('https', $cV['protocols'], true)) $chttps = true;
			}
			if (!extension_loaded('openssl') && !$chttps) html_error('You need to install/enable PHP\'s OpenSSL extension to support HTTPS connections.');
			elseif (!$chttps) $cURL = false;
		}

		if ($cURL) {
			if ($XMLRequest) $referer .= "\r\nX-Requested-With: XMLHttpRequest";
			$page = cURL($link, $cookie, $post, $referer, $auth);
		} else {
			global $pauth;
			$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
			is_page($page);
		}
		return $page;
	}

	/*
	 * Use this function instead of insert_location so that we can improve this feature in the future
	 * @param string $link -> The download link of the file
	 * @param string $FileName -> The name of the file
	 * @param string $cookie -> The cookie value
	 * @param array $post -> The post value will be serialized here
	 * @param string $referer -> The page that refered to this link
	 * @param string $auth -> In format username:password
	 * @param array $params -> This parameter allows you to add extra _GET values to be passed on
	 */

	public function RedirectDownload($link, $FileName = 0, $cookie = 0, $post = 0, $referer = 0, $force_name = 0, $auth = 0, $addon = array()) {
		if (!$referer && !empty($GLOBALS['Referer'])) {
			$referer = $GLOBALS['Referer'];
		}
		$url = parse_url($link);
		$params = $this->DefaultParamArr($link, $cookie, $referer, true);
		unset($params['premium_acc']);
		$params['filename'] = urlencode((!empty($FileName) ? basename($FileName) : urldecode(basename(parse_url($link, PHP_URL_PATH)))));
		if (!empty($force_name)) $params['force_name'] = urlencode(basename($force_name));
		$params['host'] = urlencode($url['host']);
		if (!empty($url['port'])) $params['port'] = urlencode($url['port']);
		$params['path'] = urlencode($url['path'] . (!empty($url['query']) ? '?' . $url['query'] : ''));
		if (!empty($post)) $params['post'] = urlencode(encrypt(serialize($post)));
		if (!empty($auth)) $params['auth'] = ($auth == '1' ? '1' : urlencode(encrypt(base64_encode($auth))));
		if (!empty($addon)) {
			if (!is_array($addon)) html_error('Plugin problem! Please report, error: "The parameter passed must be an array"'); // Some problems with the plugin, quit it
			foreach ($addon as $name => $value) $params[$name] = (is_array($value) ? urlencode(serialize($value)) : urlencode($value));
		}
		insert_location($params);
	}

	/*
	 * Use this function to move your multiples links array to auto downloader
	 * @param array $link_array -> Normal array containing all download links
	 */

	public function moveToAutoDownloader($link_array) {
		if (empty($link_array) || !is_array($link_array) || count($link_array) == 0) html_error('Error getting links from folder.');

		if (!is_file('audl.php') || !empty($GLOBALS['options']['auto_download_disable'])) html_error('audl.php not found or you have disable auto download feature!');

		$pos = strrpos($_SERVER['SCRIPT_NAME'], '/');
		$audlpath = ($pos !== false) ? substr($_SERVER['SCRIPT_NAME'], 0, $pos + 1).'audl.php?GO=GO' : 'audl.php?GO=GO';
		$inputs = GetDefaultParams();
		$inputs['links'] = implode("\r\n", $link_array);

		$key_array = array('premium_acc', 'premium_user', 'premium_pass', 'cookieuse', 'cookie');
		foreach ($key_array as $v) if (!empty($_GET[$v])) $inputs[$v] = urlencode($_GET[$v]);
		insert_location($inputs, $audlpath);
		exit();
	}

	public function CountDown($countDown) {
		if ($countDown <= 0) return;
		insert_timer($countDown, 'Waiting link timelock.', '', true);
	}

	/*
	 * Use this function to create Captcha display form
	 * @param string $captchaImg -> The link of the captcha image or downloaded captcha image on server
	 * @param array $inputs -> Key Value pairs for html form input elements ( these elements will be hidden form elements )
	 * @param string $captchaSize -> The size of captcha text box
	 * @param string $sname -> The text of submit button
	 * @param string $sname -> The name of captcha text field
	 */

	public function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5', $sname = 'Enter Captcha', $iname = 'captcha') {
		echo "\n<form name='captcha' action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
		foreach ($inputs as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
		echo "\t<h4>" . lang(301) . " <img alt='CAPTCHA Image' src='$captchaImg' /> " . lang(302) . ": <input id='captcha' type='text' name='$iname' size='$captchaSize' />&nbsp;&nbsp;\n\t\t<input type='submit' onclick='return check();' value='$sname' />\n\t</h4>\n\t<script type='text/javascript'>/* <![CDATA[ */\n\t\tfunction check() {\n\t\t\tvar captcha=document.getElementById('captcha').value;\n\t\t\tif (captcha == '') {\n\t\t\t\twindow.alert('You didn\'t enter the image verification code');\n\t\t\t\treturn false;\n\t\t\t} else return true;\n\t\t}\n\t/* ]]> */</script>\n</form>\n";
		include(TEMPLATE_DIR.'footer.php');
		exit();
	}

	/*
	 * This function will return an array with the Default Key Value pairs including proxy, method, email, etc.
	 * @param string $link -> Adds the link value to the array url encoded if you need it.
	 * @param string $cookie -> Adds the cookie value to the array url encoded if you need it.
	 * @param string $referer -> Adds the referer value to the array url encoded if you need it. If isn't set, it will load $Referer value. (Set as 0 or false for not add it in the array.)
	 */

	public function DefaultParamArr($link = 0, $cookie = 0, $referer = 1, $encrypt = 0) {
		if ($referer === 1 || $referer === true) {
			global $Referer;
			$referer = $Referer;
		}
		if (!empty($cookie)) {
			if (is_array($cookie)) $cookie = CookiesToStr($cookie);
			if ($encrypt) $cookie = encrypt($cookie);
		}

		$DParam = GetDefaultParams();
		if (!empty($link)) $DParam['link'] = $link;
		if (!empty($cookie)) {
			$DParam['cookie'] = urlencode($cookie);
			if ($encrypt) $DParam['cookie_encrypted'] = 1;
		}
		if (!empty($referer)) $DParam['referer'] = $referer;
		return $DParam;
	}

	/* Use this function for filehost longer timelock
	 * Param int $secs -> The number of seconds to count down
	 * Param array $post -> Variable array to include as POST so you dont need to start over the process
	 * Param $string $text -> Default text you want to display when counting down
	 */

	public function JSCountdown($secs, $post = 0, $text = '', $stop = 1, $onFinish = '') {
		if (empty($text)) $text = 'Waiting link timelock';
		if (empty($onFinish)) $onFinish = (empty($post) ? 'location.reload();' : 'document.forms.js_timer.submit();');
		echo "<p><center><span id='jsTimer_1' class='htmlerror'><b>ERROR: Please enable JavaScript. (Countdown)</b></span><br /><span id='jsTimer_2'>Please wait</span></center></p>\n";
		echo "<form action='{$_SERVER['SCRIPT_NAME']}' name='js_timer' method='POST'>\n";
		if (!empty($post) && is_array($post)) foreach ($post as $name => $input) echo "<input type='hidden' name='$name' id='C_$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
		echo "<script type='text/javascript'>/* <![CDATA[ */\nvar jsTimer=".intval($secs).";var text='".htmlspecialchars($text, ENT_QUOTES)."';var c2=0;var dl=document.getElementById('jsTimer_1');var a2=document.getElementById('jsTimer_2');fc();fc2();function fc(){if(jsTimer>0){if(jsTimer>120)dl.innerHTML=text+'. Please wait <b>'+Math.round(jsTimer/60)+'</b> minutes...';else dl.innerHTML=text+'. Please wait <b>'+jsTimer+'</b> seconds...';jsTimer--;setTimeout('fc()',1000)}else{dl.style.display='none';$onFinish}}function fc2(){if(jsTimer>120){if(c2<=20){a2.innerHTML=a2.innerHTML+'.';c2++}else{c2=10;a2.innerHTML=''}setTimeout('fc2()',100)}else{dl2.style.display='none'}}\n/* ]]> */</script></form><br />";
		if ($stop) {
			include(TEMPLATE_DIR.'footer.php');
			exit();
		}
	}

	public function changeMesg($mesg, $add=false) {
		echo("\n<script type='text/javascript'>document.getElementById('mesg').innerHTML = " . ($add ? "document.getElementById('mesg').innerHTML + " : '') . "unescape('" . rawurlencode($mesg) . "');</script>");
	}

	public function json2array($content, $errorPrefix = 'Error') {
		if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
		if (empty($content)) html_error("[$errorPrefix]: No content.");
		$content = ltrim($content);
		if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
		$cb_pos = strpos($content, '{');
		$sb_pos = strpos($content, '[');
		if ($cb_pos === false && $sb_pos === false) html_error("[$errorPrefix]: JSON start braces not found.");
		$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
		$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
		if (empty($content)) html_error("[$errorPrefix]: No JSON content.");
		$rply = json_decode($content, true);
		if ($rply === NULL) html_error("[$errorPrefix]: Error reading JSON.");
		return $rply;
	}

	public function reCAPTCHA($publicKey, $inputs, $referer = 0, $sname = 'Download File') {
		if (empty($publicKey) || preg_match('/[^\w\.\-]/', $publicKey)) html_error('Invalid reCAPTCHA PublicKey Format.');
		if (!is_array($inputs)) html_error('Error parsing captcha post data.');

		$cookie = array('PREF' => 'LD=en');
		// Check for a global recaptcha key
		$page = $this->GetPage('http://www.google.com/recaptcha/api/challenge?k=' . $publicKey, $cookie, 0, 'http://fakedomain.tld/fakepath');
		if (substr($page, 9, 3) != '200') html_error('Invalid or Deleted reCAPTCHA PublicKey.');
		$inputs['recaptcha_public_key'] = $publicKey; // This may be needed later.

		if (strpos($page, 'Invalid referer') === false && strpos($page, 'An internal error occurred') === false) {
			// Embed captcha
			echo "<script language='JavaScript'>var RecaptchaOptions = {theme:'red', lang:'en'};</script>\n\n<center><form name='recaptcha' action='{$_SERVER['SCRIPT_NAME']}' method='POST'><br />\n";
			foreach ($inputs as $name => $input) echo "<input type='hidden' name='$name' id='C_$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
			echo "<script type='text/javascript' src='//www.google.com/recaptcha/api/challenge?k=$publicKey'></script><noscript><iframe src='//www.google.com/recaptcha/api/noscript?k=$publicKey' height='300' width='500' frameborder='0'></iframe><br /><textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br /><input type='submit' name='submit' onclick='javascript:return checkc();' value='$sname' />\n<script type='text/javascript'>/*<![CDATA[*/\nfunction checkc(){\nvar capt=document.getElementById('recaptcha_response_field');\nif (capt.value == '') { window.alert('You didn\'t enter the image verification code.'); return false; }\nelse { return true; }\n}\n/*]]>*/</script>\n</form></center>\n";
			include(TEMPLATE_DIR.'footer.php');
		} else {
			// Download captcha
			$page = $this->GetPage('http://www.google.com/recaptcha/api/challenge?k=' . $publicKey, $cookie, 0, $referer);
			if (strpos($page, 'Invalid referer') !== false) html_error('Error getting reCAPTCHA challenge: Bad referer');
			if (strpos($page, 'An internal error occurred') !== false) html_error('Error getting reCAPTCHA challenge: Possible reCAPTCHA v2 or bad referer');

			if (!preg_match('@[\{,\s]challenge\s*:\s*[\'\"]([\w\.\-]+)[\'\"]@', $page, $challenge)) html_error('Error getting reCAPTCHA challenge.');
			$inputs['recaptcha_challenge_field'] = $challenge = $challenge[1];

			list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage('http://www.google.com/recaptcha/api/image?c=' . $challenge, 0, 0, $referer), 2);
			if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
			$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpeg');

			$this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $inputs, 20, $sname, 'recaptcha_response_field');
		}
		exit;
	}

	public function SolveMedia($publicKey, $data, $referer = 0, $sname = 'Download File') {
		if (!is_array($data)) html_error('Post needs to be sended in a array.');
		if (empty($publicKey) || preg_match('@[^\w\-\.]@', $publicKey)) html_error('[SM] Invalid value for $publicKey');
		$page = $this->GetPage("http://api.solvemedia.com/papi/challenge.noscript?k=$publicKey", 0, 0, $referer);
		is_present($page, 'domain / ckey mismatch', '[SM] Error getting CAPTCHA challenge: Bad referer.');
		if (!preg_match('@<img [^/<>]*src\s?=\s?\"((https?://[^/\"<>]+)?/papi/media[^\"<>]+)\"@i', $page, $imgurl)) html_error('[SM] CAPTCHA img not found.');
		$imgurl = (empty($imgurl[2])) ? 'http://api.solvemedia.com'.$imgurl[1] : $imgurl[1];

		if (!preg_match_all('@<input [^/|<|>]*type\s?=\s?\"?hidden\"?[^/<>]*\s?name\s?=\s?\"(\w+)\"[^/<>]*\s?value\s?=\s?\"([^\"<>]+)\"[^/<>]*/?\s*>@i', $page, $forms)) html_error('[SM] CAPTCHA data not found.');
		$forms = array_combine($forms[1], $forms[2]);
		foreach ($forms as $n => $v) $data["_smc[$n]"] = urlencode($v);
		$data['sm_public_key'] = $publicKey; // Required for verifySolveMedia()

		//Download captcha img.
		list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($imgurl), 2);
		if (substr($headers, 9, 3) != '200') html_error('[SM] Error downloading CAPTCHA img.');
		$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/gif');

		$this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20, $sname, 'adcopy_response');
		exit;
	}

	public function verifySolveMedia($directOutput = false, $retryMethod = 'retrySolveMedia') {
		if (empty($_POST['adcopy_response'])) html_error('[SM] You didn\'t enter the image verification code.');
		if (empty($_POST['_smc']) || !is_array($_POST['_smc'])) html_error('[SM] CAPTCHA data invalid.');
		$post = array();
		foreach ($_POST['_smc'] as $n => $v) $post[urlencode($n)] = $v;
		$post['adcopy_response'] = urlencode($_POST['adcopy_response']);
		$publicKey = $_POST['sm_public_key'];

		$link = 'http://api.solvemedia.com/papi/verify.noscript';
		$page = $this->GetPage($link, 0, $post, 'http://api.solvemedia.com/papi/challenge.noscript?k=' . urlencode($publicKey));

		if (!preg_match('@(https?://[^/\'\"<>\r\n]+)?/papi/verify\.pass\.noscript\?[^/\'\"<>\r\n]+@i', $page, $resp)) {
			if (stripos($page, '/papi/challenge.noscript') !== false) {
				$retryCallback = array($this, $retryMethod);
				if (is_callable($retryCallback)) {
					echo '<span class="htmlerror"><b>[SM] Wrong CAPTCHA entered.</b></span><br /><br />';
					return call_user_func($retryCallback);
				} else html_error('[SM] Wrong CAPTCHA entered.');
			}
			html_error('Error sending CAPTCHA.');
		}
		$resp = (empty($resp[1])) ? 'http://api.solvemedia.com'.$resp[0] : $resp[0];

		$page = $this->GetPage($resp, 0, 0, $link);
		if (!preg_match('@>\s*([^<>\s]+)\s*</textarea>@i', $page, $gibberish)) html_error('[SM] CAPTCHA response not found.');

		if ($directOutput) return urlencode($gibberish[1]);
		else return array('adcopy_challenge' => urlencode($gibberish[1]), 'adcopy_response' => 'manual_challenge');
	}

	public function reCAPTCHAv2($publicKey, $inputs, $referer = 0, $sname = 'Download File') {
		// RC2 no longer works due to security enhancements
		html_error('reCAPTCHA2 is no longer supported');
	}

	public function verifyReCaptchav2($directOutput = false, $retryMethod = 'retryReCaptchav2') {
		// RC2 no longer works due to security enhancements
		html_error('reCAPTCHA2 is no longer supported');
	}
}

/**********************************************************
  Added support of force_name in RedirectDownload function by Raj Malhotra on 02 May 2010
  Fixed  EnterCaptcha function ( Re-Write )  by Raj Malhotra on 16 May 2010
  Added auto-encryption system (szal) 14 June 2010
  Added GetPage support function for https connection by Th3-822 21 April 2011
  Added GetPage support function for xml request by vdhdevil 9 July 2011
  Tweaked DefaultParamArr code by Th3-822 22 July 2011
  Moved JSCountdown function for future use by Th3-822
  Add CheckBack function to test correctly download link by vdhdevil
  Remove declaration of checkback function, it automatically signed in the plugin itself
  Add new limitation options by Ruud v.Tony
 **********************************************************/
order deny,allow
deny from all
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class d1fichier_com extends DownloadClass {
	private $lpass, $page, $cookie = array('LG' => 'en'), $pA;
	public function Download($link) {
		$this->LnkRegexp = '@https?://(?:www\.)?((?:1fichier|alterupload|desfichiers|dfichiers|pjointe|tenvoi|dl4free)\.com|(?:cjoint|piecejointe)\.net|mesfichiers\.org|megadl\.fr)/\?([\w\-]+)@i';

		$link = explode('|', str_ireplace('%7C', '|', $link), 2);
		if (count($link) > 1) $this->lpass = rawurldecode($link[1]);

		$link = preg_replace('@//([\w\-]{4,})\.((?:1fichier|alterupload|desfichiers|dfichiers|pjointe|tenvoi|dl4free)\.com|(?:cjoint|piecejointe)\.net|mesfichiers\.org|megadl\.fr)/[^\r\n\t\'\"<>]*$@i', '//$2/?$1', $link[0]); // Let's support old links by now

		$link = parse_url($link);
		$link['scheme'] = 'https';
		$link = rebuild_url($link);

		if (!preg_match($this->LnkRegexp, $link, $fid)) html_error('Invalid link?.');
		$this->domain = $fid[1];
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->fid = $fid[2];

		$this->DLRegexp = '@https?://\w+-\w+\.((?:1fichier|alterupload|desfichiers|dfichiers|pjointe|tenvoi|dl4free)\.com|(?:cjoint|piecejointe)\.net|mesfichiers\.org|megadl\.fr)/(?:\w+'.preg_quote($this->fid).'|\w\d+)(/[^\s\'\"<>]*)?@i';

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			is_present($this->page, 'The requested file has been deleted because was not downloaded within', 'File was Removed by Inactivity.');
			is_present($this->page, 'The requested file has been deleted following an abuse request', 'File was Removed due to Abuse.');
			is_present($this->page, 'The requested file could not be found', 'File not Found.');
			$this->CheckPass($this->page);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);

			if (preg_match($this->DLRegexp, $this->page, $dl)) return $this->RedirectDownload($dl[0], (empty($dl[2]) ? 'T8_1f_d1' : urldecode(parse_url($dl[0], PHP_URL_PATH))));
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['1fichier_com']['user']) && !empty($GLOBALS['premium_acc']['1fichier_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['1fichier_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['1fichier_com']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->Login($user, $pass);
		} else return $this->FreeDL();
	}

	private function FreeDL($waited = 0) {
		$post = (empty($this->lpass) ? array('submit' => 'Download') : array('pass' => urlencode($this->lpass)));
		$post['adz'] = cut_str($this->page, 'name="adz" value="', '"');

		$page = $this->GetPage($this->link, $this->cookie, $post);
		is_present($page, 'you can only download one file at a time');
		$this->cookie = GetCookiesArr($page, $this->cookie);

		is_present($page, 'The link your requested is expired','The download link is expired, please try again.');
		
		if (preg_match($this->DLRegexp, $page, $dl)) return $this->RedirectDownload($dl[0], (empty($dl[2]) ? ($waited ? 'T8_1f_f1' : 'T8_1f_f2') : urldecode(parse_url($dl[0], PHP_URL_PATH))));

		if (preg_match('@\(\'\.clock\'\),\s*(\d+)\s*\*\s*60,\s*{\s*clockFace:@i', $page, $cD) && $cD[1] > 0) {
			if ($cD[1] > 1) {
				$data = $this->DefaultParamArr($this->link . (!empty($this->lpass) ? "|{$this->lpass}" : ''));
				return $this->JSCountdown($cD[1] * 60, $data);
			} else $this->CountDown($cD[1] * 60);
		} else $this->CheckPass($page, true);

		if ($waited > 1) html_error('Too many countdown retries, check concurrent downloads.');
		return $this->FreeDL($waited + 1);
	}

	private function PremiumDL() {
		$page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		is_present($page, 'Premium status should not be used on professional services. Use download credits.'); // IP Ban?
		if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download-Link Not Found.');

		return $this->RedirectDownload($dl[0], (empty($dl[2]) ? 'T8_1f_pr' : urldecode(parse_url($dl[0], PHP_URL_PATH))));
	}

	private function Login($user, $pass) {
		$purl = 'https://'.$this->domain.'/';

		$post = array();
		$post['mail'] = urlencode($user);
		$post['pass'] = urlencode($pass);
		$post['lt'] = 'on';
		$post['restrict'] = 'on';
		$post['valider'] = 'Send';

		$page = $this->GetPage($purl.'login.pl', $this->cookie, $post, $purl);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		is_present($page, 'Invalid email address');
		is_present($page, 'Invalid username or password', 'Login Failed: Email/Password incorrect.');

		$page = $this->GetPage($purl, $this->cookie, 0, $purl.'login.pl');
		is_notpresent($page, 'logout.pl">Logout', 'Login Error.');
		if (stripos($page, 'https://img.1fichier.com/icons/etoile.png') === false) {
			$this->changeMesg(lang(300).'<br /><b>Account isn\\\'t premium</b><br />Using it as member.');
			$this->page = $this->GetPage($this->link, $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			return $this->FreeDL();
		}

		return $this->PremiumDL();
	}

	// As some users doesn't have support por https downloads, let's switch to http
	public function RedirectDownload($link, $FileName = 0, $cookie = 0, $post = 0, $referer = 0, $force_name = 0, $auth = 0, $addon = array()) {
		$link = parse_url($link);
		$link['scheme'] = 'http';
		$link = rebuild_url($link);
		return parent::RedirectDownload($link, $FileName, $cookie, $post, $referer, $force_name, $auth, $addon);
	}

	private function CheckPass($page, $dl = false) {
		if (stripos($page, 'The owner of this file has chosen to protect access with a password.') !== false || stripos($page, 'warn">Bad password<') !== false) {
			if (empty($this->lpass)) html_error('File is password protected, please send the password in this format: link|pass');
			else if ($dl) html_error('The link\'s password you have sent is not valid.');
		}
	}
}

//[08-4-2014] Written by Th3-822.
//[18-4-2014] Fixed Link Regexp. - Th3-822
//[17-12-2014] Un-tested fixes for changes at the site. - Th3-822
//[14-10-2018] fixed countdown and form data. - miyuru
//[31-8-2021] Added link password support (FreeDL only at the moment). - Th3-822
<?php
if (!defined('RAPIDLEECH')) {
	require_once("index.html");
	exit;
}

class d2shared_com extends DownloadClass {
	public function Download($link) {
		$page = $this->GetPage($link);
		is_present($page, "file link that you requested is not valid", "The file link that you requested is not valid. Please contact link publisher or try to make a search");
		is_present($page, "File download limit has been exceeded.", "Free download limit has been exceeded. Try again later.");
		$cookie = GetCookies($page);

		if (isset($_GET ["step"]) && $_GET ["step"] == "1") {
			$post = Array();
			$post["userPass2"] = $_POST['userPass2'];
			$cookie = urldecode($_POST['cookie']);
			$page = $this->GetPage($link, $cookie, $post, $link);
			is_present($page, "enter password to access this file", "The password you have entered is not valid.");
		} elseif (stristr($page, 'enter password to access this file')) {
			global $PHP_SELF;
			$data = $this->DefaultParamArr($link, $cookie);
			$data['step'] = 1;
			echo "\n<form name='dl_password' action='$PHP_SELF' method='post'>\n";
			foreach ($data as $name => $value) echo "<input type='hidden' name='$name' id='$name' value='$input' />\n";
			echo "<h4>Enter password here: <input type='text' name='userPass2' id='filepass' size='13' />&nbsp;&nbsp;<input type='submit' onclick='return check()' value='Download File' /></h4>\n";
			echo "<script language='JavaScript'>\nfunction check() {\nvar pass=document.getElementById('filepass');\nif (pass.value == '') { window.alert('You didn\'t enter the password'); return false; }\nelse { return true; }\n}\n</script>\n";
			echo "</form>\n</body>\n</html>";
			exit;
		}

		$this->getCountDown($page);

		// Retrieve download link
		if (preg_match('/dc(\d+)\.2shared\.com\/download\/([^\'\"<>\r\n]+)/i', $page, $L)) {
			$dllink = "http://dc" . $L[1] . ".2shared.com/download/" . $L[2];
		} elseif (preg_match('@pageDownload\d/retrieveLink\.jsp\?id=[\w\-\.]+@i', $page, $RD)) {
			$page = $this->GetPage('http://www.2shared.com/'.$RD[0], $cookie, 0, $link);
			if (!preg_match('@https?://dc\d+\.2shared\.com/download/[^\'\"<>\s]+@i', $page, $L)) html_error("Download-link not found [2].");
			$dllink = $L[0];
		} else html_error("Download-link not found.");

		$this->RedirectDownload($dllink, urldecode(basename(parse_url($dllink, PHP_URL_PATH))), $cookie);
	}

	private function getCountDown($page) {
		if (preg_match('/var c = ([0-9])*;/', $page, $count)) {
			$countDown = $count[1];
			$this->CountDown($countDown);
		}
	}

	public function CheckBack($headers) {
		is_present($headers, '?errorMaxSessions=', 'User downloading session limit is reached. Please try again in few minutes.');
		//is_present($headers, '?cau2=403tNull', 'Download link has expired.');
		if (stristr($headers, '?cau2=403tNull')) {
			global $PHP_SELF;
			echo "<center><form action='$PHP_SELF' method='POST'>\n";
			$post = $this->DefaultParamArr(cut_str($headers, 'Location: ', '?cau2='));
			foreach ($post as $name => $input) echo "<input type='hidden' name='$name' id='$name' value='$input' />\n";
			echo "<input type='submit' value='Download Again' />\n";
			echo "</form></center><br />";
			html_error('Download link has expired.');
		}
	}
}

/********************************************************
Fixed by Raj Malhotra on 10 April 2010 => Fix Reloading to main page when link does not exists.

Fixed by Th3-822 on 30 October 2010 => Fixed & Added support for password protected files.
Fixed by Th3-822 on 25 December 2010 => Fixed: 2shared changed it's system (Again... Now shows dlink in same page)
Fixed by Th3-822 on 06 March 2011 => Changed regex for new dlink format & Added error msg for download limit.
Fixed by Th3-822 on 16 June 2012 => Fixed $FileName code.
Fixed by Th3-822 on 04 October 2014 => Fixed download of image files.
*********************************************************/
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class d4shared_com extends DownloadClass {
	private $page, $cookie, $pA, $DL_regexp, $noTrafficFreeDl;
	public $link;
	public function Download($link) {
		global $premium_acc;
		$this->DL_regexp = '@https?://dc\d+\.4shared\.com/download/[^/\"\'\s<>]+/(?:tsid[^/\"\'\s<>]+/)?[^/\"\'\s<>]+@i';
		$this->cookie = array('4langcookie' => 'en');
		$this->noTrafficFreeDl = true; // Set to true to switch to free download when premium traffic used is over the limit.

		$this->link = str_ireplace('.com/get/', '.com/file/', $link);
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);
		is_present($this->page, 'The file link that you requested is not valid.');
		is_present($this->page, 'The file is suspected of illegal or copyrighted content.');
		is_present($this->page, 'This file is no longer available because it\'s identical to file banned because of claim.'); // MD5 banned

		if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['4shared_com']['user']) && !empty($premium_acc['4shared_com']['pass'])))) {
			$this->pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false);
			return $this->login();
		} else return $this->FreeDownload();
	}

	private function FreeDownload() {
		$this->CheckForPass();

		// Direct link downloadable without login or countdown...
		if (preg_match($this->DL_regexp, $this->page, $DL)) {
			if (preg_match('/[\?&]dirPwdVerified=(\w+)/i', $this->link, $pwd)) $DL[0] .= '&dirPwdVerified='.$pwd[1];
			return $this->RedirectDownload($DL[0], urldecode(basename(parse_url($DL[0], PHP_URL_PATH))), $this->cookie);
		}

		if (!preg_match('@\.com/[^/]+/([^/]+)/?(.*)@i', $this->link, $L)) html_error('Invalid link?');
		$getLink = "http://www.4shared.com/get/{$L[1]}/{$L[2]}";
		$page = $this->GetPage("http://www.4shared.com/get/{$L[1]}/{$L[2]}", $this->cookie);
		$GLOBALS['Referer'] = $getLink;

		if (!preg_match($this->DL_regexp, $page, $DL)) html_error('Download-link not found.');
		$this->cookie = GetCookiesArr($page, $this->cookie);
		$dllink = $DL[0];
		if (preg_match('/[\?&]dirPwdVerified=(\w+)/i', $this->link, $pwd)) $dllink .= '&dirPwdVerified='.$pwd[1];

		if (!preg_match('@id="secondsLeft"[\s\t]+value="(\d+)"@i', $page, $count) && !preg_match('@id="downloadDelayTimeSec"[^<>/]*>(\d+)<@i', $page, $count)) html_error('Timer not found.');

		$FileName = urldecode(basename(parse_url($dllink, PHP_URL_PATH)));
		if ($count[1] <= 120) $this->CountDown($count[1]);
		else {
			$data = $this->DefaultParamArr($dllink, encrypt($this->cookie));
			$data['filename'] = urlencode($FileName);
			$data['host'] = $url['host'];
			$data['port'] = $url['port'];
			$data['path'] = urlencode($url['path'] . ($url['query'] ? '?' . $url['query'] : ''));
			$data['saveto'] = $_GET['path'];
			$this->JSCountdown($count[1], $data);
		}

		$this->RedirectDownload($dllink, $FileName, $this->cookie);
	}

	private function CheckForPass($predl=false) {
		global $PHP_SELF;
		if (isset($_GET['step']) && $_GET['step'] == '1') {
			$post = array();
			$post['userPass2'] = $_POST['userPass2'];
			$post['dsid'] = trim($_POST['dsid']);
			$this->page = $this->GetPage($this->link, $this->cookie, $post, $this->link);
			is_present($this->page, 'Please enter a password to access this file', 'The password you have entered is not valid.');
		} elseif (stristr($this->page, 'Please enter a password to access this file')) {
			echo "\n<center><form name='dl_password' action='$PHP_SELF' method='POST'>\n";
			$data = $this->DefaultParamArr($this->link);
			$data['step'] = 1;
			$data['dsid'] = cut_str($this->page, 'name="dsid" value="', '"');
			foreach ($data as $name => $val) echo "<input type='hidden' name='$name' id='$name' value='$val' />\n";
			if ($predl) echo '<br /><input type="checkbox" name="premium_acc" id="premium_acc" onclick="javascript:var displ=this.checked?\'\':\'none\';document.getElementById(\'premiumblock\').style.display=displ;" '.(!$this->pA?'checked="checked"':'').' />&nbsp;'.lang(249).'<br /><div id="premiumblock" style="display: none;"><br /><table width="150" border="0"><tr><td>'.lang(250).':&nbsp;</td><td><input type="text" name="premium_user" id="premium_user" size="15" value="" /></td></tr><tr><td>'.lang(251).':&nbsp;</td><td><input type="password" name="premium_pass" id="premium_pass" size="15" value="" /></td></tr></table></div><br />';
			echo '<h4>Enter password here: <input type="text" name="userPass2" id="filepass" size="13" />&nbsp;&nbsp;<input type="submit" onclick="return check()" value="Download File" /></h4>' . "\n";
			echo "<script type='text/javascript'>\nfunction check() {\nvar pass=document.getElementById('filepass');\nif (pass.value == '') { window.alert('You didn\'t enter the password'); return false; }\nelse { return true; }\n}\n</script>\n";
			echo "\n</form></center>\n</body>\n</html>";
			exit;
		}
		$this->cookie = GetCookiesArr($this->page, $this->cookie, true, array('','deleted','""'));
	}

	private function PremiumDownload() {
		$page = $this->GetPage($this->link, $this->cookie);
		$this->CheckForPass(true);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		if (stripos($page, "\nContent-Length: 0\n") !== false) is_notpresent($page, "\nLocation: ", 'Error: Direct link not found.');
		if (!preg_match($this->DL_regexp, $page, $DL)) html_error('Error: Download link not found.');
		$dllink = $DL[0];
		if (preg_match('/[\?&]dirPwdVerified=(\w+)/i', $this->link, $pwd)) $dllink .= '&dirPwdVerified='.$pwd[1];

		$FileName = urldecode(basename(parse_url($dllink, PHP_URL_PATH)));
		$this->RedirectDownload($dllink, $FileName, $this->cookie);
	}

	private function login() {
		global $premium_acc;
		$email = ($this->pA ? $_REQUEST['premium_user'] : $premium_acc['4shared_com']['user']);
		$pass = ($this->pA ? $_REQUEST['premium_pass'] : $premium_acc['4shared_com']['pass']);
		if (empty($email) || empty($pass)) html_error('Login Failed: EMail or Password is empty. Please check login data.');

		$postURL = 'http://www.4shared.com/web/login';
		$post['login'] = urlencode($email);
		$post['password'] = urlencode($pass);
		$post['remember'] = 'false';
		$post['doNotRedirect'] = 'true';
		$page = $this->GetPage($postURL, $this->cookie, $post, $postURL);

		is_present($page, 'Invalid e-mail address or password', 'Login Failed: Invalid Username/Email or Password.');
		if (stripos($page, '"ok":false') !== false) {
			if ($err=cut_str($page, '"rejectReason":"', '"')) html_error("Login Failed: 4S says: '$err'.");
			else html_error('Login Failed.');
		}
		$this->cookie = GetCookiesArr($page, $this->cookie, true, array('','deleted','""'));
		if (empty($this->cookie['Login'])) html_error('Login Error: Cannot find session cookie.');
		$this->cookie['WWW_JSESSIONID'] = $this->cookie['JSESSIONID'];

		$this->GetPage('http://www.4shared.com/web/user/language', $this->cookie, array('code' => 'en'), 0, 0, 1);

		// Chk Acc.
		$page = $this->GetPage('http://www.4shared.com/account/home.jsp', $this->cookie);
		if (substr($page, 9, 3) != '200') html_error('Login Error.');
		$this->cookie = GetCookiesArr($page, $this->cookie, true, array('','deleted','""'));

		$quota = cut_str($page, 'Premium Traffic:</div>', '</div>');
		$Mesg = lang(300);

		if (empty($quota) || !preg_match('@>([\d|\.]+)\s?(%|(?:\wB)) of ([\d|\.]+)\s?(\wB)@i', $quota, $qm)) {
			$Mesg .= "<br /><b>Account isn't premium?</b><br />Using it as member.";
			$this->changeMesg($Mesg);

			$this->page = $this->GetPage($this->link, $this->cookie);
			return $this->FreeDownload();
		}

		$used = floatval($qm[1]);
		$total = floatval($qm[3]);

		// I have to check the BW... I will show it too :)
		$Mesg .= "<br />4S Premium Download<br />Bandwidth: $used {$qm[2]} of $total {$qm[4]}.";
		$this->changeMesg($Mesg);
		if ($qm[2] != '%' && $total != 100) $used = ($used * 100)/$total;
		if ($used >= 95) {
			if ($this->noTrafficFreeDl) {
				$Mesg .= "<br /><b>Bandwidth limit trigered: $used% - Limit: 95%</b><br />Switching to FreeDL.";
				$this->changeMesg($Mesg);
				$this->page = $this->GetPage($this->link, $this->cookie);
				$this->cookie = GetCookiesArr($page, $this->cookie);
				return $this->FreeDownload();
			}
			html_error("Bandwidth limit trigered: Bandwidth: $used% - Limit: 95%");
		}

		return $this->PremiumDownload();
	}

	public function CheckBack($header) {
		is_present($header, 'cau2=dow-lim', '[4S] The download limit has been reached.');
		is_present($header, 'cau2=0759nousr', '[4S] You need to be logged in for download this file.');
	}
}

//[21-Nov-2010] Rewritten by Th3-822 & Using some code from the 2shared plugin.
//[26-Jan-2011] Fixed cookies for download pass-protected files. - Th3-822
//[02-Apr-2011] Fixed error when downloading pass-protected files & Added 1 Error Msg. - Th3-822
//[07-May-2011] Some edits to the plugin && Added Premium download support. - Th3-822
//[25-Jul-2011] Using a function for longer link timelock at free download ( I should add it to DownloadClass. :D ). -Th3-822
//[12-Sep-2011] Fixed regex for get BW usage in Premium && Password in files can be skiped with '?dirPwdVerified=xxxxxxxx' in the url. -Th3-822
//[15-Oct-2011] JSCountdown was added in DownloadClass.php... Removed declaration from plugin. - Th3-822
//[21-Nov-2011] Fixed regexp for get dlink in FreeDL. - Th3-822
//[23-Mar-2012] Added support for member (its needed for some links) & some changes & small fixes. - Th3-822
//[18-Apr-2012] Fixed login needed msg, direct download link regexp (freedl) && removed 2 error msgs from login function. - Th3-822
//[01-Aug-2012] Fixed for changes at 4S. - Th3-822
//[20-Feb-2014] Fixed Login/FreeDL. - Th3-822
//[10-Sep-2016] Fixed FreeDL of Direct-Link Files. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class d4sync_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@(https?://www\.4sync\.com)/file/([\w\-\.]+)/@i', preg_replace('@://(?:[\w\-]+\.)*4sync\.com/\w+/@i', '://www.4sync.com/file/', $link, 1), $fid)) html_error('Invalid link?.'); // [^/\"\'\s<>?]+
		$link = $GLOBALS['Referer'] = $fid[0];
		$fid = empty($fid[3]) ? $fid[2] : $fid[3];

		$DL_regexp = '@https?://dc\d+\.4sync\.com/download/[^/\"\'\s<>]+/[^/\"\'\s<>]+@i';
		$cookie = array('4langcookie' => 'en');

		$page = $this->GetPage($link, $cookie);
		if (!preg_match($DL_regexp, $page, $DL)) html_error('Download-Link Not Found.');

		return $this->RedirectDownload($DL[0], '4sync_placeholder');
	}
}

// [21-1-2017] Written by Th3-822
<?php
/*
@h@	/hosts/download/GenericXFS_DL.php

@h@	 GenericXFS_DL (alpha)
@h@	Written by Th3-822.
*/
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class GenericXFS_DL extends DownloadClass {
	protected $page, $cookie, $baseCookie = array('lang' => 'english'), $scheme, $wwwDomain, $domain, $port, $host, $purl, $httpsOnly = false, $sslLogin = false, $cname = 'xfss', $cookieSave = false, $cJar = array(), $form, $lpass, $fid, $enableDecoders = false, $embedDL = false, $unescaper = false, $customDecoder = false, $reverseForms = true, $cErrsFDL = array(), $DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/(?:files|dl?|cgi-bin/dl\.cgi|[\da-zA-Z]{30,})/(?:[^\?\'\"\t<>\r\n\\\]{15,}|v(?:id(?:eo)?)?\.(?:flv|mp4))@i';
	private $classVer = 24;
	public $pluginVer, $pA;

	public function Download($link) {
		html_error('[GenericXFS_DL] This plugin can\'t be called directly.');
	}

	protected function onLoad() {} // Placeholder

	protected function onLoad_Post() {} // Placeholder

	protected function Start($link, $cErrs = array(), $cErrReplace = true) {
		if ($this->pluginVer > $this->classVer) html_error('GenericXFS_DL class is outdated, please install last version from: https://pastebin.com/e5TZcfQ2 ');

		$this->cookie = $this->baseCookie = empty($this->cookie) ? $this->baseCookie : array_merge($this->cookie, $this->baseCookie);
		$link = explode('|', str_ireplace('%7C', '|', $link), 2);
		if (count($link) > 1) $this->lpass = rawurldecode($link[1]);
		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/(\w{12})(?=(?:[/\.]|(?:\.html?))?)@i', str_ireplace('/embed-', '/', $link[0]), $url)) html_error('Invalid link?.');
		$this->fid = $url[1];
		$url = parse_url($url[0]);
		$url['scheme'] =  ($this->httpsOnly ? 'https' : strtolower($url['scheme']));
		$url['host'] = strtolower($url['host']);

		if ($this->wwwDomain && strpos($url['host'], 'www.') !== 0) $url['host'] = 'www.' . $url['host'];
		elseif (!$this->wwwDomain && strpos($url['host'], 'www.') === 0) $url['host'] = substr($url['host'], 4);

		$this->scheme = $url['scheme'];
		$this->domain = $url['host'];
		$this->port = (!empty($url['port']) && $url['port'] > 0 && $url['port'] < 65536) ? $url['port'] : 0;
		$this->host = $this->domain . (!empty($this->port) ? ':'.$this->port : '');
		$this->purl = $this->scheme.'://'.$this->host.'/';
		$this->link = $GLOBALS['Referer'] = rebuild_url($url);
		unset($url, $link);

		$this->enableDecoders = $this->embedDL || $this->unescaper || $this->customDecoder;

		$this->onLoad();

		if (empty($_POST['step']) || empty($_POST['captcha_type'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			if ($this->scheme != 'https') is_present($this->page, "\nLocation: https://", '[GenericXFS_DL] Please Set "$this->httpsOnly" to true or add https:// to your link.');
			if (!empty($cErrs) && is_array($cErrs)) {
				foreach ($cErrs as $cErr) {
					if (is_array($cErr)) is_present($this->page, $cErr[0], $cErr[1]);
					else is_present($this->page, $cErr);
				}
				if ($cErrReplace) {
					$this->onLoad_Post();
					return $this->Login();
				}
			}
			is_present($this->page, 'The file you were looking for could not be found');
			is_present($this->page, 'The file was removed by administrator');
			is_present($this->page, 'The file was deleted by its owner');
			is_present($this->page, 'The file was deleted by administration');
			is_present($this->page, 'No such file with this filename', 'Error: Invalid filename, check your link and try again.'); // With the regexp i removed the filename part of the link, this error shouldn't be showed
		}

		$this->onLoad_Post();
		return $this->Login();
	}

	protected function FindPost($formOp = 'download[1-3]') {
		//if (!preg_match_all('@<form(?:[\s\t][^\>]*)?\>(?:[^<]+(?!\<form)<[^<]+)*</form>@i', $this->page, $forms)) return false;
		if (!preg_match_all('@(?><form(?:\s[^\>]*)?\>)(?>.*?</form>)@is', $this->page, $forms)) return false;
		$forms = ($this->reverseForms ? array_reverse($forms[0]) : $forms[0]); // In some hosts the freedl form is before the "premium" form so $this->reverseForms must be on false on those hosts.
		$found = false;
		foreach ($forms as $form) {
			if (preg_match('@<input\s*[^>]*\sname="op"[^>]*\svalue="' . $formOp . '"@i', $form)) {
				$found = true;
				break;
			}
		}
		if (!$found) return false;

		// Remove html commented inputs.
		while ($comment = cut_str($form, '<!--', '-->')) $form = str_replace('<!--'.$comment.'-->', '', $form);

		$this->form = $form;
		unset($forms, $form, $ret);

		preg_match_all('@<input\s*[^>]*\stype="hidden"[^>]*\sname="(\w+)"[^>]*\svalue="([^"]*)"@i', $this->form, $inputs);
		$data = array_map('html_entity_decode', array_combine($inputs[1], $inputs[2]));

		if (($pos = stripos($this->form, '<textarea')) !== false && preg_match_all('@<textarea\s+(?:[^>]*\s)?name="(\w+)"[^>]*>([^<]*)</textarea>@i', substr($this->form, $pos), $inputs)) $data = array_merge($data, array_map('html_entity_decode', array_combine($inputs[1], $inputs[2])));

		if ((stripos($this->form, 'type="submit"') !== false || stripos($this->form, 'type="image"') !== false || stripos($this->form, 'type="button"') !== false || stripos($this->form, '</button>') !== false) && preg_match_all('@<(?:input\s*[^>]*\stype="(?:submit|image|button)"|button)[^>]*\sname="(\w+)"[^>]*\svalue="([^"]*)"@i', $this->form, $inputs)) {
			$data = array_merge($data, array_map('html_entity_decode', array_combine($inputs[1], $inputs[2])));
			if (!empty($data['method_free']) && !empty($data['method_premium'])) $data['method_premium'] = '';
		}

		$this->post = $data;
		return true;
	}

	// Custom page decoder placeholder
	protected function pageDecoder() {
		html_error('[GenericXFS_DL] $this->customDecoder is enabled but there is no pageDecoder() function.');
	}

	protected function runDecoders() {
		// Packed embedded video decoder
		if (!empty($this->embedDL) && preg_match_all('@eval\s*\(\s*function\s*\(p,a,c,k,e,d\)\s*\{.+\}\s*\(\s*\'([^\r|\n]*)\'\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*\'([^\']+)\'\.split\([\'|\"](.)[\'|\"]\)(?:\s*,\s*\d\s*,\s*\{\})?\)\)@', $this->page, $js)) {
			$cnt = count($js[0]);
			for ($i = 0; $i < $cnt; $i++) {
				$this->page = str_replace($js[0][$i], $this->XFSUnpacker($js[1][$i], $js[2][$i], $js[3][$i], $js[4][$i], $js[5][$i]), $this->page);
			}
		}
		// JS unescape decoder
		if (!empty($this->unescaper) && preg_match_all('@eval\s*\(unescape\s*\(\s*(\"|\')([%\da-fA-F]+)\1\s*\)\s*\)\s*;?@', $this->page, $js)) {
			$cnt = count($js[0]);
			for ($i = 0; $i < $cnt; $i++) {
				$this->page = str_replace($js[0][$i], urldecode($js[2][$i]), $this->page);
			}
		}
		// Custom decoder function
		if (!empty($this->customDecoder)) $this->pageDecoder();
	}

	// (Placeholder) Returns video title if available to use on stream video downloads.
	protected function getVideoTitle() {
		return false;
	}

	protected function getFileName($url) {
		$fname = basename(parse_url($url, PHP_URL_PATH));
		if (preg_match("@^(?:v(?:id(?:eo)?)?|{$this->fid})?\.(mp4|flv)$@i", $fname, $vExt)) { // Possible video/stream
			// Try to get original filename or title for renaming the file.
			if (!empty($this->post['fname'])) $newname = $this->post['fname'];
			else if (($title = $this->getVideoTitle())) $newname = $title;
			else $newname = false;

			// I always like to add a letter to mark it as a reconverted video stream and remove the original video .ext
			if (!empty($newname)) $fname = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', basename($newname)) . '_S.' . strtolower($vExt[1]);
		}
		return $fname;
	}

	protected function testDL() {
		if (!empty($this->enableDecoders)) $this->runDecoders();

		if (preg_match($this->DLregexp, $this->page, $DL)) {
			$this->RedirectDownload($DL[0], basename($this->getFileName($DL[0])));
			return true;
		}
		return false;
	}

	protected function XFSUnpacker($p,$a,$c,$k,$ed) {
		$k = explode($ed, $k);
		while ($c--) if ($k[$c]) $p = preg_replace('@\b'.base_convert($c, 10, $a).'\b@', $k[$c], $p);
		return $p;
	}

	protected function findCaptcha() {
		if (!empty($this->captcha)) return false;
		if (($pos = stripos($this->page, $this->scheme . '://' . $this->host . '/captchas/')) !== false && preg_match('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)?/captchas/[\w\-]+\.(?:jpe?g|png|gif)@i', substr($this->page, $pos), $gdCaptcha)) {
			// gd Captcha
			if (empty($gdCaptcha[1])) $gdCaptcha[0] = $this->scheme . '://' . $this->host . $gdCaptcha[0];
			$this->captcha = array('type' => 1, 'url' => $gdCaptcha[0]);
		} elseif (substr_count($this->form, "<span style='position:absolute;padding-left:") > 3 && preg_match_all("@<span style='[^\'>]*padding-left\s*:\s*(\d+)[^\'>]*'[^>]*>((?:&#\w+;)|(?:\d))</span>@i", $this->form, $txtCaptcha)) {
			// Text Captcha (decodeable)
			$txtCaptcha = array_combine($txtCaptcha[1], $txtCaptcha[2]);
			ksort($txtCaptcha, SORT_NUMERIC);
			$txtCaptcha = trim(html_entity_decode(implode($txtCaptcha), ENT_QUOTES, 'UTF-8'));
			$this->captcha = array('type' => 2, 'key' => $txtCaptcha);
		} elseif ((stripos($this->page, 'google.com/recaptcha/api/') !== false || stripos($this->page, 'recaptcha.net/') !== false) && preg_match('@(?:https?:)?//(?:[\w\-]+\.)?(?:google\.com/recaptcha/api|recaptcha\.net)/(?:challenge|noscript)\?k=([\w\.\-]+)@i', $this->page, $reCaptcha)) {
			// Old reCAPTCHA
			$this->captcha = array('type' => 3, 'key' => $reCaptcha[1]);
		} elseif (preg_match('@(?:https?:)?//api(?:-secure)?\.solvemedia\.com/papi/challenge\.(?:no)?script\?k=([\w\.\-]+)@i', $this->page, $smCaptcha)) {
			// SolveMedia Captcha
			$this->captcha = array('type' => 4, 'key' => $smCaptcha[1]);
		} elseif (preg_match('@(?:class|id)=["\']g-recaptcha["\']\s+data-sitekey=["\']([\w\.\-]+)["\']@i', $this->page, $reCaptcha2)) {
			// reCAPTCHA2
			$this->captcha = array('type' => 5, 'key' => $reCaptcha2[1]);
		}
		return (!empty($this->captcha));
	}

	protected function showCaptcha($step) {
		if (!empty($this->captcha)) {
			if (!empty($this->cookie[$this->cname])) {
				$data = $this->DefaultParamArr($this->link, $this->cookie, 1, 1);
				$data['cookie_encrypted'] = 1;
			} else {
				$data = $this->DefaultParamArr($this->link);
			}
			if (!empty($this->post)) foreach ($this->post as $k => $v) $data["T8gXFS[$k]"] = $v;
			$data['step'] = $step;
			$data['captcha_type'] = $this->captcha['type'];
			switch ($this->captcha['type']) {
				default: return html_error('Unknown captcha type.');
				case 1:
					list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($this->captcha['url']), 2);
					if (substr($headers, 9, 3) != '200') html_error('[1] Error downloading CAPTCHA img.');
					$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpg');
					return $this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data);
				case 2:
					$this->post['code'] = $this->captcha['key'];
					// postCaptcha won't be needed on this case.
					return true;
				case 3: return $this->reCAPTCHA($this->captcha['key'], $data);
				case 4: return $this->SolveMedia($this->captcha['key'], $data);
				case 5: return $this->reCAPTCHAv2($this->captcha['key'], $data);
			}
		}
		return false;
	}

	protected function postCaptcha(&$step) {
		if (empty($_POST['step']) || empty($_POST['captcha_type'])) return false;
		$post = (!empty($_POST['T8gXFS']) && is_array($_POST['T8gXFS']) ? array_map('urlencode', $_POST['T8gXFS']) : array());
		switch ($_POST['captcha_type']) {
			default: 
				return html_error('Invalid captcha type.');
			case '1': // Image (gd) Captcha
				$this->captcha = array('type' => 1);
				if (empty($_POST['captcha'])) html_error('[1] You didn\'t enter the image verification code.');
				$post['code'] = urlencode($_POST['captcha']);
				break;
			case '3': // Old reCAPTCHA
				$this->captcha = array('type' => 3);
				if (empty($_POST['recaptcha_response_field'])) html_error('[3] You didn\'t enter the image verification code.');
				if (empty($_POST['recaptcha_challenge_field'])) html_error('[3] Empty reCAPTCHA challenge.');
				$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
				$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
				break;
			case '4': // Solvemedia
				$this->captcha = array('type' => 4);
				$post = array_merge($post, $this->verifySolveMedia());
				break;
			case '5': // reCAPTCHA2
				$this->captcha = array('type' => 5);
				$post = array_merge($post, $this->verifyReCaptchav2());
				break;
		}
		$step = intval($_POST['step']);
		$_POST['step'] = $_POST['captcha_type'] = false;
		$this->page = $this->GetPage($this->link, $this->cookie, $post);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);
		return true;
	}

	// Finds FreeDL countdown on $this->page and calls $this->CountDown(X) for it.
	// return true if there is a countdown, false otherwise.
	protected function findCountdown() {
		if (preg_match('@<span[^>]*>(?>.*?<span\s+id=[\'"][\w\-]+[\'"][^>]*>)\s*(\d+)\s*</span>(?>.*?</span>)@sim', $this->page, $count) || preg_match('@<span[^>]*>(?>[\w\s]*?<span\s+class=[\'\"](?:[\w-]+\s+)*seconds(?:\s+\w+)*[\'\"][^>]*>)\s*(\d+)\s*</span>(?>[\w\s]*?</span>)@sim', $this->form, $count)) {
			if ($count[1] > 0) $this->CountDown($count[1] + 2);
			return true;
		}
		return false;
	}

	protected function checkCaptcha($step) {
		if (preg_match('@>\s*Wrong captcha\s*<@i', $this->page)) {
			if (empty($this->captcha)) html_error("Error: Unknown captcha. [$step]");
			else if ($this->captcha['type'] == 2) html_error("Error: Error Decoding Captcha. [$step]");
			else html_error("Error: Wrong Captcha Entered. [$step]");
		}
	}

	protected function FreeDL($step = 1) {
		if (!$this->postCaptcha($step) && $step == 1 && !empty($this->cookie[$this->cname])) {
			// Member DL: We need to reload the page with the user's cookies.
			$this->page = $this->GetPage($this->link, $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}
		if ((($pos = stripos($this->page, 'You have to wait')) !== false || ($pos = stripos($this->page, 'Please wait ')) !== false) && preg_match('@(?:You have to|Please) wait[\W\S]?(?:(?:\s*|\s*<br\s*/?\s*>\s*)?\d+ \w+,?\s){0,2}\d+ \w+(?:\s*|\s*<br\s*/?\s*>\s*)?(?:un)?till? (?:the )?next download@i', substr($this->page, $pos), $err)) html_error('Error: '.strip_tags($err[0]));
		if (($pos = stripos($this->page, 'You can download files up to ')) !== false && preg_match('@You can download files up to \d+ [KMG]b only.@i', substr($this->page, $pos), $err)) html_error('Error: '.$err[0]);
		if (($pos = stripos($this->page, 'You have reached the download')) !== false && preg_match('@You have reached the download[- ]limit(?: of|:) \d+ [KMGT]b for(?: the)? last \d+ days?@i', substr($this->page, $pos), $err)) html_error('Error: '.$err[0]);
		if ($this->testDL()) return true;
		if (!$this->FindPost()) {
			is_present($this->page, 'Downloads are disabled for your country:', 'Downloads are disabled for your server\'s country.');
			is_present($this->page, 'This server is in maintenance mode. Refresh this page in some minutes.', 'File is not available at this moment, try again later.');
			is_present($this->page, 'This file is available for Premium Users only.');
			is_present($this->page, 'This file reached max downloads limit', 'Error: This file reached max downloads limit.');
			is_present($this->page, 'Error happened when generating Download Link.', 'Error: Download server is not available at this moment, try again later.');
			if (!empty($this->cErrsFDL) && is_array($this->cErrsFDL)) {
				foreach ($this->cErrsFDL as $cErr) {
					if (is_array($cErr)) is_present($this->page, $cErr[0], $cErr[1]);
					else is_present($this->page, $cErr);
				}
			}
			return html_error('Non aceptable form found.');
		}
		if (preg_match('@>\s*Skipped countdown@i', $this->page)) html_error("Error: Skipped countdown? [$step].");
		$this->checkCaptcha($step);
		switch ($this->post['op']) {
			default: html_error('Unknown form op.');
			case 'download1':
				$fstep = 1;
				break;
			case 'download2':
				$fstep = 2;
				break;
		}
		if ($step > $fstep) html_error("Loop Detected [$fstep]");
		is_present($this->page, '>Expired session<', "Error: Expired Download Session. [$fstep]");
		$this->findCaptcha();
		$this->findCountdown();
		$this->showCaptcha($fstep);
		$this->page = $this->GetPage($this->link, $this->cookie, array_map('urlencode', $this->post));
		$this->cookie = GetCookiesArr($this->page, $this->cookie);
		return $this->FreeDL($fstep + 1);
	}

	protected function PremiumDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		if (($pos = stripos($this->page, 'You have reached the download')) !== false && preg_match('@You have reached the download[- ]limit(?: of|:) \d+ [TGMK]b for(?: the)? last \d+ days?@i', substr($this->page, $pos), $err)) html_error('Error: '.$err[0]);

		if (!$this->testDL()) {
			if (!$this->FindPost()) {
				is_present($this->page, 'Downloads are disabled for your country:', 'Downloads are disabled for your server\'s country.');
				is_present($this->page, 'This server is in maintenance mode. Refresh this page in some minutes.', 'File is not available at this moment, try again later.');
				is_present($this->page, 'Error happened when generating Download Link.', 'Error: Download server is not available at this moment, try again later.');
				html_error('[PremiumDL] Non aceptable form found.');
			}
			if (!isset($this->post['method_premium']) || $this->post['method_premium'] === '') $this->post['method_premium'] = 1;
			sleep(1); // This should avoid errors at massive usage.
			$this->page = $this->GetPage($this->link, $this->cookie, array_map('urlencode', $this->post));
			if (($pos = stripos($this->page, 'You have reached the download')) !== false && preg_match('@You have reached the download[- ]limit(?: of|:) \d+ [TGMK]b for(?: the)? last \d+ days?@i', substr($this->page, $pos), $err)) html_error('Error: '.$err[0]);
			if (!$this->testDL()) html_error('Error: Download-link not found.');
		} else return true;
	}

	// Allow Custom Login Post.
	protected function sendLogin($post) {
		$page = $this->GetPage((!empty($this->sslLogin) ? 'https://'.$this->host.'/' : $this->purl) . '?op=login', $this->cookie, $post, $this->purl);
		return $page;
	}

	protected function Login() {
		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		$pkey = str_ireplace(array('www.', '.'), array('', '_'), $this->domain);
		if (empty($_POST['cookie']) && ($_REQUEST['premium_acc'] != 'on' || (!$this->pA && (empty($GLOBALS['premium_acc'][$pkey]['user']) || empty($GLOBALS['premium_acc'][$pkey]['pass'])) && empty($GLOBALS['premium_acc'][$pkey]['cookie'])))) return $this->FreeDL();

		if (!empty($_POST['cookie']) || !empty($GLOBALS['premium_acc'][$pkey]['cookie'])) {
			if (!empty($_POST['cookie'])) {
				if (!empty($_POST['cookie_encrypted'])) {
					$_POST['cookie'] = decrypt(urldecode($_POST['cookie']));
					unset($_POST['cookie_encrypted']);
				}
				$this->cookie = StrToCookies($_POST['cookie']);
				$_POST['cookie'] = false;
			} else {
				$cookie = $GLOBALS['premium_acc'][$pkey]['cookie'];
				$this->cookie = (is_array($cookie) ? $cookie : StrToCookies($cookie));
			}
		} else {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc'][$pkey]['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc'][$pkey]['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}

			if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');
			
			if ($this->cookieSave && ($page = $this->cJar_load($user, $pass))) {
				if ($page === true) $page = $this->GetPage($this->purl.'?op=my_account', $this->cookie, 0, $this->purl);
				return $this->checkAccount($page);
			} else {
				$post = array();
				$post['op'] = 'login';
				$post['redirect'] = '';
				$post['login'] = urlencode($user);
				$post['password'] = urlencode($pass);

				$page = $this->sendLogin($post);
				if (empty($this->sslLogin) && $this->scheme != 'https') is_present($page, "\nLocation: https://", '[GenericXFS_DL] Please Set "$this->sslLogin" to true.');

				if (!$this->checkLogin($page)) html_error('Login Error: checkLogin() returned false.');
				$this->cookie = GetCookiesArr($page);
			}
		}

		if (empty($this->cookie[$this->cname])) html_error('Login Error: Cannot find session cookie.');
		$this->cookie = array_merge($this->cookie, $this->baseCookie);

		$page = $this->isLoggedIn();
		if (!$page) html_error('Login Error: isLoggedIn() returned false.');

		if ($this->cookieSave && !empty($this->cJar)) $this->cJar_save();

		if ($page === true) $page = $this->GetPage($this->purl.'?op=my_account', $this->cookie, 0, $this->purl);
		return $this->checkAccount($page);
	}

	private function cJar_encrypt($data, $key) {
		if (empty($data)) return false;
		global $secretkey;
		$_secretkey = $secretkey;
		$secretkey = $key;
		$data = base64_encode(encrypt(json_encode($data)));
		$secretkey = $_secretkey;
		return $data;
	}

	private function cJar_decrypt($data, $key) {
		if (empty($data)) return false;
		global $secretkey;
		$_secretkey = $secretkey;
		$secretkey = $key;
		$data = json_decode(decrypt(base64_decode($data)), true);
		$secretkey = $_secretkey;
		return (!empty($data) ? $data : false);
	}

	private function cJar_load($user, $pass) {
		if (empty($user) || empty($pass)) return html_error('Login Failed: User or Password is empty.');

		$user = strtolower($user);
		$this->cJar['file'] = DOWNLOAD_DIR . get_class($this) . '_dl.php';
		$this->cJar['hash'] = base64_encode(sha1("$user$pass", true));
		$this->cJar['key'] = substr(base64_encode(hash('sha512', "$user$pass", true)), 0, 56);

		if (file_exists($this->cJar['file']) && ($cFile = file($this->cJar['file'])) && is_array($cFile = unserialize($cFile[1])) && array_key_exists($this->cJar['hash'], $cFile) && ($testCookie = $this->cJar_decrypt($cFile[$this->cJar['hash']]['cookie'], $this->cJar['key']))) {
			return $this->cJar_test($testCookie);
		} else return false;
	}

	private function cJar_test($cookie) {
		if (empty($this->cJar) || empty($cookie[$this->cname])) return false;
		$oldCookie = $this->cookie;
		$this->cookie = array_merge($cookie, $this->baseCookie);

		if (!($page = $this->isLoggedIn())) {
			$this->cookie = $oldCookie;
			return false;
		}
		$this->cJar_save(); // Update last used time.
		return $page;
	}

	private function cJar_save() {
		if (empty($this->cJar)) return;
		$maxTime = 31 * 86400; // Max time to keep unused cookies saved (31 days)
		if (file_exists($this->cJar['file']) && ($savedcookies = file($this->cJar['file'])) && is_array($savedcookies = unserialize($savedcookies[1]))) {
			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= $maxTime) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$savedcookies[$this->cJar['hash']] = array('time' => time(), 'cookie' => $this->cJar_encrypt($this->cookie, $this->cJar['key']));

		file_put_contents($this->cJar['file'], "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}

	// Checks For Login Errors on $page and Calls html_error() For Them.
	// return true if there are no login errors, false otherwise.
	protected function checkLogin($page) {
		is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
		is_present($page, 'Your account was banned by administrator.', 'Login failed: Account is Banned.');
		is_present($page, 'Your IP is banned', 'Login Error: IP banned temporally for too many wrong logins.');
		if (preg_match('@Incorrect (Username|Login) or Password@i', $page)) html_error('Login failed: User/Password incorrect.');
		return true;
	}

	// Checks if account is logged in.
	// return $page - If it's logged in and the $page loaded is usable for checkAccount() too, if not, return true or false
	protected function isLoggedIn() {
		$page = $this->GetPage($this->purl.'?op=my_account', $this->cookie, 0, $this->purl);
		if (stripos($page, '/?op=logout') === false && stripos($page, '/logout') === false) return false;
		return $page;
	}

	// A simpler function for check if account is premium in $page contents, easier to override on plugins for specific hosts.
	// return true if user is premium, false otherwise.
	protected function isAccPremium($page) {
		if (stripos($page, 'Premium account expire') !== false || stripos($page, 'Premium-account expire') !== false || stripos($page, 'Premium Expires') !== false || stripos($page, 'Expiration date') !== false) return true;
		return false;
	}

	protected function checkAccount($page) {
		is_present($page, 'Your account was banned by administrator.', '[checkAccount] Account is Banned.');
		if ($this->isAccPremium($page)) return $this->PremiumDL();

		// FreeDL() shouldn't have issues using it with a premium account... But PremiumDL() uses less checks.
		$this->changeMesg('<br /><b>Account isn\'t premium?</b>', true);
		return $this->FreeDL();
	}

}

// GenericXFS_DL (alpha)
// Written by Th3-822.
<?php
if (!defined('RAPIDLEECH')) {
	require_once ('index.html');
	exit();
}

class adrive_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://(?:www\.)?adrive\.com/public/(?!(?:dir)?view)(\w+)(?:/|\.html?|$)@i', $link, $fid)) {
			if (!preg_match('@https?://(?:\w+\.)*adrive\.com/public/dirview/(\w+)/(\d+)@i', $link, $fid)) html_error('Invalid Link?');
			html_error('TODO: Add Folder Support.');
		}

		$page = $this->GetPage($link);
		is_present($page, 'The file you are trying to access is no longer available publicly', 'File Private/Not Found');
		is_present($page, 'The public file you are trying to download is associated with a non-valid ADrive account.');
		$cookie = GetCookiesArr($page);

		if (!preg_match("@https?://(?:\w+\.)*adrive\.com/public/view/{$fid[1]}(?:/[^\s\"\'<>]*|\.html?|$)@i", $page, $dlLink)) {
			if (preg_match('@https?://(?:\w+\.)*adrive.com/public/{$fid[1]}.html@i', $page, $folder)) {
				html_error('TODO: Add (Sub)?Folder Support.');
			}
			html_error('Download Link Not Found.');
		}
		$this->RedirectDownload($dlLink[0], 'adrive_com', $cookie);
	}
}

// [15-5-15] Rewritten By Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class alfafile_net extends DownloadClass {
	private $page, $cookie = array('lang' => 'en'), $pA, $login, $DLRegexp = '@https?://a\d+\.alfafile\.net/dl/\w+/[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://alfafile\.net)/file/(\w+)@i', str_ireplace('://www.alfafile.net', '://alfafile.net', $link), $fid)) html_error('Invalid link?.');
		$this->link = str_ireplace('http://', 'https://', $fid[0]);
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			if (substr($this->page, 9, 3) == '404') html_error('File Not Found.');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['alfafile_net']['user']) && !empty($GLOBALS['premium_acc']['alfafile_net']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['alfafile_net']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['alfafile_net']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->Login($user, $pass);
		} else return $this->AnonDL();
	}

	private function AnonDL() {
		if (empty($_POST['step']) || $_POST['step'] != '1') {
			$page = $this->GetPage($this->baseurl . '/download/start_timer/' . $this->fid, $this->cookie, 0, $this->link . "\r\nX-Requested-With: XMLHttpRequest");
			$this->cookie = GetCookiesArr($page, $this->cookie);
			$start_timer = $this->json2array($page, 'StartTimer Error');

			if (empty($start_timer) || (empty($start_timer['show_timer']) && empty($start_timer['redirect_url']))) {
				if (!empty($start_timer['html'])) {
					if (preg_match('@Delay between downloads must be not less than \d+ minutes.\s+Try again in \d+ minutes@i', $page, $err)) html_error("[AnonDL] {$err[0]}");
					html_error('Error @ StartTimer: ' . htmlspecialchars(strip_tags($start_timer['html']), ENT_QUOTES));
				} else { //  if (substr($page, 9, 3) == '200')
					textarea($start_timer);
					html_error('Unknown error @ StartTimer');
				}
			}
			if (strpos($start_timer['redirect_url'], '://') === false) $start_timer['redirect_url'] = $this->baseurl . $start_timer['redirect_url'];

			if (!empty($start_timer['show_timer']) && $start_timer['timer'] > 0) $this->CountDown($start_timer['timer']);

			$page = $this->GetPage($start_timer['redirect_url'], $this->cookie, 0, $this->link);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			if (!preg_match('@https?://api(?:-secure)?\.solvemedia\.com/papi/challenge\.(?:no)?script\?k=([\w\-\.]+)@i', $page, $smKey)) {
				if (preg_match($this->DLRegexp, $page, $DL)) return $this->RedirectDownload($DL[0], urldecode(parse_url($DL[0], PHP_URL_PATH)));
				html_error('CAPTCHA not found.');
			}

			$data = $this->DefaultParamArr($this->link, $this->cookie, $start_timer['redirect_url'], true);
			$data['step'] = '1';
			$data['posturl'] = urldecode(parse_url($start_timer['redirect_url'], PHP_URL_PATH));
			return $this->SolveMedia($smKey[1], $data, $start_timer['redirect_url']);
		} else {
			$post = $this->verifySolveMedia();
			$post['send'] = 'Submit';
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

			$page = $this->GetPage($this->baseurl . $_POST['posturl'], $this->cookie, $post);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			if (preg_match("@\nLocation: (?:https?://(?:www\.)?alfafile\.net)?/file/{$this->fid}/?\r?\n@i", $page)) {
				$page = $this->GetPage($this->link, $this->cookie);
			}

			if (!preg_match($this->DLRegexp, $page, $DL)) html_error('Download Link Not Found.');

			return $this->RedirectDownload($DL[0], urldecode(parse_url($DL[0], PHP_URL_PATH)));
		}
	}

	private function ApiDL() {
		$DL = $this->ApiReq('file/download', array('file_id' => $this->fid));

		if (empty($DL['download_url'])) html_error('Download-Link Not Found.');

		return $this->RedirectDownload($DL['download_url'], urldecode(parse_url($DL['download_url'], PHP_URL_PATH)));
	}

	private function Login($user, $pass) {
		$this->login = $this->ApiReq('user/login', array('login' => $user, 'password' => $pass));
		if (empty($this->login['token'])) html_error('Login Token Not Found.');
		if (empty($this->login['user'])) html_error('User Data Not Found.');
		if (empty($this->login['user']['is_premium'])) $this->changeMesg('<br /><b>Account isn\'t premium</b>', true);

		return $this->ApiDL();
	}

	private function ApiReq($path, $post = array()) {
		if (!is_array($post)) $post = array();
		if ($path != 'user/login' && !empty($this->login['token'])) $post['token'] = $this->login['token'];

		$page = $this->GetPage("https://alfafile.net/api/v1/$path", 0, array_map('urlencode', $post), 'https://alfafile.net/');
		$reply = $this->json2array($page, "ApiReq($path) Error");

		if (empty($reply['response']) && !empty($reply['details'])) html_error("[ApiReq($path) Error] " . htmlspecialchars($reply['details'], ENT_QUOTES));

		return $reply['response'];
	}

	// Special Function Called by verifySolveMedia When Captcha Is Incorrect, To Allow Retry. - Optional
	protected function retrySolveMedia() {
		$data = $this->DefaultParamArr($this->link);
		$data['cookie'] = (!empty($_POST['cookie']) ? $_POST['cookie'] : '');
		$data['step'] = '1';
		$data['posturl'] = $_POST['posturl'];

		return $this->SolveMedia($_POST['sm_public_key'], $data, $this->baseurl . $_POST['posturl']);
	}
}

//[20-12-2015]  Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class allmyvideos_net extends GenericXFS_DL {
	public $pluginVer = 9;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class anafile_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class aparat_com extends DownloadClass {
	public $link;
	
	public function Download($link) {
		$this->link = $link;
		
		if (!preg_match('@aparat\.com/v/(\w+)@i', $link, $vid)) html_error('Video ID not found.');
		$vid = $vid[1];

		$page = $this->GetPage("https://www.aparat.com/v/$vid");
		is_present($page, "ÙÛØ¯ÛÙ ÙØ´Ø§Ø¨ÙÛ ÛØ§ÙØª ÙØ´Ø¯.", 'Video not found or it was deleted.');
		if (!preg_match('@<title>(?>(.*?)</title>)@is', $page, $title)) html_error('Error: Video title not found.');
		
		$qualities = $this->Qualities($page);
		
		if (!isset($_GET['submit']) && !isset($_GET['audl'])) {
			echo $this->QSelector($qualities);
			return;
		}
		
		if (isset($_GET['audl'])) {
			reset($qualities);
			$_GET['quality'] = key($qualities);
		}
		
		$quality = $qualities[$_GET['quality']]['quality'];
		$video = $qualities[$_GET['quality']]['video'];
		$filename = html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8');
		if (isset($_GET['clean_name'])) {
			$filename = preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', $filename);
		}
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', $filename);
		$filename .= sprintf(' [Aparat%s][%s].mp4', (empty($quality) ? '' : '-' . $quality), $vid);

		$this->RedirectDownload($video, $filename, 0, 0, 0, $filename);
	}
	
	public function Qualities($page) {
		if (!preg_match_all('@<a.*?href="(https?://(?:[\w-]+\.)*aparat\.com/aparat-video/\w+(?:-(\d+p))?__\w+\.mp4)".*?><span.*?>(.*?)<@im', $page, $matches, PREG_SET_ORDER, 0)) {
			html_error('Download link not found.');
		}
		$return = array();
		foreach ($matches as $match) {
			$return[] = array(
				'video' => $match[1],
				'quality' => $match[2],
				'title' => $match[3],
			);
		}
		if (!$return) {
			html_error('Download link not found.');
		}
		krsort($return);
		return $return;
	}
	
	public function QSelector($qualities) {
		if (!is_array($qualities)) {
			html_error('Quality not found.');
		}
		$str = "";
		$str .= "\n<center><form action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
		$str .= '<label><input type="checkbox" name="clean_name" value="1" /><small>&nbsp;Remove non-supported characters from filename</small></label><br />';
		$str .= "<select name='quality'>\n";
		foreach ($qualities as $key => $quality) {
			$str .= "<option value='{$key}'>Quality: [" . ($quality['quality'] ? $quality['quality'] : 'Normal') . "]</option>\n";
		}
		$str .= "</select>\n";
		$data = $this->DefaultParamArr($this->link);
		foreach ($data as $n => $v) {
			$str .= "<input type='hidden' name='$n' id='QS_$n' value='$v' />\n";
		}
		$str .= "<input type='submit' name='submit' value='".lang(209)."' />\n";
		$str .= "</form></center>\n</body>\n</html>";
		return $str;
	}
}

//[23-12-2015]  Written by Th3-822.
//[27-12-2015]  Fixed Regexp. - Th3-822
//[02-11-2018]  Fixed video URL pattern - Nabi K.A.Z. <www.nabi.ir>
//[02-11-2018]  Added aparat quality selector - Nabi K.A.Z. <www.nabi.ir>
//[02-11-2018]  Fixed bug in multi downloader - Nabi K.A.Z. <www.nabi.ir>

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class axfiles_net extends GenericXFS_DL {
	public $pluginVer = 13;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}

	protected function findCountdown() {
		if (preg_match('@<div[^>]*>(?>.*?<div\s+id=[\'"][\w\-]+[\'"][^>]*>)\s*(\d+)\s*</div>(?>.*?</div>)@sim', $this->form, $count)) {
			if ($count[1] > 0) $this->CountDown($count[1] + 2);
			return true;
		}
		return false;
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class baidu_com extends DownloadClass {
	private $userAgent = 'netdisk;5.7.2.3;PC;PC-Windows;6.1.7601;WindowsBaiduYunGuanJia';
	public function Download($link) {
		if (!preg_match('@(https?://(?:pan|yun)\.baidu\.com)/(?:s/\w+|(?:(?:wap/)?share|wap)/link\?\w+=\w+(?:&\w+=\w+)*)@i', $link, $_link)) html_error('Invalid link?.');
		$link = $GLOBALS['Referer'] = str_ireplace(array('http://', '/wap/link', '/wap/'), array('https://', '/share/link', '/'), $_link[0]);
		$host = $_link[1];
		$cookie = isset($_POST['step']) && !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array();

		if (empty($_POST['step']) || $_POST['step'] != '1') {
			$bduss = $this->getLoginCookie();

			$page = $this->GetPage($link);
			$cookie = GetCookiesArr($page);

			// Baidu doesn't reply /s/ links without a valid BAIDUID cookie :S
			if (substr($page, 9, 3) == '403') {
				$page = $this->GetPage($link, $cookie);
				$cookie = GetCookiesArr($page, $cookie);
			}

			is_present($page, 'åå¦ï¼ä½ æè®¿é®çé¡µé¢ä¸å­å¨äº', 'File Doesn\'t Exist');

			if (!preg_match('@yunData\.setData\((\{.+?\})\);@s', $page, $data)) html_error('yunData.setData Not Found.');
			$rawYunData = preg_replace('@([:,\[\]{}])(\d{11,})([:,\[\]{}])@', '$1"$2"$3', $data[1]); // Avoid Issues With Long IDs
			$yunData = $this->json2array($rawYunData, 'Error while parsing yunData');
			if (empty($yunData['bdstoken'])) $yunData['bdstoken'] = 'null';
		} else {
			$cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
			$_POST['step'] = false;
			if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
			if (empty($_POST['vcode_str'])) html_error('Empty Captcha Challenge.');
			if (empty($_POST['yunData'])) html_error('[Post] Empty yunData.');
			if (empty($_POST['bduss'])) html_error('[Post] Empty bduss cookie.');
			$captcha = array('vcode_input' => urlencode($_POST['captcha']), 'vcode_str' => urlencode($_POST['vcode_str']));
			$rawYunData = decrypt(base64_decode($_POST['yunData']));
			$yunData = $this->json2array($rawYunData, '[Post] Error while parsing yunData');
			$bduss = decrypt(base64_decode($_POST['bduss']));
		}

		$post = array('encrypt' => 0, 'product' => 'share', 'uk' => $yunData['uk'], 'primaryid' => $yunData['shareid'], 'fid_list' => "%5B{$yunData['file_list']['list'][0]['fs_id']}%5D");
		if (!empty($captcha)) $post = array_merge($post, $captcha);

		$json = $this->GetPage("$host/api/sharedownload?app_id={$yunData['file_list']['list'][0]['app_id']}&bdstoken={$yunData['bdstoken']}&channel=chunlei&clienttype=0&sign={$yunData['sign']}&timestamp={$yunData['timestamp']}&web=1", $cookie, $post, $GLOBALS['Referer'] . "\r\nX-Requested-With: XMLHttpRequest");
		$data = $this->json2array($json, 'Error getting download info');

		if (!empty($data['errno'])) {
			if ($data['errno'] == -20) {
				$captcha = $this->json2array($this->GetPage("{$host}/api/getvcode?app_id={$yunData['file_list']['list'][0]['app_id']}&bdstoken={$yunData['bdstoken']}&channel=chunlei&clienttype=0&prod=share&web=1", $cookie, $post, $GLOBALS['Referer'] . "\r\nX-Requested-With: XMLHttpRequest"), 'Error getting captcha data');
				if (!empty($captcha['errno'])) html_error("Unknown captcha error [{$captcha['errno']}]");

				$data = $this->DefaultParamArr($link, $cookie, 1, 1);
				$data['step'] = 1;
				$data['yunData'] = base64_encode(encrypt($rawYunData));
				$data['bduss'] = base64_encode(encrypt($bduss));
				$data['vcode_str'] = $captcha['vcode'];

				list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($captcha['img']), 2);
				if (substr($headers, 9, 3) != '200') html_error('Error downloading CAPTCHA img.');
				$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpg');
				return $this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data);
			} else if ($data['errno'] == 112) html_error('Expired Download Token');
			html_error("Unknown download-info error [{$data['errno']}]");
		}

		if (empty($data['list'][0]['dlink'])) html_error('Redirect-Link Not Found.');
		if (function_exists('headers2request')) $GLOBALS['Referer'] .= "\r\nUser-Agent: {$this->userAgent}"; // Changed User-Agent to "increase" download speed

		$cookie['BDUSS'] = $bduss; // Extra Cookie (Needed to Download)
		$page = $this->GetPage($data['list'][0]['dlink'], $cookie);
		if (substr($page, 9, 3) == '403') html_error('Invalid BDUSS Cookie');
		if (!preg_match('@https?://(?:[\w\-]+\.)+baidupcs(?:\.[\w\-]+)*\.com/file/[^\s\"\'<>]+@i', $page, $DL)) html_error('Download-Link Not Found.');

		return $this->RedirectDownload($DL[0], 'pan_baidu_com_placeholder');
	}

	private function getLoginCookie() {
		if (!empty($_POST['cookie'])) {
			if (!empty($_POST['cookie_encrypted'])) {
				$_POST['cookie'] = decrypt(urldecode($_POST['cookie']));
				unset($_POST['cookie_encrypted']);
			}
			$cookie = StrToCookies($_POST['cookie']);
			$_POST['cookie'] = false;
		} else if (!empty($GLOBALS['premium_acc']['baidu_com']['cookie'])) {
			$cookie = $GLOBALS['premium_acc']['baidu_com']['cookie'];
			$cookie = (is_array($cookie) ? $cookie : StrToCookies($cookie));
		}
		if (empty($cookie['BDUSS'])) html_error('Needs a Valid "BDUSS" Cookie for Download');
		return $cookie['BDUSS'];
	}
}

// [26-8-2016] Written by Th3-822.
// [30-8-2016] Switched links to http to help decrease connection errors & Changed User-Agent for "better" download speed. - Th3-822
// [18-4-2017] Fixed. - Th3-822
// [26-1-2018] Switched to https as there is now a forced redirect & fixed download (now it does require a login cookie for download). - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class bestreams_net extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = true; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.
		$this->customDecoder = true; // Enable pageDecoder()

		// Custom Download Regexp
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w{58}/[^\t\r\n<>\'\"\?\&]+@i';

		$this->Start($link);
	}

	// Rapidleech doesn't support rtmp, so i must get to the real file, that it's somewhere.
	protected function pageDecoder() {
		if (preg_match('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/)i/(?:[^/\s\"\'<>]+/)*\w{12}(_t)?\.jpe?g@i', $this->page, $SV) && preg_match('@[?&]h(?:ash)?=(\w+)@i', $this->page, $hash)) {
			$DL = $SV[1] . $hash[1] . '/v.mp4'; // And that's how a XFS video download link is forged.
			$this->page = str_replace($SV[0], $DL, $this->page, $count);
			return ($count > 0 ? true : false);
		}
		return false;
	}
}

// Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once ("index.html");
    exit();
}

class bitshare_com extends DownloadClass {

    public function Download($link) {
        global $premium_acc;
        
        if (!$_REQUEST['step']) {
            $this->page = $this->GetPage($link, "language_selection=EN"); //keep page in english
            is_present($this->page, "Error - File not available");
            $this->cookie = GetCookies($this->page). "; language_selection=EN";
        }
        if ($_REQUEST ["premium_acc"] == "on" && (($_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) || ($premium_acc ["bitshare_com"] ["user"] && $premium_acc ["bitshare_com"] ["pass"]))) {
            $this->DownloadPremium($link);
        } else {
            $this->DownloadFree($link);
        }
    }
    
    private function DownloadFree($link) {
        if ($_REQUEST['step'] == '1') {
            $Url = urldecode($_POST['link']);
            $this->cookie = urldecode($_POST['cookie']);
            $recap = $_POST['recap']; //to be called when we failed to enter captcha code
            $ajaxid = $_POST['ajaxid'];
            
            $post['request'] = 'validateCaptcha';
            $post['ajaxid'] = $ajaxid;
            $post['recaptcha_challenge_field'] = $_POST['challenge'];
            $post['recaptcha_response_field'] = $_POST['captcha'];
            $check = $this->GetPage($Url, $this->cookie, $post,  $link , 0, 1);
        } else {
            is_present($this->page, "Your Traffic is used up for today. Upgrade to premium to continue!");
            if (preg_match('@<span id="blocktimecounter">(\d+) seconds<\/span>@', $this->page, $wait) && !strpos($this->page, "var blocktime = 0;")) {
                echo  ("<center><font color='red'><b>You reached your hourly traffic limit.</b></font></center>");
                $this->JSCountdown($wait[1]);
            }
            if (!preg_match('@url: "([^"]+)",@', $this->page, $rd)) html_error("Error: Post Link [FREE] not found!");
            if (!preg_match('@var ajaxdl = "([^"]+)";@i', $this->page, $ajax)) html_error("Error: Ajax ID [FREE] not found!");
            
            $post['request'] = 'generateID';
            $post['ajaxid'] = $ajax[1];
            $check = $this->GetPage($rd[1], $this->cookie, $post,  $link , 0, 1);
            if (!preg_match('@file:(\d+)\:[0-1]+@', $check, $wait)) html_error("Error: Timer not found!");
            $this->CountDown($wait[1]);
            if (!preg_match('@\/challenge\?k=([^"]+)"@', $this->page, $cap) && !stristr($this->page, "var captcha = 1;")) html_error("Error getting CAPTCHA Data!");
            $ch = cut_str($this->GetPage("http://www.google.com/recaptcha/api/challenge?k=$cap[1]"), "challenge : '", "'");
            $capt = $this->GetPage("http://www.google.com/recaptcha/api/image?c=" . $ch);
            $capt_img = substr($capt, strpos($capt, "\r\n\r\n") + 4);
            $imgfile = DOWNLOAD_DIR . "bitshare_captcha.jpg";

            if (file_exists($imgfile)) unlink($imgfile);
            if (empty($capt_img) || !write_file($imgfile, $capt_img)) html_error("Error getting CAPTCHA image.");
            
            $data = $this->DefaultParamArr($rd[1], $this->cookie);
            $data['step'] = '1';
            $data['challenge'] = $ch;
            $data['ajaxid'] = $ajax[1];
            $data['recap'] = $cap[1];
            $this->EnterCaptcha($imgfile, $data, 20);
            exit();
        }
        is_present($check, "We are sorry, but an error occured.");
        if (strpos($check, "SUCCESS") && !strpos($check, 'ERROR')) {
            unset($post);
            
            $post['request'] = 'getDownloadURL';
            $post['ajaxid'] = $ajaxid;
            $this->page = $this->GetPage($Url, $this->cookie, $post, $link, 0, 1);
            is_present($this->page, "ERROR#SESSION ERROR!");
            if (!preg_match('@(http(s)?:\/\/\w+\.bitshare\.com(:\d+)?\/[^\r\n]+)@i', $this->page, $dl)) html_error("Error: Download Link [FREE] not found!");
            $dlink = trim($dl[1]);
            $filename = basename(parse_url($dlink, PHP_URL_PATH));
            $this->RedirectDownload($dlink, $filename, $this->cookie, 0, $link);
            exit();
        } else {
            echo ("<center><font color='red'><b>".  cut_str($check, 'ERROR:', '\r\n')."</b></font></center>");
            $this->changeMesg("<font color='red'><b>".  cut_str($check, 'ERROR:', '\r\n')."</b></font>");
            
            $ch = cut_str($this->GetPage("http://www.google.com/recaptcha/api/challenge?k=$recap"), "challenge : '", "'");
            $capt = $this->GetPage("http://www.google.com/recaptcha/api/image?c=" . $ch);
            $capt_img = substr($capt, strpos($capt, "\r\n\r\n") + 4);
            $imgfile = DOWNLOAD_DIR . "bitshare_captcha.jpg";

            if (file_exists($imgfile)) unlink($imgfile);
            if (empty($capt_img) || !write_file($imgfile, $capt_img)) html_error("Error getting CAPTCHA image.");
            
            $data = $this->DefaultParamArr($Url, $this->cookie);
            $data['challenge'] = $ch;
            $data['step'] = '1';
            $data['ajaxid'] = $ajaxid;
            $data['recap'] = $recap;
            $this->EnterCaptcha($imgfile, $data, 20);
            exit();
        }
    }
    
    private function DownloadPremium($link) {
        global $premium_acc;
        
        $user = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["bitshare_com"] ["user"]);
        $pass = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["bitshare_com"] ["pass"]);
        if (empty($user) || empty($pass)) html_error("Login failed, $user [user] or $pass [password] is empty!");
        
        $Url = 'http://bitshare.com/';
        $post['user'] = $user;
        $post['password'] = $pass;
        $post['rememberlogin'] = '';
        $post['submit'] = 'Login';
        $check = $this->GetPage($Url."login.html", $this->cookie, $post, $Url);
        $this->cookie = $this->cookie. ";". GetCookies($check);
        is_notpresent($this->cookie, 'login=', "Wrong Username or Password!");
        is_present($check, "<a href=\"http://bitshare.com/myupgrade.html\">Free</a>", "Account type : FREE");
        
        $this->page = $this->GetPage($link, $this->cookie, 0, $link);
        if (!preg_match('@Location: (http(s)?:\/\/[^\r\n]+)@i', $this->page, $dl)) { // non direct link
            if (!preg_match('@url: "([^"]+)",@i', $this->page, $rd)) html_error("Error: Post Link [PREMIUM] not found!");
            if (!preg_match('@var ajaxdl = "([^"]+)";@i', $this->page, $ajax)) html_error("Error: Post Data [PREMIUM] not found!");
            
            unset($post);
            $post['request'] = 'generateID';
            $post['ajaxid'] = $ajax[1];
            $check = $this->GetPage($rd[1], $this->cookie, $post, $link, 0, 1);
            unset($post);
            $post['request'] = 'getDownloadURL';
            $post['ajaxid'] = $ajax[1];
            $this->page = $this->GetPage($rd[1], $this->cookie, $post, $link, 0, 1);
            if (!preg_match('@(http(s)?:\/\/\w+\.bitshare\.com(:\d+)?\/[^\r\n]+)@i', $this->page, $dl)) html_error("Error: Download Link [PREMIUM] not found!");
        }
        $dlink = trim($dl[1]);
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $this->cookie);
    }
}

/*
 * by vdhdevil Dec-11-2010
 * fixed by Ruud v.Tony 25-01-2012
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class br2share_net extends GenericXFS_DL {
	public $pluginVer = 13;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class brupload_net extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class clicknupload_co extends GenericXFS_DL {
	public $pluginVer = 23;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = true; // Force https on login post only.
		$this->cookieSave = true; // Save login cookies to file. (For hosts that limit/bans repeated logins)
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder

		$this->Start($link);
	}

	protected function findCountdown() {
		if (preg_match('@<span\s+class=[\'\"](?:[\w-]+\s+)*seconds(?:\s+\w+)*[\'\"][^>]*>\s*(\d+)\s*</span>@sim', $this->page, $count)) {
			if ($count[1] > 0) $this->CountDown($count[1] + 2);
			return true;
		}
		return false;
	}

}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class cloud_mail_ru extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://cloud\.mail\.ru/public/(\w+)/[^<>\s\"\']+@i', $link, $fid)) html_error('Invalid Link.');
		$link = $GLOBALS['Referer'] = $fid[0];
		$fid = $fid[1];

		if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');

		$page = $this->GetPage($link);
		is_present($page, 'ÐÐ¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾, ÑÐºÐ°Ð·Ð°Ð½ Ð½ÐµÐ¿ÑÐ°Ð²Ð¸Ð»ÑÐ½ÑÐ¹ Ð°Ð´ÑÐµÑ ÑÑÑÐ°Ð½Ð¸ÑÑ.', 'File Not Found.');

		if (!preg_match('@https?://\w+\.cldmail\.ru/\w+/\w+@i', $page, $dServer)) html_error('Error: Download Server not Found.');
		if (!preg_match('@"(?:uri|query_string)"\s*:\s*"(?:/?public)?(/' . $fid . '/[^\s\"]+)"@i', $page, $dPath)) html_error('Error: Download Path not Found.');

		if (preg_match('@"download"\s*:\s*"(\w+)"@i', $page, $dToken)) $token = $dToken[1];
		else {
			$post = array('api' => 2);
			if (!preg_match('@"BUILD"\s*:\s*"([\w\-\.]+)"@', $page, $dummy)) html_error('Error: Build Code not Found.');
			$post['build'] = urlencode($dummy[1]);
			if (!preg_match('@"x-page-id"\s*:\s*"(\w+)"@', $page, $dummy)) html_error('Error: Page ID not Found.');
			$post['x-page-id'] = urlencode($dummy[1]);

			list($headers, $body) = explode("\r\n\r\n", $this->GetPage('https://cloud.mail.ru/api/v2/tokens/download', 0, $post, "$link\r\nX-Requested-With: XMLHttpRequest"));
			$data = json_decode($body, true);
			if ($data === NULL) html_error('Error while parsing Download Token JSON.');

			if (empty($data['status']) || $data['status'] != 200) html_error('Error: Failed Download Token Request.');
			if (empty($data['body']['token'])) html_error('Error: Download Token not Found.');
			$token = $data['body']['token'];
		}

		$DL = $dServer[0] . $dPath[1] . '?key=' . urlencode($token);

		$this->RedirectDownload($DL, basename(urldecode(parse_url($DL, PHP_URL_PATH))));
	}
}

//[17-7-2016]  Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class cloudtime_to extends DownloadClass {
	public function Download($link) {
		$page = $this->GetPage($link);
		is_present($page, 'This file no longer exists', 'Video not found or it was deleted.');
		is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');

		if (($stepkey = cut_str($page, '"stepkey" value="', '"'))) {
			$post = array('stepkey' => $stepkey, 'submit' => 'submit');
			$cookie = GetCookiesArr($page);
			$page = $this->GetPage($link, $cookie, $post);
			is_present($page, 'This file no longer exists', 'Video not found or it was deleted..');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable..');
		}

		if (!preg_match('@<div class="video_det">\s*<strong>\s*([^"<>]+)\s*</strong>@i', $page, $title)) html_error('Error: Video title not found.');
		if (!preg_match('@flashvars.domain\s*=\s*"([^"]+)";\s+flashvars.file\s*=\s*"([^"]+)";\s+flashvars.filekey\s*=\s*(?:"([^"]+)"|([\$_A-Za-z][\$\w]*))@', $page, $matches)) html_error('Error: Download link not found.');
		if (empty($matches[3])) {
			if (!preg_match('@var\s+'.$matches[4].'\s*=\s*"([^"]+)"\s*;@i', $page, $fkey)) html_error('FileKey not Found.');
			$matches[3] = $fkey[1];
		}

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $matches[2] . '&pass=undefined&key=' . urlencode($matches[3]);
		$page2 = $this->GetPage($url);
		is_present($page2, ' is being transfered', 'Video is temporarily unavailable');
    
		if (!preg_match('@url=(http://[^&]+)@', $page2, $downl)) html_error('Error: Download link not found.');  

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [CloudTime][%s]%s', $matches[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  ReWritten by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class cloudy_ec extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/)(?:file/|v/|embed\.php\?id=)(\w+)@i', $link, $vid)) html_error('Invalid Link.');
		$link = $GLOBALS['Referer'] = $vid[1] . 'v/' . $vid[2];

		$page = $this->GetPage($link);
		if (!preg_match('@<h4 class="title">\s*([^"<>]+)\s*</h4>@i', $page, $title) && !preg_match('@<title>\s*([^"<>|]+?)(?>\s+\|)@i', $page, $title))  {
			is_present($page, 'The video no longer exists', 'Video not found or it was deleted.');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');
			html_error('Error: Video title not found.');
		}

		$embed = $this->GetPage("{$vid[1]}embed.php?id={$vid[2]}&autoplay=1");
		if (!preg_match('@domain\s*:\s*"([^"]+)"\s*,\s*key\s*:\s*"([^"]+)"@', $embed, $matches)) html_error('Error: Download link not found.');

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $vid[2] . '&pass=undefined&key=' . urlencode($matches[2]);
		$page2 = $this->GetPage($url);
		is_present($page, ' is being transfered', 'Video is temporarily unavailable');

		if (!preg_match('@url=(http://[^&]+)@', urldecode($page2), $downl)) html_error('Error: Download link not found.');

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [Cloudy][%s]%s', $vid[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  Written by Th3-822.
//[22-1-2016]  Fixed link parse & case when video reports not found, but still downloadable. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class copiapop_com extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.copiapop\.com/download\?[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://copiapop\.com)/(?:[^/]+/)+[^\r\n\t/<>\"]+?,(\d+)[^\r\n\t/<>\"]*@i', preg_replace('@^(http)s?(://)(?:www\.)?(copiapop)\.(?:com|es)(?=/)@i', '$1$2$3.com', $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['copiapop_com']['user']) && !empty($GLOBALS['premium_acc']['copiapop_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['copiapop_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['copiapop_com']['pass']);
			return $this->Login($user, $pass);
		} else return $this->TryDL();
	}

	private function TryDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!preg_match($this->DLRegexp, $this->page, $DL)) {
			if (substr($this->page, 9, 3) != '200') html_error('File Not Found or Private.');
			$download = $this->reqAction('DownloadFile', array('fileId' => $this->fid, '__RequestVerificationToken' => $this->getCSRFToken($this->page)));
			if (empty($download['DownloadUrl']) || !preg_match($this->DLRegexp, $download['DownloadUrl'], $DL)) {
				if (empty($this->cookie['.ASPXAUTH_v2']) && $download['Type'] == 'Window') html_error('Login is Required to Download This File.');
				html_error('Download-Link Not Found.');
			}
		}
		return $this->RedirectDownload($DL[0], 'copiapop_placeholder_fname');
	}

	private function getCSRFToken($page, $errorPrefix = 'Error') {
		if (!preg_match('@name="__RequestVerificationToken"\s+type="hidden"\s+value="([\w\-+/=]+)"@i', $page, $token)) return html_error("[$errorPrefix]: Request Token Not Found.");
		return $token[1];
	}

	private function Login($user, $pass) {
		$page = $this->GetPage($this->baseurl . '/', $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$login = $this->reqAction('Account/Login', array('UserName' => $user, 'Password' => $pass, '__RequestVerificationToken' => $this->getCSRFToken($page, 'Login Error')));
		if (!empty($login['Content'])) is_present($login['Content'], 'El nombre de usuario o la contrase&#241;a no son correctos', 'Login Error: Wrong Login/Password.');
		if (empty($this->cookie['.ASPXAUTH_v2'])) html_error('Login Error: Cookie ".ASPXAUTH_v2" not Found.');

		return $this->TryDL();
	}

	private function reqAction($path, $post = array()) {
		$page = $this->GetPage("{$this->baseurl}/action/$path", $this->cookie, array_map('urlencode', $post), "{$this->baseurl}/\r\nX-Requested-With: XMLHttpRequest");
		$reply = $this->json2array($page, "reqAction($path) Error");
		if (empty($reply)) html_error("[reqAction($path) Error] Empty Response.");
		$this->cookie = GetCookiesArr($page, $this->cookie);

		return $reply;
	}

}

// [20-3-2016] Written by Th3-822.
// [22-4-2016] Renamed to copiapop_com and fixed. - Th3-822

?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once ('index.html');
    exit();
}

class crocko_com extends DownloadClass {

    public function Download($link) {
        global $premium_acc;
        
        if (strstr($link, "easy-share.com/")) {
            $link = str_replace("easy-share.com/", "crocko.com/", $link);
        }
        if ($_REQUEST ["premium_acc"] == "on" && (($_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) || ($premium_acc["crocko_com"]["user"] && $premium_acc["crocko_com"]["pass"]))) {
            $this->DownloadPremium($link);
        } else {
            $this->DownloadFree($link);
        }
    }

    public function CheckBack($header) {
        is_notpresent($header, "ontent-Disposition: attachment;", "You have input wrong captcha, Please try again!");
    }

    private function DownloadFree($link) {
        global $Referer;

        if ($_REQUEST['step'] == 'captcha') {
            $post["recaptcha_challenge_field"] = $_POST['recaptcha_challenge_field'];
            $post["recaptcha_response_field"] = $_POST['recaptcha_response_field'];
            $post["id"] = $_POST['id'];
            $cookie = urldecode($_POST['cookie']);
            $dlink = urldecode($_POST['link']);
            $FileName = $_POST['name'];
            $this->RedirectDownload($dlink, $FileName, $cookie, $post, $Referer);
            exit();
        }elseif ($_REQUEST['step'] == 'countdown') {
            $link = urldecode($_POST['link']);
            $cookie = StrToCookies(urldecode($_POST['cookie']));
            $page = $this->GetPage($link, $cookie, 0, $Referer);
        } else {
            $page = $this->GetPage($link);
            is_present($page, 'Requested file is deleted.');
            is_present($page, 'There is another download in progress from your IP. Please try to downloading later.');
            $cookie = GetCookiesArr($page);
            $FileName = trim(str_replace(" ", ".", cut_str($page, 'Download ', ',')));
            // first timer
            if (preg_match('/wf = (\d+);/', $page, $wait)) $this->CountDown($wait[1]);
            if (preg_match("/u='(.+)'/", $page, $cap)) $link = "http://www.crocko.com$cap[1]";
            $page = $this->GetPage($link, $cookie, 0, $Referer);
        }            
        //get new timer, then refresh the page
        if (preg_match("/w='(\d+)'/", $page, $wait)) {
            if ($wait[1] > 100) {
                $data = $this->DefaultParamArr($link, $cookie);
                $data['step'] = 'countdown';
                $this->JSCountdown($wait[1], $data);
            } else {
                $this->CountDown($wait[1]);
                $page = $this->GetPage($link, $cookie, 0, $Referer);
            }
        }
        if (preg_match('%<form  method="post" action="([^"]+)">%', $page, $dl)) {
            $dlink = trim($dl[1]);
            if (!is_array($cookie)) {
                $cookie = StrToCookies($cookie, GetCookiesArr($page));
            } else {
                $cookie = GetCookiesArr($page, $cookie);
            }
            if (!preg_match('/Recaptcha\.create\("([^"]+)/i', $page, $cid)) html_error('Can\'t find chaptcha id');
            $data = $this->DefaultParamArr($dlink, $cookie);
            $data['step'] = 'captcha';
            $data['id'] = cut_str($page, 'name="id" value="', '"');
            $data['name'] = $FileName;
            $this->reCAPTCHA($cid[1], $data);
            exit();
        }
    }

    private function DownloadPremium($link) {
        global $premium_acc, $pauth;

        $post = array();
        $post ["login"] = $_REQUEST ["premium_user"] ? $_REQUEST ["premium_user"] : $premium_acc ["crocko_com"] ["user"];
        $post ["password"] = $_REQUEST ["premium_pass"] ? $_REQUEST ["premium_pass"] : $premium_acc ["crocko_com"] ["pass"];
        $post ["remember"] = "1";
        $page = $this->GetPage("https://www.crocko.com/accounts/login", 0, $post, "https://www.crocko.com/\r\nX-Requested-With: XMLHttpRequest");
        $cookies = GetCookies($page);
        if (!preg_match("#PREMIUM=[\w%]+#", $cookies, $Premium)) {
            html_error("Login Failed , Bad username/password combination");
        }
        preg_match("#PHPSESSID=\w+#", $cookies, $PhpSessId);
        $page = $this->GetPage($link, $cookies, 0, $Referer, $pauth);
        is_present($page, 'The requested file is temporarily unavailable', 'Link is not available');
        $cookies = $PhpSessId[0] . "; " . $Premium[0] . "; " . GetCookies($page);
        $FileName = basename(parse_url($link, PHP_URL_PATH));
        $FileName = $FileName ? $FileName : "Crocko";
        if (!preg_match("#Location: (.*)#", $page, $prelink)) {
            html_error("Error 1x01: Plugin is out of date");
        }
        $this->RedirectDownload($prelink[1], $FileName, $cookies, 0, $link);
        exit();
    }
}

/*
 * crocko.com download plugin by Ruud v.Tony & vdhdevil 19-10-2011
 * updated for including easy-share.com in checking link by Ruud v.Tony 13-01-2012
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class d_h_st extends DownloadClass {
	public function Download($link) {
		if (stripos($link, '://d-h.st/') === false) {
			$link = parse_url($link);
			$link['host'] = 'd-h.st';
			$link = rebuild_url($link);
		}
		$page = $this->GetPage($link);
		is_present($page, 'The file you were looking for could not be found', 'File Not Found.');

		if (!preg_match('@https?://fs\d*\.d-h\.st/download/\w+/\w+/[^\s<>\'\"]+@i', $page, $dl)) html_error('Download Link Not Found');
		return $this->RedirectDownload($dl[0], basename(urldecode(parse_url($dl[0], PHP_URL_PATH))), 0, 0, $link);
	}
}

// [26-7-2015] Rewritten by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class dailymotion_com extends DownloadClass {
	private $cookie, $xid, $title, $streams,
	$formats = array('1080' => 'stream_h264_hd1080_url', '720' => 'stream_h264_hd_url',
		'480' => 'stream_h264_hq_url', '384' => 'stream_h264_url', '240' => 'stream_h264_ld_url');

	public function Download($link) {
		$this->cookie = !empty($_POST['step']) && !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : array('ff' => 'off');
		if (!preg_match('@/video/(x[0-9a-zA-Z]+)@i', $link, $xid)) html_error('Video ID not found.');
		$this->xid = $xid[1];
		$this->link = 'https://www.dailymotion.com/video/'.$this->xid;

		if (empty($_POST['step'])) {
			$page = $this->GetPage($this->link, $this->cookie);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			$status = (int)substr($page, 9, 3);
			switch ($status) {
				case 200: break;
				case 403: html_error('This video is forbidden to download!');break;
				case 404: html_error('404 Not Found');break;
				case 410: html_error('This video has been removed by the user.');break;
				default: html_error("Unexpected response: $status");break;
			}
		}

		$this->getVideoInfo();

		if (empty($_POST['dlstream']) && !isset($_GET['audl'])) return $this->QSelector();
		elseif (empty($_POST['dlstream']) || !empty($this->streams[$_POST['dlstream']])) {
			$key = (empty($_POST['dlstream']) ? key($this->streams) : $_POST['dlstream']);
			$DL = $this->streams[$key];
		} else html_error('Selected video stream was not found.');

		$filename = preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($this->title), ENT_QUOTES, 'UTF-8'));
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', $filename);
		$filename .= " [DM-{$key}p][{$this->xid}].mp4";

		$DL = str_replace( 'http://', 'https://', $DL);

		$page = $this->GetPage($DL, $this->cookie);
		if (!preg_match('@https?://[^/\s]+/video/[^\s<>\'\"]+@i', $page, $DL)) html_error('Download Link not Found.');

		$this->RedirectDownload($DL[0], $filename, $this->cookie, 0, 0, $filename);
	}

	private function getVideoInfo() {
		$page = $this->GetPage("https://www.dailymotion.com/json/video/{$this->xid}?fields=title%2C".implode('%2C', $this->formats), $this->cookie);
		$json = $this->json2array($page);

		if (empty($json['title'])) html_error('Video Title not Found.');
		$this->title = $json['title'];

		$this->streams = array();
		foreach ($this->formats as $key => $fmt) if (!empty($json[$fmt])) $this->streams[$key] = $json[$fmt];
		if (empty($this->streams)) html_error('Video Streams not Found.');
	}

	private function QSelector() {
		echo "\n<br /><br /><h3 style='text-align: center;'>Video Quality Selector</h4>";
		echo "\n<center><form name='T8_QS' action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
		echo "<select name='dlstream' id='QS_fmt'>\n";
		foreach ($this->streams as $fmt => $url) echo "<option value='$fmt'>{$fmt}p</option>\n";
		echo "</select>\n";
		if (count($this->cookie) > 0) $this->cookie = encrypt(CookiesToStr($this->cookie));
		$data = $this->DefaultParamArr($this->link, $this->cookie);
		$data['step'] = 1;
		foreach ($data as $n => $v) echo("<input type='hidden' name='$n' id='QS_$n' value='$v' />\n");
		echo "<input type='submit' name='Th3-822' value='".lang(209)."' />\n";
		echo "</form></center>\n</body>\n</html>";
		exit;
	}
}

//[07-3-2014] Written by Th3-822.
//[14-10-2018] Fixed download issues with http by swiching to https. - miyuru
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class dailyuploads_net extends GenericXFS_DL {
	public $pluginVer = 13;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once 'index.html';
	exit;
}

class datafile_com extends DownloadClass {

	public function Download($link) {
		global $premium_acc;

		if (!$_REQUEST['step']) {
			$this->page = $this->GetPage($link);
			is_present($this->page, 'File not found');
			$this->cookie = GetCookiesArr($this->page);
		}
		$this->link = $link;
		$this->posturl = 'https://www.datafile.com';
		if ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST['premium_pass']) || ($premium_acc['datafile_com']['user'] && $premium_acc['datafile_com']['pass']))) {
			return $this->Premium();
		} elseif ($_REQUEST['step'] == 1) {
			return $this->DownloadFree();
		} else {
			return $this->PrepareFree();
		}
	}

	private function Premium() {
		$filename = cut_str($this->page, '<div class="file-name">', '</div>');
		$cookie = $this->login();
		$page = $this->GetPage($this->link, $cookie);
		if (!preg_match('/Location: (\/[^\s\t\r\n]+)/i', $page, $rd)) html_error('Error[Redirect Link - PREMIUM not found!]');
		$page = $this->GetPage($this->posturl . $rd[1], $cookie, 0, $this->link);
		if (!preg_match('/Location: (https?:\/\/n\d+\.datafile\.com\/[^\s\t\r\n]+)/i', $page, $dl)) html_error('Error[Download Link - PREMIUM not found!]');
		$dlink = trim($dl[1]);
		$this->RedirectDownload($dlink, $filename, $cookie, 0, $this->link, $filename);
	}

	private function login() {
		global $premium_acc;

		$user = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["datafile_com"] ["user"]);
		$pass = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["datafile_com"] ["pass"]);
		if (empty($user) || empty($pass)) html_error("Login failed, username or password is empty!");

		$post = array();
		$post['login'] = $user;
		$post['password'] = $pass;
		$post['remember_me'] = 0;
		$post['remember_me'] = 1;
		$post['btn'] = '';
		$page = $this->GetPage($this->posturl . '/login.html', $this->cookie, $post, $this->posturl . '/login.html');
		$cookie = GetCookiesArr($page, $this->cookie);
		is_present($page, 'Incorrect login or password!');

		//check account
		$page = $this->GetPage($this->posturl . '/profile.html', $cookie, 0, $this->posturl . '/index.html');
		is_notpresent($page, 'Premium Expires', 'Account isn\'t Premium?');

		return $cookie;
	}

	private function DownloadFree() {
		$post = array();
		foreach ($_POST['temp'] as $k => $v) {
			$post[$k] = $v;
		}
		$post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
		$post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
		$recap = $_POST['recap'];
		$filename = $_POST['filename'];
		$this->cookie = urldecode($_POST['cookie']);
		$page = $this->GetPage($this->posturl . '/files/ajax.html', $this->cookie, $post, $this->link, 0, 1);
		$json = $this->json2array($page);
		if ($json['success'] == 0) {
			echo "<div align='center'><font color='red'><b>{$json['msg']}</b></font></div>";
			$data = $this->DefaultParamArr($this->link, $this->cookie);
			foreach ($_POST['temp'] as $k => $v) {
				$data["temp[{$k}]"] = $v;
			}
			$data['step'] = 1;
			$data['recap'] = $recap;
			$data['filename'] = $filename;
			$this->Show_reCaptcha($recap, $data);
			exit();
		}
		if (empty($json['link'])) html_error('Error[Download Link - FREE not found!]');
		$this->RedirectDownload($json['link'], $filename, $this->cookie, 0, $this->link, $filename);
	}

	private function PrepareFree() {
		if ($_REQUEST['step'] == 'countdown') {
			$this->cookie = urldecode($_POST['cookie']);
			$this->page = $this->GetPage($this->link, $this->cookie);
		} else {
			if (!preg_match("/counter\.contdownTimer\('(\d+)'/", $this->page, $w)) html_error('Error[Timer not found!]');
			if ($w[1] < 120) $this->CountDown($w[1]);
			else {
				$data = $this->DefaultParamArr($this->link, $this->cookie);
				$data['step'] = 'countdown';
				$this->JSCountdown($w[1], $data);
			}
		}
		if (stripos($this->page, 'Recaptcha')) {
			$data = $this->DefaultParamArr($this->link, $this->cookie);
			$data['temp[doaction]'] = 'getFileDownloadLink';
			$data['temp[fileid]'] = cut_str($this->page, "getFileDownloadLink('", "'");

			if (!preg_match('/\/challenge\?k=([^"]+)"/', $this->page, $c) || !preg_match('/\/noscript\?k=([^"]+)"/', $this->page, $c)) html_error('Error[Captcha Data not found!]');
			$data['step'] = 1;
			$data['filename'] = cut_str($this->page, '<div class="file-name">', '</div>');
			$data['recap'] = $c[1];
			$this->reCAPTCHA($c[1], $data);
			exit();
		}
	}

}

/*
 * Written by Tony Fauzi Wihana/Ruud v.Tony 24/04/2013
 */
?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once('index.html');
    exit();
}

class datafilehost_com extends DownloadClass {
    
    public function Download($link) {
        $page = $this->GetPage($link);
        is_present($page, cut_str($page, '<div style="text-align:center">', '<br>'));
        $cookie = GetCookiesArr($page);
        if (!preg_match('/https?:\/\/(?:www\.)?datafilehost\.com\/get\.php\?file=[^\'\"\t<>\r\n\\\]+/i', $page, $dl)) html_error("Error[DownloadLink] not found!");
        $dlink = trim($dl[0]);
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $cookie, 0, $link);
        exit();
    }
}

/*
 * by Ruud v.Tony 06-02-2012 (while chatting with Palooo & Th3-822, :D)
 * fix small regex by Tony Fauzi Wihana/Ruud v.Tony 04/01/2013
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class depfile_com extends DownloadClass {
	private $page, $cookie = array('sdlanguageid' => '2'), $pA, $DLRegexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\d/\d+/\d/\w+/[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https://depfile\.com)/(?>downloads|([a-zA-Z\d]{8,})(?=/|$))(?(2)|/i/(\d+)/f/[^\s]+\.html)@i', str_ireplace(array('http://', '//www.depfile.com'), array('https://', '//depfile.com'), $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseUrl = $fid[1];
		$this->fid = empty($fid[3]) ? $fid[2] : $fid[3];

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);

			if (substr($this->page, 9, 3) == '404') html_error('Page Not Found.');

			if (is_numeric($this->fid)) is_present($this->page, 'File was not found in the DepFile database.', 'File Not Found or Link Invalid.');
			else is_present($this->page, "\nLocation: /premium", 'File Not Found.');
			$this->cookie['sdlanguageid'] = '2';

			if (stripos($this->page, '<h1>Download folder</h1>') !== false) return $this->Folder();
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['depfile_com']['user']) && !empty($GLOBALS['premium_acc']['depfile_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['depfile_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['depfile_com']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->CookieLogin($user, $pass);
		} else return $this->FreeDL();
	}

	private function Folder() {
		if (isset($_GET['audl'])) return html_error('Cannot check folder in audl.');
		if (!preg_match_all('@https?://(?:www\.)?depfile\.com/[a-zA-Z\d]{8,}(?=\')@i', $this->page, $links)) html_error('Empty folder?');
		return $this->moveToAutoDownloader($links[0]);
	}

	private function FreeDL() {
		if (empty($_POST['step']) || $_POST['step'] != '1') {
			is_present($this->page, 'File is available only for Premium users', 'This File Is Only Available For Premium Users.');
			if (!preg_match('@/includes/vvc\.php\?vvcid=(\d+)@i', $this->page, $vvc)) html_error('CAPTCHA not Found.');
			$data = $this->DefaultParamArr($this->link, $this->cookie, 1, 1);
			$data['step'] = '1';
			$data['vvcid'] = $vvc[1];
			list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($this->baseUrl.$vvc[0]), 2);
			if (substr($headers, 9, 3) != '200') html_error('FreeDL: Error downloading captcha img.');
			$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');
			return $this->EnterCaptcha("data:$mimetype;base64," . base64_encode($imgBody), $data);
		}
		if (empty($_POST['vvcid'])) html_error('FreeDL: Captcha\'s vvcid not Found.');
		if (empty($_POST['captcha'])) html_error('FreeDL: You didn\'t enter the image verification code.');
		$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
		$this->cookie['sdlanguageid'] = '2';

		$post = array('vvcid' => urlencode($_POST['vvcid']), 'verifycode' => urlencode($_POST['captcha']), 'FREE' => 'Low+Speed+Download');
		$page = $this->GetPage($this->link, $this->cookie, $post);
		is_present($page, 'Wrong CAPTCHA', 'Incorrect CAPTCHA Answer.');
		is_present($page, '>Download limit for free user.<', 'FreeDL Limit Reached.');
		if (preg_match('@A file was recently downloaded from your IP address. No less than \d+ \w+ should pass before next download.@i', $page, $err)) html_error($err[0]);

		// Search Download Link
		if (!preg_match($this->DLRegexp, $page, $DL)) {
			if (!preg_match('@document\.getElementById\("wait_url"\)\.innerHTML\s*=\s*unescape\(\'([^\']+)\'\)@', $page, $inner)) html_error('Download Link Container not Found.');
			$inner = rawurldecode($inner[1]);
			if (!preg_match($this->DLRegexp, $inner, $DL)) html_error('Download Link not Found.');
		}

		// Countdown
		if (!preg_match('@var\s+sec\s*=\s*(\d+)\s*;@', $page, $cD)) html_error('Countdown not Found.');
		$this->CountDown($cD[1]);

		return $this->RedirectDownload($DL[0], urldecode(parse_url($DL[0], PHP_URL_PATH)));
	}

	private function PremiumDL() {
		$page = $this->GetPage($this->link, $this->cookie);
		$this->chkPremCaptcha($page);
		is_present($page, 'Sorry, you spent downloads limit on urls/files per 24 hours.', 'Premium Download Limit Reached.');
		if (!preg_match($this->DLRegexp, $page, $DL)) html_error('Download Link not Found.');
		return $this->RedirectDownload($DL[0], urldecode(parse_url($DL[0], PHP_URL_PATH)));
	}

	private function chkPremCaptcha(&$page) {
		if (!preg_match('@/includes/vvc\.php\?vvcid=(\d+)@i', $page, $vvc)) return false;

		if (empty($_POST['step']) || $_POST['step'] != '3') {
			$data = $this->DefaultParamArr($this->link, $this->cookie, 1, 1);
			$data['step'] = '3';
			$data['vvcid'] = $vvc[1];
			if ($this->pA) {
				$data['pA_encrypted'] = 'true';
				$data['premium_user'] = urlencode(encrypt($_REQUEST['premium_user']));
				$data['premium_pass'] = urlencode(encrypt($_REQUEST['premium_pass']));
			}
			list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($this->baseUrl.$vvc[0]), 2);
			if (substr($headers, 9, 3) != '200') html_error('PremiumDL: Error downloading captcha img.');
			$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');
			return $this->EnterCaptcha("data:$mimetype;base64," . base64_encode($imgBody), $data);
		}
		if (empty($_POST['vvcid'])) html_error('PremiumDL: Captcha\'s vvcid not Found.');
		if (empty($_POST['captcha'])) html_error('PremiumDL: You didn\'t enter the image verification code.');

		$post = array('vvcid' => urlencode($_POST['vvcid']), 'verifycode' => urlencode($_POST['captcha']), 'prem_plus' => 'Next');
		$page = $this->GetPage($this->link, $this->cookie, $post);
		is_present($page, 'Wrong CAPTCHA', 'Incorrect CAPTCHA Answer.');
		return true;
	}

	private function loginTOTP(&$page) {
		if (empty($_POST['step']) || $_POST['step'] != '2') {
			if (strpos($page, "' name='user_otp_code'") === false) return false;
			// Found otp input field
			$data = $this->DefaultParamArr($this->link, $this->cookie, 1, 1);
			$data['step'] = '2';
			if ($this->pA) {
				$data['pA_encrypted'] = 'true';
				$data['premium_user'] = urlencode(encrypt($_REQUEST['premium_user']));
				$data['premium_pass'] = urlencode(encrypt($_REQUEST['premium_pass']));
			}
			echo "<form action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
			foreach ($data as $key => $value) echo "<input type='hidden' name='$key' value='" . htmlspecialchars($value, ENT_QUOTES) . "' />\n";
			echo 'Enter login TOTP' . ($this->pA ? ' for ' . htmlspecialchars($_REQUEST['premium_user']) : '') . ":<br />\n<input type='text' pattern='[0-9]{6}' name='totp_code' placeholder='Enter OTP token here' autofocus='autofocus' required='required' />\n<input type='submit' />\n</form>";
			return html_error('Login TOTP (Time-based One-Time Password) Required');
		}
		$_POST['step'] = false;
		if (empty($_POST['totp_code']) || !preg_match('/^\d{6}$/', $_POST['totp_code'])) html_error('Empty TOTP Code or Incomplete.');

		$page = $this->GetPage($this->baseUrl . '/', $this->cookie, array('user_otp_code' => $_POST['totp_code']));
		is_present($page, "' name='user_otp_code'", 'Incorrect Login TOTP Token.');
		$this->cookie = GetCookiesArr($page, $this->cookie); // Update cookies
		$this->cookie['sdlanguageid'] = '2';

		return true;
	}

	private function Login($user, $pass) {
		$post = array('login' => 'login');
		$post['loginemail'] = urlencode($user);
		$post['loginpassword'] = urlencode($pass);
		$post['submit'] = 'login';
		$post['rememberme'] = 'on';
		$page = $this->GetPage($this->baseUrl . '/', $this->cookie, $post);
		is_present($page, 'E-mail not found.', 'Login Error: Wrong Email.');
		is_present($page, 'Incorrect password', 'Login Error: Wrong Password.');
		$this->cookie = GetCookiesArr($page, $this->cookie); // Update cookies
		$this->cookie['sdlanguageid'] = '2';
		if (empty($this->cookie['sduserid'])) html_error('Login Error: "sduserid" cookie not found.');
		if (empty($this->cookie['sdpassword'])) html_error('Login Error: "sdpassword" cookie not found.');

		$this->SaveCookies($user, $pass); // Update cookies file

		if ($this->loginTOTP($page)) $this->SaveCookies($user, $pass);

		if (stripos($page, "<img src='/images/svg/i_premium.svg'") === false) {
			$this->changeMesg('<br /><b>Account isn\'t premium?</b>', true);

			$this->page = $this->GetPage($this->link, $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			$this->cookie['sdlanguageid'] = '2';

			return $this->FreeDL();
		} else return $this->PremiumDL();
	}

	private function IWillNameItLater($cookie, $decrypt = true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass, $filename = 'depfile_dl.php') {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
		$user = strtolower($user);

		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename)) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$page = $this->GetPage($this->baseUrl.'/', $testCookie);
			if (stripos($page, '\'/uploads/logout\'>') === false) return $this->Login($user, $pass);
			$this->cookie = GetCookiesArr($page, $testCookie); // Update cookies
			$this->cookie['sdlanguageid'] = '2';
			$this->SaveCookies($user, $pass); // Update cookies file
			if ($this->loginTOTP($page)) $this->SaveCookies($user, $pass);
			if (stripos($page, "<img src='/images/svg/i_premium.svg'") === false) {
				$this->changeMesg('<br /><b>Account isn\'t premium?</b>', true);
				$this->page = $this->GetPage($this->link, $this->cookie);
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
				$this->cookie['sdlanguageid'] = '2';
				return $this->FreeDL();
			} else return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'depfile_dl.php') {
		global $secretkey;
		$maxdays = 31; // Max days to keep extra cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			if (is_array($savedcookies)) {
				// Remove old cookies
				foreach ($savedcookies as $k => $v) if (empty($v['time']) || time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
			} else $savedcookies = array();
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}
}

// [28-4-2016] Written by Th3-822.
// [02-1-2017] Fixed premium check. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class depositfiles_com extends DownloadClass {
	public $link, $page, $domain, $Mesg;
	private $cookie, $pA, $DLregexp, $TryFreeDLTricks;
	public function Download($link) {
		global $premium_acc;
		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		$this->link = str_ireplace('http://', 'https://', $link);
		$this->cookie = array('lang_current' => 'en');
		$this->DLregexp = '@(?:https?:)?//fileshare\d+\.(?:depositfiles|dfiles)\.[^/:\r\n\t\"\'<>]+(?:\:\d+)?/auth-[^\r\n\t\"\'<>]+@i';
		$this->TryFreeDLTricks = true;
		$EnableJsCountdowns = false; // Change this to true if you can't download because server/client timeouts... Doesn't work with audl serverside.
		$this->domain = parse_url($this->link, PHP_URL_HOST);
		if (empty($_REQUEST['step'])) {
			$this->page = cURL($this->link, $this->cookie);
			$this->CheckDomain();
			is_present($this->page, 'This file does not exist', 'The requested file is not found');
		} else $this->CheckDomain(false);

		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($premium_acc['depositfiles_com']['user']) && !empty($premium_acc['depositfiles_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $premium_acc['depositfiles_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $premium_acc['depositfiles_com']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			$this->CookieLogin($user, $pass);
		} else {
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			if ($EnableJsCountdowns) $this->jsFreeDL();
			else $this->FreeDL();
		}
	}

	private function CheckDomain($reload = true) {
		if (empty($this->page)) $content = cURL($this->link, $this->cookie);
		else $content = $this->page;

		if (($hpos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, 0, $hpos);
		if (stripos($content, "\nLocation: ") !== false && preg_match('@\nLocation: (?:https?:)?//(?:[^/\r\n]+\.)?((?:depositfiles|dfiles)\.[^/:\r\n\t\"\'<>]+)(?:\:\d+)?/@i', $content, $redir_domain)) {
			$link = parse_url($this->link);
			$domain = strtolower($link['host']);
			$redir_domain = strtolower($redir_domain[1]);
			if ($domain != $redir_domain) {
				global $Referer;
				$this->domain = $link['host'] = $redir_domain;
				$Referer = $this->link = rebuild_url($link);
				if ($reload) $this->page = cURL($this->link, $this->cookie);
			}
		}
	}

	private function jsT8Trick() {
		$purl = 'https://' . $this->domain . '/';
		$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
		$page = cURL($this->link, $this->cookie, array('gateway_result' => '1'));
		if (!preg_match('@<span class="html_download_api-limit_interval">[\s\t\r\n]*(\d+)[\s\t\r\n]*</span>@i', $page, $limit) || $limit < 1) return 0;
		$try = (isset($_POST['T8']['try']) ? $_POST['T8']['try'] : false);
		if (empty($_POST['T8']['fd2']) || !is_numeric($try) || $try < 0 || $try > 3) return $limit[1];
		$try++;

		$page = cURL($purl . 'get_file.php?fd2='.urlencode($_POST['T8']['fd2']), $this->cookie);
		$page = cURL($this->link, $this->cookie, array('gateway_result' => '1'));
		if (preg_match('@<span class="html_download_api-limit_interval">[\s\t\r\n]*(\d+)[\s\t\r\n]*</span>@i', $page, $_limit)) {
			$diff = $limit[1] - $_limit[1];
			$limit[1] = $_limit[1];
			$this->Mesg .= "<br /><br />Skipped $diff secs of ip-limit wait time.";
			$this->changeMesg($this->Mesg);
			if ($diff < 1) return 0; // Error?
			$page = cURL($purl . 'get_file.php?fd=clearlimit', $this->cookie);
			if (($fd2 = cut_str($page, 'name="fd2" value="', '"')) == false) return $limit[1];
			$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
			$data['step'] = '2';
			$data['T8[fd2]'] = htmlentities($fd2);
			$data['T8[try]'] = $try;
			$this->JSCountdown(30, $data, 'Try ' . ($try + 1) . ' to reduce ip-limit waiting time');
			exit;
		} else {
			$this->Mesg .= "<br /><br />Skipped the remaining {$limit[1]} secs of ip-limit wait time.";
			$this->changeMesg($this->Mesg);
			return 0;
		}
	}

	private function jsFreeDL() {
		$purl = 'https://' . $this->domain . '/';
		if ($this->TryFreeDLTricks) $this->Mesg = lang(300);
		if (!empty($_POST['step'])) switch ($_POST['step']) {
			case '1': $response = urldecode($this->verifySolveMedia(true));
				$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
				if (empty($_POST['fid'])) html_error('FileID not found after POST.');

				$query = array('fid' => $_POST['fid'], 'challenge' => $response, 'response' => 'manual_challenge', 'acpuzzle' => '1');
				$page = cURL($purl . 'get_file.php?'.http_build_query($query), $this->cookie);
				is_present($page, 'load_recaptcha()', 'Error: Wrong CAPTCHA entered.');

				if (!preg_match($this->DLregexp, $page, $dlink)) html_error('Download link Not Found.');
				return $this->RedirectDownload((substr($dlink[0], 0, 1) == '/' ? 'https:' : '') . $dlink[0], basename(urldecode(parse_url($dlink[0], PHP_URL_PATH))));
			case '2': if (!$this->TryFreeDLTricks) break;
				$limit = $this->jsT8Trick();
				if ($limit > 0) return $this->JSCountdown($limit, $this->DefaultParamArr($this->link), 'Connection limit has been exhausted for your IP address');
				break;
			case '3': if (empty($_POST['T8']['fid']) || empty($_POST['T8']['cpid'])) html_error('Empty values after countdown.');
				$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
				if ($this->TryFreeDLTricks) {
					$page = cURL($purl . 'get_file.php?fd2='.urlencode($_POST['T8']['fid']), $this->cookie);
					if (preg_match($this->DLregexp, $page, $dlink)) return $this->RedirectDownload((substr($dlink[0], 0, 1) == '/' ? 'https:' : '') . $dlink[0], basename(urldecode(parse_url($dlink[0], PHP_URL_PATH))));
					$this->Mesg .= '<br /><br /><b>Cannot skip captcha.</b>';
					$this->changeMesg($this->Mesg);
				}

				$page = cURL($purl . 'get_file.php?fid='.urlencode($_POST['T8']['fid']), $this->cookie);
				is_notpresent($page, 'load_recaptcha()', 'Error: Countdown skipped?.');

				if (!preg_match('@var\s*+ACPuzzleKey\s*=\s*[\'\"]([\w\.\-]+)[\'\"]\s*;@', $page, $cpkey)) html_error('FreeDL: CAPTCHA Not Found.');

				$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
				$data['step'] = '1';
				$data['fid'] = urlencode($fid[1]);
				return $this->SolveMedia($cpkey[1], $data);
		}

		$page = cURL($this->link, $this->cookie, array('gateway_result' => '1'));
		is_present($page, 'This file does not exist', 'The requested file is not found');
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (stripos($page, 'Connection limit has been exhausted for your IP address!') !== false) {
				if (preg_match('@<span class="html_download_api-limit_interval">[\s\t\r\n]*(\d+)[\s\t\r\n]*</span>@i', $page, $limit)) {
					if ($limit[1] > 45) {
						$page = cURL($purl . 'get_file.php?fd=clearlimit', $this->cookie);
						if (($fd2 = cut_str($page, 'name="fd2" value="', '"')) == false) return $limit[1];
						$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
						$data['step'] = '2';
						$data['T8[fd2]'] = htmlentities($fd2);
						$data['T8[try]'] = '0';
						return $this->JSCountdown(30, $data, 'Try 1 to reduce ip-limit waiting time');
					}
					return $this->JSCountdown($limit[1], $this->DefaultParamArr($this->link), 'Connection limit has been exhausted for your IP address');
				} else html_error('Connection limit has been exhausted for your IP address. Please try again later.');
			}

			if (!preg_match('@var\s+fid\s*=\s*\'(\w+)\'@i', $page, $fid)) html_error('FileID not found.');
			if (!preg_match('@setTimeout\(\'load_form\(fid, msg\)\',\s*(\d+)(\s*\*\s*1000)?\s*\);@i', $page, $cd)) html_error('Countdown not found.');
			$cd = empty($cd[2]) ? $cd[1] / 1000 : $cd[1];
			if ($cd > 0) {
				$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
				$data['step'] = '3';
				$data['T8[fid]'] = htmlentities($fid[1]);
				$data['T8[cpid]'] = $cpid[1];
				return $this->JSCountdown($cd, $data);
			}

			if ($this->TryFreeDLTricks) {
				$page = cURL($purl . 'get_file.php?fd2='.urlencode($fid[1]), $this->cookie);
				if (preg_match($this->DLregexp, $page, $dlink)) return $this->RedirectDownload((substr($dlink[0], 0, 1) == '/' ? 'https:' : '') . $dlink[0], basename(urldecode(parse_url($dlink[0], PHP_URL_PATH))));
				$this->Mesg .= '<br /><br /><b>Cannot skip captcha.</b>';
				$this->changeMesg($this->Mesg);
			}

			$page = cURL($purl . 'get_file.php?fid='.urlencode($fid[1]), $this->cookie);
			is_notpresent($page, 'load_recaptcha()', 'Error: Countdown skipped?.');

			if (!preg_match('@var\s*+ACPuzzleKey\s*=\s*[\'\"]([\w\.\-]+)[\'\"]\s*;@', $page, $cpkey)) html_error('FreeDL: CAPTCHA Not Found.');

			$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
			$data['step'] = '1';
			$data['fid'] = urlencode($fid[1]);
			return $this->SolveMedia($cpkey[1], $data);
	}

	private function FreeDL() {
		$purl = 'https://' . $this->domain . '/';
		if (!empty($_POST['step']) && $_POST['step'] == 1) {
			$response = urldecode($this->verifySolveMedia(true));
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
			if (empty($_POST['fid'])) html_error('FileID not found after POST.');

			$query = array('fid' => $_POST['fid'], 'challenge' => $response, 'response' => 'manual_challenge', 'acpuzzle' => '1');
			$page = cURL($purl . 'get_file.php?'.http_build_query($query), $this->cookie);
			is_present($page, 'load_recaptcha()', 'Error: Wrong CAPTCHA entered.');

			if (!preg_match($this->DLregexp, $page, $dlink)) html_error('Download link Not Found.');
			$this->RedirectDownload((substr($dlink[0], 0, 1) == '/' ? 'https:' : '') . $dlink[0], basename(urldecode(parse_url($dlink[0], PHP_URL_PATH))));
		} else {
			$page = cURL($this->link, $this->cookie, array('gateway_result' => '1'));
			is_present($page, 'This file does not exist', 'The requested file is not found');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			if ($this->TryFreeDLTricks) $this->Mesg = lang(300);

			if (stripos($page, 'Connection limit has been exhausted for your IP address!') !== false) {
				if (preg_match('@<span class="html_download_api-limit_interval">[\s\t\r\n]*(\d+)[\s\t\r\n]*</span>@i', $page, $limit)) {
					$x = 0;
					if ($this->TryFreeDLTricks && $limit[1] > 45) while ($x < 3) {
						$page = cURL($purl . 'get_file.php?fd=clearlimit', $this->cookie);
						if (($fd2 = cut_str($page, 'name="fd2" value="', '"')) == false) break;
						insert_timer(30, 'Trying to reduce ip-limit waiting time.');
						$page = cURL($purl . 'get_file.php?fd2='.urlencode($fd2), $this->cookie);
						$page = cURL($this->link, $this->cookie, array('gateway_result' => '1'));
						if (!preg_match('@<span class="html_download_api-limit_interval">[\s\t\r\n]*(\d+)[\s\t\r\n]*</span>@i', $page, $_limit)) {
							$this->Mesg .= '<br /><br />Skipped the remaining '.($limit[1] - 30).' secs of ip-limit wait time.';
							$this->changeMesg($this->Mesg);
							$limit[1] = 0;
							break;
						}
						$diff = ($limit[1] - 30) - $_limit[1];
						$limit[1] = $_limit[1];
						$this->Mesg .= "<br /><br />Skipped $diff secs of ip-limit wait time.";
						$this->changeMesg($this->Mesg);
						if ($diff < 1) break; // Error?
						$x++;
					}
					if ($limit[1] > 0) return $this->JSCountdown($limit[1], $this->DefaultParamArr($this->link), 'Connection limit has been exhausted for your IP address');
				} else html_error('Connection limit has been exhausted for your IP address. Please try again later.');
			}

			if (!preg_match('@var\s+fid\s*=\s*\'(\w+)\'@i', $page, $fid)) html_error('FileID not found.');
			if (!preg_match('@setTimeout\(\'load_form\(fid, msg\)\',\s*(\d+)(\s*\*\s*1000)?\s*\);@i', $page, $cd)) html_error('Countdown not found.');
			$cd = empty($cd[2]) ? $cd[1] / 1000 : $cd[1];
			if ($cd > 0) $this->CountDown($cd);

			if ($this->TryFreeDLTricks) {
				$page = cURL($purl . 'get_file.php?fd2='.urlencode($fid[1]), $this->cookie);
				if (preg_match($this->DLregexp, $page, $dlink)) return $this->RedirectDownload((substr($dlink[0], 0, 1) == '/' ? 'https:' : '') . $dlink[0], basename(urldecode(parse_url($dlink[0], PHP_URL_PATH))));
				$this->Mesg .= '<br /><br /><b>Cannot skip captcha.</b>';
				$this->changeMesg($this->Mesg);
			}

			$page = cURL($purl . 'get_file.php?fid='.urlencode($fid[1]), $this->cookie);
			is_notpresent($page, 'load_recaptcha()', 'Error: Countdown skipped?.');

			if (!preg_match('@var\s*+ACPuzzleKey\s*=\s*[\'\"]([\w\.\-]+)[\'\"]\s*;@', $page, $cpkey)) html_error('FreeDL: CAPTCHA Not Found.');

			$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
			$data['step'] = '1';
			$data['fid'] = urlencode($fid[1]);
			return $this->SolveMedia($cpkey[1], $data);
		}
	}

	private function PremiumDL() {
		$page = cURL($this->link, $this->cookie);
		is_present($page, 'This file does not exist', 'The requested file is not found');

		if (!preg_match_all($this->DLregexp, $page, $dlink)) html_error('Download-link Not Found.');
		$dlink = $dlink[0][array_rand($dlink[0])];
		$fname = basename(urldecode(parse_url($dlink, PHP_URL_PATH)));
		$this->RedirectDownload((substr($dlink[0], 0, 1) == '/' ? 'https:' : '') . $dlink, $fname);
	}

	private function Login($user, $pass) {
		$purl = 'https://' . $this->domain . '/';
		$errors = array('CaptchaInvalid' => 'Wrong CAPTCHA entered.', 'LoginInvalid' => 'Invalid Login/Pass.', 'InvalidLogIn' => 'Invalid Login/Pass.', 'CaptchaRequired' => 'Captcha Required.');
		if (!empty($_POST['step']) && $_POST['step'] == '1') {
			$post = $this->verifyReCaptchav2();
			$post['login'] = urlencode($user);
			$post['password'] = urlencode($pass);

			$page = cURL($purl.'api/user/login', $this->cookie, $post, $purl.'login.php?return=%2F');
			$json = $this->json2array($page);
			if (!empty($json['error'])) html_error('Login Error'. (!empty($errors[$json['error']]) ? ': ' . $errors[$json['error']] : '.. ['.htmlentities($json['error']).']'));
			elseif ($json['status'] != 'OK') html_error('Login Failed');

			$this->cookie = GetCookiesArr($page, $this->cookie);
			if (empty($this->cookie['autologin'])) html_error('Login Error: Cannot find "autologin" cookie');

			$this->SaveCookies($user, $pass); // Update cookies file
			if ($json['data']['mode'] == 'free') html_error('Login Error: Account isn\'t gold');

			return $this->PremiumDL();
		} else {
			$post = array();
			$post['login'] = urlencode($user);
			$post['password'] = urlencode($pass);

			$page = cURL($purl.'api/user/login', $this->cookie, $post, $purl.'login.php?return=%2F');
			$json = $this->json2array($page);
			if (!empty($json['error']) && $json['error'] != 'CaptchaRequired') html_error('Login Error'. (!empty($errors[$json['error']]) ? ': ' . $errors[$json['error']] : '. ['.htmlentities($json['error']).']'));
			elseif ($json['status'] == 'OK') {
				$this->cookie = GetCookiesArr($page, $this->cookie);
				if (empty($this->cookie['autologin'])) html_error('Login Error: Cannot find "autologin" cookie.');
				$this->SaveCookies($user, $pass); // Update cookies file
				if ($json['data']['mode'] == 'free') html_error('Login Error: Account isn\'t gold.');
				return $this->PremiumDL();
			} elseif (empty($json['error']) || $json['error'] != 'CaptchaRequired') html_error('Login Failed.');

			// Captcha Required
			$page = cURL($purl.'login.php?return=%2F', $this->cookie, 0, $purl);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			if (!preg_match('@(https?://([\w\-]+\.)?(?:depositfiles|dfiles)\.[^/:\r\n\t\"\'<>]+(?:\:\d+)?)/js/base2\.js@i', $page, $jsurl)) html_error('Cannot find captcha.');
			$jsurl = (empty($jsurl[1])) ? 'https://' . $this->domain . $jsurl[0] : $jsurl[0];
			$page = cURL($jsurl, $this->cookie, 0, $purl.'login.php?return=%2F');

			if (!preg_match('@recaptcha2PublicKey\s*=\s*[\'\"]([\w\.\-]+)@i', $page, $cpid)) html_error('reCAPTCHA2 Not Found.');

			$data = $this->DefaultParamArr($this->link);
			$data['step'] = '1';
			$data['premium_acc'] = 'on';
			if ($this->pA) {
				$data['pA_encrypted'] = 'true';
				$data['premium_user'] = urlencode(encrypt($user));
				$data['premium_pass'] = urlencode(encrypt($pass));
			}
			$this->reCAPTCHAv2($cpid[1], $data, 0, 'Login');
		}
	}

	// Special Function Called by verifyReCaptchav2 When Captcha Is Incorrect, To Allow Retry. - Required for NoScript reCAPTCHA2
	protected function retryReCaptchav2() {
		$data = $this->DefaultParamArr($this->link);
		$data['step'] = '1';
		$data['premium_acc'] = 'on';
		if ($this->pA && !empty($_GET['pA_encrypted']) && !empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) {
			$data['pA_encrypted'] = 'true';
			$data['premium_user'] = $_REQUEST['premium_user'];
			$data['premium_pass'] = $_REQUEST['premium_pass'];
		}
		return $this->reCAPTCHAv2($_POST['recaptcha2_public_key'], $data, 0, 'Retry Login');
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass, $filename = 'depositfiles_dl.php') {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');

		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename) || (!empty($_POST['step']) && $_POST['step'] == '1')) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = sha1($user.':'.$pass);
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$page = cURL('https://' . $this->domain . '/', $testCookie);
			if (stripos($page, 'style="display: none;" data-type="guest"') === false) return $this->Login($user, $pass);
			$this->cookie = GetCookiesArr($page, $testCookie); // Update cookies
			$this->SaveCookies($user, $pass); // Update cookies file
			is_present($page, 'user_icon user_member', 'Account isn\'t premium');
			return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'depositfiles_dl.php') {
		global $secretkey;
		$maxdays = 31; // Max days to keep cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = sha1($user.':'.$pass);
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}

	public function CheckBack($header) {
		$statuscode = intval(substr($header, 9, 3));
		if ($statuscode == 400) {
			if (stripos($header, "\nGuest-Limit: Wait") !== false) html_error('[DepositFiles] FreeDL Limit Reached, try downloading again for countdown.');
			elseif (stripos($header, "\nDownload-Error: No such voucher") !== false) html_error('[DepositFiles] Expired download link.');
			else html_error('Error: 400 Bad Request');
		} elseif ($statuscode == 404) {
			textarea($header);
			html_error('[DepositFiles] Your IP was banned?.');
		}
	}

	// Fix For HTTPS links.
	public function RedirectDownload($link, $FileName = 0, $cookie = 0, $post = 0, $referer = 0, $force_name = 0, $auth = 0, $addon = array()) {
		return parent::RedirectDownload(str_ireplace('https://', 'http://', $link), $FileName, $cookie, $post, $referer, $force_name, $auth, $addon);
	}
}

//[13-1-2013]  Written by Th3-822.
//[20-1-2013] Updated for df's new domains. - Th3-822
//[20-2-2013] Added new functions and a var for using JSCountdown at freedl for avoid timeouts. - Th3-822
//[23-7-2013] Fixed freedl countdown on both freedl functions. - Th3-822
//[17-9-2013] Fixed redirect not working with https links. - Th3-822
//[21-6-2015] Fixed CAPTCHAs. - Th3-822
//[25-3-2017] Switched to cURL/https, fixed CheckDomain & fixed download regexp/url. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class diskokosmiko_mx extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.diskokosmiko\.mx/download\?[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://diskokosmiko\.mx)/(?:[^/]+/)+[^\r\n\t/<>\"]+?,(\d+)[^\r\n\t/<>\"]*@i', preg_replace('@^(http)s?(://)(?:www\.)?(diskokosmiko)\.(?:mx|com)(?=/)@i', '$1$2$3.mx', $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['diskokosmiko_mx']['user']) && !empty($GLOBALS['premium_acc']['diskokosmiko_mx']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['diskokosmiko_mx']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['diskokosmiko_mx']['pass']);
			return $this->Login($user, $pass);
		} else return $this->TryDL();
	}

	private function TryDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!preg_match($this->DLRegexp, $this->page, $DL)) {
			if (substr($this->page, 9, 3) != '200') html_error('File Not Found or Private.');
			$download = $this->reqAction('DownloadFile', array('fileId' => $this->fid, '__RequestVerificationToken' => $this->getCSRFToken($this->page)));
			if (empty($download['DownloadUrl']) || !preg_match($this->DLRegexp, $download['DownloadUrl'], $DL)) {
				if (empty($this->cookie['.ASPXAUTH_v2']) && $download['Type'] == 'Window') html_error('Login is Required to Download This File.');
				html_error('Download-Link Not Found.');
			}
		}
		return $this->RedirectDownload($DL[0], 'diskokosmiko_placeholder_fname');
	}

	private function getCSRFToken($page, $errorPrefix = 'Error') {
		if (!preg_match('@name="__RequestVerificationToken"\s+type="hidden"\s+value="([\w\-+/=]+)"@i', $page, $token)) return html_error("[$errorPrefix]: Request Token Not Found.");
		return $token[1];
	}

	private function Login($user, $pass) {
		$page = $this->GetPage($this->baseurl . '/', $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$login = $this->reqAction('Account/Login', array('UserName' => $user, 'Password' => $pass, '__RequestVerificationToken' => $this->getCSRFToken($page, 'Login Error')));
		if (!empty($login['Content'])) is_present($login['Content'], 'El nombre de usuario o la contrase&#241;a no son correctos', 'Login Error: Wrong Login/Password.');
		if (empty($this->cookie['.ASPXAUTH_v2'])) html_error('Login Error: Cookie ".ASPXAUTH_v2" not Found.');

		return $this->TryDL();
	}

	private function reqAction($path, $post = array()) {
		$page = $this->GetPage("{$this->baseurl}/action/$path", $this->cookie, array_map('urlencode', $post), "{$this->baseurl}/\r\nX-Requested-With: XMLHttpRequest");
		$reply = $this->json2array($page, "reqAction($path) Error");
		if (empty($reply)) html_error("[reqAction($path) Error] Empty Response.");
		$this->cookie = GetCookiesArr($page, $this->cookie);

		return $reply;
	}
}

// [20-3-2016] Written by Th3-822.
// [22-4-2016] Renamed to diskokosmiko_mx and fixed. - Th3-822

?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit();
}

class dl_free_fr extends DownloadClass {
    
    public function Download($link) {
        $page = $this->GetPage($link);
        if (preg_match('@Location: (http(s)?:\/\/[^\r\n]+)@i', $page, $redir)) {
            $link = trim($redir[1]);
            $page = $this->GetPage($link);
        }
        is_present($page, "Fichier inexistant.", "The file could not be found. Please check the download link.");
        is_present($page, "Le fichier demand&eacute; n'a pas &eacute;t&eacute; trouv&eacute;.", "The file could not be found. Please check the download link.");
        is_present($page, "Erreur 404 - Document non trouv&eacute;", "The file could not be found. Please check the download link.");
        is_present($page, "Appel incorrect.", "Incorrect link.");
        $cookie = GetCookies($page);
        if (!preg_match('@<a style="text-decoration: underline" id="link" href="(http(s)?:\/\/[^|\r|\n|"]+)">@', $page, $dl)) html_error("Error: Download link not found!");
        $dlink = trim($dl[1]);
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $cookie, 0, $link);
        exit();
    }
}
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class dropapk_com extends GenericXFS_DL {
	public $pluginVer = 15;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class easybytez_com extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}

	protected function sendLogin($post) {
		$purl = (!empty($this->sslLogin) ? 'https://'.$this->host.'/' : $this->purl) . '?op=login';
		$page = $this->GetPage($purl, $this->cookie);
		if (!($form = cut_str($page, '<form', '</form>'))) html_error('Cannot find login form.');
		if (!($post['rand'] = cut_str($page, 'name="rand" value="', '"'))) html_error('Login form "rand" not found.');
		$post['op'] .= '2';
		return parent::sendLogin($post);
	}

	protected function checkLogin($page) {
		if (preg_match('@Your IP is temporarily blocked due to \d+ incorrect login attempts<br(?:\s*/)?>This block will last for \d+ \w+.@i', $page, $err)) html_error($err[0]);
		return parent::checkLogin($page);
	}

	// It always show expire date... So i will have to check it.
	protected function isAccPremium($page) {
		if (!preg_match('@Premium account expire:\s*</TD>\s*<TD>\s*<b>\s*(\d+ \w+ \d{4})\s*</b>@i', $page, $date) || !($date = strtotime($date[1]))) html_error('Cannot check premium status.');
		return (time() < $date ? true : false);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class ex_load_com extends GenericXFS_DL {
	public $pluginVer = 5;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)

		$this->Start($link);
	}

	// Edited to add login captcha decoder.
	protected function sendLogin($post) {
		$purl = (!empty($this->sslLogin) ? 'https://'.$this->host.'/' : $this->purl) . '?op=login';
		$page = $this->GetPage($purl, $this->cookie);
		if (!($form = cut_str($page, '<form', '</form>'))) html_error('Cannot find login form.');
		if (!($post['rand'] = cut_str($page, 'name="rand" value="', '"'))) html_error('Login form "rand" not found.');
	
		if (substr_count($form, "<span style='position:absolute;padding-left:") > 3 && preg_match_all("@<span style='[^\'>]*padding-left\s*:\s*(\d+)[^\'>]*'[^>]*>((?:&#\w+;)|(?:\d))</span>@i", $form, $txtCaptcha)) {
			// Text Captcha (decodeable)
			$txtCaptcha = array_combine($txtCaptcha[1], $txtCaptcha[2]);
			ksort($txtCaptcha, SORT_NUMERIC);
			$txtCaptcha = trim(html_entity_decode(implode($txtCaptcha), ENT_QUOTES, 'UTF-8'));
			$post['code'] = $txtCaptcha;
		} else html_error('Login captcha not found.');

		// Don't remove this sleep or you will only see "Error Decoding Captcha. [Login]"
		sleep(3); // 2 or 3 seconds.
		return parent::sendLogin($post);
	}

	// Added login captcha error msg.
	protected function checkLogin($page) {
		is_present($page, '>Wrong captcha code<', 'Error: Error Decoding Captcha. [Login]');
		return parent::checkLogin($page);
	}
}
// Written by Th3-822.
?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class facebook_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@://(?:[^/]+\.)?facebook\.com/(?:(?:video/video|photo)\.php\?v=|[\w\-]+/videos/)(\d+)@i', $link, $vid)) html_error('Video ID not found.');
		$page = $this->GetPage('https://www.facebook.com/video/video.php?v='.$vid[1]);
		is_present($page, '>This content is currently unavailable<', 'Video unavailable or deleted.');

		if (!preg_match('@"video_title"\s?,\s?"([^"]+)"@i', $page, $title) && !preg_match('@<title id="pageTitle">[\s\t\r\n]*([^<>]+)[\s\t\r\n]*\|[\s\t\r\n]*Facebook[\s\t\r\n]*</title>@i', $page, $title)) {
			html_error('Video title not found.');
		}
		$title = preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', urldecode(html_entity_decode(preg_replace('@\\\u(\d{4})@i', '&#$1;', trim($title[1])), ENT_QUOTES, 'UTF-8')));

		if (!preg_match('@"video_src"\s?,\s?"(http[^"]+)"@i', $page, $dl)) {
			if (!preg_match('@\[\s?\"params\"\\s?,\s?\"([^\"\]]+)@i', $page, $params)) html_error('Download link not found.');
			$params = json_decode(urldecode(str_replace('\u0025', '%', $params[1])), true);
			$video = reset($params['video_data']);
			$dllink = !empty($video['hd_src']) ? $video['hd_src'] : $video['sd_src'];
		} else $dllink = urldecode(str_replace('\u0025', '%', $dl[1]));

		$ext = strrchr(basename(parse_url($dllink, PHP_URL_PATH)), '.');if (empty($ext)) $ext = '.flv';
		$fname = "$title [FB-" . (!empty($video['hd_src']) ? 'HD' : 'SD') . "][{$vid[1]}]$ext";
		// Remove rate limit
		$dllink = preg_replace('@&rl=\d+@i', '', $dllink);
		$this->RedirectDownload($dllink, $fname);
	}
}

//[25-10-2012] Written by Th3-822. (I won't reply "media-related" plugin requests by Mail/IM/PM, only at forum.)
//[20-9-2016] Small Fixes. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class file_al extends GenericXFS_DL {
	public $pluginVer = 13;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class file_upload_com extends GenericXFS_DL {
	public $pluginVer = 22;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder

		$this->Start($link);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class fileband_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class fileboom_me extends DownloadClass {
	private $page, $cookie = array(), $pA;
	public function Download($link) {
		$this->LnkRegexp = '@https?://(?:www\.)?(f(?:ile)?boom\.me)/file(?:/info)?/(\w+)@i';
		$this->RDRegexp = '@/file/url.html\?file=\w+@i';
		$this->DLRegexp = '@https?://(?:free|premium)-\d+\.(?:f(?:ile)?boom\.me)/[^\s\'\"<>]+@i';

		if (!preg_match($this->LnkRegexp, $link, $fid)) html_error('Invalid link?.');
		$this->domain = $fid[1];
		$this->link = $GLOBALS['Referer'] = 'https://'.$fid[1].'/file/'.$fid[2];

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			if (preg_match($this->LnkRegexp, $this->page, $fid)) {
				$this->domain = $fid[1];
				$this->link = $GLOBALS['Referer'] = 'https://'.$fid[1].'/file/'.$fid[2];
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
				$this->page = $this->GetPage($this->link, $this->cookie);
			}
			is_present($this->page, 'File not found or deleted');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['fileboom_me']['user']) && !empty($GLOBALS['premium_acc']['fileboom_me']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['fileboom_me']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['fileboom_me']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->CookieLogin($user, $pass);
		} else return $this->FreeDL();
	}

	private function FreeDL() {
		if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
			is_present($this->page, 'This file is available<br>only for premium members.', 'This file is available only for premium members.');
			$post = array();
			$post['slow_id'] = cut_str($this->page, 'data-slow-id="', '"');
			if (empty($post['slow_id'])) html_error('FreeDL ID don\'t found.');

			$page = $this->GetPage($this->link, $this->cookie, $post);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			// Check freedl limit timer
			if (preg_match('@Please wait (?:(\d{1,2})\:)?(\d{2}):(\d{2}) to download this file@i', $page, $timer)) {
				$timer = ($timer[1] * 3600) + ($timer[2] * 60) + $timer[3];
				return $this->JSCountdown($timer, 0, 'FreeDL limit reached.');
			}

			// Check direct link
			if (preg_match($this->RDRegexp, $page, $idDl)) {
				$page = $this->GetPage('https://'.$this->domain.$idDl[0], $this->cookie);
				if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download Link Not Found.');
				return $this->RedirectDownload($dl[0], 'T8_fb_fr2', $this->cookie);
			}

			$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
			$data['step'] = '1';
			$data['uniqueId'] = $post['slow_id'];

			if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $cpid)) {
				$data['step'] = '1';
				$this->reCAPTCHA($pid[1], $data);
			} elseif (preg_match('@\W(file/captcha\.html\?v=\w+)@i', $page, $cpid)) {
				$data['step'] = '2';
				list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage('https://'.$this->domain.'/'.$cpid[1], $this->cookie), 2);
				if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
				$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');
				$this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20);
			} else html_error('CAPTCHA not found.');
			return;
		}

		$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
		$uniqueId = !empty($_POST['uniqueId']) ? trim($_POST['uniqueId']) : false;
		if (empty($uniqueId)) html_error('Error: Empty "uniqueId".');

		$post = array('free' => 1, 'freeDownloadRequest' => 1, 'uniqueId' => $uniqueId);
		if ($_POST['step'] == '1') {
			if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
			$post['CaptchaForm%5Bcode%5D'] = '';
			$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
			$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
		} else {
			if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
			$post['CaptchaForm%5Bcode%5D'] = urlencode($_POST['captcha']);
		}

		$page = $this->GetPage($this->link, $this->cookie, $post);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		is_present($page, 'The verification code is incorrect.');

		if (!preg_match('@\sid="download-wait-timer"[^>]*>\s*(?:<\w+(?:\s[^>]+)?>)?(\d+)\s*</@i', $page, $cD)) html_error('Countdown not found.');
		if ($cD[1] > 0) $this->CountDown($cD[1]);

		$post = array('uniqueId' => $uniqueId, 'free' => 1);
		$page = $this->GetPage($this->link, $this->cookie, $post);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		if (!preg_match($this->RDRegexp, $page, $idDl)) html_error('Redirect Link Not Found.');
		$page = $this->GetPage('https://'.$this->domain.$idDl[0], $this->cookie);

		if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download Link Not Found.');

		$this->RedirectDownload($dl[0], 'T8_fb_fr', $this->cookie);
	}

	private function checkAntiBotCaptcha($page) {
		if (!empty($_POST['step']) && $_POST['step'] == '-1') return; // Don't recheck.
		if (stripos($page, 'Your account is suspected in using illegal software') !== false) {
			$data = $this->DefaultParamArr($this->link);
			$data['premium_acc'] = 'on';
			if ($this->pA) {
				$data['pA_encrypted'] = 'true';
				$data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
				$data['premium_pass'] = urlencode(encrypt($pass)); // And this too.
			}
			if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $pkey)) {
				$data['step'] = '3';
				return $this->reCAPTCHA($pkey[1], $data);
			} elseif (preg_match('@(https?://(?:www\.)?(?:f(?:ile)?boom\.me))?(?(1)/)(?:[^/\"\'<>\s]+/)*captcha\.html\?v=\w+@i', $page, $imgcap)) {
				$imgcap = empty($imgcap[1]) ? 'https://'.$this->domain.'/'.$imgcap[0] : $imgcap[0];
				$data['step'] = '4';
				list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($purl . $cpid[1], $this->cookie), 2);
				if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
				$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');

				return $this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20);
			}
			html_error('AntiBot captcha not found.');
		}
	}

	private function postAntiBotCaptcha() {
		if (empty($_POST['step']) || !in_array($_POST['step'], array('3', '4'))) return $_POST['step'] = false;
		$post = array();
		if ($_POST['step'] == '3') {
			if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
			if (empty($_POST['recaptcha_challenge_field'])) html_error('Empty reCAPTCHA challenge.');
			$post['CoreRobotsCheckForm%5BverifyCode%5D'] = '';
			$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
			$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
		} else {
			if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
			$post['CoreRobotsCheckForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
		}
		$_POST['step'] = '-1';

		return $this->GetPage($this->link, $this->cookie, $post);
	}

	private function PremiumDL() {
		if (!($page = $this->postAntiBotCaptcha())) $page = $this->GetPage($this->link, $this->cookie);
		if (preg_match($this->LnkRegexp, $page, $fid)) {
			$this->domain = $fid[1];
			$this->link = $GLOBALS['Referer'] = 'https://'.$fid[1].'/file/'.$fid[2];
			$this->cookie = GetCookiesArr($page, $this->cookie);
			$page = $this->GetPage($this->link, $this->cookie);
		}
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$this->checkAntiBotCaptcha($page);

		// Check direct link
		if (preg_match($this->DLRegexp, $page, $dl)) return $this->RedirectDownload($dl[0], 'T8_fb_pr2', $this->cookie);

		is_present($page, 'Traffic limit exceed!');

		if (!preg_match($this->RDRegexp, $page, $idDl)) html_error('Redirect-Link Not Found.');
		$page = $this->GetPage('https://'.$this->domain.$idDl[0], $this->cookie);
		if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download-Link Not Found.');
		return $this->RedirectDownload($dl[0], 'T8_fb_pr', $this->cookie);
	}

	private function Login($user, $pass) {
		$purl = 'https://'.$this->domain.'/';

		$post = array();
		$post['LoginForm%5Busername%5D'] = urlencode($user);
		$post['LoginForm%5Bpassword%5D'] = urlencode($pass);
		$post['LoginForm%5BrememberMe%5D'] = 1;
		if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
			$page = $this->GetPage($purl.'login.html', $this->cookie, $post, $purl);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			if (stripos($page, 'The verification code is incorrect.') !== false) {
				$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
				$data['premium_acc'] = 'on';
				if ($this->pA) {
					$data['pA_encrypted'] = 'true';
					$data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
					$data['premium_pass'] = urlencode(encrypt($pass)); // And this too.
				}
				if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $cpid)) {
					$data['step'] = '1';
					$this->reCAPTCHA($pid[1], $data, 0, 'Login');
				} elseif (preg_match('@\W(auth/captcha\.html\?v=\w+)@i', $page, $cpid)) {
					$data['step'] = '2';

					list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($purl . $cpid[1], $this->cookie), 2);
					if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
					$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');

					$this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20);
				} else html_error('Login CAPTCHA not found.');
				exit;
			}
		} else {
			if ($_POST['step'] == '1') {
				if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
				$post['LoginForm%5BverifyCode%5D'] = '';
				$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
				$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
			} else {
				if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
				$post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
			}

			$_POST['step'] = false;
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

			$page = $this->GetPage($purl.'login.html', $this->cookie, $post, $purl);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			is_present($page, 'The verification code is incorrect.');
		}
		is_present($page, 'Incorrect username or password', 'Login Failed: Email/Password incorrect.');
		is_present($page, 'You logged in from different country IP', 'Login Failed: Your account was locked for security reasons, to unlock your account check your email.');
		if (empty($this->cookie['c903aeaf0da94d1b365099298d28f38f'])) html_error('Login Cookie Not Found.');

		$page = $this->GetPage($purl.'site/profile.html', $this->cookie, 0, $purl.'login.html');
		is_notpresent($page, '/auth/logout.html">Logout', 'Login Error.');
		$this->SaveCookies($user, $pass); // Update cookies file
		if (preg_match('@Account type:\s*<span(?:\s[^>]+)?>\s*Free\s*</span>@i', $page)) html_error('Account isn\'t premium.');

		return $this->PremiumDL();
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass, $filename = 'fileboom_dl.php') {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
		$user = strtolower($user);

		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename) || (!empty($_POST['step']) && in_array($_POST['step'], array('1', '2')))) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$page = $this->GetPage('https://'.$this->domain.'/site/profile.html', $testCookie);
			if (stripos($page, '/auth/logout.html">Logout') === false) return $this->Login($user, $pass);
			$this->cookie = GetCookiesArr($page, $testCookie); // Update cookies
			$this->SaveCookies($user, $pass); // Update cookies file
			if (preg_match('@Account type:\s*<span(?:\s[^>]+)?>\s*Free\s*</span>@i', $page)) html_error('Account isn\'t premium');
			return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'fileboom_dl.php') {
		global $secretkey;
		$maxdays = 31; // Max days to keep extra cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}
}

//[16-2-2014] Written by Th3-822.
//[07-3-2014] Fixed login captcha. - Th3-822
//[08-6-2014] Added support for Anti bot captcha at premium Dl. (Untested) - Th3-822
//[02-8-2014] Fixed FreeDL captcha. - Th3-822
//[02-1-2016] Fixed FreeDL countdown. - Th3-822
//[17-1-2016] Copied keep2share_cc to fileboom_me & fixed. - Th3-822
//[02-4-2017] Switched to https. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class filecloud_io extends DownloadClass {
	
	public function Download($link) {
			echo 'Filecloud.io Download Plugin by <b>The Devil</b><br>';
			global $premium_acc;
			(!empty($premium_acc['filecloud_io']['user']) || !empty($premium_acc['filecloud_io']['pass']) || !empty($_REQUEST['premium_user']) || !empty($_REQUEST['premium_pass'])) ? html_error('Download From Premium Account Not Supported Yet') :'';
			if($_POST['Devil'] == "1") {
				$this->DownloadFree($link);
			} else {
				$this->GetIt($link);
			}
	}
	
	private function GetIt($link){
		
		$this->page = $this->GetPage($link);
		is_present($this->page,'The file at this URL was either removed or did not exist in the first place','File Deleted');
		$this->cookie = GetCookiesArr($this->page);
		$this->strcookie = CookiesToStr($this->cookie);
		$this->fname = cut_str($this->page,'title="','"'); 
		$devil = preg_match("@data:([\d\w\s :',\{\}]+)@", $this->page,$block);
		(!$devil)?html_error('[4]Error: Unable to Retrieve Data'):'';
		$block = substr(preg_replace('/\s+/', '', $block[1]),0,-1);
		$block = preg_replace("/'+/", '"', $block);
		$block = preg_replace("/response/", '"response"', $block);
		$data = $this->jsonreply($block);
		(empty($data['f2']) || empty($data['f1']) || empty($data['fkey']))?html_error('[2]Error: API Down/Check API'):'';
		$devil = preg_match("@'sitekey'([\d\w\s:']+)@",$this->page,$pubkeys);
		(!$devil)?html_error('[5]Error: Unable to Retrieve reCAPTCHAv2 Key'):'';
		$pubkey = str_replace(array("'",":",' '),'',$pubkeys[1]);
		$data['Devil'] = '1';
		$data['link'] = $link;
		$data['cookie']=$this->strcookie;
		$data['fname'] = $this->fname;
		$this->reCAPTCHAv2($pubkey,$data);
	}
	

	private function DownloadFree($link){
		$vcap = $this->verifyReCaptchav2(true);
		$go = $_POST['link'];
		$post = array('fkey'=>$_POST['fkey'],'f1'=>$_POST['f1'],'f2'=>$_POST['f2'],'r'=>$vcap);
		$requesturl = 'http://filecloud.io/?m=download&a=request';
		$this->devil = $this->GetPage($requesturl,$cookie,$post,$go);
		is_present($this->devil,'error','[3]Error: Contact Admin If Error Continues');
		$this->devil = $this->jsonreply($this->devil);
		(empty($this->devil['downloadUrl']))?html_error('[1]Error: Plugin Update Required!'):'';
		$this->RedirectDownload($this->devil['downloadUrl'],$_POST['fname']);
	}
	
	protected function retryReCaptchav2(){
		$data = array();
		$data['cookie'] = $_POST['cookie'];
		$data['fname'] = $_POST['fname'];
		$data['link'] = $_POST['link'];
		$data['Devil'] = '1';
		$data['fkey'] = $_POST['fkey'];
		$data['f1'] = $_POST['f1'];
		$data['f2'] = $_POST['f2'];
		$data['r'] = $_POST['r'];
		return $this->reCAPTCHAv2($_POST['recaptcha2_public_key'], $data, 0, 'Retry');
	}

	private function jsonreply($resp){
		$tmp = stristr($resp,'{');
		$json = json_decode($tmp,true);
		return $json;

	}

}

// Written by The Devil

?>


<?php
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class filefactory_com extends DownloadClass {
	private $page, $cookie = array('ff_locale' => 'en_US.utf8'), $lpass = '';
	public function Download($link) {
		global $premium_acc;

		$arr = explode('|', str_replace('%7C', '|', $link), 2);
		if (count($arr) >= 2) {
			$this->lpass = (strpos($link, '|') === false) ? rawurldecode($arr[1]) : $arr[1];
			$link = $arr[0];
		}
		unset($arr);

		$this->link = $GLOBALS['Referer'] = str_ireplace(array('http://', '://filefactory.com/'), array('https://', '://www.filefactory.com/'), $link);

		$post = empty($this->lpass) ? 0 : array('password' => urlencode($this->lpass), 'Submit' => 'Continue');
		$this->page = $this->GetPage($this->link, $this->cookie, $post);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		$this->CheckPass();

		$X = 0;
		while ($X < 3 && preg_match('@\nLocation: .*(/(?:file|preview)/[^\r\n]+)@i', $this->page, $RD)) {
			$this->link = 'https://www.filefactory.com' . $RD[1];
			$this->page = $this->GetPage($this->link, $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			$X++;
		}

		if (preg_match('@/error\.php\?code=(\d+)@i', $this->page, $this->redir) && !in_array($this->redir[1], array('257', '258')) /*Forcing PPS is not fair...*/) {
			if ($this->redir[1] == '160') html_error('IP banned by FF.');
			$page = $this->GetPage('https://www.filefactory.com'.$this->redir[0], $this->cookie);
			if (preg_match('@class="alert alert-error">\s*<h2>\s*([\w\-\s]+)\s*</h2>@i', $page, $err)) html_error("[FF:{$this->redir[1]}] ".htmlspecialchars($err[1]));
			html_error("Link is not available [{$this->redir[1]}]");
		}
		if (stripos($this->page, 'error.php?code=') === false && $this->CheckTS()) return; // insert_location doesn't do exit()... So i must to stop the plugin if it's a trafficshare link.

		if (stripos($this->link, '/preview/') === false && $_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['filefactory_com']['user']) && !empty($premium_acc['filefactory_com']['pass'])))) $this->Login();
		else $this->FreeDL();
	}

	private function CheckTS() {
		if (preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*filefactory\.com/get/t/[^\r\n\"\'<>\s\t]+@i', $this->page, $dl)) {
			$filename = urldecode(basename(parse_url($dl[0], PHP_URL_PATH)));
			if (stripos($dl[0], ';') !== false) $dl[0] = str_replace(array('&',';'), '', $dl[0]);
			$this->RedirectDownload($dl[0], $filename, $this->cookie, 0, 0, $filename);
			return true;
		}
		return false;
	}

	private function CheckPass() {
		if (stripos($this->page, 'This File has been password protected by the uploader.') !== false || stripos($this->page, '>Please enter the password</') !== false) {
			if (empty($this->lpass)) html_error('File is password protected, please send the password in this format: link|pass');
			else html_error('The link\'s password you have sent is not valid.');
		}
	}

	private function FreeDL() {
		if (!empty($this->redir)) {
			$page = $this->GetPage('https://www.filefactory.com'.$this->redir[0], $this->cookie);
			if (preg_match('@class="alert alert-error">\s*<h2>\s*([\w\-\s]+)\s*</h2>@i', $page, $err)) html_error("[FF:{$this->redir[1]}] ".htmlspecialchars($err[1]));
			html_error("Link is not available [{$this->redir[1]}]");
		}

		if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*filefactory\.com/get/f/[^\r\n\"\'<>\s\t]+@i', $this->page, $dllink)) html_error('Download Link Not Found.');
		$dllink = $dllink[0];

		if (!preg_match('@data-delay\s*=\s*"(\d+)"@i', $this->page, $C) && stripos($this->link, '/preview/') === false) html_error('Failed to Get Link Time-lock.');
		if (!empty($C[1])) $this->CountDown($C[1]);

		$filename = urldecode(basename(parse_url($dllink, PHP_URL_PATH)));
		if (stripos($dllink, ';') !== false) $dllink = str_replace(array('&',';'), '', $dllink);
		$this->RedirectDownload($dllink, $filename, $this->cookie, 0, 0, $filename);
	}

	private function PremiumDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		$X = 0;
		while ($X < 3 && preg_match('@\nLocation: .*(/(?:file|preview)/[^\r\n]+)@i', $this->page, $RD)) {
			$this->link = 'https://www.filefactory.com' . $RD[1];
			$this->page = $this->GetPage($this->link, $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			$X++;
		}

		if (preg_match('@/error\.php\?code=(\d+)@i', $this->page, $this->redir)) {
			$this->page = $this->GetPage('https://www.filefactory.com'.$this->redir[0], $this->cookie);
			if (preg_match('@class="alert alert-error">\s*<h2>\s*([\w\-\s]+)\s*</h2>@i', $this->page, $err)) html_error("[FF:{$this->redir[1]}]-".htmlspecialchars($err[1]));
			html_error("Link is not available. [{$this->redir[1]}]");
		}

		if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*filefactory\.com/get/p/[^\r\n\"\'<>\s\t]+@i', $this->page, $dl)) html_error('Download-Link Not Found.');

		$filename = urldecode(basename(parse_url($dl[0], PHP_URL_PATH)));
		if (stripos($dl[0], ';') !== false) $dl[0] = str_replace(array('&',';'), '', $dl[0]);
		$this->RedirectDownload($dl[0], $filename, $this->cookie, 0, 0, $filename);
	}

	private function Login() {
		global $premium_acc;
		$pA = !empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false;
		$email = $pA ? $_REQUEST['premium_user'] : $premium_acc['filefactory_com']['user'];
		$password = $pA ? $_REQUEST['premium_pass'] : $premium_acc['filefactory_com']['pass'];

		if (empty($email) || empty($password)) html_error('Login Failed: Email or Password is empty. Please check login data.');

		$postURL = 'https://www.filefactory.com/member/signin.php';
		$post = array();
		$post['loginEmail'] = urlencode($email);
		$post['loginPassword'] = urlencode($password);
		$post['Submit'] = 'Sign+In';
		$page = $this->GetPage($postURL, 0, $post, $postURL);
		is_present($page, 'The Email Address submitted was invalid', 'Login Failed: Invalid email address.');
		is_present($page, 'The email address or password you have entered is incorrect.', 'Login Failed: The Email/Password you have entered is incorrect.');

		$this->cookie = GetCookiesArr($page, $this->cookie);
		if (empty($this->cookie['auth'])) html_error('Login Failed, auth cookie not found.');

		$page = $this->GetPage('https://www.filefactory.com/account/', $this->cookie, 0, $postURL);
		is_present($page, "\nLocation: /member/settos.php", 'TOS have changed and need to be approved at the site.');
		is_present($page, "\nLocation: /member/setpwd.php", 'Your password has expired, please change it.');
		if (stripos($page, '>Free Member<') !== false) {
			$this->changeMesg(lang(300).'<br /><b>Account isn\'t premium</b><br />Using it as member.');
			$this->page = $this->GetPage($this->link, $this->cookie);
			preg_match('@/error\.php\?code=(\d+)@i', $this->page, $this->redir);
			return $this->FreeDL();
		}
		return $this->PremiumDL();
	}
}

//[26-Nov-2010] Written by Th3-822.
//[20-Feb-2011] Fixed regex for redirect & Fixed errors in filename & Changed captcha funtion for show reCaptcha. - Th3-822
//[10-Feb-2012] Added error msg at freedl & 2 Regexps edited. -Th3-822
//[11-Mar-2012] Fixed getting dlink in premium account (Sometimes the request it's redirected to freedl error page) && Fixed login function. - Th3-822
//[23-Mar-2012] Fixed free dl regexps. - Th3-822
//[22-May-2012] Added support for files with Traffic Share on freedl. - Th3-822
//[11-Jul-2012] Fixed regexp for files with Traffic Share on freedl && fixed regexp at premiumdl && minor changes. - Th3-822
//[10-Aug-2012] Added cookie support & fixed free acc check. - Th3-822
//[22-Aug-2012] Fixed Traffic Share support (Again) & added error msg. - Th3-822
//[14-May-2013] Fixed freedl (ff removed the captcha... But the code still at page, so i will let it on the plugin too). - Th3-822
//[17-Sep-2013] Rewritten for make it work with the new site & Cookie support removed & Added password protected links support. - Th3-822
//[24-Oct-2013] Added a error at login & fixed redirect on premium download. - Th3-822
//[18-Nov-2013] Fixed premium-dl error msgs. - Th3-822
//[02-Dec-2016] Fixed login error msgs. - Th3-822
//[14-May-2021] Switched links to https. - Th3-822
<?php
if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit;
}

class fileflyer_com extends DownloadClass {

    public function Download($link) {
        global $premium_acc, $Referer;

        $page = $this->GetPage($link);
        is_present($page, "Removed", "The file has been removed or has been expired!");
        if (stristr($page, 'class="handlinkblocked"')) {

            $pass = ($_REQUEST ["premium_pass"] ? $_REQUEST ["premium_pass"] : $premium_acc ["fileflyer_com"] ["pass"]);
            if (empty($pass)) html_error("This link required premium account!");

            if (!preg_match('/<form name="form1" method="post" action="(.*)"/U', $page, $pre)) html_error('Error: Premium link not found?');
            $link = $pre[1];

            $post = array();
            $post['__EVENTTARGET'] = "";
            $post['__EVENTARGUMENT'] = "";
            $post['__VIEWSTATE'] = urlencode(cut_str($page, 'id="__VIEWSTATE" value="', '"'));
            $post['__EVENTVALIDATION'] = urlencode(cut_str($page, 'id="__EVENTVALIDATION" value="', '"'));
            $post['SMSButton'] = "Go";
            $post['Password'] = $pass;
            $post['TextBox1'] = "";
            $page = $this->GetPage($link, 0, $post, $Referer);
            is_notpresent($page, "Access enabled", "Invalid premium codes");
        }
        $cookie = GetCookies($page);
        if (!preg_match('@http:\/\/.+fileflyer\.com\/d\/[^"]+@', $page, $dl)) html_error ('Error: Download link not found, plugin need to be updated!');
        $dlink = trim($dl[0]);
        $filename = parse_url($dlink);
        $FileName = basename($filename['path']);
        $this->RedirectDownload($dlink, $FileName, $cookie, 0, $Referer);
        exit();
    }
}

//fileflyer download plugin by Ruud v.Tony 25-06-2011
//updated by Ruud v.Tony 14-10-2011
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class filejoker_net extends GenericXFS_DL {
	public $pluginVer = 18;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom Download Regexp
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w{72}/[^\t\r\n<>\'\"\?\&]+@i';

		$this->Start($link);
	}

	protected function sendLogin($post) {
		html_error('This Plugin Only Supports Login With Cookies.');
	}

	protected function isLoggedIn() {
		$page = $this->GetPage($this->purl.'profile', $this->cookie, 0, $this->purl.'login');
		if (stripos($page, '>Logout</a>') === false) return false;
		return $page;
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class filenext_com extends GenericXFS_DL {
	public $pluginVer = 18;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder

		$this->Start($link);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once ("index.html");
	exit;
}

class fileover_net extends DownloadClass {
	public function Download($link) {
		global $premium_acc;
		if ($_REQUEST["premium_acc"] == "on" && ((!empty($_REQUEST["premium_user"]) && !empty($_REQUEST["premium_pass"])) || ($premium_acc["fileover_net"]["user"] && $premium_acc["fileover_net"]["pass"]))) {
			return $this->Download_Premium($link);
		} elseif ($_POST['step'] == 1) {
			return $this->Download_Free($link);
		} else {
			return $this->Prepare_Free($link);
		}
	}

	private function Prepare_Free($link) {
		$page = $this->GetPage($link);
		$cookie = GetCookies($page);
		is_present($page, "Location: /deleted/", 'Error: File not found.');
		if (preg_match('@You have to wait: [^\.]+.@i', $page, $dlt)) html_error("Download limit exceeded: {$dlt[0]}");
		if (!preg_match('@fileover\.net/(\d+)@i', $link, $lid)) html_error('Error: Link ID not found. Malformed link?');
		if (!preg_match('@"wseconds">(\d+)<@i', $page, $cD)) html_error('Error: Timer not found.');

		$page = $this->GetPage("http://fileover.net/ax/timereq.flo?{$lid[1]}", $cookie);
		if (!preg_match('@"hash":"([^"]+)"@i', $page, $lhs)) html_error('Error: Timehash not found.');
		$this->CountDown($cD[1]+1);

		$page = $this->GetPage("http://fileover.net/ax/timepoll.flo?file={$lid[1]}&hash={$lhs[1]}", $cookie);
		if (!preg_match('@/challenge\?k=([^"|\']+)(?:"|\')@i', $page, $rpid)) html_error('Error: Captcha not found.');

		$data = $this->DefaultParamArr($link, $cookie);
		$data['step'] = '1';
		$data['fo_file'] = $lid[1];
		$data['fo_hash'] = $lhs[1];

		$this->reCAPTCHA($rpid[1], $data);
	}

	private function Download_Free($link) {
		if (empty($_POST['recaptcha_response_field'])) {
			html_error("Error: You didn't enter the image verification code.");
		}

		$post = array();
		$post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
		$post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
		$post['recaptcha_shortencode_field'] = $_POST['recaptcha_shortencode_field'];
		$post['file'] = $_POST['fo_file'];
		$post['hash'] = $_POST['fo_hash'];
		$cookie = urldecode($_POST['cookie']);

		$page = $this->GetPage("http://fileover.net/ax/timepoll.flo", $cookie, $post);
		is_present($page, "/recaptcha/api/challenge?k=", 'Error: Entered captcha was incorrect.');

		if (!preg_match('@(?:"|\')(http://[^/]+\.fileover\.net/\d+/\w+/([^"|\']+))(?:"|\')@i', $page, $downl)) html_error('Error: Download link not found.');

		$this->RedirectDownload($downl[1], $downl[2], $cookie);
	}

	private function Download_Premium($link) {
		$page = $this->GetPage($link);
		is_present($page, "Location: /deleted/", 'Error: File not found.');

		$cookie = $this->Login();
		$page = $this->GetPage($link, $cookie);

		if (!preg_match('@Location: (https?://(?:[^/|\r|\n]+\.)?fileover.net/[^\r|\n]+)@i', $page, $dllink)) html_error("Error: Download-link not found.");

		$FileName = urldecode(basename(parse_url($dllink[1], PHP_URL_PATH)));
		$this->RedirectDownload($dllink[1], $FileName, $cookie);
	}

	private function Login() {
		global $premium_acc;
		$pA = (empty($_REQUEST["premium_user"]) || empty($_REQUEST["premium_pass"])) ? false : true;
		$email = ($pA ? $_REQUEST["premium_user"] : $premium_acc["fileover_net"]["user"]);
		$pass = ($pA ? $_REQUEST["premium_pass"] : $premium_acc["fileover_net"]["pass"]);
		if (empty($email) || empty($pass)) html_error("Login Failed: EMail or Password is empty. Please check login data.");

		$post = array();
		$post["email"] = urlencode($email);
		$post["password"] = urlencode($pass);
		$page = $this->GetPage("http://fileover.net/api/users/login/", 0, $post);
		is_notpresent($page, "Set-Cookie: email=", "Login failed: Check your login details.");
		$cookie = GetCookiesArr($page);

		$page = $this->GetPage("http://fileover.net/user/account", $cookie);
		is_notpresent($page, "<h2>Expires</h2>", "Login error: Account isn't premium?.");
		return $cookie;
	}
}

//[13-6-2011]  Written by Th3-822 (Free download only).
//[18-4-2012]  Added premium download support. - Th3-822

?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once ("index.html");
    exit();
}

class filepost_com extends DownloadClass {

    public function Download($link) {
        global $premium_acc;

        if (strstr($link, "fp.io/")) {
            $link = str_replace("fp.io/", "filepost.com/files/", $link);
        }
        $this->link = $link;
        if (!$_REQUEST['step']) {
            $this->page = $this->GetPage($this->link);
            if (preg_match('@Location: (http(s)?:\/\/[^\r\n]+)@i', $this->page, $rd)) {
                $this->link = trim($rd[1]);
                $this->page = $this->GetPage($this->link);
            }
            is_present($this->page, "File not found");
            is_present($this->page, "This IP address has been blocked on our service due to some fraudulent activity.");
            $this->Cookies = GetCookiesArr($this->page);
            if ($this->Cookies['SID'] == '') html_error("Error Cookie [SID] not found!");
        }
        if ($_REQUEST ["premium_acc"] == "on" && (($_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) || ($premium_acc ["filepost_com"] ["user"] && $premium_acc ["filepost_com"] ["pass"]))) {
            return $this->Login();
        } elseif ($_REQUEST['step'] == 'Recaptcha') {
            return $this->Login(true);
        } elseif ($_REQUEST['step'] == 'Passpre') {
            return $this->Premium(true);
        } else {
            return $this->Free();
        }
    }

    private function Free() {
        switch ($_REQUEST['step']) {
            case 'Captcha':
                $post['code'] = $_POST['code'];
                $post['file_pass'] = '';
                $post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
                $post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
                $post['token'] = $_POST['token'];
                $Url = urldecode($_POST['link']);
                $this->Cookies = urldecode($_POST['cookie']);
                $recap = $_POST['recap'];
                $check = $this->GetPage($Url, $this->Cookies, $post, $this->link);
                break;
            case 'password':
                $post['code'] = $_POST['code'];
                $post['file_pass'] = $_POST['password'];
                $post['token'] = $_POST['token'];
                $Url = urldecode($_POST['link']);
                $this->Cookies = urldecode($_POST['cookie']);
                $check = $this->GetPage($Url, $this->Cookies, $post, $this->link);
                break;
            default:
                is_present($this->page, "Files over 1024MB can be downloaded by premium<br/ >members only. Please upgrade to premium");
                if (!preg_match("@code: '([^']+)',@", $this->page, $code) || !preg_match("@[({]token: '([^']+)',@", $this->page, $token)) html_error('Error: Post Data [FREE] not found!');
                $code = $code[1];
                $token = $token[1];
                $Url = "http://filepost.com/files/get/?SID={$this->Cookies['SID']}&JsHttpRequest=" . jstime() . "-xml";
                $post = array('action' => 'set_download', 'code' => $code, 'token' => $token);
                $check = $this->GetPage($Url, $this->Cookies, $post, $this->link);
                $this->Cookies = GetCookiesArr($check, $this->Cookies);
                if (preg_match('@"js":\{"(\w+)":\{?"([a-z|\_]+)"?:?"?(\d+)"?@i', $check, $match)) $this->CountDown($match[3]);
                if (strpos($this->page, 'var is_pass_exists = true') || strpos($this->page, 'var show_captcha = true')) {
                    $data = $this->DefaultParamArr($Url, $this->Cookies);
                    $data['code'] = $code;
                    $data['token'] = $token;
                    if (strpos($this->page, 'var is_pass_exists = true')) {
                        $data['step'] = 'password';
                        $this->EnterPassword($data);
                        exit();
                    } else {
                        if (!preg_match('@key:			\'([^\']+)@i', $this->page, $cap)) html_error('Error: Captcha Data [FREE] not found!');
                        $data['step'] = 'Captcha';
                        $data['recap'] = $cap[1]; // incase we need to load the captcha image again
                        $this->reCAPTCHA($cap[1], $data);
                        exit();
                    }
                } else { // no captcha or password required, skip the form process
                    $post = array('code' => $code, 'file_pass' => '', 'token' => $token);
                    $check = $this->GetPage($Url, $this->Cookies, $post, $this->link);
                }
                break;
        }

        // Let's play with the regex
        if (!preg_match('@"js":\{"(\w+)":\{?"([^"]+)"?:?"?([^|\r|\n|"]+)?"\}@i', $check, $match)) html_error("Error: Unknown Post Data [FREE] page response!");
        switch ($match[1]) {
            case 'error':
                echo ("<center><font color='red'><b>$match[2]</b></font></center>");

                $data = $this->DefaultParamArr($Url, $this->Cookies);
                $data['code'] = $_POST['code'];
                $data['token'] = $_POST['token'];
                switch ($match[2]) {
                    case 'Wrong file password':
                        $data['step'] = 'password';
                        $this->EnterPassword($data);
                        break;
                    case 'You entered a wrong CAPTCHA code. Please try again.':
                        $data['step'] = 'Captcha';
                        $data['recap'] = $recap;
                        $this->reCAPTCHA($recap, $data);
                        break;
                }
                break;
            case 'answer':
                switch ($match[2]) {
                    case 'link':
                        $dlink = str_replace('\\', '', $match[3]);
                        $filename = basename(parse_url($dlink, PHP_URL_PATH));
                        $this->RedirectDownload($dlink, $filename, $this->Cookies, 0, $this->link);
                        break;
                }
                break;
            default:
                html_error("$match[1], $match[2]");
                break;
        }
    }

    private function Login($captcha = false) {
        global $premium_acc;

        $email = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["filepost_com"] ["user"]);
        $password = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["filepost_com"] ["pass"]);
        if (empty($email) || empty($password)) html_error("Login failed, username or password is empty!");

        $post = array();
        $post['email'] = $email;
        $post['password'] = $password;
        $post['remember'] = 'on';
        if ($captcha == true) {
            $post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
            $post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
            $posturl = urldecode($_POST['link']);
            $this->Cookies = StrToCookies(urldecode($_POST['cookie']));
            $check = $this->GetPage($posturl, $this->Cookies, $post, "http://filepost.com/");
        } else {
            $posturl = "http://filepost.com/general/login_form/?SID={$this->Cookies['SID']}&JsHttpRequest=" . jstime() . "-xml";
            $check = $this->GetPage($posturl, $this->Cookies, $post, "http://filepost.com/");
        }
        if (!preg_match('@"js":\{"(\w+)":\{?"([^"]+)"?:?(\w+)?\}?,?"?(\w+)?"?:?"?([^"]+)?"?\}@i', $check, $match)) html_error("Error: Unknown Login Page Response, Plugin need to be updated!");
        if ($match[1] == 'answer' && $match[4] !== 'error') {
            switch ($match[2]) {
                case 'captcha':
                    if (!preg_match('@key:			\'([^\']+)@i', $this->page, $cap)) html_error('Error: Captcha Data [Premium] not found!');

                    $data = $this->DefaultParamArr($posturl, $this->Cookies);
                    $data['step'] = 'Recaptcha';
                    $this->reCAPTCHA($cap[1], $data);
                    break;
                case 'success':
                    //check account, we need to convert to array since we have pass the captcha, I also made mistake, should be array_merge, not array_replace, stupid...
                    $this->Cookies = GetCookiesArr($check, $this->Cookies);
                    $check = $this->GetPage("http://filepost.com/partners/", $this->Cookies, 0, 'http://filepost.com/');
                    is_present($check, "Account type: <span>Free</span>");
                    break;
            }
        }
        is_present($match[1], 'error', str_replace('\\', '', $match[2]));
        is_present($match[4], 'error', $match[5]);

        return $this->Premium();
    }

    private function Premium($password = false) {
        if ($password == true) {
            $post['code'] = $_POST['code'];
            $post['file_pass'] = $_POST['password'];
            $post['token'] = $_POST['token'];
            $Url = urldecode($_POST['link']);
            $this->Cookies = decrypt(urldecode($_POST['cookie']));
            $this->page = $this->GetPage($Url, $this->Cookies, $post, $this->link);
            if (!preg_match('@"js":\{"(\w+)":\{?"([^"]+)"?:?"?([^|\r|\n|"]+)?"\}@i', $this->page, $match)) html_error("Error: Unknown Password Link [PREMIUM] page response, plugin need to be updated!");
            switch ($match[1]) {
                case 'error':
                    echo ("<center><font color='red'><b>$match[2]</b></font></center>");

                    $data = $this->DefaultParamArr($Url, encrypt($this->Cookies), $this->link);
                    $data['step'] = 'Passpre';
                    $data['code'] = $_POST['code'];
                    $data['token'] = $_POST['token'];
                    $this->EnterPassword($data);
                    break;
                case 'answer':
                    switch ($match[2]) {
                        case 'link':
                            $dlink = str_replace('\\', '', $match[3]);
                            $filename = basename(parse_url($dlink, PHP_URL_PATH));
                            $this->RedirectDownload($dlink, $filename, $this->Cookies);
                            break;
                    }
                    break;
            }
        } else {
            $this->page = $this->GetPage($this->link, $this->Cookies, 0, $this->link);
			is_present($this->page, "You can only download 50GB a day");
            if (strpos($this->page, 'var is_pass_exists = true')) {
                if (!preg_match("@code: '([^']+)',@", $this->page, $code) || !preg_match("@[({]token: '([^']+)',@", $this->page, $token)) html_error('Error: Post Password Data [Premium] not found!');
                $Url = "http://filepost.com/files/get/?SID={$this->Cookies['SID']}&JsHttpRequest=" . jstime() . "-xml";

                $data = $this->DefaultParamArr($Url, encrypt(CookiesToStr($this->Cookies)), $this->link);
                $data['code'] = $code[1];
                $data['token'] = $token[1];
                $data['step'] = 'Passpre';
                $this->EnterPassword($data);
                exit();
            }
            if (!preg_match('@http(s)?:\/\/fs\d+\.filepost\.com\/get_file\/[^|\r|\n|\']+@i', $this->page, $dl)) html_error("Error: Download Link [PREMIUM] non password not found!");
            $dlink = trim($dl[0]);
            $filename = basename(parse_url($dlink, PHP_URL_PATH));
            $this->RedirectDownload($dlink, $filename, $this->Cookies);
        }
    }

    private function EnterPassword($inputs) {
        global $PHP_SELF;
        if (!is_array($inputs)) {
            html_error("Error parsing password data.");
        }
        echo "\n" . '<center><form action="' . $PHP_SELF . '" method="post" >' . "\n";
        foreach ($inputs as $name => $input) {
            echo "<input type='hidden' name='$name' id='$name' value='$input' />\n";
        }
        echo '<h4>Enter password here: <input type="text" name="password" id="filepass" size="13" />&nbsp;&nbsp;<input type="submit" onclick="return check()" value="Submit" /></h4>' . "\n";
        echo "<script type='text/javascript'>\nfunction check() {\nvar pass=document.getElementById('filepass');\nif (pass.value == '') { window.alert('You didn\'t enter the password'); return false; }\nelse { return true; }\n}\n</script>\n";
        echo "\n</form></center>\n</body>\n</html>";
        exit();
    }

}

/*
 * Filepost.com free download plugin by Ruud v.Tony 29-09-2011
 * Updated to support premium by vdhdevil 12-10-2011
 * Updated the free download code by Ruud v.Tony 02-11-2011 for multiple option error
 * Small regex fix in free download by Ruud v.Tony 10-01-2012
 * Updated for including short link (fp.io) in check link by Ruud v.Tony 13-01-2012
 * Updated to support captcha also password protected files in premium by Ruud v.Tony 21-01-2012
 * Small fix in checking account also free download code by Ruud v.Tony 01-02-2012
 * Implement new function for an example by Ruud v.Tony 04-02-2012
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class filerio_in extends GenericXFS_DL {
	public $pluginVer = 11;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = true; // Enable JS unescape decoder.

		$this->Start($link);
	}

	// They have another op name for the my_account option.
	protected function isLoggedIn() {
		$page = $this->GetPage($this->purl.'?op=view_account', $this->cookie, 0, $this->purl);
		if (stripos($page, '/?op=logout') === false && stripos($page, '/logout') === false) return false;
		return $page;
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class filescdn_com extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class filesend_co extends DownloadClass {
	private $page, $cookie = array();
	public function Download($link) {
		$this->link = $GLOBALS['Referer'] = str_ireplace('http://', 'https://', $link);

		$this->page = $this->GetPage($this->link, $this->cookie);
		is_present($this->page, 'Nothing has been found', 'File Not Found.');
		is_present($this->page, 'There are no files to be shown', 'File Not Found or Deleted.');
		is_present($this->page, 'Files have been removed due to lack of activity', 'File Deleted due to Inactivity.');
		is_present($this->page, 'Files have been reported', 'File Deleted due to Abuse.');
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		// Only FreeDL at the Moment.
		return $this->FreeDL();
	}

	private function FreeDL() {
		$json = $this->getMetaData($this->page, 'FreeDL_1');
		if (empty($json['app']['downloader'])) {
			if (empty($json['app']['folderView']['entities'])) html_error('Files Metadata Not Found.');
			$files = $json['app']['folderView']['entities'];
			if (empty($files[1])) {
				// Just 1 File, Download Directly
				$file = $files[0];
				if (empty($file['downloadUrl'])) html_error('Redirect Link Not Found.');
				$redir = (strpos($file['downloadUrl'], '://') !== false ? $file['downloadUrl'] : 'https://filesend.co' . $file['downloadUrl']);
				$page = $this->GetPage($redir, $this->cookie);
				$this->cookie = GetCookiesArr($page, $this->cookie);

				$json = $this->getMetaData($page, 'FreeDL_2');
				if (empty($json['app']['downloader'])) html_error('Download Metadata Not Found.');
			} else {
				// More Than 1 File
				$links = array();
				foreach ($files as $file) {
					if (!empty($file['downloadUrl'])) {
						$links[] = (strpos($file['downloadUrl'], '://') !== false ? $file['downloadUrl'] : 'https://filesend.co' . $file['downloadUrl']);
					}
				}
				return $this->moveToAutoDownloader($links);
			}
		}
		$downloader = $json['app']['downloader'];
		if (empty($downloader['url'])) html_error('Download Link Not Found.');

		$DL = (strpos($downloader['url'], '://') !== false ? $downloader['url'] : 'https://filesend.co' . $downloader['url']);
		return $this->RedirectDownload($DL);
	}

	private function getMetaData($page, $suffix) {
		if (!preg_match('@\[\'tEGurWM89B6p'.'hAeXuNMH'.'xYUfkUiV'.'UUWoPHnKV'.'yHkWhr2TLqf'.'nh3KLnAB'.'tkEVkLRc\'\]\s*=\s*"([^"]+)"@i', $page, $data)) html_error("Page Metadata Not Found [$suffix]");
		$data = trim(rawurldecode($this->b64XorDecoder('3YKqDNZ'.'AFtzW4av'.'QrrNhRLjR'.'ArAPoaCY4'.'KeZVugyPG'.'ddTezMZzP'.'gAe9MN'.'RHbLX3G', $data[1])));
		is_notpresent($data, '{"app":', "Cannot validate metadata. Key has changed? [$suffix]");
		return $this->json2array($data, "Metadata Parse Error][$suffix");
	}

	private function b64XorDecoder($key, $str) {
		$key = str_split($key);
		$str = str_split(base64_decode($str));
		$kLen = count($key);
		$sLen = count($str);
		$output = '';
		for ($i = 0; $i < $sLen; $i++) $output .= chr(ord($str[$i]) ^ ord($key[floor($i % $kLen)]));
		return $output;
	}
}

// [06-12-2016] Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
    require_once ("index.html");
    exit ();
}

class fileserving_com extends DownloadClass {
	
	    public function Download($link) {
        global $premium_acc, $options;
        if (($_REQUEST ["premium_acc"] == "on" && $_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) || ($_REQUEST ["premium_acc"] == "on" && $premium_acc ["fileserving_com"] ["user"] && $premium_acc ["fileserving_com"] ["pass"])) {
            $this->DownloadPremium($link);
        } elseif ($_POST['step'] == "1") {
            $this->DownloadFree($link);
        } else {
            $this->Retrieve($link);
        }
    }
	
   private function Retrieve($link) {
        global $options;
        $page = $this->GetPage($link);
		if (preg_match("#Location: (.*)#", $page)) {
            html_error("File Not Available or Not Found: Error 01.");
        }
		preg_match("#HTTP\/1\.1 ([0-9]+)#", $page, $err);
		if($err[1] == '400'){
			html_error('Error 400: Bad Request');
		}
		if (!preg_match("#verify_url = '([^']+)'#", $page, $pth)) {
            html_error("Cannot get URL ReCaptcha");
        }
		if (!preg_match("#fid:'([^']+)'#", $page, $fid)) {
            html_error("File Not Available or Not Found. Error 02");
        }
		if (!preg_match("#server:'([^']+)'#", $page, $server)) {
            html_error("Cannot get URL of Download");
        }
        $Cookies = GetCookies($page);
		$page = $this->GetPage("http://www.google.com/recaptcha/api/challenge?k=6LfrS8kSAAAAAIMFkpPQ3wacYcW2EbM7mC53RvvD");
	    $sr = cut_str($page, "challenge : '", "'");
        $img = "http://www.google.com/recaptcha/api/image?c=".$sr;
		$url = $pth[1].'?fid='.$fid[1].'&sid=1&server='.$server[1].'&recaptcha_challenge_field='.$sr;
        $page = $this->GetPage($img);
        $head = strpos($page, "\r\n\r\n");
        $img = substr($page, $head + 4);
        write_file($options['download_dir'] . "fileserving_captcha.jpg", $img);
        $data = array();
        $data['link'] = urlencode($link);
        $data['step'] = '1';
        $data['cookie'] = urlencode($Cookies);
        $data['url']= urlencode(trim($url));
        $this->EnterCaptcha($options['download_dir'] . "fileserving_captcha.jpg", $data, 20);
        exit;
    }
	    private function DownloadFree($link) {
        $enter = $_POST['captcha'];
        $Cookies = urldecode($_POST['cookie']);
		$go = urldecode($_POST['url']);
		$url = $go.'&recaptcha_response_field='.$enter;
        $page = $this->GetPage($url, $Cookies, 0, $link);
        if (!preg_match('#"rs":"([^"]+)"#', $page, $rs)) {
            html_error("Cannot get response of ReCaptcha");
        }
		if($rs[1] != 'ok'){
			html_error("Invalid Captcha! Please try again.");
		}
		$dl = explode('"', $page);
		$dlink = str_replace("\\","",$dl[8]);
		if(empty($dlink)){
			html_error('Cannot get download link');
		}
        $this->RedirectDownload(trim($dlink), "FileName", $Cookies, 0, $link);
        exit;
    }
	
	    private function DownloadPremium($link) {
        global $premium_acc;
		$username = $_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["fileserving_com"] ["user"];
		$password = $_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["fileserving_com"] ["pass"];
		if(empty($username) or empty($password)){
			html_error('Usuer and/or Password this empty.');
		}
		$url = 'http://www.fileserving.com/Public/login';
		$page = $this->GetPage($url, 0, 0, "http://www.fileserving.com");
		if (!preg_match('#name="__hash__"[\r|\n|\s]+value="([^"]+)"#', $page, $hash)){
			html_error("Cannot get Hash.");
		}
        $post = array();
        $post["username"] = $username;
        $post["password"] = $password;
        $post["dpt_id"] = "0";
		$post["from_dpt"] = "3016";
		$post["fail_callback"] = "http://www.fileserving.com/Public/login/error/[msg]";
        $post["success_callback"] = "http://www.fileserving.com/Api/central_login";
		$post["__hash__"] = $hash[1];
		$urllogin = "https://account.yesup.com/login/client";
        $page = $this->GetPage($urllogin, 0, $post, "http://www.fileserving.com");
		if (!preg_match("#Location: (.*)#", $page, $sucess)) {
			html_error('Cannot get redirection of login.');
		}
		$error = explode('/error/', $sucess[1]);
		if (!empty($error[1])) {
			html_error('Error in login: '.$error[1]);
		}
		$cookie = GetCookies($page);
		if(empty($cookie)){
			html_error('Error in login, update plugin, or try later.');
		}
		$htt = 'https://account.yesup.com/'.$sucess[1];
		$page = $this->GetPage($htt, $cookie, 0, "http://www.fileserving.com/Public/login");
		if (!preg_match("#Location: (.*)#", $page, $mov)) {
			html_error('Unable to retrieve authentication.');
		}
		$page = $this->GetPage($mov[1], $cookie, 0, $htt);
		$lang = GetCookies($page);
		$cookie .= '; '.$lang;
		$my = 'http://www.fileserving.com/';
		$page = $this->GetPage($my, $cookie, 0, "http://www.fileserving.com");
		if (!preg_match("#Account[\r|\n|\s]+Type:[\r|\n|\s]+<span>(.*)</span>#", $page, $acc)) {
			html_error('Unable to verify if the account is premium.');
		}
		if (trim($acc[1]) != 'Premium') {
			html_error('Your account is not premium.');
		}
        $page = $this->GetPage($link, $cookie, 0, "http://www.fileserving.com");
        if (!preg_match("#Location: (.*)#", $page, $dl)) {
			html_error('Failed to recover download link premium.');
		}
		if (trim($dl[1]) == 'http://www.fileserving.com') {
			html_error('File Not Available or Not Found.');
		}
		preg_match("#HTTP\/1\.1 ([0-9]+)#", $page, $err);
		if($err[1] == '400'){
			html_error('Error 400: Bad Request');
		}
      $this->RedirectDownload(trim($dl[1]), "Fileserving");
        exit();
    }

}
//work by simplesdescarga 11/02/2012
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class filesflash_com extends DownloadClass {
	private $page, $cookie;
	public function Download($link) {
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+filesflash\.(?:com|net)(?:\:\d+)?/\w{32}/\w{32}/[^\'\"\t<>\r\n]+@i';
		$this->cookie = array();

		$link = parse_url($link);
		$link['host'] = 'filesflash.com';
		if (!empty($link['port']) && !in_array($link['port'], array(80, 443))) $link['port'] = (strtolower($link['scheme']) == 'https' ? 443 : 80);
		$link = rebuild_url($link);

		$this->link = $GLOBALS['Referer'] = $link;
		if (empty($_POST['step']) || $_POST['step'] != '1') {
			$this->page = $this->GetPage($this->link, $this->cookie);
			is_present($this->page, 'That file has been deleted.');
			is_present($this->page, 'That is not a valid url.', 'Error: Invalid Link?.');
		}

		$this->FreeDL();
	}

	private function FreeDL() {
		$pUrl = 'http://filesflash.com/freedownload.php';
		if (!empty($_POST['step']) && $_POST['step'] == '1') {
			if (!empty($_POST['cookie'])) $this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
			if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
			if (empty($_POST['recaptcha_challenge_field'])) html_error('Empty reCAPTCHA challenge.');
			$post = array();
			$post['token'] = $_POST['token'];
			$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
			$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
			$post['submit'] = 'Submit';

			$page = $this->GetPage($pUrl, $this->cookie, $post);

			is_present($page, 'Your IP address is already downloading another link.');
			if (stripos($page, 'google.com/recaptcha/api/') !== false || stripos($page, 'recaptcha.net/') !== false) html_error('Wrong captcha entered.');

			if (!preg_match($this->DLregexp, $page, $dlink)) html_error('Error: Download link not found.');
			if (!preg_match('@\scount\s*=\s*(\d+)\s*;@i', $page, $wait)) html_error('Error: Countdown not found.');
			if ($wait[1] > 0) $this->CountDown($wait[1]);

			return $this->RedirectDownload($dlink[0], urldecode(basename(parse_url($dlink[0], PHP_URL_PATH))), $this->cookie, 0, $pUrl);
		}
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		$post = array();
		$post['token'] = urlencode(cut_str($this->page, 'name="token" value="', '"')) or html_error('Download Token not Found.');
		$post['freedl'] = urlencode(cut_str($this->page, 'name="freedl" value="', '"')) or $post['submit'] = '+Start+free+download+';

		$page = $this->GetPage($pUrl, $this->cookie, $post);

		is_present($page, 'Your IP address is already downloading another link.');

		$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
		$data['step'] = 1;
		$data['token'] = $post['token'];

		// Modified regexp
		if (!preg_match('@https?://(?:[\w\-]+\.)?(?:google\.com/recaptcha/api|recaptcha\.net)/(?:challenge|noscript)\?(?:[^\'\"<>&]+&(?:amp;)?)*k=([\w\.\-]+)@i', $page, $reCaptcha)) html_error('reCAPTCHA not found.');

		$this->reCAPTCHA($reCaptcha[1], $data);
		exit;
	}

	public function CheckBack($header) {
		if (stripos($header, "\nContent-Type: text/html") !== false) {
			global $fp, $sFilters;
			if (empty($fp) || !is_resource($fp)) html_error('[filesflash_com] Cannot check download error.');
			$is_chunked = (stripos($header, "\nTransfer-Encoding: chunked") !== false);
			if (!isset($sFilters) || !is_array($sFilters)) $sFilters = array();
			if ($is_chunked && empty($sFilters['dechunk']) && in_array('dechunk', stream_get_filters())) $sFilters['dechunk'] = stream_filter_append($fp, 'dechunk', STREAM_FILTER_READ);
			$body = stream_get_contents($fp);
			if ($is_chunked && empty($sFilters['dechunk']) && function_exists('http_chunked_decode')) {
				$dechunked = http_chunked_decode($body);
				if ($dechunked !== false) $body = $dechunked;
				unset($dechunked);
			}
			is_present($body, 'Your IP address is not valid for this link.', '[filesflash_com] Your IP address is not valid for this link.');
			is_present($body, 'Your IP address is already downloading another link.', '[filesflash_com] Your IP address is already downloading another link.');
			is_present($body, 'Your link has expired.', '[filesflash_com] Your link has expired.');
			is_present($body, 'Interrupted free downloads cannot be resumed.', '[filesflash_com] Interrupted free downloads cannot be resumed.');
			html_error('[filesflash_com] Unknown download error.');
		}
	}
}

// [15-6-2014]  Written by Th3-822. (FreeDl only.)

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class filesmonster_com extends DownloadClass {
	private $link, $baseUrl, $fid, $page, $cookie = array('yab_ulanguage' => 'en'), $pA;
	public function Download($link) {
		$link = parse_url($link);
		$link['scheme'] = 'https';
		$link['host'] = 'filesmonster.com';
		$link = rebuild_url($link);
		if (!preg_match('@(https?://filesmonster\.com)/download\.php\?id=([\w\-\.%]+)@i', $link, $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = str_ireplace('http://', 'https://', $fid[0]);
		$this->baseUrl = $fid[1];
		$this->fid = $fid[2];

		$this->page = $this->GetPage($this->link, $this->cookie);
		if (substr($this->page, 9, 3) == '404') html_error('File Not Found.');
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['filesmonster_com']['user']) && !empty($GLOBALS['premium_acc']['filesmonster_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['filesmonster_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['filesmonster_com']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->Login($user, $pass);
		} else {
			// There is not FreeDL support yet, due to lack of "public" downloadable links
			is_present($this->page, 'You need Premium membership to download', 'Only Premium users can download this file.');
			html_error('FreeDL Support Not Added Yet, Please Report Any Link Which Supports It On The Forum.');
		}
	}

	private function PremiumDL() {
		$page = $this->GetPage($this->link, $this->cookie);

		if (!preg_match('@/get/[\w\-\.%]+/@', $page, $redir)) html_error('PremiumDL Error: Redirect not Found.');
		$page = $this->GetPage($this->baseUrl . $redir[0], $this->cookie);

		if (!preg_match('@/dl/gpl/[\w\-\.%]+/@', $page, $redir)) html_error('PremiumDL Error: Redirect 2 not Found.');
		$page = $this->GetPage($this->baseUrl . $redir[0], $this->cookie);
		$reply = $this->json2array($page, 'PremiumDL Error');

		if (empty($reply['url']) || strpos($reply['url'], '://') === false) html_error('Download-Link Not Found.');
		return $this->RedirectDownload($reply['url'], urldecode(parse_url($reply['url'], PHP_URL_PATH)));
	}

	private function Login($user, $pass) {
		$lUrl = $this->baseUrl . '/login.php?return=%2F';
		$hUrl = $this->baseUrl . '/';

		$post = array('act' => 'login', 'captcha_shown' => 0);
		$post['user'] = urlencode($user);
		$post['pass'] = urlencode($pass);

		$page = $this->GetPage($lUrl, $this->cookie, $post, $hUrl);
		is_present($page, 'Username/Password can not be found', 'Login Error: Wrong Login/Password.');
		$this->cookie = GetCookiesArr($page, $this->cookie);
		if (empty($this->cookie['yab_logined'])) html_error('Login Error: Cookie "yab_logined" not Found.');
		$this->cookie['yab_ulanguage'] = 'en';

		$page = $this->GetPage($hUrl, $this->cookie, 0, $lUrl);
		is_notpresent($page, '<span class="expire-date', 'Login Error: Account Isn\'t Premium?');

		return $this->PremiumDL();
	}
}

//[21-01-2017] Rewritten by Th3-822.
<?php
if (!defined('RAPIDLEECH')) {
    require_once ('index.html');
    exit;
}

class fshare_in extends DownloadClass {
    
    public function Download($link) {
        $page = $this->GetPage($link);
        $area = cut_str($page, '<table id="download">', '</table>');
        if (!preg_match_all('%<a href="([^"]+)" target="_blank">%', $area, $ck)) html_error('Error [Mirror link not found!]');
        $all_link = array_unique($ck[1]);
        $this->Submit($all_link);
        exit();
    }
    
    private function Submit($links) {
        global $PHP_SELF;
        if (!is_array($links) && count($links) < 1) html_error("No links found or \$links isn't an array.");
        echo "\n<center><form name='multilink_form' action='$PHP_SELF' method='post' >\n";
        echo "\n<h4>Select a host for download this file:</h4><br />\n";
        echo "<select name='link' style='width:160px;height:20px;'>\n";
        foreach ($links as $Name => $Link) echo "\t<option value='" . urlencode($Link) . "'>" . htmlentities($Link) . "</option>\n";
        echo "</select><br />\n";
        $defdata = $this->DefaultParamArr($link);
        foreach ($defdata as $name => $val) {
            echo "<input type='hidden' name='$name' id='$name' value='$val' />\n";
        }
        echo '<br /><input type="checkbox" name="premium_acc" id="premium_acc" onclick="javascript:var displ=this.checked?\'\':\'none\';document.getElementById(\'premiumblock\').style.display=displ;" checked="checked" />&nbsp;' . lang(249) . '<br /><div id="premiumblock" style="display: none;"><br /><table width="150" border="0"><tr><td>' . lang(250) . ':&nbsp;</td><td><input type="text" name="premium_user" id="premium_user" size="15" value="" /></td></tr><tr><td>' . lang(251) . ':&nbsp;</td><td><input type="password" name="premium_pass" id="premium_pass" size="15" value="" /></td></tr></table></div><br />';
        echo "<input type='submit' value='Download File' />\n";
        echo "\n</form></center>\n</body>\n</html>";
        exit;
    }
}

/*
 * Written by Ruud v.Tony 15-02-2012, taken multiform submit link by Th3-822
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit;
}

class fshare_vn extends DownloadClass {

    public function Download($link) {
        global $premium_acc;
        if (($_REQUEST["premium_acc"] == "on" && $_REQUEST["premium_user"] && $_REQUEST["premium_pass"]) || ($_REQUEST["premium_acc"] == "on" && $premium_acc["fshare_vn"]["user"] && $premium_acc["fshare_vn"]["pass"])) {
            $this->DownloadPremium($link);
        } else {
            $this->DownloadFree($link);
        }
    }

    private function DownloadFree($link) {
        global $options;
        $page = $this->GetPage($link);
        $file_id = cut_str($page, 'name="file_id" value="', '"');
        is_present($page, "Vui lÃ²ng chá» lÆ°á»£t download káº¿ tiáº¿p ", "Vui lÃ²ng chá» lÆ°á»£t download káº¿ tiáº¿p ");
        $Cookies = GetCookies($page);
        $post = array();
        $post['link_file_pwd_dl']="";
        $post['action']="download_file";
        $post['file_id']=$file_id;        
        $page = $this->GetPage($link, $Cookies, $post, $link);
        is_notpresent($page, "var count = 30;", "Error 0x01: Plugin is out of date");
        insert_timer(30);
        if (!preg_match("#http://\w+.\w+.\w+/download/[^/]+/[^']+#", $page, $dlink)) {
            html_error("Error 0x10: Plugin is out of date");
        }
        $this->RedirectDownload($dlink[0], "fshare_vn", $Cookies, 0, $link);
        exit;
    }

    private function DownloadPremium($link) {
        html_error("Not support now");
    }

}

/*
 * by vdhdevil
 */
?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once ("index.html");
    exit();
}

class furk_net extends DownloadClass {

    public function Download($link) {
        global $premium_acc;

        if (!$_REQUEST['step']) {
            $link = str_replace("https", "http", $link);
            $this->page = $this->GetPage($link);
            is_present($this->page, "This torrent is not ready for <strong>direct HTTP download</strong> yet.");
            $this->cookie = GetCookiesArr($this->page);
        }
        $this->link = $link;
        if ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST['premium_pass']) || ($premium_acc['furk_net']['user'] && $premium_acc['furk_net']['pass']))) {
            return $this->Premium();
        } else {
            return $this->Free();
        }
    }

    private function Free() {
        if (!preg_match("@action=\"([^\r\n\"]+)\" method=\"post\">@", $this->page, $fd)) html_error("Error[getFreeLink]");
        if (!preg_match('@<div id="free_dl_countdown">(\d+)<\/div>@', $this->page, $wait)) html_error("Error[getTimer]");

        $this->CountDown($wait[1]);

        $dlink = trim($fd[1]);
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $this->cookie, array('submit' => 'Download the file'));
        exit();
    }

    private function Premium() {
        global $premium_acc;

        $user = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["furk_net"] ["user"]);
        $pass = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["furk_net"] ["pass"]);
        if (empty($user) || empty($pass)) html_error("Login failed, username[$username] or password[$password] is empty!");

        $Url = 'https://www.furk.net';
        $post['url'] = '';
        $post['gigya_uid'] = '';
        $post['login'] = $user;
        $post['pwd'] = $pass;
        $check = $this->GetPage($Url . '/api/login/login/', 0, $post, $Url . "/login/", 0, 1);
        $this->cookie = GetCookiesArr($check, $this->cookie);
        if (preg_match('@\{"(\w+)":"(\w+)","(\w+)":"([^"]+)"\}@', $check, $match)) {
            if ($match[2] == 'ok') {
                switch ($match[4]) {
                    case '/billing':
                        $this->changeMesg(lang(300) . "<br />Furk.net Free Account");
                        $this->page = $this->GetPage($this->link, $this->cookie, 0, $this->link);

                        return $this->Free();
                        break;

                    case '/users/account':
                        $this->changeMesg(lang(300) . "<br />Furk.net Premium Account");

                        $this->page = $this->GetPage($this->link, $this->cookie, 0, $this->link);
                        if (!preg_match("@<a class=\"dl_link button-large\" href=\"([^\r\n\"]+)\"@", $this->page, $dl)) html_error("Error[getPremiumDownloadLink!]");
                        $dlink = trim($dl[1]);
                        $filename = basename(parse_url($dlink, PHP_URL_PATH));
                        $this->RedirectDownload($dlink, $filename, $this->cookie);
                        break;
                }
            }
            is_present($match[2], 'error', $match[3]);
        }
    }

}

// Created by rajmalhotra on 05 Dec 09
// Fixed countdown by Th3-822 on 31 Dec 10
// Add premium and free account also implement new function for example by Ruud v.Tony 04-02-2012
?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class gigapeta_com extends DownloadClass {

	public function Download($link) {
		if ($_REQUEST['step'] == 'Captcha') {
			$post['captcha_key'] = $_POST['captcha_key'];
			$post['captcha'] = $_POST['captcha'];
			$post['download'] = 'Download';
			$link = urldecode($_POST['link']);
			$cookie = urldecode($_POST['cookie']);
			$page = $this->GetPage($link, $cookie, $post, $link);
		} else {
			$page = $this->GetPage($link, array('lang' => 'us'));
			is_present($page, 'Attention! This file has been deleted from our server by user who uploaded it on the server.');
			is_notpresent($page, '<h1>Download file</h1>', 'Download file is not available for ur server area!');
			$cookie = GetCookiesArr($page, array('lang' => 'us'));

			if (!preg_match('/(\d+)<\/b> second/', $page, $wait)) html_error('Error[Timer not found!]');
			$this->CountDown($wait[1]);

			$time = time();
			$data = $this->DefaultParamArr($link, $cookie);
			$data['step'] = 'Captcha';
			$data['captcha_key'] = $time;

			// get the captcha
			$cap = $this->GetPage('http://gigapeta.com/img/captcha.gif?x=' . $time, $cookie);
			$capt_img = substr($cap, strpos($cap, "\r\n\r\n") + 4);
			$imgfile = DOWNLOAD_DIR . "gigapeta_captcha.gif";
			if (file_exists($imgfile)) unlink($imgfile);
			if (!write_file($imgfile, $capt_img)) html_error("Error getting CAPTCHA image.");

			$this->EnterCaptcha($imgfile, $data, 20);
			exit();
		}
		is_present($page, 'Entered figures don&#96;t coincide with the picture', 'You entered a wrong CAPTCHA code. Please try again.');
		if (!preg_match('/Location: (http:\/\/[a-z0-9]+\.gigapeta\.com\/download[^|\r|\n]+)/i', $page, $dl)) html_error('Error: Download link not found!');
		$dlink = trim($dl[1]);
		$FileName = basename(parse_url($dlink, PHP_URL_PATH));
		$this->RedirectDownload($dlink, $FileName, $cookie, 0, $link);
		exit();
	}

}

/*
 * Gigapeta.com free download plugin by Ruud v.Tony 05-11-2011
 * Small fix by Tony Fauzi Wihana/Ruud v.Tony 21-01-2013
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once("index.html");
	exit;
}

class gigasize_com extends DownloadClass {
	public function Download($link) {
		global $premium_acc;
		if ($_REQUEST["premium_acc"] == "on" && (($_REQUEST["premium_user"] && $_REQUEST["premium_pass"]) || ($premium_acc["gigasize_com"]["user"] && $premium_acc["gigasize_com"]["pass"]))) {
			$this->Premium($link);
		} elseif ($_POST['step'] == '1') {
			$this->Free($link);
		} else {
			$this->Retrieve($link);
		}
	}

	private function Retrieve($link) {
		$page = $this->GetPage($link);
		is_present($page, "The file you are looking for is not available");
		is_present($page, "has been removed because we have received", "The file you are looking was removed");
		is_present($page, "<strong>DOWNLOAD LIMIT</strong>", "Download limit reached... Please try again 8-10 hours later.");
		$cookie = GetCookies($page);

		if (!$fname = cut_str($page, '<strong title="','"')) html_error("Filename not found.");
		if (!preg_match('/name="fileId" value="([^"]+)"/i', $page, $fileid)) html_error("Link fileId not found.");
		$link = 'http://www.gigasize.com/get/'.$fileid[1];

		if (!$k = cut_str($page, "adscaptcha.com/Get.aspx?", "'")) html_error("Error getting CAPTCHA data.");
		$page = $this->GetPage("http://api.adscaptcha.com/Get.aspx?$k");

		if (!$ch = cut_str($page, "challenge: '","'")) html_error("Error getting CAPTCHA image.");

		$data = $this->DefaultParamArr($link, $cookie);
		$data['step'] = '1';
		$data['fileId'] = urlencode($fileid[1]);
		$data['fname'] = urlencode($fname);
		$data['adscaptcha_challenge_field'] = urlencode($ch);
		$this->EnterCaptcha("http://api.adscaptcha.com/Challenge.aspx?cid=$ch&w=180", $data, 25);
		exit();
	}

	private function Free($link) {
		if (!$fname = urldecode($_POST['fname'])) html_error("Cannot get filename.");
		$post = array();
		$post['fileId'] = $_POST['fileId'];
		$post['adUnder'] = '';
		$post['adscaptcha_response_field'] = $_POST['captcha'];
		$post['adscaptcha_challenge_field'] = $_POST['adscaptcha_challenge_field'];
		$cookie = urldecode($_POST['cookie']);

		$page = $this->GetPage("http://www.gigasize.com/getoken", $cookie, $post);
		if (!preg_match('/"status":(\d+)/i', $page, $st)) html_error("Token status not found.");

		if ($st[1] != 1) {
			if ($st[1] == 0) return $this->Retrieve($link); // Bad CAPTCHA
			if ($st[1] == 2) html_error("Password protected files aren't supported.");
			html_error("Unknown error. ({$st[1]})");
		}

		$token = $this->GetPage('http://www.gigasize.com/formtoken', $cookie);
		$token = trim(substr($token, strpos($token, "\r\n\r\n") + 4));

		$this->CountDown(32);

		$post = array();
		$post['fileId'] = $_POST['fileId'];
		$post['token'] = $token;
		$page = $this->GetPage("http://www.gigasize.com/getoken", $cookie, $post);
		if (!preg_match('@"status":(\d+)(?:,"redirect":"([^"]+)")?@i', $page, $dl)) html_error("Download data not found.");
		if ($dl[1] == 0) html_error("Error... Limit reached or need premium for download this file.");
		if ($dl[1] != 1) html_error("Unknown error 2. ({$dl[1]})");

		$page = $this->GetPage(str_replace('\\', '', $dl[2]), $cookie);
		if (!preg_match('@Location: (http://(www\d+\.)?gigasize\.com(:\d+)?/[^\r|\n]+)@i', $page, $dllink)) html_error("Download link not found.");

		$this->RedirectDownload($dllink[1], $fname, $cookie);
	}

	private function Premium($link) {
		$cookie = $this->login();
		$page = $this->GetPage($link, $cookie);
		is_present($page, "The file you are looking for is not available");
		is_present($page, "has been removed because we have received", "The file you are looking was removed");

		if (!$fname = cut_str($page, '<strong title="','"')) html_error("Filename not found.");
		if (!preg_match('/name="fileId" value="([^"]+)"/i', $page, $fileid)) html_error("Link fileId not found.");
		$link = 'http://www.gigasize.com/get/'.$fileid[1];

		$post = array();
		$post['fileId'] = $fileid[1];
		$post['fileExt'] = cut_str($page, 'name="fileExt" value="','"');
		$page = $this->GetPage("http://www.gigasize.com/getoken", $cookie, $post);
		if (!preg_match('/"status":(\d+)/i', $page, $st)) html_error("Token status not found.");
		if ($st[1] != 1) {
			if ($st[1] == 2) html_error("Password protected files aren't supported.");
			html_error("Unknown error. ({$st[1]})");
		}

		$token = $this->GetPage('http://www.gigasize.com/formtoken', $cookie, $post);
		$token = trim(substr($token, strpos($token, "\r\n\r\n") + 4));
		$post['token'] = $token;
		$page = $this->GetPage("http://www.gigasize.com/getoken", $cookie, $post);
		if (!preg_match('@"status":(\d+)(?:,"redirect":"([^"]+)")?@i', $page, $dl)) html_error("Download data not found.");
		$page = $this->GetPage(str_replace('\\', '', $dl[2]), $cookie);
		if (!preg_match('@Location: (https?://(www\d+\.)?gigasize\.com(:\d+)?/[^\r|\n]+)@i', $page, $dllink)) html_error("Download link not found.");
		if (!extension_loaded('openssl')) $dllink[1] = str_replace('https://', 'http://', $dllink[1]);

		$this->RedirectDownload($dllink[1], $fname, $cookie);
	}

	private function login() {
		global $premium_acc;
		$pA = ($_REQUEST["premium_user"] && $_REQUEST["premium_pass"] ? true : false);
		$email = ($pA ? $_REQUEST["premium_user"] : $premium_acc["gigasize_com"]["user"]);
		$pass = ($pA ? $_REQUEST["premium_pass"] : $premium_acc["gigasize_com"]["pass"]);

		if (empty($email) || empty($pass)) html_error("Login Failed: Email or Password is empty. Please check login data.");

		$token = $this->GetPage('http://www.gigasize.com/formtoken');
		$token = trim(substr($token, strpos($token, "\r\n\r\n") + 4));

		$post = array('func'=>'');
		$post["token"] = $token;
		$post["signRem"] = 1;
		$post["email"] = $email;
		$post["password"] = $pass;

		$page = $this->GetPage("http://www.gigasize.com/signin", 0, $post, "http://www.gigasize.com/\r\nX-Requested-With: XMLHttpRequest"); // Don't change this line...
		$cookie = GetCookiesArr($page);

		is_present($page, '"status":0', "Login Failed: Invalid Email or Password.");
		is_notpresent($page, '"premium":1', "Login Failed: Account isn't premium?.");
		is_notpresent($page, "Set-Cookie: MIIS_GIGASIZE_AUTH=", "Login Failed: Auth cookie not found.");

		return $cookie;
	}
}

// [22-7-2011]  - Written for Free download. - Th3-822
// [16-8-2011]  - Added premium support. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once ("index.html");
	exit();
}

class google_com extends DownloadClass {
	public $fNames = array('odt' => 'OpenDocument Text', 'docx' => 'Microsoft Word', 'rtf' => 'Rich Text Format', 'txt' => 'Plain Text', 'pdf' => 'PDF Document', 'epub' => 'EPUB Publication', 'zip' => 'Zipped html Document', 'pptx' => 'Microsoft PowerPoint', 'ods' => 'OpenDocument Spreadsheet', 'xlsx' => 'Microsoft Excel'), $dFormats = array('odt', 'docx', 'rtf', 'txt', 'pdf', 'epub', 'zip'), $pFormats = array('pptx', 'pdf'), $ssFormats = array('ods', 'xlsx', 'pdf', 'zip'), $sFormats = array(13 => 'ods', 420 => 'xlsx', 12 => 'pdf');
	public function Download($link) {
		$this->checkBug78902($link);
		if (!preg_match('@https?://(?:[\w\-]+\.)*(?:drive|docs)\.google\.com/(?:(?:folderview|open|(?:a/[\w\-\.]+/)?uc)\?(?:[\w\-\%]+=[\w\-\%]*&)*id=|(?:folder|file|document|presentation|spreadsheets)/d/|spreadsheet/ccc\?(?:[\w\-\%]+=[\w\-\%]*&)*key=|drive/folders/)([\w\-]{28,})@i', $link, $this->ID)) html_error('File/Folder ID not found at link.');
		$this->ID = $this->ID[1];

		// Use /open link for check if ID exists and also get it's type.
		$page = $this->GetPage('https://drive.google.com/open?id='.$this->ID);
		if (substr($page, 9, 3) == '404') html_error('File/Folder doesn\'t exists.');
		if (substr($page, 9, 1) != '3' || !preg_match('@\nLocation: https?://(?:[\w\-]+\.)*(?:drive|docs)\.google\.com/(?:drive/)?(\w+)[\?/]@i', $page, $type)) html_error('Cannot find /open redirect.');

		switch (strtolower($type[1])) {
			case 'file': $this->File();break;
			case 'folder': case 'folders': case 'folderview': $this->Folder();break;
			case 'document': $this->Document();break;
			case 'presentation': $this->Presentation();break;
			case 'spreadsheets': $this->Spreadsheets();break; // New spreadsheets
			case 'spreadsheet': $this->Spreadsheet();break;
			default: html_error('Unknown /open redirect.');break;
		}
	}

	private function checkBug78902($link = '') {
		// 7.4 - 7.4.2, 7.3.11 - 7.3.14, 7.2.24 - 7.2.*
		if (substr(PHP_OS, 0, 3) == 'WIN' || version_compare(PHP_VERSION, '7.2.24', '<') || version_compare(PHP_VERSION, '7.4.2', '>') || !version_compare(PHP_VERSION, '7.3.14', '<=')) return;

		if (empty($link)) echo('<div id="mesg" width="100%" align="center"></div><br />');
		$this->changeMesg('Warning: Running on PHP v' . PHP_VERSION . ' (Please Upgrade)<br />Downloads with this PHP release will be affected by the bug <a href="https://bugs.php.net/bug.php?id=78902">#78902</a> and will leak RAM until exhausted.<br />File may stop at a random size (up to ~1 GB).');

		if (!empty($_GET['method']) && $_GET['method'] == '78902') return;
		if (!empty($link)) {
			$form = $this->DefaultParamArr($link);
			$form['method'] = '78902';

			echo "\n<form name='f78902' action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
			foreach ($form as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
			echo "\t<div><br /><input type='submit' value='Continue' /></div></form>\n";
			include(TEMPLATE_DIR.'footer.php');
			exit();
		}
	}

	private function isPrivate($page) {
		if (substr($page, 9, 2) == '30') is_present($page, 'Location: https://www.google.com/accounts/ServiceLogin', 'Private File/Folder.');
		else is_present($page, "0; url='https://www.google.com/accounts/ServiceLogin", 'Private File/Folder.');
	}

	private function File() {
		$page = $this->GetPage('https://drive.google.com/uc?export=download&confirm=T822&id='.$this->ID, "download_warning_13058876669334088843_{$this->ID}=T822");
		$this->isPrivate($page);
		if (substr($page, 9, 1) != '3' || !preg_match('@\nLocation: (https?://(?:[\w\-]+\.)*googleusercontent\.com/[^\r\n]+)@i', $page, $dl)) html_error('File\'s download-link not found.');
		$this->RedirectDownload($dl[1], 'fGoogle', 0, 0, 'https://drive.google.com/file/d/'.$this->ID);
	}

	private function Folder() {
		if (isset($_GET['audl'])) html_error('Cannot check folder in audl.');
		$page = $this->GetPage('https://drive.google.com/drive/folders/'.$this->ID);
		$this->isPrivate($page);
		if (!preg_match_all('@\\\x5b\\\x22([\w\-]{28,})\\\x22,@i', $page, $ids) && !preg_match_all('@\[(\\\x22)([\w\-]{28,})\1,\[\1[\w\-]{28,}\1\]\\\n,\1(?>.*?\1),\1(?!application\\\/vnd\.google-apps\.folder)@i', $page, $ids, PREG_SET_ORDER)) html_error('Empty folder?');
		$ids = $ids[1];
		$links = array();
		foreach ($ids as $id) $links[] = "https://drive.google.com/uc?id=$id&export=download";
		$this->moveToAutoDownloader($links);
	}

	private function Document() {
		$url = 'https://docs.google.com/document/d/'.$this->ID;
		$page = $this->GetPage("$url/edit");
		$this->isPrivate($page);
		if (empty($_GET['T8']['format']) && !isset($_GET['audl'])) $this->formatSelector(1);
		$format = (!empty($_GET['T8']['format']) && in_array($_GET['T8']['format'], $this->dFormats)) ? $_GET['T8']['format'] : reset($this->dFormats);
		$this->RedirectDownload("$url/export?format=$format", 'dGoogle', 0, 0, $url);
	}

	private function Presentation() {
		$url = 'https://docs.google.com/presentation/d/'.$this->ID;
		$page = $this->GetPage("$url/edit");
		$this->isPrivate($page);
		if (empty($_GET['T8']['format']) && !isset($_GET['audl'])) $this->formatSelector(2);
		$format = (!empty($_GET['T8']['format']) && in_array($_GET['T8']['format'], $this->pFormats)) ? $_GET['T8']['format'] : reset($this->pFormats);
		$this->RedirectDownload("$url/export/$format", 'pGoogle', 0, 0, $url);
	}

	private function Spreadsheets() {
		$url = 'https://docs.google.com/spreadsheets/d/'.$this->ID;
		$page = $this->GetPage("$url/edit");
		$this->isPrivate($page);
		if (empty($_GET['T8']['format']) && !isset($_GET['audl'])) $this->formatSelector(3);
		$format = (!empty($_GET['T8']['format']) && in_array($_GET['T8']['format'], $this->ssFormats)) ? $_GET['T8']['format'] : reset($this->ssFormats);
		$this->RedirectDownload("$url/export/$format", 'ssGoogle', 0, 0, $url);
	}

	private function Spreadsheet() {
		$url = 'https://docs.google.com/spreadsheet';
		$page = $this->GetPage("$url/ccc?key=".$this->ID);
		$this->isPrivate($page);
		$cookie = GetCookiesArr($page);

		if (substr($page, 9, 1) != '3' || !preg_match('@\nLocation: (https?://(?:[\w\-]+\.)*google\.com/[^\r\n]+)@i', $page, $redir)) html_error("Redirect 1 not found");
		$page = $this->GetPage($redir[1], $cookie);
		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['PREF'])) html_error("Cookie 'PREF' not found");

		$page = $this->GetPage("$url/ccc?key=".$this->ID, $cookie);

		if (empty($_GET['T8']['format']) && !isset($_GET['audl'])) $this->formatSelector(4);
		if (empty($_GET['T8']['format']) || ($fmcmd = array_search($_GET['T8']['format'], $this->sFormats)) === false) {
			reset($this->sFormats);
			$fmcmd = key($this->sFormats);
		}
		if (($cmdUrl = cut_str($page, '/fm?id=', '"')) == false || !preg_match('@[\w\-\.]+@i', $cmdUrl, $cmdId)) html_error('Download ID not found.');
		$this->RedirectDownload("$url/fm?id={$cmdId[0]}&fmcmd=$fmcmd", 'sGoogle', $cookie, 0, "$url/ccc?key=".$this->ID);
	}

	private function formatSelector($type = 1) {
		switch ($type) {
			case 1: $tName = 'Document';$formats = $this->dFormats;break;
			case 2: $tName = 'Presentation';$formats = $this->pFormats;break;
			case 3: $tName = 'Spreadsheets';$formats = $this->ssFormats;break;
			case 4: $tName = 'Spreadsheet';$formats = $this->sFormats;break;
			default: html_error('formatSelector: Unknown type.');
		}
		if (count($formats) == 1) return $_GET['T8'] = array('format' => reset($formats));
		echo "\n<br /><br /><h3 style='text-align: center;'>$tName format selector.</h4>";
		echo "\n<center><form name='GD_FS' action='{$GLOBALS['PHP_SELF']}' method='POST'>\n";
		echo "<select name='T8[format]' id='GD_ext'>\n";
		foreach ($formats as $ext) echo "<option value='$ext'>".(!empty($this->fNames[$ext]) ? $this->fNames[$ext]." (.$ext)" : ".$ext")."</option>\n";
		echo "</select>\n";
		$data = $this->DefaultParamArr('https://drive.google.com/open?id='.$this->ID);
		foreach ($data as $n => $v) echo("<input type='hidden' name='$n' id='FS_$n' value='$v' />\n");
		echo "<input type='submit' name='Th3-822' value='".lang(209)."' />\n";
		echo "</form></center>\n</body>\n</html>";
		exit;
	}

	// Add a Range header for get the filesize on chunked file downloads
	public function RedirectDownload($link, $FileName = 0, $cookie = 0, $post = 0, $referer = 0, $force_name = 0, $auth = 0, $addon = array()) {
		$referer .= "\r\nRange: bytes=0-";
		return parent::RedirectDownload($link, $FileName, $cookie, $post, $referer, $force_name, $auth, $addon);
	}

	public function CheckBack(&$headers) {
		$this->checkBug78902();
		if (substr($headers, 9, 3) == '416') html_error('[google_com.php] Plugin needs a fix, \'Range\' method is not working.');
		if (stripos($headers, "\nTransfer-Encoding: chunked") !== false) {
			global $fp, $sFilters;
			if (empty($fp) || !is_resource($fp)) html_error('Error: Your rapidleech copy is outdated and it doesn\'t support functions required by this plugin.');
			if (!in_array('dechunk', stream_get_filters())) html_error('Error: dechunk filter not available, cannot download chunked file.');
			if (!isset($sFilters) || !is_array($sFilters)) $sFilters = array();
			if (empty($sFilters['dechunk'])) $sFilters['dechunk'] = stream_filter_append($fp, 'dechunk', STREAM_FILTER_READ);
			if (!$sFilters['dechunk']) html_error('Error: Unknown error while initializing dechunk filter, cannot download chunked file.');
			// Little hack to get the filesize.
			$headers = preg_replace('@\nContent-Range\: bytes 0-\d+/@i', "\nContent-Length: ", $headers, 1);
		}
	}
}

// [11-2-2014]  Written by Th3-822.
// [23-12-2014]  Added support for new spreadsheets format/urls & Some workarounds to get filesize on chunked downloads... - Th3-822
// [30-4-2018]  Fixed Folders. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class hitfile_net extends DownloadClass {
	private $link, $page, $cookie, $pA, $RDregexp, $DLregexp;
	public function Download($link) {
		global $premium_acc, $Referer;
		if (!preg_match('@^https?://(?:[^/]+\.)?hitfile\.net/(?:download/free/)?(\w+)@i', $link, $id)) html_error('Error: Invalid link entered.');
		$this->link = $Referer = 'http://hitfile.net/' . $id[1];
		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		$this->cookie = array('user_lang' => 'en');
		$this->RDregexp = '@(https?://(?:[^/\"\'\t\r\n<>]+\.)?hitfile\.net(?:\:\d+)?)?//?download/redirect/[^\"\'\t\r\n<>]+@i';
		$this->DLregexp = '@https?://s\d+\.hitfile\.net(?:\:\d+)?/download\.php\?[^\"\'\t\r\n<>]+@i';

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link);
			is_present($this->page, 'File was deleted or not found', 'File Not Found.'); // 404
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($premium_acc['hitfile_net']['user']) && !empty($premium_acc['hitfile_net']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $premium_acc['hitfile_net']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $premium_acc['hitfile_net']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->CookieLogin($user, $pass);
		} else {
			$this->link = 'http://hitfile.net/download/free/' . $id[1];
			return $this->FreeDL();
		}
	}

	private function FreeDL() {
		$_POST['step'] = empty($_POST['step']) ? '' : $_POST['step'];
		switch ($_POST['step']) {
			case '1': { // Send Captcha && Get Countdown
				if (empty($_POST['captcha'])) html_error('You didn\'t enter the image-verification code.');
				$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

				$post = array();
				$post['captcha_response'] = urlencode($_POST['captcha']);
				$post['captcha_type'] = urlencode($_POST['c_type']);
				$post['captcha_subtype'] = (!empty($_POST['c_subtype']) ? urlencode($_POST['c_subtype']) : '');
				$page = $this->GetPage($this->link, $this->cookie, $post);

				is_present($page, 'Incorrect, try again!', 'Error: Wrong CAPTCHA entered.');
				is_present($page, 'Looks like your browser has disabled cookies.', 'Error: Invalid cookies.');

				if (!preg_match('@\W(?:min)?Limit[\s\t]*:[\s\t]*([\d\s\t\r\n\+\-\*/\(\)]+)[\s\t]*[\,\;]@i', $page, $count)) html_error('Countdown not found.');
				$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
				$data['step'] = '2';
				$this->JSCountdown($count[1], $data);
				break;
			}
			case '2': { // Download
				$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
				$page = $this->GetPage(str_replace('/download/free/', '/download/getLinkTimeout/', $this->link), $this->cookie, 0, $this->link . "\r\nX-Requested-With: XMLHttpRequest");

				if (preg_match($this->RDregexp, $page, $redir)) {
					$redir = (empty($redir[1])) ? 'http://hitfile.net'.$redir[0] : $redir[0];
					$page = $this->GetPage($redir, $this->cookie, 0, $this->link);
					if (!preg_match($this->DLregexp, $page, $dllink)) html_error('Download-Link not Found.');
				} elseif (!preg_match($this->DLregexp, $page, $dllink)) html_error('Redirect-Link not Found.');
				$this->RedirectDownload(html_entity_decode($dllink[0]), 'hitfile_fr', $this->cookie);
				break;
			}
			default : { // Get Captcha
				$page = $this->GetPage($this->link, $this->cookie);

				if (preg_match('@\W(?:min)?Limit[\s\t]*:[\s\t]*([\d\s\t\r\n\+\-\*/\(\)]+)[\s\t]*[\,\;]@i', $page, $count)) {
					$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
					$this->JSCountdown($count[1], $data, 'FreeDL limit reached');
				}

				if (!preg_match('@(https?://[^/\r\n\t\s\'\"<>]+)?/captcha/[^\r\n\t\s\'\"<>]+@i', $page, $imgurl)) html_error('Error: CAPTCHA not found.');
				$imgurl = (empty($imgurl[1])) ? 'http://hitfile.net'.$imgurl[0] : $imgurl[0];
				$imgurl = html_entity_decode($imgurl);

				if (!preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]+)[\'\"]\s+name\s*=\s*[\'\"]captcha_type[\'\"]@i', $page, $c_type) || !preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]*)[\'\"]\s+name\s*=\s*[\'\"]captcha_subtype[\'\"]@i', $page, $c_subtype)) html_error('CAPTCHA data not found');

				//Download captcha img.
				$capt_page = $this->GetPage($imgurl, $this->cookie);
				$capt_img = substr($capt_page, strpos($capt_page, "\r\n\r\n") + 4);
				$imgfile = DOWNLOAD_DIR . 'hitfile_captcha.png';

				if (file_exists($imgfile)) unlink($imgfile);
				if (!write_file($imgfile, $capt_img)) html_error('Error getting CAPTCHA image');
				unset($capt_page, $capt_img);

				$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
				$data['step'] = '1';
				$data['c_type'] = urlencode($c_type[1]);
				$data['c_subtype'] = urlencode($c_subtype[1]);
				$this->EnterCaptcha($imgfile.'?'.time(), $data);
				exit;
			}
		}
	}

	private function PremiumDL() {
		$page = $this->GetPage($this->link, $this->cookie);
		if (preg_match($this->RDregexp, $page, $redir)) {
			$redir = (empty($redir[1])) ? 'http://hitfile.net'.$redir[0] : $redir[0];
			$page = $this->GetPage($redir, $this->cookie);

			if (!preg_match($this->DLregexp, $page, $dllink)) html_error('Download Link not Found.');
		} elseif (!preg_match($this->DLregexp, $page, $dllink)) html_error('Redirect Link not Found.');
		$this->RedirectDownload(html_entity_decode($dllink[0]), 'hitfile_pr', $this->cookie);
	}

	private function Login($user, $pass) {
		$purl = 'http://hitfile.net/';
		if (!empty($_POST['step']) && ($_POST['step'] == '1' || $_POST['step'] == '2')) {
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

			$post = array();
			$post['user%5Blogin%5D'] = urlencode($user);
			$post['user%5Bpass%5D'] = urlencode($pass);
			if ($_POST['step'] == '1') {
				if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
				$post['user%5Bcaptcha_response%5D'] = urlencode($_POST['captcha']);
			} else {
				if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
				$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
				$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
			}
			$post['user%5Bcaptcha_type%5D'] = urlencode($_POST['c_type']);
			$post['user%5Bcaptcha_subtype%5D'] = (!empty($_POST['c_subtype']) ? urlencode($_POST['c_subtype']) : '');
			$post['user%5Bmemory%5D'] = 'on';
			$post['user%5Bsubmit%5D'] = 'Login';

			$page = $this->GetPage($purl.'user/login', $this->cookie, $post, $purl.'login');
			$this->cookie = GetCookiesArr($page, $this->cookie);

			$x = 0;
			while ($x < 3 && stripos($page, "\nLocation: ") !== false && preg_match('@\nLocation: ((https?://[^/\r\n]+)?/[^\r\n]*)@i', $page, $redir)) {
				$redir = (empty($redir[2])) ? 'http://hitfile.net'.$redir[1] : $redir[1];
				$page = $this->GetPage($redir, $this->cookie);
				$this->cookie = GetCookiesArr($page, $this->cookie);
				$x++;
			}

			is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect.');
			is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail.');
			is_present($page, 'Username(Email) does not exist', 'Login Failed: E-Mail is not registered.');
			is_present($page, 'Incorrect verification code', 'Login Failed: Wrong CAPTCHA entered.');
			is_present($page, 'Incorrect captcha code', 'Login Failed: Wrong Recaptcha entered.');
			// is_present($page, 'Limit of login attempts exceeded for your account. It has been temporarily locked.', 'Login Failed: Account Temporally Locked.');

			if (empty($redir) || $redir != $purl) $page = $this->GetPage($purl, $this->cookie, 0, $purl);
			is_notpresent($page, '/user/logout">Logout<', 'Login Failed.');

			$this->SaveCookies($user, $pass); // Update cookies file
			is_present($page, 'Account: <b>free</b>', 'Login Failed: Account isn\'t premium.');
			return $this->PremiumDL();
		} else {
			$post = array();
			$post['user%5Blogin%5D'] = urlencode($user);
			$post['user%5Bpass%5D'] = urlencode($pass);
			$post['user%5Bmemory%5D'] = 'on';
			$post['user%5Bsubmit%5D'] = 'Login';
			$page = $this->GetPage($purl.'user/login', $this->cookie, $post, $purl.'login');
			$this->cookie = GetCookiesArr($page, $this->cookie);

			if (!empty($this->cookie['user_isloggedin']) && $this->cookie['user_isloggedin'] == '1') {
				$page = $this->GetPage($purl, $this->cookie, 0, $purl);
				$this->SaveCookies($user, $pass); // Update cookies file
				is_present($page, 'Account: <b>free</b>', 'Login Failed: Account isn\'t premium');
				return $this->PremiumDL();
			}

			$x = 0;
			while ($x < 3 && stripos($page, "\nLocation: ") !== false && preg_match('@\nLocation: ((https?://[^/\r\n]+)?/[^\r\n]*)@i', $page, $redir)) {
				$redir = (empty($redir[2])) ? 'http://hitfile.net'.$redir[1] : $redir[1];
				$page = $this->GetPage($redir, $this->cookie);
				$this->cookie = GetCookiesArr($page, $this->cookie);
				$x++;
			}
			if ($x < 1) html_error('Login redirect not found');

			is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect');
			is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail');
			is_present($page, 'Username(Email) does not exist', 'Login Failed: E-Mail is not registered.');
			// is_present($page, 'Limit of login attempts exceeded for your account. It has been temporarily locked.', 'Login Failed: Account Temporally Locked');

			if (preg_match('@(https?://[^/\r\n\t\s\'\"<>]+)?/captcha/[^\r\n\t\s\'\"<>]+@i', $page, $imgurl)) {
				$imgurl = (empty($imgurl[1])) ? 'http://hitfile.net'.$imgurl[0] : $imgurl[0];
				$imgurl = html_entity_decode($imgurl);

				if (!preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]+)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_type\][\'\"]@i', $page, $c_type) || !preg_match('@\Wvalue\s*=\s*[\'\"]([^\'\"\r\n<>]*)[\'\"]\s+name\s*=\s*[\'\"]user\[captcha_subtype\][\'\"]@i', $page, $c_subtype)) html_error('CAPTCHA data not found.');


				//Download captcha img.
				$capt_page = $this->GetPage($imgurl, $this->cookie);
				$capt_img = substr($capt_page, strpos($capt_page, "\r\n\r\n") + 4);
				$imgfile = DOWNLOAD_DIR . 'hitfile_captcha.png';

				if (file_exists($imgfile)) unlink($imgfile);
				if (!write_file($imgfile, $capt_img)) html_error('Error getting CAPTCHA image.');
				unset($capt_page, $capt_img);

				$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
				$data['step'] = '1';
				$data['c_type'] = urlencode($c_type[1]);
				$data['c_subtype'] = urlencode($c_subtype[1]);
				$data['premium_acc'] = 'on';
				if ($this->pA) {
					$data['pA_encrypted'] = 'true';
					$data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
					$data['premium_pass'] = urlencode(encrypt($pass)); // And this too.
				}
				$this->EnterCaptcha($imgfile.'?'.time(), $data);
				exit;
			} elseif (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $pid)) {
				$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
				$data['step'] = '2';
				$data['c_type'] = 'recaptcha';
				$data['premium_acc'] = 'on';
				if ($this->pA) {
					$data['pA_encrypted'] = 'true';
					$data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
					$data['premium_pass'] = urlencode(encrypt($pass)); // And this too.
				}
				$this->reCAPTCHA($pid[1], $data, 0, 'Login');
				exit;
			} elseif (stripos($page, '/user/logout">Logout<') !== false) {
				$this->SaveCookies($user, $pass); // Update cookies file
				is_present($page, 'Account: <b>free</b>', 'Login Failed: Account isn\'t premium');
				return $this->PremiumDL();
			} else html_error('CAPTCHA not found.');
		}
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass, $filename = 'hitfile_dl.php') {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');

		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename)) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = sha1($user.':'.$pass);
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$page = $this->GetPage('http://hitfile.net/', $testCookie);
			if (stripos($page, '/user/logout">Logout<') === false) return $this->Login($user, $pass);
			$this->cookie = GetCookiesArr($page, $testCookie); // Update cookies
			$this->SaveCookies($user, $pass); // Update cookies file
			is_present($page, 'Account: <b>free</b>', 'Account isn\'t premium.');
			return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'hitfile_dl.php') {
		global $secretkey;
		$maxdays = 31; // Max days to keep cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = sha1($user.':'.$pass);
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}
}

//[09-1-2013] Written by Th3-822.
//[07-6-2013] Added login recaptcha support. - Th3-822
//[03-1-2016] Replaced 'turbobit' with 'hitfile' && small edits to make it work. - Th3-822

?>
<?php
$host = array();
$d = dir(HOST_DIR . 'download/');
$HostnamesToFix = array('d.h.st' => 'd-h.st', 'ex.load.com' => 'ex-load.com', 'samsung.firmware.org' => 'samsung-firmware.org', 'share.online.biz' => 'share-online.biz', 'up.4ever.com' => 'up-4ever.com');
$HostnamesToIgnore = array('hosts', 'genericxfs.dl');
while (false !== ($entry = $d->read())) {
	if (strtolower(strrchr($entry, '.')) == '.php' && stripos($entry, '.JD') === false) {
		$hostname = strtolower(substr($entry, 0, -4));
		if (empty($hostname)) continue;
		$hostname = str_replace('_', '.', $hostname);
		if (array_key_exists($hostname, $HostnamesToFix)) $hostname = $HostnamesToFix[$hostname];
		if (in_array($hostname, $HostnamesToIgnore, true)) continue;
		$host[$hostname] = $entry;
		switch ($hostname) {
		//define the domain so we dont need to make new plugin with only 3-6 lines code
			case '1fichier.com':
				foreach(array('alterupload.com', 'cjoint.net', 'desfichiers.com', 'dfichiers.com', 'megadl.fr', 'mesfichiers.org', 'piecejointe.net', 'pjointe.com', 'tenvoi.com', 'dl4free.com') as $d1fichier) $host["$d1fichier"] = $host['1fichier.com'];
				break;
			case 'crocko.com':
				$host['easy-share.com'] = $host['crocko.com'];
				break;
			case 'depositfiles.com':
				foreach(array('depositfiles.in', 'depositfiles.mobi', 'depositfiles.net', 'depositfiles.net.cn', 'depositfiles.org', 'depositfiles.co.uk', 'depositfiles.info', 'dfiles.eu', 'dfiles.ru', 'dfiles.co', 'dfiles.co.uk') as $dfdomains) $host["$dfdomains"] = $host['depositfiles.com'];
				break;
			case 'd-h.st':
				$host['dev-host.org'] = $host['d-h.st'];
				break;
			case 'fileboom.me':
				$host['fboom.me'] = $host['fileboom.me'];
				break;
			case 'filecloud.io':
				$host['ifile.it'] = $host['filecloud.io'];
				break;
			case 'filepost.com':
				$host['fp.io'] = $host['filepost.com'];
				break;
			case 'filerio.in':
				$host['filerio.com'] = $host['filerio.in'];
				$host['filekeen.com'] = $host['filerio.in'];
				break;
			case 'filesflash.com':
				$host['filesflash.net'] = $host['filesflash.com'];
				break;
			case 'freakshare.com':
				$host['freakshare.net'] = $host['freakshare.com'];
				break;
			case 'keep2share.cc':
				foreach(array('keep2share.com', 'keep2s.cc', 'k2s.cc') as $k2sdomains) $host["$k2sdomains"] = $host['keep2share.cc'];
				break;
			case 'kumpulbagi.id':
				$host['kumpulbagi.com'] = $host['kumpulbagi.id'];
				$host['kbagi.com'] = $host['kumpulbagi.id'];
				break;
			case 'mega.co.nz':
				$host['mega.nz'] = $host['mega.co.nz'];
				break;
			case 'multiupload.nl':
				$host['multiupload.com'] = $host['multiupload.nl'];
				break;
			case 'rapidgator.net':
				$host['rg.to'] = $host['rapidgator.net'];
				break;
			case 'speedyshare.com':
				$host['speedy.sh'] = $host['speedyshare.com'];
				break;
			case 'terafile.co':
				$host['lumfile.com'] = $host['terafile.co'];
				$host['lumfile.se'] = $host['terafile.co'];
				break;
			case 'turbobit.net':
				$host['turbobit.ru'] = $host['turbobit.net'];
				$host['unextfiles.com'] = $host['turbobit.net'];
				break;
			case 'uploaded.net':
				foreach (array('ul.to', 'uploaded.to') as $uploaded) $host["$uploaded"] = $host['uploaded.net'];
				break;
			case 'uploadboy.com':
				$host['uploadboy.me'] = $host['uploadboy.com'];
				break;
			case 'uploadhero.co':
				$host['uploadhero.com'] = $host['uploadhero.co'];
				break;
			case 'uppit.com':
				$host['up.ht'] = $host['uppit.com'];
				break;
			case 'upstore.net':
				$host['upsto.re'] = $host['upstore.net'];
				break;
			case 'youtube.com':
				$host['youtu.be'] = $host['youtube.com'];
				break;
			case 'xvideos.com':
				$host['xnxx.com'] = $host['xvideos.com'];
				break;
		}
	}
}
unset($HostnamesToFix, $HostnamesToIgnore);
$d->close();
?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once ('index.html');
	exit();
}

class howfile_com extends DownloadClass {

	public function Download($link) {
		global $premium_acc;

		if (!$_REQUEST['step']) {
			$tcookie['language'] = 'en_us';
			$this->page = $this->GetPage($link, $tcookie);
			is_present($this->page, "Been deleted", "File not found");
			$tcookie = GetCookiesArr($this->page, $tcookie);
			if (!preg_match_all('/setCookie\("(v\w+)", "(\w+)",/i', $this->page, $cb)) html_error("Error: vid\vid1 Cookie not found!");
			$this->cookie = array_merge($tcookie, array_combine($cb[1], $cb[2]));
		}
		$this->link = $link;
		if ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST['premium_pass']) || ($premium_acc['howfile_com']['user'] && $premium_acc['howfile_com']['pass']))) {
			return $this->Premium();
		} else {
			return $this->Free();
		}
	}

	private function Free() {

		if (!preg_match("/<a href=\"([^\"]+)\" onclick='setCookie/", $this->page, $dl)) html_error("Error: Download Link not found!");
		$dlink = trim($dl[1]);
		$this->RedirectDownload($dlink, 'howfile', $this->cookie, 0, $this->link);
		exit();
	}

	private function Premium() {

		$cookie = $this->login();
		$page = $this->GetPage($this->link, $cookie);
		if (!preg_match("/<a href=\"([^\"]+)\" onclick='setCookie/", $this->page, $dl)) html_error("Error: Download Link not found!");
		$dlink = trim($dl[1]);
		$this->RedirectDownload($dlink, 'howfile', $cookie);
	}

	private function login() {
		global $premium_acc;

		$user = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["howfile_com"] ["user"]);
		$pass = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["howfile_com"] ["pass"]);
		if (empty($user) || empty($pass)) html_error("Login failed, username or password is empty!");

		$posturl = 'http://www.howfile.com/';
		$post = array();
		$post['returnPath'] = '/desktop/into.html';
		$post['username'] = $user;
		$post['password'] = $pass;
		$post['remember'] = 'on';
		$page = $this->GetPage($posturl . 'view?module=member&action=validateLogin', $this->cookie, $post, $posturl);
		is_present($page, 'Wrong username or password');
		$cookie = GetCookiesArr($page, $this->cookie);

		$page = $this->GetPage($posturl . 'desktop/into.html', $cookie, 0, $posturl);
		is_present($page, 'Upgrade</a>', 'Account isn\'t Premium!');

		return $cookie;
	}

}

/*
 * howfile.com free download plugin by Ruud v.Tony 18-01-2012
 * Updated to support premium by Tony Fauzi Wihana/Ruud v.Tony 26-12-2012
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class hulkload_com extends GenericXFS_DL {
	public $pluginVer = 14;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<html><head><title>RAPIDLEECH V2.2</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css"><!--@import url("../images/style.css");--></style></head><body><center><img src="../images/logo.gif" alt="RAPIDLEECH V2.2"><h1>403: RapidLeech -> Forbidden</h1><hr />You have reached this page in error, please useyour back button to return to RapidLeech.</center></body></html>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class indishare_me extends GenericXFS_DL {
	public $pluginVer = 18;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class junocloud_me extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Fix link and check for the dlX. redirect
		$link = preg_replace('@(?<=://)dl\d*\.(junocloud\.me)(?=/)@i', '$1', $link);
		$test = explode("\r\n\r\n", $this->GetPage($link), 2);
		if (preg_match('@\nLocation: (https?://dl\d*\.junocloud\.me/\w{12}(?=(?:[/\.]|(?:\.html?))?))@i', $test[0], $redir)) $link = $redir[1];

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class keep2share_cc extends DownloadClass {
	private $page, $cookie = array('use_new_design' => 0), $pA;
	public function Download($link) {
		$this->LnkRegexp = '@https?://(?:www\.)?(keep2share\.(?:cc|com)|k(?:eep)?2s\.cc)/file(?:/info)?/(\w+)@i';
		$this->RDRegexp = '@/file/url.html\?file=\w+@i';
		$this->DLRegexp = '@https?://(?:slow|prx)-\d+\.(?:keep2share\.(?:cc|com)|k(?:eep)?2s\.cc)/[^\s\'\"<>]+@i';

		if (!preg_match($this->LnkRegexp, $link, $fid)) html_error('Invalid link?.');
		$this->domain = $fid[1];
		$this->link = $GLOBALS['Referer'] = 'https://'.$fid[1].'/file/'.$fid[2];

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			if (preg_match($this->LnkRegexp, $this->page, $fid)) {
				$this->domain = $fid[1];
				$this->link = $GLOBALS['Referer'] = 'https://'.$fid[1].'/file/'.$fid[2];
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
				$this->page = $this->GetPage($this->link, $this->cookie);
			}
			is_present($this->page, 'File not found or deleted');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['keep2share_cc']['user']) && !empty($GLOBALS['premium_acc']['keep2share_cc']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['keep2share_cc']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['keep2share_cc']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->CookieLogin($user, $pass);
		} else return $this->FreeDL();
	}

	private function FreeDL() {
		if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
			is_present($this->page, 'This file is available<br>only for premium members.', 'This file is available only for premium members.');
			$post = array('yt0' => 'Submit');
			$post['slow_id'] = cut_str($this->page, 'name="slow_id" value="', '"');
			if (empty($post['slow_id'])) html_error('FreeDL ID don\'t found.');

			$page = $this->GetPage($this->link, $this->cookie, $post);
			is_present($page, 'Free user can\'t download large files.', 'File is Too Heavy for Free Download');
			$this->cookie = GetCookiesArr($page, $this->cookie);

			// Check freedl limit timer
			if (preg_match('@Please wait (?:(\d{1,2})\:)?(\d{2}):(\d{2}) to download this file@i', $page, $timer)) {
				$timer = ($timer[1] * 3600) + ($timer[2] * 60) + $timer[3];
				return $this->JSCountdown($timer, 0, 'FreeDL limit reached.');
			}

			// Check direct link
			if (preg_match($this->RDRegexp, $page, $idDl)) {
				$page = $this->GetPage('https://'.$this->domain.$idDl[0], $this->cookie);
				if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download Link Not Found.');
				return $this->RedirectDownload($dl[0], 'T8_k2s_fr2', $this->cookie);
			}

			$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
			$data['step'] = '1';
			$data['uniqueId'] = $post['slow_id'];

			if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $cpid)) {
				$data['step'] = '1';
				$this->reCAPTCHA($pid[1], $data);
			} elseif (preg_match('@\W(file/captcha\.html\?v=\w+)@i', $page, $cpid)) {
				$data['step'] = '2';
				list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage('https://'.$this->domain.'/'.$cpid[1], $this->cookie), 2);
				if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
				$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');
				$this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20);
			} else html_error('CAPTCHA not found.');
			return;
		}

		$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
		$uniqueId = !empty($_POST['uniqueId']) ? trim($_POST['uniqueId']) : false;
		if (empty($uniqueId)) html_error('Error: Empty "uniqueId".');

		$post = array('free' => 1, 'freeDownloadRequest' => 1, 'uniqueId' => $uniqueId, 'yt0' => 'Submit');
		if ($_POST['step'] == '1') {
			if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
			$post['CaptchaForm%5Bcode%5D'] = '';
			$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
			$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
		} else {
			if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
			$post['CaptchaForm%5Bcode%5D'] = urlencode($_POST['captcha']);
		}

		$page = $this->GetPage($this->link, $this->cookie, $post);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		is_present($page, 'The verification code is incorrect.');

		if (!preg_match('@\sid="download-wait-timer"[^>]*>\s*(?:<\w+(?:\s[^>]+)?>)?(\d+)\s*</@i', $page, $cD)) html_error('Countdown not found.');
		if ($cD[1] > 0) $this->CountDown($cD[1]);

		$post = array('uniqueId' => $uniqueId, 'free' => 1);
		$page = $this->GetPage($this->link, $this->cookie, $post);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		if (!preg_match($this->RDRegexp, $page, $idDl)) html_error('Redirect Link Not Found.');
		$page = $this->GetPage('https://'.$this->domain.$idDl[0], $this->cookie);

		if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download Link Not Found.');

		$this->RedirectDownload($dl[0], 'T8_k2s_fr', $this->cookie);
	}

	private function checkAntiBotCaptcha($page) {
		if (!empty($_POST['step']) && $_POST['step'] == '-1') return; // Don't recheck.
		if (stripos($page, 'Your account is suspected in using illegal software') !== false) {
			$data = $this->DefaultParamArr($this->link);
			$data['premium_acc'] = 'on';
			if ($this->pA) {
				$data['pA_encrypted'] = 'true';
				$data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
				$data['premium_pass'] = urlencode(encrypt($pass)); // And this too.
			}
			if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $pkey)) {
				$data['step'] = '3';
				return $this->reCAPTCHA($pkey[1], $data);
			} elseif (preg_match('@(https?://(?:www\.)?(?:keep2share\.(?:cc|com)|k(?:eep)?2s\.cc))?(?(1)/)(?:[^/\"\'<>\s]+/)*captcha\.html\?v=\w+@i', $page, $imgcap)) {
				$imgcap = empty($imgcap[1]) ? 'https://'.$this->domain.'/'.$imgcap[0] : $imgcap[0];
				$data['step'] = '4';
				list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($purl . $cpid[1], $this->cookie), 2);
				if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
				$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');

				return $this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20);
			}
			html_error('AntiBot captcha not found.');
		}
	}

	private function postAntiBotCaptcha() {
		if (empty($_POST['step']) || !in_array($_POST['step'], array('3', '4'))) return $_POST['step'] = false;
		$post = array();
		if ($_POST['step'] == '3') {
			if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
			if (empty($_POST['recaptcha_challenge_field'])) html_error('Empty reCAPTCHA challenge.');
			$post['CoreRobotsCheckForm%5BverifyCode%5D'] = '';
			$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
			$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
		} else {
			if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
			$post['CoreRobotsCheckForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
		}
		$_POST['step'] = '-1';

		return $this->GetPage($this->link, $this->cookie, $post);
	}

	private function PremiumDL() {
		if (!($page = $this->postAntiBotCaptcha())) $page = $this->GetPage($this->link, $this->cookie);
		if (preg_match($this->LnkRegexp, $page, $fid)) {
			$this->domain = $fid[1];
			$this->link = $GLOBALS['Referer'] = 'https://'.$fid[1].'/file/'.$fid[2];
			$this->cookie = GetCookiesArr($page, $this->cookie);
			$page = $this->GetPage($this->link, $this->cookie);
		}
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$this->checkAntiBotCaptcha($page);

		// Check direct link
		if (preg_match($this->DLRegexp, $page, $dl)) return $this->RedirectDownload($dl[0], 'T8_k2s_pr2', $this->cookie);

		is_present($page, 'Traffic limit exceed!');

		if (!preg_match($this->RDRegexp, $page, $idDl)) html_error('Redirect-Link Not Found.');
		$page = $this->GetPage('https://'.$this->domain.$idDl[0], $this->cookie);
		if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download-Link Not Found.');
		return $this->RedirectDownload($dl[0], 'T8_k2s_pr', $this->cookie);
	}

	private function Login($user, $pass) {
		$purl = 'https://'.$this->domain.'/';

		$post = array();
		$post['LoginForm%5Busername%5D'] = urlencode($user);
		$post['LoginForm%5Bpassword%5D'] = urlencode($pass);
		$post['LoginForm%5BrememberMe%5D'] = 1;
		$post['yt0'] = 'Submit';
		if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
			$page = $this->GetPage($purl.'login.html', $this->cookie, $post, $purl);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			if (stripos($page, 'The verification code is incorrect.') !== false) {
				$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
				$data['premium_acc'] = 'on';
				if ($this->pA) {
					$data['pA_encrypted'] = 'true';
					$data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
					$data['premium_pass'] = urlencode(encrypt($pass)); // And this too.
				}
				if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $cpid)) {
					$data['step'] = '1';
					$this->reCAPTCHA($pid[1], $data, 0, 'Login');
				} elseif (preg_match('@\W(auth/captcha\.html\?v=\w+)@i', $page, $cpid)) {
					$data['step'] = '2';

					list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($purl . $cpid[1], $this->cookie), 2);
					if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
					$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');

					$this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20);
				} else html_error('Login CAPTCHA not found.');
				exit;
			}
		} else {
			if ($_POST['step'] == '1') {
				if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
				$post['LoginForm%5BverifyCode%5D'] = '';
				$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
				$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
			} else {
				if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
				$post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
			}

			$_POST['step'] = false;
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

			$page = $this->GetPage($purl.'login.html', $this->cookie, $post, $purl);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			is_present($page, 'The verification code is incorrect.');
		}
		is_present($page, 'Incorrect username or password', 'Login Failed: Email/Password incorrect.');
		is_present($page, 'You logged in from different country IP', 'Login Failed: Your account was locked for security reasons, to unlock your account check your email.');
		if (empty($this->cookie['c903aeaf0da94d1b365099298d28f38f'])) html_error('Login Cookie Not Found.');
		$this->cookie['use_new_design'] = 0;

		$page = $this->GetPage($purl, $this->cookie, 0, $purl.'login.html');
		is_notpresent($page, '/auth/logout.html">Logout', 'Login Error.');
		$this->SaveCookies($user, $pass); // Update cookies file
		if (preg_match('@Account type:\s*<span(?:\s[^>]+)?>\s*Free\s*</span>@i', $page)) html_error('Account isn\'t premium.');

		return $this->PremiumDL();
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass, $filename = 'keep2share_dl.php') {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
		$user = strtolower($user);

		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename) || (!empty($_POST['step']) && in_array($_POST['step'], array('1', '2')))) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$testCookie['use_new_design'] = 0;
			$page = $this->GetPage('https://'.$this->domain.'/', $testCookie);
			if (stripos($page, '/auth/logout.html">Logout') === false) return $this->Login($user, $pass);
			$this->cookie = GetCookiesArr($page, $testCookie); // Update cookies
			$this->SaveCookies($user, $pass); // Update cookies file
			if (preg_match('@Account type:\s*<span(?:\s[^>]+)?>\s*Free\s*</span>@i', $page)) html_error('Account isn\'t premium');
			return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'keep2share_dl.php') {
		global $secretkey;
		$maxdays = 31; // Max days to keep extra cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}
}

//[16-2-2014] Written by Th3-822.
//[07-3-2014] Fixed login captcha. - Th3-822
//[08-6-2014] Added support for Anti bot captcha at premium Dl. (Untested) - Th3-822
//[02-8-2014] Fixed FreeDL captcha. - Th3-822
//[02-1-2016] Fixed FreeDL countdown. - Th3-822
//[17-1-2016] Merged updates from fileboom plugin. - Th3-822
//[01-4-2017] Switched to https and added cookie to avoid site's new design. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class kingfiles_net extends GenericXFS_DL {
	public $pluginVer = 16;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class kumpulbagi_id extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.(?:kumpulbagi\.(?:id|com)|kbagi\.com)/download\?[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		$link = parse_url($link);
		$link['scheme'] = 'http';
		$link['host'] = 'kbagi.com';
		$link = rebuild_url($link);
		if (!preg_match('@(https?://kbagi\.com)/(?:[^/]+/)+[^\r\n\t/<>\"]+?,(\d+)[^\r\n\t/<>\"]*@i', $link, $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['kumpulbagi_id']['user']) && !empty($GLOBALS['premium_acc']['kumpulbagi_id']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['kumpulbagi_id']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['kumpulbagi_id']['pass']);
			return $this->Login($user, $pass);
		} else return $this->TryDL();
	}

	private function TryDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!preg_match($this->DLRegexp, $this->page, $DL)) {
			if (substr($this->page, 9, 3) != '200') html_error('File Not Found or Private.');
			$download = $this->reqAction('DownloadFile', array('fileId' => $this->fid, '__RequestVerificationToken' => $this->getCSRFToken($this->page)));
			if (empty($download['DownloadUrl']) || !preg_match($this->DLRegexp, $download['DownloadUrl'], $DL)) {
				if (empty($this->cookie['.ASPXAUTH_v2']) && $download['Type'] == 'Window') html_error('Login is Required to Download This File.');
				html_error('Download-Link Not Found.');
			}
		}
		return $this->RedirectDownload($DL[0], 'kumpulbagi_placeholder_fname');
	}

	private function getCSRFToken($page, $errorPrefix = 'Error') {
		if (!preg_match('@name="__RequestVerificationToken"\s+type="hidden"\s+value="([\w\-+/=]+)"@i', $page, $token)) return html_error("[$errorPrefix]: Request Token Not Found.");
		return $token[1];
	}

	private function Login($user, $pass) {
		$page = $this->GetPage($this->baseurl . '/', $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$login = $this->reqAction('Account/Login', array('UserName' => $user, 'Password' => $pass, '__RequestVerificationToken' => $this->getCSRFToken($page, 'Login Error')));
		if (!empty($login['Content'])) is_present($login['Content'], 'ID atau kata sandi salah.', 'Login Error: Wrong Login/Password.');
		if (empty($this->cookie['.ASPXAUTH_v2'])) html_error('Login Error: Cookie ".ASPXAUTH_v2" not Found.');

		return $this->TryDL();
	}

	private function reqAction($path, $post = array()) {
		$page = $this->GetPage("{$this->baseurl}/action/$path", $this->cookie, array_map('urlencode', $post), "{$this->baseurl}/\r\nX-Requested-With: XMLHttpRequest");
		$reply = $this->json2array($page, "reqAction($path) Error");
		if (empty($reply)) html_error("[reqAction($path) Error] Empty Response.");
		$this->cookie = GetCookiesArr($page, $this->cookie);

		return $reply;
	}
}

// [20-3-2016] Written by Th3-822.
// [22-4-2016] Renamed to kumpulbagi_id and fixed. - Th3-822
// [12-8-2016] Switched domain to .com tld (I won't rename the plugin again) & Added support for "mirror" domains. - Th3-822
// [12-10-2016] Changed Domain. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class kutucugum_com extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.kutucugum\.com/download\?[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://kutucugum\.com)/(?:[^/]+/)+[^\r\n\t/<>\"]+?,(\d+)[^\r\n\t/<>\"]*@i', preg_replace('@^(http)s?(://)(?:www\.)?(kutucugum)\.com(?=/)@i', '$1$2$3.com', $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['kutucugum_com']['user']) && !empty($GLOBALS['premium_acc']['kutucugum_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['kutucugum_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['kutucugum_com']['pass']);
			return $this->Login($user, $pass);
		} else return $this->TryDL();
	}

	private function TryDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!preg_match($this->DLRegexp, $this->page, $DL)) {
			if (substr($this->page, 9, 3) != '200') html_error('File Not Found or Private.');
			$download = $this->reqAction('DownloadFile', array('fileId' => $this->fid, '__RequestVerificationToken' => $this->getCSRFToken($this->page)));
			if (empty($download['DownloadUrl']) || !preg_match($this->DLRegexp, $download['DownloadUrl'], $DL)) {
				if (empty($this->cookie['.ASPXAUTH_v2']) && $download['Type'] == 'Window') html_error('Login is Required to Download This File.');
				html_error('Download-Link Not Found.');
			}
		}
		return $this->RedirectDownload($DL[0], 'kutucugum_placeholder_fname');
	}

	private function getCSRFToken($page, $errorPrefix = 'Error') {
		if (!preg_match('@name="__RequestVerificationToken"\s+type="hidden"\s+value="([\w\-+/=]+)"@i', $page, $token)) return html_error("[$errorPrefix]: Request Token Not Found.");
		return $token[1];
	}

	private function Login($user, $pass) {
		$page = $this->GetPage($this->baseurl . '/', $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$login = $this->reqAction('Account/Login', array('UserName' => $user, 'Password' => $pass, '__RequestVerificationToken' => $this->getCSRFToken($page, 'Login Error')));
		if (!empty($login['Content'])) is_present($login['Content'], 'KullanÄ±cÄ± adÄ± veya Åifre yanlÄ±ÅtÄ±r.', 'Login Error: Wrong Login/Password.');
		if (empty($this->cookie['.ASPXAUTH_v2'])) html_error('Login Error: Cookie ".ASPXAUTH_v2" not Found.');

		return $this->TryDL();
	}

	private function reqAction($path, $post = array()) {
		$page = $this->GetPage("{$this->baseurl}/action/$path", $this->cookie, array_map('urlencode', $post), "{$this->baseurl}/\r\nX-Requested-With: XMLHttpRequest");
		$reply = $this->json2array($page, "reqAction($path) Error");
		if (empty($reply)) html_error("[reqAction($path) Error] Empty Response.");
		$this->cookie = GetCookiesArr($page, $this->cookie);

		return $reply;
	}
}

// [20-3-2016] Written by Th3-822.
// [22-4-2016] Renamed to kutucugum_com and fixed. - Th3-822

?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class letitbit_net extends DownloadClass {
	private $page, $cookie;
	public $link;
	public function Download($link) {
		global $premium_acc;
		$this->cookie = array('lang' => 'en');
		// Check link
		if (empty($_REQUEST['step']) || $_REQUEST['step'] != '1') {
			$this->page = $this->GetPage($link, $this->cookie);
			$headers = substr($this->page, 0, strpos($this->page, "\r\n\r\n"));
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			if (preg_match('@\nLocation: ((https?://(?:[a-zA-Z\d\-]+\.)*letitbit\.net)?/[^\r\n]+)@i', $headers, $redir)) {
				$link = (empty($redir[2])) ? 'http://letitbit.net'.$redir[1] : $redir[1];
				$this->page = $this->GetPage($link, $this->cookie);
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
			} elseif (preg_match('@\nLocation: https?://[^/\r\n]+/[^\r\n]+@i', $headers)) html_error('Error: Non Acceptable Redirect.');
			if (stripos($this->page, 'File not found') !== false) {
				if ($this->cookie['country'] == 'US') html_error('The requested file was not found or isn\'t downloadable in your server\'s country.'); // It seems that lib blocks downloads from usa... I will check this later and add the error msg if it's true. - T8
				html_error('The requested file was not found.');
			}
		}
		$this->link = $link;
		if ($_REQUEST ['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST ['premium_pass']) || (!empty($premium_acc ['letitbit_net'] ['user']) && !empty($premium_acc ['letitbit_net'] ['pass'])))) {
			$user = $_REQUEST ["premium_user"] ? $_REQUEST ["premium_user"] : $premium_acc ["letitbit_net"] ["user"];
			$pass = $_REQUEST ["premium_pass"] ? $_REQUEST ["premium_pass"] : $premium_acc ["letitbit_net"] ["pass"];
			if (empty($user) || empty($pass)) html_error("Login Failed: Username or Password is empty. Please check login data.");
			return $this->SkipLoginC($user, $pass);
		} elseif ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_pass'])||(!empty($premium_acc['letitbit_net']['pass'])))) {
			$key = ($_REQUEST ["premium_pass"] ? trim($_REQUEST ["premium_pass"]) : $premium_acc["letitbit_net"]["pass"]);
			return $this->Premium($key);
		} elseif (!empty($_REQUEST['step']) && $_REQUEST['step'] == '1') {
			return $this->Free();
		} else {
			return $this->Retrieve();
		}
	}

	private function Retrieve() {
		if (!preg_match("@<form (?:[^<>]*)[\s\t]*id=\"ifree_form\"(?:[^<>]*)>@i", $this->page, $form_tag)) html_error('Error: Free Form 1 Tag Not Found!');
		$form_action = trim(cut_str($form_tag[0], 'action="', '"'));
		if (!preg_match("@<form (?:[^<>]*)[\s\t]*id=\"enter_premium_form\"(?:[^<>]*)>@i", $this->page, $form_tag)) html_error('Error: Free Form 1 Tag Not Found!');
		$form = trim(cut_str($this->page, $form_tag[0], '</form>'));
		if (empty($form)) html_error('Error: Empty Free Form 1!');
		$post = $this->AutomatePost($form);
		if (stripos($form_action, 'born_iframe') !== false) {
			$page = $this->GetPage("http://letitbit.net$form_action", $this->cookie, $post);
			if (!preg_match("@<form (?:[^<>]*)[\s\t]*id=\"d3_form\"(?:[^<>]*)>@i", $page, $form_tag)) html_error('Error: Free Form 2 Tag Not Found!');
			$form = trim(cut_str($page, $form_tag[0], '</form>'));
			if (empty($form)) html_error('Error: Empty Free Form 2!');
			$post = $this->AutomatePost($form);
			$form_action = trim(cut_str($form_tag[0], 'action="', '"'));
		}
		$this->link = "http://letitbit.net$form_action";
		$page = $this->GetPage($this->link, $this->cookie, $post);
		$this->cookie = GetCookiesArr($page, $this->cookie);
		unset($post, $form_tag, $form_action);
		if (!preg_match("/ajax_check_url = '((http:\/\/[a-z0-9]+\.[\w.]+)\/[^\r\n']+)';/", $page, $check)) html_error("Error: Redirect link [Free] not found!");
		$this->link = $check[1];
		$this->server = $check[2];
		// If you want, you can skip the countdown...
		if (preg_match('@(\d+)<\/span> seconds@', $page, $wait)) $this->CountDown($wait[1]);
		// end countdown timer...
		$this->GetPage($this->link, $this->cookie, array(), 0, 0, 1); //empty array in post variable needed...

		if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $pid)) html_error('reCAPTCHA not found.');
		if (!preg_match('@var[\s\t]+recaptcha_control_field[\s\t]*=[\s\t]*\'([^\'\;]+)\'@i', $page, $ctrl)) html_error('Captcha control field not found.');

		$data = $this->DefaultParamArr($this->server . "/ajax/check_recaptcha.php", $this->cookie);
		$data['step'] = '1';
		$data['recaptcha_control_field'] = rawurlencode($ctrl[1]);
		$this->reCAPTCHA($pid[1], $data);
	}

	private function Free() {
		if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
		$post = array();
		$post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
		$post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
		$post['recaptcha_control_field'] = rawurlencode(rawurldecode($_POST['recaptcha_control_field']));

		$this->cookie = urldecode($_POST['cookie']);
		$page = $this->GetPage($this->link, $this->cookie, $post, 0, 0, 1); //too many XML request needed so I used default http.php function in geturl...
		is_present($page, 'error_wrong_captcha', 'Error: Wrong Captcha Entered.');
		is_present($page, 'error_free_download_blocked', 'Error: FreeDL limit reached.');
		if (!preg_match_all('/"(https?:[^\|\r\n\"\']+)"?/', $page, $dl)) html_error('Error: Download link [Free] not found.');
		$dlink = str_replace('\\', '', trim($dl[1][array_rand($dl[1])]));
		$FileName = urldecode(basename(parse_url($dlink, PHP_URL_PATH)));
		$this->RedirectDownload($dlink, $FileName, $this->cookie, 0);
		exit();
	}

	private function Premium($premiumkey = false) {
		if ($premiumkey) {
			$form = cut_str($this->page, '<div class="hide-block password_area">', '<div class="column label" style="width:200px">');
			if (empty($form)) html_error("Error: Empty Premium Key Form!");
			$post = $this->AutomatePost($form);
			$post['pass'] = $premiumkey;
			$post['submit_sms_ways_have_pass'] = 'Download file';
			$this->link = "http://letitbit.net" . cut_str($form, '<form action="', '"');
			$this->page = $this->GetPage($this->link, $this->cookie, $post);
		} else $this->page = $this->GetPage($this->link, $this->cookie, 0, $this->link);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		$x = 0;
		$ref = $this->link;
		while ($x < 5 && preg_match('@\nLocation: ((https?://(?:[a-zA-Z\d\-]+\.)*letitbit\.net)?/[^\r\n]*)@i', $this->page, $redir)) {
			$redir = (empty($redir[2])) ? (!empty($ref['scheme']) && strtolower($ref['scheme']) == 'https' ? 'https' : 'http').'://'.parse_url($ref, PHP_URL_HOST).$redir[1] : $redir[1];
			$this->page = $this->GetPage($redir, $this->cookie, 0, $ref);
			$ref = $redir;
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			$x++;
		}

		is_present($this->page, 'The premium key has been banned for sharing with other people.');
		is_present($this->page, 'This premium key is attached to a registered account', 'You need to use your username and password not the premium key!');
		is_present($this->page, 'callback_no_pass', 'This premium key does not exist.');
		if (!preg_match_all('@"(https?://[^/]+/[^\"]+)"\s*\:\s*"direct\_link\_\d+"@', $this->page, $dl)) html_error('Error: Download Link [Premium] not found!');
		$dlink = trim($dl[1][array_rand($dl[1])]);
		$FileName = urldecode(basename(parse_url($dlink, PHP_URL_PATH)));
		$this->RedirectDownload($dlink, $FileName, $this->cookie, 0, $this->link);
	}

	private function login($user, $pass) {
		$post = array();
		$post['act'] = 'login';
		$post['login'] = $user;
		$post['password'] = $pass;
		$check = $this->GetPage("http://letitbit.net/ajax/auth.php", $this->cookie, $post, "http://letitbit.net/");
		is_present($check, 'Authorization data is invalid');
		is_present($check, 'Your login attempts have been made more than 100 times in 24 hours, the next attempt will be available only tomorrow.');
		$this->cookie = GetCookiesArr($check, array('lang' => 'en'));
		if (empty($this->cookie['log']) || empty($this->cookie['pas'])) html_error('Error [log/pass cookie not found!]');

		$check = $this->GetPage('http://letitbit.net/ajax/get_attached_passwords.php', $this->cookie, 0, 'http://letitbit.net/');
		is_present($check, 'Authorization data is invalid!', 'Unknown login error.');
		$this->SaveCookies($user, $pass); // Update cookies file
		is_present($check, 'There are no attached premium', 'No premium codes attached');

		return $this->Premium();
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function SkipLoginC($user, $pass, $filename = 'letitbit_dl.php') {
		global $secretkey;
		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename)) return $this->login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user . ':' . $pass);
		if (array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = sha1($user . ':' . $pass);
			$this->cookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (is_array($this->cookie)) unset($this->cookie['PHPSESSID']);
			if ((is_array($this->cookie) && count($this->cookie) < 1) || empty($this->cookie)) return $this->login($user, $pass);

			$check = $this->GetPage('http://letitbit.net/ajax/get_attached_passwords.php', $this->cookie, 0, 'http://letitbit.net/');
			if (stripos($check, 'Authorization data is invalid!') !== false) return $this->login($user, $pass);
			$this->SaveCookies($user, $pass); // Update cookies file
			is_present($check, 'There are no attached premium', 'No premium codes attached');

			return $this->Premium();
		}
		return $this->login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'letitbit_dl.php') {
		global $secretkey;
		$maxdays = 7; // Max days to keep cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = hash('crc32b', $user . ':' . $pass);
		$_secretkey = $secretkey;
		$secretkey = sha1($user . ':' . $pass);
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
	}

	private function AutomatePost($form) {
		if (!preg_match_all('@<input type="hidden" name="([^"]+)" value="([^"]+)" \/>@i', $form, $match)) html_error("Error: Post Data not found!");
		$post = array();
		$match = array_combine($match[1], $match[2]);
		foreach ($match as $k => $v) $post[$k] = ($v == "") ? 1 : $v;
		return $post;
	}

}

/***********************************************************************************************\
  WRITTEN BY VinhNhaTrang 15-11-2010
  Fix the premium code by code by vdhdevil
  Fix the free download code by vdhdevil & Ruud v.Tony 25-3-2011
  Updated the premium code by Ruud v.Tony 19-5-2011
  Updated for site layout change by Ruud v.Tony 24-7-2011
  Updated for joining between premium user & pass with only single key by Ruud v.Tony 13-10-2011
  Small fix in post form by Ruud v.Tony 16-12-2011 (sorry for the delay, I'm busy with my real life)
  Fix free code by Ruud v.Tony & Th3-822 for letitbit new layout 31-12-2011 (Happy new year everyone)
  Fix new login policy & free download code from letitbit by Ruud v.Tony & Th3-822 18-02-2012
  Fixed free download code by Ruud v.Tony 16-04-2012
  Fixed for redirects in download links by Th3-822 16-10-2012
  reCaptcha support added at freedl by Th3-822 24-11-2012
  Fixed free dl for extra form on some locations. - Th3-822
  FreeDl & PremiumKeyDl fixed. - Th3-822 | [19-4-2013]
\***********************************************************************************************/

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class littlebyte_net extends DownloadClass {
	private $page, $cookie = array('lng' => 'EN'), $link, $baseUrl, $fid, $fuid;
	public function Download($link) {
		if (!preg_match('@(http://littlebyte\.net/)download/(\d+)\.(\w+)/[^/\r\n\"\'<>]+\.html@i', $link, $fid)) html_error('Invalid Link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseUrl = $fid[1];
		$this->fid = $fid[2];
		$this->fuid = $fid[3];

		$this->page = $this->GetPage($this->link, $this->cookie);
		is_present($this->page, 'There are no files to be shown', 'File Not Found or Deleted.');
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		// Only FreeDL at the Moment.
		return $this->FreeDL();
	}

	private function FreeDL() {
		$post = array(
			'action' => 'getSlowDownload',
			'params%5Bfile_id%5D' => $this->fid,
			'params%5Bfile_uid%5D' => $this->fuid,
		);
		$page = $this->GetPage($this->baseUrl . 'ajax.php', $this->cookie, $post);
		if (preg_match('@Next free download will be available for you after \d+ minutes@', $page, $err)) html_error("FreeDL Error: {$err[0]}");

		$post = array('action' => 'checkCaptcha');
		if (!preg_match('@\s*(captchaId)\s*:\s*(\d+)\s*,\s*(captchaHash)\s*:\s*\'(\w+)\'@', $page, $captchaData)) html_error('CAPTCHA Data Not Found.');
		$post[$captchaData[1]] = $captchaData[2];
		$post[$captchaData[3]] = $captchaData[4];
		if (preg_match('@\.html(\'<h1>(\d{4})</h1>\');@i', $page, $captcha)) {
			$captcha = $captcha[1];
		} else if (preg_match('@://((?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)/(?:(?:frame)?video|embed)/([\w\.\-]+)@i', $page, $captcha)) {
			$video = $this->GetPage("http://{$captcha[1]}/video/{$captcha[2]}");
			if (preg_match("@\nLocation: https?://((?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)/video/({$captcha[2]})@i", $video, $captcha)) {
				$video = $this->GetPage("http://{$captcha[1]}/video/{$captcha[2]}");
			}
			if (!preg_match('@[\s\,]title\s*:\s*"([^"]+)"\s*,@i', $video, $captcha) || !preg_match('@\b(\d{4})\b@', preg_replace('@\D@', ' ', $captcha[1]), $captcha)) html_error('Video "CAPTCHA" Response Not Found.');
			$captcha = $captcha[1];
		} else html_error('Video "CAPTCHA" Not Found.');
		$post['captcha'] = $captcha;

		//if (!preg_match('@[\s,]freeRemind\s*=\s*(\d+)\s*;@i', $page, $cD)) html_error('Countdown Not Found.');
		//if ($cD[1] > 0) $this->Countdown($cD[1] + 2);

		$page = $this->GetPage($this->baseUrl . 'ajax.php', $this->cookie, $post);
		$reply = $this->json2array($page, 'Error At FreeDL Post');
		if (empty($reply['status'])) html_error('Unexpected Response At FreeDL.');

		if ($reply['status'] != 'OK') {
			if ($reply['status'] == 'ERROR') {
				if (array_key_exists('content', $reply)) {
					if (is_null($reply['content'])) html_error('Invalid "CAPTCHA" Response"');
					else textarea($reply['content']);
				}
				html_error('Unknown FreeDL Error.');
			} else if ($reply['status'] == 'RELOAD') html_error('FreeDL Limit Reached.');
			else html_error('Unknown FreeDL Error: ' . htmlspecialchars($reply['status']));
		} else if (empty($reply['content']) || !preg_match('@https?://cdn\d+.littlebyte\.net/files/[^\r\n\t\"\'<>]+@i', $reply['content'], $DL)) html_error('Download Link Not Found.');

		return $this->RedirectDownload($DL[0]);
	}
}

// [31-12-2016] Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class longfiles_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class maknyos_indowebster_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class mediafire_com extends DownloadClass {
	private $page = '', $cookie = array(), $fid, $link;
	public function Download($link) {
		if (!empty($_POST['mfpassword'])) {
			$this->cookie = StrToCookies(urldecode($_POST['cookie']));
			$this->page = $this->GetPage($link, $this->cookie, array('downloadp' => urlencode($_POST['mfpassword'])), $link);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		if (!preg_match('@https?://(?:[\w\-]+\.)*mediafire\.com/(?:(download|file)/|(download\.php|file/|view/)?\??)([\w\-\.]+)(?(1)(/[^/\s]+))?@i', $link, $this->fid)) html_error('Invalid Link?');

		$this->link = $GLOBALS['Referer'] = 'http://www.mediafire.com/file/' . $this->fid[3] . (!empty($this->fid[4]) ? $this->fid[4] : '');

		if (empty($_POST['step']) || $_POST['step'] != '1') {
			$this->page = $this->GetPage($this->link, $this->cookie, 0, 'http://www.mediafire.com/?' . $this->fid[3]);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			if (preg_match('@\nLocation: .*(/file/([^/\r\n]+)/?[^\r\n]*)@i', $this->page, $redir)) {
				$this->link = $GLOBALS['Referer'] = 'http://www.mediafire.com'.$redir[1];
				$this->page = $this->GetPage($this->link, $this->cookie);
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
			}
			if (preg_match('@/error\.php\?errno=\d+@i', $this->page, $redir)) {
				$this->page = $this->GetPage('http://www.mediafire.com'.$redir[0]);
				if (preg_match('@error_msg_title(?: notranslate)?">\s*([^\r\n<>]+)\s*<@i', $this->page, $err)) html_error($err[1]);
				html_error('Link is not available');
			}
		}

		$this->MF_Captcha();
		if (strpos($this->page, 'name="downloadp" id="downloadp"')) {
			$DefaultParam = $this->DefaultParamArr(preg_replace('@/file/([^/]+)/?.*@i', '/?$1', $link), $this->cookie);
			echo "<form action='".htmlspecialchars($GLOBALS['PHP_SELF'], ENT_QUOTES)."' method='POST'>\n";
			foreach ($DefaultParam as $key => $value) echo "<input type='hidden' name='$key' value='" . htmlspecialchars($value, ENT_QUOTES) . "' />\n";
			echo "Enter your password here:<br />\n<input type='text' name='mfpassword' value='' placeholder='Enter file password here' autofocus='autofocus' required='required' />\n<input type='submit' />\n</form>";
			return html_error('File requires password');
		}
		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/[\w\-\.]{5,}/' . preg_quote($this->fid[3]) . '/[^\?\'\"\t<>\r\n\\\]+@i', $this->page, $dl)) return html_error("Error: Download link [FREE] not found!");
		$this->RedirectDownload($dl[0], 'Mediafire.com');
	}

	private function MF_Captcha() {
		if (!empty($this->page) && stripos($this->page, ">Authorize Download</a>") === false) return;
		if (!empty($_POST['step']) && $_POST['step'] == '1') {
			$_POST['step'] = false;
			if (empty($_POST['recaptcha2_response_field']) && empty($_POST['recaptcha_response_field']) && empty($_POST['adcopy_response']) && empty($_POST['mf_captcha_response'])) html_error('You didn\'t enter the image verification code.');
			if (empty($_POST['mf_captcha_response'])) {
				if (empty($_POST['adcopy_response'])) {
					if (empty($_POST['recaptcha2_public_key'])) $post = array('recaptcha_challenge_field' => urlencode($_POST['recaptcha_challenge_field']), 'recaptcha_response_field' => urlencode($_POST['recaptcha_response_field']));
					else $post = $this->verifyReCaptchav2();
				} else $post = $this->verifySolveMedia();
				$this->cookie = StrToCookies(urldecode($_POST['cookie']));
			} else {
				$post = array('mf_captcha_response' => $_POST['mf_captcha_response']);
			}

			$purl = 'http://www.mediafire.com/?' . $this->fid[3];

			$this->page = $this->GetPage($purl, $this->cookie, $post);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			is_present($this->page, 'Your entry was incorrect, please try again!');

			$this->page = $this->GetPage($this->link, $this->cookie, 0, $purl);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			is_present($this->page, 'Your entry was incorrect, please try again!.');

			$this->MF_Captcha();
		} else {
			$data = $this->DefaultParamArr($this->link, $this->cookie);
			$data['step'] = 1;

			if (($pos = stripos($this->page, 'data-sitekey=')) !== false && preg_match('@data-sitekey=\s*[\"\']([\w\.\-]+)[\"\']@i', $this->page, $cKey, 0, $pos)) {
				// reCAPTCHA v2
				return $this->reCAPTCHAv2($cKey[1], $data);
			} else if (($pos = stripos($this->page, '://api.solvemedia.com/')) !== false && preg_match('@https?://api\.solvemedia\.com/papi/challenge\.(?:no)?script\?k=([\w\.\-]+)@i', $this->page, $cKey, 0, $pos)) {
				// SolveMedia
				return $this->SolveMedia($cKey[1], $data);
			} else if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $this->page, $cKey)) {
				// Old reCAPTCHA
				return $this->reCAPTCHA($cKey[1], $data);
			} else if (($pseudoCaptcha = cut_str($this->page, 'name="mf_captcha_response" value="', '"'))) {
				// Best... CAPTCHA... Ever... :D
				if (!empty($_POST['mf_captcha_response'])) html_error('Captcha Loop?');
				$_POST['step'] = '1';
				$_POST['mf_captcha_response'] = html_entity_decode($pseudoCaptcha);
				return $this->MF_Captcha();
			}

			html_error('Error: CAPTCHA not found.');
		}
	}

	// Special Function Called by verifyReCaptchav2 When Captcha Is Incorrect, To Allow Retry. - Required
	protected function retryReCaptchav2() {
		$data = $this->DefaultParamArr($this->link, $this->cookie);
		$data['step'] = '1';

		return $this->reCAPTCHAv2($_POST['recaptcha2_public_key'], $data);
	}
}

/*
 * credit to farizemo [at] rapidleech forum
 * by vdhdevil
 * remove additional function for temporary fix until get finished - Ruud v.Tony 06-01-2011
 * fix for shared premium link by Ruud v.Tony 23-01-2012
 * regex fix for download link not found by Th3-822 24-02-2012
 * added support for captcha by Th3-822 14-04-2012
 * freedl regexp fixed again by Th3-822 10-05-2012
 * incomplete fix for getting dllink by Th3-822 14-05-2012
 * added solvemedia captcha support && fixed dead link msgs by Th3-822 06-10-2012
 * quick fix for new format/redirect for share links && fixed capcha submit url by Th3-822 24-05-2013
 * fixed password post url by Th3-822 27-07-2013
 * fixed redirects by Th3-822 24-09-2013
 * fixed captcha forms by Th3-822 11-04-2014
 * added recaptcha v2 captcha support && fixed dead link msgs by Th3-822 07-04-2015
 * added checkbox "captcha" support (non tested) by Th3-822 18-06-2015
 * fixed link regexp, redirect by Th3-822 18-10-2016
 * fixed download regexp by Th3-822 09-05-2018
 */
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class mediafree_co extends GenericXFS_DL {
	public $pluginVer = 5;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)

		$this->Start($link);
	}

	// Edit for add a closed form tag where it's needed.
	protected function FindPost($formOp = 0) {
		// I don't know why it's that comment just when there should be that </form>
		$this->page = str_replace('<!-- Family-safe ads -->', '</form>', $this->page);

		if (empty($formOp)) return parent::FindPost();
		else return parent::FindPost($formOp);
	}
}
// Written by Th3-822.
?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}
// Using functions from: http://julien-marchand.fr/blog/using-the-mega-api-with-php-examples/
class mega_co_nz extends DownloadClass {
	private $useOpenSSL, $useOldFilter, $seqno, $cookie;
	public function Download($link) {
		$this->checkCryptDependences();
		$this->checkBug78902($link);

		$this->seqno = mt_rand();
		$this->changeMesg(lang(300).'<br />Mega.co.nz plugin by Th3-822'); // Please, do not remove or change this line contents. - Th3-822

		$fragment = parse_url($link, PHP_URL_FRAGMENT);
		if (preg_match('@^F!([^!]{8})!([\w\-\,]{22})(?:!([^!#]{8}))?(!less$)?@i', $fragment, $fid)) return $this->Folder($fid[1], $fid[2], (!empty($fid[3]) && $fid[3] != $fid[1] ? $fid[3] : 0), (empty($fid[4]) ? 1 : 0));
		if (!preg_match('@^(T8|N)?!([^!]{8})!([\w\-\,]{43})(?:(?:!|=###n=)([^!#]{8})(?:!|$))?@i', $fragment, $fid)) html_error('FileID or Key not found at link.');

		$pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (!empty($_REQUEST['premium_acc']) && $_REQUEST['premium_acc'] == 'on' && ($pA || (!empty($GLOBALS['premium_acc']['mega_co_nz']['user']) && !empty($GLOBALS['premium_acc']['mega_co_nz']['pass'])))) {
			$user = ($pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['mega_co_nz']['user']);
			$pass = ($pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['mega_co_nz']['pass']);
			if ($pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
		}

		do {
			$reply = $this->apiReq(array('a' => 'g', 'g' => 1, (empty($fid[1]) ? 'p' : 'n') => $fid[2], 'ssl' => 0), (!empty($fid[1]) && !empty($fid[4]) ? $fid[4] : ''));
			if (is_numeric($reply[0])) $this->CheckErr($reply[0]);
			if (!empty($reply[0]['e']) && is_numeric($reply[0]['e'])) $this->CheckErr($reply[0]['e']);
			$tLimit = $this->checkTrafficLimit($reply[0]['g']);
		} while (!empty($user) && !empty($pass) && empty($this->cookie['sid']) && $tLimit && $this->cJar_load($user, $pass));

		if ($tLimit) {
			if (empty($this->cookie['sid'])) html_error('Anonymous Traffic Limit Reached, add an account then try again.');
			else html_error('Traffic Limit Reached.');
		}

		$key = $this->base64_to_a32($fid[3]);
		$key = array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]);
		$attr = $this->dec_attr($this->base64url_decode($reply[0]['at']), $key);
		if (empty($attr)) html_error((!empty($fid[1]) ? 'Folder Error: ' : '').'File\'s key isn\'t correct.');

		$this->RedirectDownload($reply[0]['g'], $attr['n'], 0, 0, $link, 0, 0, array('T8[fkey]' => $fid[3]));
	}

	private function checkBug78902($link = '') {
		// 7.4 - 7.4.2, 7.3.11 - 7.3.14, 7.2.24 - 7.2.*
		if (substr(PHP_OS, 0, 3) == 'WIN' || version_compare(PHP_VERSION, '7.2.24', '<') || version_compare(PHP_VERSION, '7.4.2', '>') || !version_compare(PHP_VERSION, '7.3.14', '<=')) return;

		if (empty($link)) echo('<div id="mesg" width="100%" align="center"></div><br />');
		$this->changeMesg('Warning: Running on PHP v' . PHP_VERSION . ' (Please Upgrade)<br />Downloads with this PHP release will be affected by the bug <a href="https://bugs.php.net/bug.php?id=78902">#78902</a> and will leak RAM until exhausted.<br />File may stop at a random size (up to ~1 GB).');

		if (!empty($_GET['method']) && $_GET['method'] == '78902') return;
		if (!empty($link)) {
			$form = $this->DefaultParamArr($link);
			$form['method'] = '78902';

			echo "\n<form name='f78902' action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
			foreach ($form as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
			echo "\t<div><br /><input type='submit' value='Continue' /></div></form>\n";
			include(TEMPLATE_DIR.'footer.php');
			exit();
		}
	}

	private function checkCryptDependences() {
		$this->useOpenSSL = (version_compare(PHP_VERSION, '5.4.0', '>=') && extension_loaded('openssl') && in_array('aes-128-cbc', ($ossl_ciphers = openssl_get_cipher_methods()), true));

		if (!$this->useOpenSSL || !in_array('aes-128-ctr', $ossl_ciphers, true))
		{
			$this->useOldFilter = true;
			if (!extension_loaded('mcrypt') || !in_array('rijndael-128', mcrypt_list_algorithms(), true)) html_error("OpenSSL / Mcrypt module isn't installed or it doesn't have support for the needed encryption.");
		} else $this->useOldFilter = false;
	}

	// It's seems to not work properly with a HEAD request neither with a GET with a small Range (TODO: Add here a small copy of geturl that stops after getting the headers or add a parameter to geturl that does that)
	private function checkTrafficLimit($link) {
		if (extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec')) {
			$page = cURL($link, 0, 0, 0, 0, array(CURLOPT_NOBODY => true));
		} else if (function_exists('readCustomHeaders')) {
			$page = $this->GetPage($link, 0, 0, "https://mega.nz/\r\n:HEAD " . parse_url($link, PHP_URL_PATH) . " HTTP/1.1");
		} else html_error('Your rapidleech is outdated and doesn\'t support a required check.');
		return (intval(substr($page, 9, 3)) == 509);
	}

	private function CheckErr($code, $prefix = 'Error') {
		$isLogin = (stripos($prefix, 'login') !== false);
		switch ($code) {
			default: $msg = '*No message for this error*';break;
			case -1: $msg = 'An internal error has occurred';break;
			case -2: $msg = 'You have passed invalid arguments to this command, your rapidleech is outdated?';break;
			case -3: $msg = 'A temporary congestion or server malfunction prevented your request from being processed';break;
			case -4: $msg = 'You have exceeded your command weight per time quota. Please wait a few seconds, then try again';break;
			case -9: $msg = ($isLogin ? 'Email/Password incorrect' : 'File/Folder not found');break;
			case -11: $msg = 'Access violation';break;
			case -13: $msg = ($isLogin ? 'Account not Activated yet' : 'Trying to access an incomplete file');break;
			case -14: $msg = 'A decryption operation failed';break;
			case -15: $msg = 'Invalid or expired user session, please relogin';break;
			case -16: $msg = ($isLogin ? 'Account blocked' : 'File/Folder not available, uploader\'s account is banned');break;
			case -17: $msg = 'Request over quota';break;
			case -18: $msg = ($isLogin ? 'Login service' : 'File/Folder') . ' temporarily not available, please try again later';break;
			// Confirmed at page:
			case -6: $msg = 'File not found, account was deleted';break;
		}
		html_error("$prefix: [$code] $msg.");
	}

	private function apiReq($atrr, $node = '') {
		$try = 0;
		do {
			if ($try > 0) sleep(2);
			$ret = $this->doApiReq($atrr, $node);
			$try++;
		} while ($try < 6 && $ret[0] == -3);
		return $ret;
	}

	private function doApiReq($atrr, $node='') {
		if (!function_exists('json_encode')) html_error('Error: Please enable JSON in php.');
		$page = $this->GetPage('https://g.api.mega.co.nz/cs?id=' . ($this->seqno++) . (!empty($node) ? "&n=$node" : '') . (!empty($this->cookie['sid']) ? "&sid={$this->cookie['sid']}" : ''), 0, json_encode((!empty($atrr[0]) && is_array($atrr[0])) ? $atrr : array($atrr)), "https://mega.nz/\r\nContent-Type: application/json");
		if (in_array(intval(substr($page, 9, 3)), array(500, 503))) return array(-3); //  500 Server Too Busy
		list ($header, $page) = array_map('trim', explode("\r\n\r\n", $page, 2));
		if (is_numeric($page)) return array(intval($page));
		return $this->json2array($page);
	}

	private function str_to_a32($b) {
		// Add padding, we need a string with a length multiple of 4
		$b = str_pad($b, 4 * ceil(strlen($b) / 4), "\0");
		return array_values(unpack('N*', $b));
	}

	private function a32_to_str($hex) {
		return call_user_func_array('pack', array_merge(array('N*'), $hex));
	}

	private function base64url_encode($data) {
		return strtr(rtrim(base64_encode($data), '='), '+/', '-_');
	}

	private function a32_to_base64($a) {
		return $this->base64url_encode($this->a32_to_str($a));
	}

	private function base64url_decode($data) {
		if (($s = (2 - strlen($data) * 3) % 4) < 2) $data .= substr(',,', $s);
		return base64_decode(strtr($data, '-_,', '+/='));
	}

	private function base64_to_a32($s) {
		return $this->str_to_a32($this->base64url_decode($s));
	}

	private function aes_cbc_encrypt($data, $key) {
		if ($this->useOpenSSL) {
			$data = str_pad($data, 16 * ceil(strlen($data) / 16), "\0"); // OpenSSL needs this padded.
			return openssl_encrypt($data, 'aes-128-cbc', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
		} else return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
	}

	private function aes_cbc_decrypt($data, $key) {
		if ($this->useOpenSSL) {
			$data = str_pad($data, 16 * ceil(strlen($data) / 16), "\0"); // OpenSSL needs this padded.
			return openssl_decrypt($data, 'aes-128-cbc', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
		} else return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
	}

	private function aes_cbc_encrypt_a32($data, $key) {
		return $this->str_to_a32($this->aes_cbc_encrypt($this->a32_to_str($data), $this->a32_to_str($key)));
	}

	private function aes_cbc_decrypt_a32($data, $key) {
		return $this->str_to_a32($this->aes_cbc_decrypt($this->a32_to_str($data), $this->a32_to_str($key)));
	}

	private function stringhash($s, $aeskey) {
		$s32 = $this->str_to_a32($s);
		$h32 = array(0, 0, 0, 0);
		for ($i = 0; $i < count($s32); $i++) $h32[$i % 4] ^= $s32[$i];
		for ($i = 0; $i < 0x4000; $i++) $h32 = $this->aes_cbc_encrypt_a32($h32, $aeskey);
		return $this->a32_to_base64(array($h32[0], $h32[2]));
	}

	private function prepare_key($a) {
		$pkey = array(0x93C467E3, 0x7DB0C7A4, 0xD1BE3F81, 0x0152CB56);
		$count_a = count($a);
		for ($r = 0; $r < 0x10000; $r++) {
			for ($j = 0; $j < $count_a; $j += 4) {
				$key = array(0, 0, 0, 0);
				for ($i = 0; $i < 4; $i++) if ($i + $j < $count_a) $key[$i] = $a[$i + $j];
				$pkey = $this->aes_cbc_encrypt_a32($pkey, $key);
			}
		}
		return $pkey;
	}

	private function decrypt_key($a, $key) {
		$x = array();
		for ($i = 0; $i < count($a); $i += 4) $x = array_merge($x, $this->aes_cbc_decrypt_a32(array_slice($a, $i, 4), $key));
		return $x;
	}

	private function mpi2bc($s) {
		$s = bin2hex(substr($s, 2));
		$len = strlen($s);
		$n = 0;
		for ($i = 0; $i < $len; $i++) $n = bcadd($n, bcmul(hexdec($s[$i]), bcpow(16, $len - $i - 1)));
		return $n;
	}

	private function bin2int($str) {
		$result = 0;
		$n = strlen($str);
		do {
			$result = bcadd(bcmul($result, 256), ord($str[--$n]));
		} while ($n > 0);
		return $result;
	}

	private function int2bin($num) {
		$result = '';
		do {
			$result .= chr(bcmod($num, 256));
			$num = bcdiv($num, 256);
		} while (bccomp($num, 0));
		return $result;
	}

	private function bitOr($num1, $num2, $start_pos) {
		$start_byte = intval($start_pos / 8);
		$start_bit = $start_pos % 8;
		$tmp1 = $this->int2bin($num1);
		$num2 = bcmul($num2, 1 << $start_bit);
		$tmp2 = $this->int2bin($num2);
		if ($start_byte < strlen($tmp1)) {
			$tmp2 |= substr($tmp1, $start_byte);
			$tmp1 = substr($tmp1, 0, $start_byte) . $tmp2;
		} else $tmp1 = str_pad($tmp1, $start_byte, "\0") . $tmp2;
		return $this->bin2int($tmp1);
	}

	private function bitLen($num) {
		$tmp = $this->int2bin($num);
		$bit_len = strlen($tmp) * 8;
		$tmp = ord($tmp[strlen($tmp) - 1]);
		if (!$tmp) $bit_len -= 8;
		else while (!($tmp & 0x80)) {
			$bit_len--;
			$tmp <<= 1;
		}
		return $bit_len;
	}

	private function rsa_decrypt($enc_data, $p, $q, $d) {
		$enc_data = $this->int2bin($enc_data);
		$exp = $d;
		$modulus = bcmul($p, $q);
		$data_len = strlen($enc_data);
		$chunk_len = $this->bitLen($modulus) - 1;
		$block_len = intval(ceil($chunk_len / 8));
		$curr_pos = 0;
		$bit_pos = 0;
		$plain_data = 0;
		while ($curr_pos < $data_len) {
			$tmp = $this->bin2int(substr($enc_data, $curr_pos, $block_len));
			$tmp = bcpowmod($tmp, $exp, $modulus);
			$plain_data = $this->bitOr($plain_data, $tmp, $bit_pos);
			$bit_pos += $chunk_len;
			$curr_pos += $block_len;
		}
		return $this->int2bin($plain_data);
	}

	private function dec_attr($attr, $key) {
		$attr = trim($this->aes_cbc_decrypt($attr, $this->a32_to_str($key)));
		if (substr($attr, 0, 6) != 'MEGA{"') return false;
		$attr = substr($attr, 4);$attr = substr($attr, 0, strrpos($attr, '}') + 1);
		return $this->json2array($attr);
	}

	public function CheckBack($header) {
		$this->checkBug78902();
		if (($statuscode = intval(substr($header, 9, 3))) != 200) {
			switch ($statuscode) {
				case 509: html_error('[Mega_co_nz] Transfer quota exceeded.');
				case 503: html_error('[Mega_co_nz] Too many connections for this download.');
				case 403: html_error('[Mega_co_nz] Link used/expired.');
				case 404: html_error('[Mega_co_nz] Link expired.');
				default : html_error('[Mega_co_nz][HTTP] '.trim(substr($header, 9, strpos($header, "\n") - 8)));
			}
		}

		global $fp, $sFilters;
		if (empty($fp) || !is_resource($fp)) html_error("Error: Your rapidleech version is outdated and it doesn't support this plugin.");
		$this->checkCryptDependences();
		if (!empty($_GET['T8']['fkey'])) $key = $this->base64_to_a32(urldecode($_GET['T8']['fkey']));
		elseif (preg_match('@^(T8|N)?!([^!]{8})!([\w\-\,]{43})@i', parse_url($_GET['referer'], PHP_URL_FRAGMENT), $dat)) $key = $this->base64_to_a32($dat[2]);
		else html_error("[CB] File's key not found.");
		$iv = array_merge(array_slice($key, 4, 2), array(0, 0));
		$key = array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]);
		$opts = array('iv' => $this->a32_to_str($iv), 'key' => $this->a32_to_str($key));

		if (!stream_filter_register('MegaDlDecrypt', ($this->useOldFilter ? 'Th3822_MegaDlDecrypt_Old' : 'Th3822_MegaDlDecrypt')) && !in_array('MegaDlDecrypt', stream_get_filters())) html_error('Error: Cannot register "MegaDlDecrypt" filter.');

		if (!isset($sFilters) || !is_array($sFilters)) $sFilters = array();
		if (empty($sFilters['MegaDlDecrypt'])) $sFilters['MegaDlDecrypt'] = stream_filter_append($fp, 'MegaDlDecrypt', STREAM_FILTER_READ, $opts);
		if (!$sFilters['MegaDlDecrypt']) html_error('Error: Unknown error while initializing MegaDlDecrypt filter, cannot continue download.');
	}

	private function FSort($a, $b) {
		return strcmp($a['n'], $b['n']);
	}

	private function Folder($fnid, $fnk, $sfolder, $recursive) {
		$files = $this->apiReq(array('a' => 'f', 'c' => 1, 'r' => (!empty($sfolder) || $recursive ? 1 : 0)), $fnid);
		if (is_numeric($files[0])) $this->CheckErr($files[0], 'Cannot get folder contents');
		$sfolder = (!empty($sfolder) ? array($sfolder => 1) : array());

		foreach ($files[0]['f'] as $file) {
			switch ($file['t']) {
				case 0: // File
					if (!empty($sfolder) && empty($sfolder[$file['p']])) break;
					$keys = array();
					foreach (explode('/', $file['k']) as $key) if (strpos($key, ':') !== false && $key = explode(':', $key, 2)) $keys[$key[0]] = $key[1];
					if (empty($keys)) {
						$key = $this->base64_to_a32($fnk);
						$attr = $this->dec_attr($this->base64url_decode($file['a']), array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]));
						if (!empty($attr)) textarea($attr);
						break;
					}
					$key = $this->decrypt_key($this->base64_to_a32(reset($keys)), $this->base64_to_a32($fnk));
					if (empty($key)) break;
					$attr = $this->dec_attr($this->base64url_decode($file['a']), array($key[0] ^ $key[4], $key[1] ^ $key[5], $key[2] ^ $key[6], $key[3] ^ $key[7]));
					if (!empty($attr)) $dfiles[$file['h']] = array('k' => $this->a32_to_base64($key), 'n' => $attr['n'], 'p' => $file['p']);
					break;
				case 1: // Folder
					if (!empty($sfolder) && $recursive && !empty($sfolder[$file['p']])) $sfolder[$file['h']] = 1;
					break;
			}
		}

		if (empty($dfiles)) html_error('Error while decoding folder: Empty'.(!empty($sfolder) ? ' or Inexistent Sub-' : ' ').'Folder? [Subfolders: '.(!empty($sfolder) || $recursive ? 'Yes' : 'No').']');
		uasort($dfiles, array($this, 'FSort'));

		$files = array();
		foreach ($dfiles as $file => $key) $files[] = "https://mega.nz/#N!$file!{$key['k']}!$fnid!Rapidleech";
		$this->moveToAutoDownloader($files);
	}

	private function cJar_encrypt($data, $key = 0) {
		if (empty($data)) return false;
		if (!empty($key)) {
			global $secretkey;
			$_secretkey = $secretkey;
			$secretkey = $key;
		}
		if (is_array($data)) {
			$data = array_combine(array_map('base64_encode', array_map('encrypt', array_keys($data))), array_map('base64_encode', array_map('encrypt', array_values($data))));
		} else {
			$data = base64_encode(encrypt($data));
		}
		if (!empty($key)) $secretkey = $_secretkey;
		return $data;
	}

	private function cJar_decrypt($data, $key = 0) {
		if (empty($data)) return false;
		if (!empty($key)) {
			global $secretkey;
			$_secretkey = $secretkey;
			$secretkey = $key;
		}
		if (is_array($data)) {
			$data = array_combine(array_map('decrypt', array_map('base64_decode', array_keys($data))), array_map('decrypt', array_map('base64_decode', array_values($data))));
		} else {
			$data = decrypt(base64_decode($data));
		}
		if (!empty($key)) $secretkey = $_secretkey;
		return $data;
	}

	private function cJar_load($user, $pass, $filename = 'mega_dl.php') {
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');

		$user = strtolower($user);
		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename) || !($savedcookies = file($filename)) || !is_array($savedcookies = unserialize($savedcookies[1]))) return $this->Login($user, $pass);

		$hash = sha1("$user$pass");
		if (array_key_exists($hash, $savedcookies)) {
			$key = substr(base64_encode(hash('sha512', "$user$pass", true)), 0, 56); // 56 chars cropped base64 encoded key to avoid blowfish issues with \0
			$testCookie = ($this->cJar_decrypt($savedcookies[$hash]['enc'], $key) == 'OK') ? $this->cJar_decrypt($savedcookies[$hash]['cookie'], $key) : 0;
			if (!empty($testCookie)) return $this->cJar_test($user, $pass, $testCookie, true);
		}
		return $this->Login($user, $pass);
	}

	private function cJar_test($user, $pass, $cookie, $preLogin = false) {
		$this->cookie = array('sid' => $cookie['sid']);
		$quota = $this->apiReq(array('a' => 'uq')); // I'm using the 'User quota details' request for validating the session id.
		if (is_numeric($quota[0]) && $quota[0] < 0) {
			if ($quota[0] == -15) { // Session code expired... We need to get a newer one.
				if (!extension_loaded('bcmath')) html_error('This plugin needs BCMath extension for re-login.');
				$this->cookie['sid'] = $cookie['sid'] = false; // Do not send old sid or it will get '-15' error.
				$res = $this->apiReq(array('a' => 'us', 'user' => $user, 'uh' => $cookie['user_handle']));
				if (is_numeric($res[0])) $this->CheckEr($res[0], 'Cannot re-login');
				$rsa_priv_key = explode('/T8\\', $cookie['rsa_priv_key']);
				$cookie['sid'] = $this->base64url_encode(substr(strrev($this->rsa_decrypt($this->mpi2bc($this->base64url_decode($res[0]['csid'])), $rsa_priv_key[0], $rsa_priv_key[1], $rsa_priv_key[2])), 0, 43));
			} else $this->CheckEr($quota[0], 'Cannot validate saved-login');
		}
		$this->cookie = $cookie;
		$this->cJar_save($user, $pass); // Update last used time.
		return true;
	}

	private function cJar_save($user, $pass, $filename = 'mega_dl.php') {
		$maxTime = 31 * 86400; // Max time to keep unused cookies saved (31 days)
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename) && ($savedcookies = file($filename)) && is_array($savedcookies = unserialize($savedcookies[1]))) {
			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= $maxTime) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = sha1("$user$pass");
		$key = substr(base64_encode(hash('sha512', "$user$pass", true)), 0, 56); // 56 chars cropped base64 encoded key to avoid blowfish issues with \0
		$savedcookies[$hash] = array('time' => time(), 'enc' => $this->cJar_encrypt('OK', $key), 'cookie' => $this->cJar_encrypt($this->cookie, $key));

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}

	private function Login($user, $pass) {
		if (!extension_loaded('bcmath')) html_error('This plugin needs BCMath extension for login.');
		$this->cookie = array();
		$password_aes = $this->prepare_key($this->str_to_a32($pass));
		$this->cookie['user_handle'] = $this->stringhash($user, $password_aes);
		$res = $this->apiReq(array('a' => 'us', 'user' => $user, 'uh' => $this->cookie['user_handle']));
		if (is_numeric($res[0])) $this->CheckEr($res[0], 'Cannot login');
		$master_key = $this->decrypt_key($this->base64_to_a32($res[0]['k']), $password_aes);
		$privk = $this->a32_to_str($this->decrypt_key($this->base64_to_a32($res[0]['privk']), $master_key));
		$rsa_priv_key = array(0, 0, 0, 0);
		for ($i = 0; $i < 4; $i++) {
			$l = ((ord($privk[0]) * 256 + ord($privk[1]) + 7) / 8) + 2;
			$rsa_priv_key[$i] = $this->mpi2bc(substr($privk, 0, $l));
			$privk = substr($privk, $l);
		}
		unset($privk, $rsa_priv_key[3]);
		$this->cookie['sid'] = $this->base64url_encode(substr(strrev($this->rsa_decrypt($this->mpi2bc($this->base64url_decode($res[0]['csid'])), $rsa_priv_key[0], $rsa_priv_key[1], $rsa_priv_key[2])), 0, 43));
		$this->cookie['rsa_priv_key'] = implode('/T8\\', $rsa_priv_key);
		$this->cJar_save($user, $pass); // Update cookies file.
		return true;
	}
}

class Th3822_MegaDlDecrypt extends php_user_filter {
	private $key, $iv, $start, $lastBlock, $waste;
	public function onCreate() {
		if (empty($this->params['iv']) || empty($this->params['key'])) return false;
		$this->key = $this->params['key'];
		$this->iv = $this->params['iv'];
		$this->waste = $this->lastBlock = $this->start = 0;
		if (!empty($this->params['startFrom']) && is_numeric($this->params['startFrom']) && $this->params['startFrom'] > 0) {
			$this->setNextStart($this->params['startFrom']);
		}
		return true;
	}

	public function filter($in, $out, &$consumed, $stop) {
		while ($bucket = stream_bucket_make_writeable($in)) {
			if ($bucket->datalen > 0) {
				if ($this->waste > 0) $bucket->data = str_repeat('*', $this->waste) . $bucket->data;
				$bucket->data = openssl_decrypt($bucket->data, 'aes-128-ctr', $this->key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $this->iv);
				if ($this->waste > 0) $bucket->data = substr($bucket->data, $this->waste);
				$consumed += $bucket->datalen;
				$this->setNextStart($bucket->datalen);
				stream_bucket_append($out, $bucket);
			}
		}
		return PSFS_PASS_ON;
	}

	private function setNextStart($nextStart) {
		$start = $this->start + $nextStart;
		$block = floor($start / 16);
		if (($incBlocks = $block - $this->lastBlock) > 0) $this->increaseIV($incBlocks);
		$this->start = $start;
		$this->lastBlock = $block;
		$this->waste = $start % 16;
	}

	private function increaseIV($inc) {
		$i = 16;
		while ($inc > 0 && --$i >= 0) {
			$sum = ord($this->iv[$i]) + $inc;
			$this->iv[$i] = chr($sum & 0xFF);
			$inc = $sum >> 8;
		}
	}
}

class Th3822_MegaDlDecrypt_Old extends php_user_filter {
	private $td;
	public function onCreate() {
		if (empty($this->params['iv']) || empty($this->params['key'])) return false;
		$this->td = mcrypt_module_open('rijndael-128', '', 'ctr', '');
		$iv = $this->params['iv'];
		if (!empty($this->params['startFrom']) && is_numeric($this->params['startFrom']) && $this->params['startFrom'] > 0) {
			$blocks = floor($this->params['startFrom'] / 16);
			$waste = $this->params['startFrom'] % 16;
			if ($blocks > 0) $this->increaseIV($iv, $blocks);
		} else $waste = 0;
		$init = mcrypt_generic_init($this->td, $this->params['key'], $iv);
		if ($init === false || $init < 0) return false;
		if ($waste > 0) mdecrypt_generic($this->td, str_repeat('*', $waste));
		return true;
	}

	public function filter($in, $out, &$consumed, $stop) {
		while ($bucket = stream_bucket_make_writeable($in)) {
			if ($bucket->datalen > 0) {
				$bucket->data = mdecrypt_generic($this->td, $bucket->data);
				$consumed += $bucket->datalen;
				stream_bucket_append($out, $bucket);
			}
		}
		return PSFS_PASS_ON;
	}

	public function onClose() {
		mcrypt_generic_deinit($this->td);
		mcrypt_module_close($this->td);
	}

	private function increaseIV(&$iv, $inc = 1) {
		$i = 16;
		while ($inc > 0 && --$i >= 0) {
			$sum = ord($iv[$i]) + $inc;
			$iv[$i] = chr($sum & 0xFF);
			$inc = $sum >> 8;
		}
	}
}

//[24-2-2013] Written by Th3-822. (Rapidleech r415 or newer required)
//[02-3-2013] Added "checks" for validating rapidleech version & added 2 error msg. - Th3-822
//[27-3-2013] Simplified Stream decrypt function (The other one was not working well... After many tests looks like it's better now :D). - Th3-822
//[20-7-2013] Fixed link regexp. - Th3-822
//[09-8-2013] Added folder support and small fixes from upload plugin. (Download links that are fetched from a folder link are not public and only can be downloaded with this plugin.) - Th3-822
//[30-1-2014] Fixed download from folders. - Th3-822
//[09-2-2014] Fixed issues at link parsing. - Th3-822
//[29-1-2015] Replaced 'T8' prefix at folder->file links for support on third-party downloaders using links with 'N' as prefix. - Th3-822
//[04-2-2016] Added sub-folders support (fully) and added support for link suffix "!less" to disable recursive sub-folder download. - Th3-822
//[27-12-2016] Added Login support for increase traffic limits & forced SSL on downloads to avoid corrupted downloads. - Th3-822
//[12-11-2017] Removed SSL from downloads to increase download speed & updated Th3822_MegaDlDecrypt class. - Th3-822
//[18-10-2019] Added new Th3822_MegaDlDecrypt class using OpenSSL & Removed mcrypt dependence to run, now it can be used with only the OpenSSL module (Btw, it's Faster). - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit;
}

class megashares_com extends DownloadClass {

    public function Download($link) {
        global $premium_acc;
        if (( $_REQUEST ["premium_acc"] == "on" && $_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"] ) ||( $_REQUEST ["premium_acc"] == "on" && $premium_acc ["megashares_com"] ["user"] && $premium_acc ["megashares_com"] ["pass"] )) {
            $this->DownloadPremium($link);
        } else if ($_POST['step'] == "1") {
            $this->DownloadFree($link);
        } else {
            $this->Retrieve($link);
        }
    }

    private function Retrieve($link) {
        global $options;
        $page = $this->GetPage($link);
        is_present($page, "Link was removed due to violation of our TOS", "Link is not invalid");
        $Cookies = GetCookies($page);
        $random_num = cut_str($page, 'id="random_num" value="', '"');
        $passport_num=cut_str($page, 'id="passport_num" value="', '"');
        preg_match('#http://[a-z]{7}\d+.megashares.com/[^"]+#', $page, $dlink);
        $img = "http://d01.megashares.com/index.php?secgfx=gfx&random_num={$random_num}";
        $page = $this->GetPage($img, $Cookies, 0, $link);
        $headerend = strpos($page, "\r\n\r\n");
        $pass_img = (substr($page, $headerend + 4));
        if (preg_match("#\w{4}\r\n#", $pass_img)) {
            $t = strpos($pass_img, "P");
            $pass_img = ltrim(substr($pass_img, $t - 2), "\r\n");
        }
        write_file($options['download_dir'] . "megashares_captcha.png", $pass_img);
        $data=array();
        $data['step']="1";
        $data['Cookies']=$Cookies;
        $data['link']=$link;
        $data['random_num']=$random_num;
        $data['passport_num']=$passport_num;
        $data['dlink']=$dlink[0];
        $this->EnterCaptcha($options['download_dir'] . "megashares_captcha.png", $data, "7");
        exit;
    }
    private function DownloadFree($link){
        $glink="{$link}&rs=check_passport_renewal&rsargs[]={$_POST['captcha']}&rsargs[]={$_POST['random_num']}&rsargs[]={$_POST['passport_num']}&rsargs[]=replace_sec_pprenewal&rsrnd=".  round(microtime(true))*1000;
        $Cookies=$_POST['Cookies'];
        $page=$this->GetPage($glink, $Cookies, 0, $link);
        $this->RedirectDownload($_POST['dlink'], "Megashares", $Cookies, 0, $link);
        exit;
        
    }
    private function DownloadPremium($link) {
        global $premium_acc;
        $post = array();
        $post['httpref'] = "";
        $post['mymslogin_name'] = $_REQUEST ["premium_user"] ? $_REQUEST ["premium_user"] : $premium_acc ["megashares_com"] ["user"];
        $post['mymspassword'] = $_REQUEST ["premium_pass"] ? $_REQUEST ["premium_pass"] : $premium_acc ["megashares_com"] ["pass"];
        $post['myms_login'] = "Login";
        $page = $this->GetPage("http://d01.megashares.com/myms_login.php", 0, $post);
        $Cookies = GetCookies($page);
        is_notpresent($Cookies, "myms", "Login Failed");
        $page = $this->GetPage($link, $Cookies, 0, $link);
        if (preg_match("#Location: (.+)#", $page, $match)) {
            $page = $this->GetPage(trim($match[1]), $Cookies, 0, $link);
            $link = $match[1];
        }
        is_present($page, "Link was removed due to violation of our TOS", "Link is not invalid");
        $Cookies.="; " . GetCookies($page);
        if (!preg_match('#http://webprod\d+.\w+.\w+[^"]+#', $page, $dlink)) {
            html_error("Error: Plugin is out of date or Account is expired");
        }
        $this->RedirectDownload($dlink[0], "megashares", $Cookies, 0, $link);
        exit();
    }

}

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class mexa_sh extends GenericXFS_DL {
	public $pluginVer = 13;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class mightyupload_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.
		$this->customDecoder = true; // Enable pageDecoder()

		$this->Start($link);
	}

	// Remove player links
	protected function pageDecoder() {
		if (strpos($this->page, "jwplayer('container').setup({") !== false) {
			// Removing the http will avoid to be catched by the download regexp and download with a wrong name.
			$this->page = str_replace("file: 'http", "file: 'xxxx", $this->page, $count);
			return ($count > 0 ? true : false);
		}
		return false;
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class minhateca_com_br extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.minhateca\.com\.br/File\.aspx\?[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://minhateca\.com\.br)/(?:[^/]+/)+[^\r\n\t/<>\"]+,(\d+)[^\r\n\t/<>\"]*@i', str_ireplace('://www.minhateca.com.br', '://minhateca.com.br', $link), $fid)) html_error('Invalid link?.');
		$this->link = str_ireplace('https://', 'http://', $fid[0]);
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['minhateca_com_br']['user']) && !empty($GLOBALS['premium_acc']['minhateca_com_br']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['minhateca_com_br']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['minhateca_com_br']['pass']);
			return $this->Login($user, $pass);
		} else return $this->TryDL();
	}

	private function TryDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!preg_match($this->DLRegexp, $this->page, $DL)) {
			if (substr($this->page, 9, 3) != '200') html_error('File Not Found or Private.');
			$download = $this->reqAction('License/Download', array('fileId' => $this->fid, '__RequestVerificationToken' => $this->getCSRFToken($this->page)));
			if (empty($download['redirectUrl']) || !preg_match($this->DLRegexp, $download['redirectUrl'], $DL)) {
				if (empty($this->cookie['RememberMe']) && $download['Type'] == 'Window') html_error('Login is Required to Download This File.');
				html_error('Download-Link Not Found.');
			}
		}
		return $this->RedirectDownload($DL[0], 'minhateca_placeholder_fname');
	}

	private function getCSRFToken($page, $errorPrefix = 'Error') {
		if (!preg_match('@name="__RequestVerificationToken"\s+type="hidden"\s+value="([\w\-+/=]+)"@i', $page, $token)) return html_error("[$errorPrefix]: Request Token Not Found.");
		return $token[1];
	}

	private function Login($user, $pass) {
		$page = $this->GetPage($this->baseurl . '/', $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$login = $this->reqAction('login/login', array('Login' => $user, 'Password' => $pass, 'FileId' => 0, '__RequestVerificationToken' => $this->getCSRFToken($page, 'Login Error')));
		if (empty($login['IsSuccess'])) html_error('Login Error: IsSuccess is false.');
		is_present($login['Content'], 'Connta com este nome n&#227;o existe.', 'Login Error: Wrong Username/Email.');
		is_present($login['Content'], 'A senha indicada n&#227;o &#233; a senha correcta do propriet&#225;rio desta conta.', 'Login Error: Wrong Password.');
		if (empty($this->cookie['RememberMe'])) html_error('Login Error: "RememberMe" cookie not found.');

		return $this->TryDL();
	}

	private function reqAction($path, $post = array()) {
		$page = $this->GetPage("{$this->baseurl}/action/$path", $this->cookie, array_map('urlencode', $post), "{$this->baseurl}/\r\nX-Requested-With: XMLHttpRequest");
		$reply = $this->json2array($page, "reqAction($path) Error");
		if (empty($reply)) html_error("[reqAction($path) Error] Empty Response.");
		$this->cookie = GetCookiesArr($page, $this->cookie);

		return $reply;
	}
}

// [20-3-2016] Written by Th3-822.
// [22-4-2016] Renamed to minhateca_com_br. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class moyapidbirka_com_ua extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.moyapidbirka\.com\.ua/download\?[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://moyapidbirka\.com\.ua)/(?:[^/]+/)+[^\r\n\t/<>\"]+?,(\d+)[^\r\n\t/<>\"]*@i', preg_replace('@^(http)s?(://)(?:www\.)?mo[yi](apidbirka\.com)(?:\.ua)?(?=/)@i', '$1$2moy$3.ua', $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['moyapidbirka_com_ua']['user']) && !empty($GLOBALS['premium_acc']['moyapidbirka_com_ua']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['moyapidbirka_com_ua']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['moyapidbirka_com_ua']['pass']);
			return $this->Login($user, $pass);
		} else return $this->TryDL();
	}

	private function TryDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!preg_match($this->DLRegexp, $this->page, $DL)) {
			if (substr($this->page, 9, 3) != '200') html_error('File Not Found or Private.');
			$download = $this->reqAction('DownloadFile', array('fileId' => $this->fid, '__RequestVerificationToken' => $this->getCSRFToken($this->page)));
			if (empty($download['DownloadUrl']) || !preg_match($this->DLRegexp, $download['DownloadUrl'], $DL)) {
				if (empty($this->cookie['.ASPXAUTH_v2']) && $download['Type'] == 'Window') html_error('Login is Required to Download This File.');
				html_error('Download-Link Not Found.');
			}
		}
		return $this->RedirectDownload($DL[0], 'moyapidbirka_placeholder_fname');
	}

	private function getCSRFToken($page, $errorPrefix = 'Error') {
		if (!preg_match('@name="__RequestVerificationToken"\s+type="hidden"\s+value="([\w\-+/=]+)"@i', $page, $token)) return html_error("[$errorPrefix]: Request Token Not Found.");
		return $token[1];
	}

	private function Login($user, $pass) {
		$page = $this->GetPage($this->baseurl . '/', $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$login = $this->reqAction('Account/Login', array('UserName' => $user, 'Password' => $pass, '__RequestVerificationToken' => $this->getCSRFToken($page, 'Login Error')));
		if (!empty($login['Content'])) is_present($login['Content'], 'ÐÐ¾Ð³ÑÐ½ Ð°Ð±Ð¾ Ð¿Ð°ÑÐ¾Ð»Ñ Ð½ÐµÐ¿ÑÐ°Ð²Ð¸Ð»ÑÐ½Ð¸Ð¹.', 'Login Error: Wrong Login/Password.');
		if (empty($this->cookie['.ASPXAUTH_v2'])) html_error('Login Error: Cookie ".ASPXAUTH_v2" not Found.');

		return $this->TryDL();
	}

	private function reqAction($path, $post = array()) {
		$page = $this->GetPage("{$this->baseurl}/action/$path", $this->cookie, array_map('urlencode', $post), "{$this->baseurl}/\r\nX-Requested-With: XMLHttpRequest");
		$reply = $this->json2array($page, "reqAction($path) Error");
		if (empty($reply)) html_error("[reqAction($path) Error] Empty Response.");
		$this->cookie = GetCookiesArr($page, $this->cookie);

		return $reply;
	}
}

// [20-3-2016] Written by Th3-822.
// [22-4-2016] Renamed to moyapidbirka_com_ua and fixed. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class my_pcloud_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://my\.pcloud\.com/publink/show\?code=\w+@i', $link, $_link)) html_error('Invalid link?.');
		$link = $GLOBALS['Referer'] = $_link[0];

		if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');

		$page = $this->GetPage($link);
		if (!preg_match('@var\s+publinkData\s*=\s*(\{.+?\})\s*;@s', $page, $data)) html_error('Filedata Not Found.');
		$data = json_decode($data[1], true);
		if ($data === NULL) html_error('Error while parsing Filedata JSON.');

		if (!empty($data['result'])) {
			$data['result'] = htmlspecialchars($data['result'], ENT_QUOTES);
			if (!empty($data['error'])) {
				$data['error'] = htmlspecialchars($data['error'], ENT_QUOTES);
				html_error("[Error {$data['result']}] File Error: {$data['error']}");
			}
			html_error('Unknown File Error: ' . $data['result']);
		}

		if (empty($data['downloadlink'])) html_error('Download-Link Not Found.');
		return $this->RedirectDownload($data['downloadlink'], 'my_pcloud_com_placeholder');
	}
}

// [08-7-2016] Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class namasha_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://www\.namasha\.com/v/(\w+)@i', str_ireplace('//namasha.com', '//www.namasha.com', $link), $vid)) html_error('Invalid Link.');
		$link = $GLOBALS['Referer'] = $vid[0];

		$page = $this->GetPage($link);
		if (substr($page, 9, 3) == '404') html_error('404 Video Not Found');

		if (!preg_match('@<h1\s+style="font-size: 24px">\s*([^"<>]+?)\s*</h1>@i', $page, $title)) html_error('Error: Video title not found.');
		if (!preg_match('@https?://s\d+\.namasha\.com/videos/\d+\.mp4@i', $page, $DL)) html_error('Error: Download link not found.');
		$DL = urldecode($DL[0]);

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($DL), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [namasha][%s]%s', $vid[1], $ext[0]);

		$this->RedirectDownload($DL, $filename, 0, 0, 0, $filename);
	}
}

//[10-7-2016]  Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit;
}

class netload_in extends DownloadClass {

    public function Download($link) {
        global $premium_acc, $Referer;

        $this->link = $link;
        //check the link
        if (!$_REQUEST['step']) {
            $this->page = $this->GetPage($this->link);
            if (preg_match('/Location: (\/[^|\r|\n]+)/i', $this->page, $temp)) {
                $this->link = 'http://netload.in' . $temp[1];
                $this->page = $this->GetPage($this->link);
            }
            is_present($this->page, 'Code: ER_NFF', 'Error[File not found]!');
        }
        if ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST['premium_pass']) || ($premium_acc['netload_in']['user'] && $premium_acc['netload_in']['pass']))) {
            return $this->Login();
        } elseif ($_REQUEST['step'] == 'password') {
            $post['file_id'] = $_POST['file_id'];
            $post['password'] = $_POST['password'];
            $post['submit'] = $_POST['submit'];
            $this->link = urldecode($_POST['link']);
            if (!empty($_POST['cookie'])) {
                $this->cookie = decrypt(urldecode($_POST['cookie']));
                $this->page = $this->GetPage($this->link, $this->cookie, $post, $Referer);
                return $this->Premium();
            } else {
                $this->page = $this->GetPage($this->link, 0, $post, $Referer);
                return $this->Retrieve();
            }
        } elseif ($_REQUEST['step'] == 'captcha') {
            return $this->Free();
        } else {
            return $this->Retrieve();
        }
    }

    private function Retrieve() {
        global $Referer;

        if (stristr($this->page, 'This file is password-protected!')) {
            $form = cut_str($this->page, '<form name="form" method="post"', '</form>');
            if (!preg_match('%action="([^"]+)"%', $form, $pw)) html_error("Error[getFreePassLink]");
            $this->link = 'http://netload.in/' . $pw[1];
            if (!preg_match_all('%<input type="(hidden|submit)" value="([^"]+)?" name="([^"]+)" \/>%', $form, $match)) html_error("Error[getFreePostPass]");
            $data = array_merge($this->DefaultParamArr('http://netload.in/' . $pw[1]), array_combine($match[3], $match[2]));
            $data['step'] = 'password';
            $this->EnterPassword($data);
            exit();
        }
        $this->cookie = GetCookies($this->page);
        if (!preg_match('%<div class="Free_dl"><a href="([^"]+)">%', $this->page, $temp)) html_error('Error[getFreeLink]');
        $this->link = 'http://netload.in/' . html_entity_decode($temp[1], ENT_QUOTES, 'UTF-8');
        $this->page = $this->GetPage($this->link, $this->cookie, 0, $Referer);
        if (!preg_match('@countdown\(([0-9]+),\'change\(\)\'\)@', $this->page, $wait)) html_error('Error[getFreeTimer1]!');
        $this->CountDown($wait[1] / 100);
        if (stripos($this->page, 'Please enter the security code')) {
            $form = cut_str($this->page, '<form method="post"', '</form>');
            if (!preg_match('%action="([^"]+)">%', $form, $temp) || !preg_match('%src="([^"]+)" alt="Sicherheitsbild" \/>%', $form, $cap)) html_error("Error[getCaptchaLink/Image]");
            if (!preg_match_all('@name="([^"]+)" type="(hidden|submit)" value="([^"]+)?"@', $form, $match)) html_error("Error[getCaptchaPostData]");

            $capt = $this->GetPage('http://netload.in/' . $cap[1], $this->cookie);
            $capt_img = substr($capt, strpos($capt, "\r\n\r\n") + 4);
            $imgfile = DOWNLOAD_DIR . "netload_captcha.png";
            if (file_exists($imgfile)) unlink($imgfile);
            if (empty($capt_img) || !write_file($imgfile, $capt_img)) html_error("Error getting CAPTCHA image.");
            
            $data = array_merge($this->DefaultParamArr('http://netload.in/' . $temp[1], $this->cookie), array_combine($match[1], $match[3]));
            $data['step'] = 'captcha';
            $this->EnterCaptcha($imgfile, $data);
            exit();
        }
    }

    private function Free() {
        global $Referer;

        $post['file_id'] = $_POST['file_id'];
        $post['captcha_check'] = $_POST['captcha'];
        $post['start'] = $_POST['start'];
        $this->link = urldecode($_POST['link']);
        $this->cookie = urldecode($_POST['cookie']);
        $this->page = $this->GetPage($this->link, $this->cookie, $post, $Referer);
        if (!preg_match('#countdown\(([0-9]+),\'change\(\)\'\)#', $this->page, $wait)) html_error('Error[getFreeTimer2]!');
        $timer = trim($wait[1]) / 100;
        if ($timer > 20) html_error("Error[Limit reach, you can download your next file in " . round($timer / 60) . " minute]!");
        $this->CountDown($timer);
        if (!preg_match('@http:\/\/[\d.]+\/[^|\r|\n|"]+@', $this->page, $dl)) html_error('Error[getFreeDownloadLink]');
        $dlink = trim($dl[0]);
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $this->cookie, 0, $Referer);
        exit();
    }

    private function Login() {
        global $premium_acc;

        $user = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc["netload_in"]["user"]);
        $pass = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc["netload_in"]["pass"]);
        if (empty($user) || empty($pass)) html_error("Login Failed: User [$user] or Password [$pass] is empty. Please check login data.");

        $posturl = 'http://netload.in/';
        $post['txtuser'] = $user;
        $post['txtpass'] = $pass;
        $post['txtcheck'] = 'login';
        $post['txtlogin'] = 'Login';
        $this->page = $this->GetPage($posturl . 'index.php', 0, $post, $posturl);
        is_present($this->page, '/index.php?id=15', 'Login failed, invalid username or password???');
        $this->cookie = GetCookies($this->page);
        //check the premium account (IMPORTANT!)
        $this->page = $this->GetPage($posturl . 'index.php?id=2', $this->cookie);
        is_present($this->page, 'Order Premium Account now', 'Account Status : FREE!');
        //start download the link
        $this->page = $this->GetPage($this->link, $this->cookie, 0, $this->link);

        return $this->Premium();
    }

    private function Premium() {
        if (stristr($this->page, 'This file is password-protected!')) {
            $form = cut_str($this->page, '<form name="form" method="post"', '</form>');
            if (!preg_match('%action="([^"]+)"%', $form, $pw)) html_error("Error[getPrePassLink]");
            if (!preg_match_all('%<input type="(hidden|submit)" value="([^"]+)?" name="([^"]+)" \/>%', $form, $match)) html_error("Error[getPrePostPass]");
            
            $data = array_merge($this->DefaultParamArr('http://netload.in/' . $pw[1], encrypt($this->cookie)), array_combine($match[3], $match[2]));
            $data['step'] = 'password';
            $this->EnterPassword($data);
            exit();
        }
        if (!preg_match('@http:\/\/[\d.]+\/[^|\r|\n|\'"]+@i', $this->page, $dl)) html_error('Error[getPremiumDownloadLink]');
        $dlink = trim($dl[0]);
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $this->cookie);
    }

    private function EnterPassword($inputs) {
        global $PHP_SELF;

        if (!is_array($inputs)) {
            html_error("Error parsing password data!");
        }
        echo "\n" . '<center><form action="' . $PHP_SELF . '" method="post" >' . "\n";
        foreach ($inputs as $name => $val) {
            echo "<input type='hidden' name='$name' id='$name' value='$val' />\n";
        }
        echo '<h4>Enter password here: <input type="text" name="password" id="filepass" size="13" />&nbsp;&nbsp;<input type="submit" onclick="return check()" value="Continue" /></h4>' . "\n";
        echo "<script type='text/javascript'>\nfunction check() {\nvar pass=document.getElementById('filepass');\nif (pass.value == '') { window.alert('You didn\'t enter the password'); return false; }\nelse { return true; }\n}\n</script>\n";
        echo "\n</form></center>\n</body>\n</html>";
        exit();
    }

}

//updated 05-jun-2010 for standard auth system (szal)
//updated 05-Okt-2011 for premium & free, password protected files by Ruud v.Tony
//small fix in checkin' link 10-Okt-2011 by Ruud v.Tony
//fix password & captcha form layout by Ruud v.Tony 02-02-2012
?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once 'index.html';
	exit;
}

class nippyshare_com extends DownloadClass {

	public function Download($link) {
		
		echo 'Nippyshare.com Download Plugin by <b>The Devil</b><br>';
		$this->page = $this->GetPage($link);
		$devil = preg_match('@nippyshare.com/d/[^\r\n\s\t<>\'\"]+@',$this->page,$dlink);
		if($devil==0){
			html_error('Unable to Download');
		}
		$dloc = 'https://'.$dlink[0];
		preg_match('@<li>Name:.(.*)@',$this->page,$fnames);
		$fname = cut_str($fnames[0],'<li>Name: ','</li>');
		$cookie = GetCookiesArr($this->page);
		$this->RedirectDownload($dloc,$fname,$cookie);
		
	}

}

// Written by The Devil

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class nitroflare_com extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.nitroflare\.com/d/\w+/[^\s\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@https?://(?:www\.)?nitroflare\.com/view/(\w{15,})(?:/[^\s<>\'\"/]+)?@i', $link, $fid)) html_error('Invalid link?.');
		$this->fid = $fid[1];
		$this->link = $fid[0];

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			$this->followLinkRedirect();
			is_present($this->page, 'This file has been removed due to inactivity.');
			is_present($this->page, 'This file has been removed due to infringement of copyright.');
			is_present($this->page, 'This file has been removed by its owner.');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['nitroflare_com']['user']) && !empty($GLOBALS['premium_acc']['nitroflare_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['nitroflare_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['nitroflare_com']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->CookieLogin($user, $pass);
		} else return $this->FreeDL();
	}

	private function followLinkRedirect() {
		if (!preg_match("@\nLocation: ((https?://(?:www\.)?nitroflare\.com)?/view/{$this->fid}/[^\s<>\'\"/]+)@i", $this->page, $redir)) return;
		$redir = (empty($redir[2]) ? 'http://nitroflare.com'.$redir[1] : $redir[1]);


		// Follow Redirect
		$this->cookie = GetCookiesArr($this->page, $this->cookie);
		$this->page = $this->GetPage($redir, $this->cookie);
		// Update $this->link and $Referer
		$this->link = $GLOBALS['Referer'] = $redir;
	}

	private function FreeDL() {
		if (empty($_POST['step']) || $_POST['step'] != '1') {
			$page = $this->GetPage($this->link, $this->cookie, array('goToFreePage' => 'Submit'));
			$this->cookie = GetCookiesArr($page, $this->cookie);

			$page = $this->GetPage($this->link.'/free', $this->cookie);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $pid)) html_error('CAPTCHA not found.');

			$post = array('method' => 'startTimer', 'fileId' => $this->fid);
			$page = $this->GetPage('http://nitroflare.com/ajax/freeDownload.php', $this->cookie, $post, $this->link . "\r\nX-Requested-With: XMLHttpRequest");
			list($ajaxHeader, $ajaxBody) = explode("\r\n\r\n", $page, 2);

			is_present($ajaxBody, 'This file is available with Premium only. Reason: this file is larger than 1024mb.');
			is_present($ajaxBody, 'This file is available with Premium only. Reason: the file\'s owner disabled free downloads.');
			if (preg_match('@Free downloading is not possible. You have to wait (\d+) \w+ to download your next file.@i', $ajaxBody, $err)) html_error($err[0]);

			$ajaxBody = trim($ajaxBody);
			if ($ajaxBody != "\xEF\xBB\xBF1" && $ajaxBody != '1') html_error('Unexpected result at freeDownload request.');

			if (preg_match('@id="CountDownTimer"\s+data-timer="(\d+)"@i', $page, $cD))$this->CountDown($cD[1]);

			$data = $this->DefaultParamArr($this->link, $this->cookie, 1, 1);
			$data['step'] = 1;
			return $this->reCAPTCHA($pid[1], $data);
		}

		$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
		if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');

		$post = array();
		$post['method'] = 'fetchDownload';
		$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
		$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);

		$page = $this->GetPage('http://nitroflare.com/ajax/freeDownload.php', $this->cookie, $post, $this->link . "\r\nX-Requested-With: XMLHttpRequest");
		is_present($page, 'Free users have to wait ', 'Error: Skipped CountDown?');
		is_present($page, 'The captcha wasn\'t entered correctly');

		if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download Link Not Found.');

		return $this->RedirectDownload($dl[0], urldecode(parse_url($dl[0], PHP_URL_PATH)));
	}

	private function PremiumDL() {
		$page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		if (!preg_match($this->DLRegexp, $page, $dl)) html_error('Download-Link Not Found.');

		return $this->RedirectDownload($dl[0], urldecode(parse_url($dl[0], PHP_URL_PATH)));
	}

	private function Login($user, $pass) {
		$purl = 'https://nitroflare.com/login';
		if (!empty($_POST['step']) && $_POST['step'] == '1') {
			$post = $this->verifyReCaptchav2();
			$post['email'] = urlencode($user);
			$post['password'] = urlencode($pass);
			$post['login'] = 'Submit';
			$post['token'] = urlencode($_POST['token']);

			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
			$page = $this->GetPage($purl, $this->cookie, $post, $purl);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			is_present($page, 'Account does not exist.', 'Login Error: Invalid or Inexistent Email.');
			is_present($page, 'Wrong Email / Password', 'Login Error: Incorrect Email / Password.');
			if (preg_match('@Please try again in \d+ minutes@i', $page, $err)) html_error("Login Error: {$err[0]}.");
			is_present($page, 'CAPTCHA error', 'Login Error: Unknown Captcha Error.');
		} else {
			$post = array();
			$post['email'] = urlencode($user);
			$post['password'] = urlencode($pass);
			$post['login'] = 'Submit';

			$page = $this->GetPage($purl, $this->cookie);
			if (!($post['token'] = urlencode(cut_str($page, 'name="token" value="', '"')))) html_error('Login Error: Cannot find login token');
			$this->cookie = GetCookiesArr($page, $this->cookie);

			$page = $this->GetPage($purl, $this->cookie, $post, $purl);
			$this->cookie = GetCookiesArr($page, $this->cookie);

			is_present($page, 'Account does not exist.', 'Login Error: Invalid or Inexistent Email');
			is_present($page, 'Wrong Email / Password', 'Login Error: Incorrect Email / Password');
			if (preg_match('@Please try again in \d+ minutes@i', $page, $err)) html_error('Login Error: ' . $err[0]);

			if (!preg_match('@class="g-recaptcha" data-sitekey="([\w\.\-]+)"@i', $page, $cpid) && stripos($page, 'CAPTCHA error') !== false) html_error('reCAPTCHA2 Not Found.');

			if (!empty($cpid[1])) {
				// Captcha Required
				$data = $this->DefaultParamArr($this->link, $this->cookie, true, true);
				$data['step'] = '1';
				if (!($data['token'] = html_entity_decode(cut_str($page, 'name="token" value="', '"'), ENT_QUOTES))) html_error('Login Error: Cannot find login token.');
				$data['premium_acc'] = 'on';
				if ($this->pA) {
					$data['pA_encrypted'] = 'true';
					$data['premium_user'] = urlencode(encrypt($user));
					$data['premium_pass'] = urlencode(encrypt($pass));
				}
				return $this->reCAPTCHAv2($cpid[1], $data, 0, 'Login');
			}
		}

		if (empty($this->cookie['user'])) html_error('Login Error: Cannot find "user" cookie.');
		$this->SaveCookies($user, $pass); // Update cookies file

		// Test Login
		$page = $this->GetPage('https://nitroflare.com/member', $this->cookie, 0, $purl);
		is_present($page, '>Inactive</', 'Login Error: Account isn\'t premium.');

		return $this->PremiumDL();
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass, $filename = 'nitroflare_dl.php') {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');

		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename)/* || (!empty($_POST['step']) && $_POST['step'] == '1')*/) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = sha1($user.':'.$pass);
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$page = $this->GetPage('https://nitroflare.com/member', $testCookie);
			if (stripos($page, '>Logout</a>') === false) return $this->Login($user, $pass);
			$this->cookie = GetCookiesArr($page, $testCookie); // Update cookies
			$this->SaveCookies($user, $pass); // Update cookies file
			is_present($page, '>Inactive</', 'Account isn\'t premium');
			return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'nitroflare_dl.php') {
		global $secretkey;
		$maxdays = 31; // Max days to keep cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = sha1($user.':'.$pass);
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}

	// Special Function Called by verifyReCaptchav2 When Captcha Is Incorrect, To Allow Retry. - Required
	protected function retryReCaptchav2() {
		$data = $this->DefaultParamArr($this->link);
		$data['cookie'] = (!empty($_POST['cookie']) ? $_POST['cookie'] : '');
		$data['step'] = '1';
		$data['token'] = (!empty($_POST['cookie']) ? $_POST['token'] : '');
		$data['premium_acc'] = 'on';
		if ($this->pA && !empty($_GET['pA_encrypted']) && !empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) {
			$data['pA_encrypted'] = 'true';
			$data['premium_user'] = $_REQUEST['premium_user'];
			$data['premium_pass'] = $_REQUEST['premium_pass'];
		}
		return $this->reCAPTCHAv2($_POST['recaptcha2_public_key'], $data, 0, 'Retry Login');
	}
}

//[18-10-2015] Written by Th3-822.
//[13-12-2015] Fixed FreeDL CountDown. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class novafile_com extends GenericXFS_DL {
	public $pluginVer = 18;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom Download Regexp
		$this->DLregexp = '@https?://s\d+\.novafile\.com/\w{72}/[^\t\r\n<>\'\"\?\&]+@i';

		// Extra FreeDL Error Messages.
		$this->cErrsFDL = array('This file can only be downloaded by Premium Members');

		$this->Start($link);
	}

	// Edited to fix login url
	protected function sendLogin($post) {
		$page = $this->GetPage((!empty($this->sslLogin) ? 'https://'.$this->host.'/' : $this->purl) . 'login', $this->cookie, $post);
		return $page;
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class novamov_com extends DownloadClass {
	public function Download($link) {
		$page = $this->GetPage($link);
		is_present($page, 'This file no longer exists', 'Video not found or it was deleted.');
		is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');

		if (($stepkey = cut_str($page, '"stepkey" value="', '"'))) {
			$post = array('stepkey' => $stepkey, 'submit' => 'submit');
			$cookie = GetCookiesArr($page);
			$page = $this->GetPage($link, $cookie, $post);
			is_present($page, 'This file no longer exists', 'Video not found or it was deleted..');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable..');
		}

		if (!preg_match('@<h3>\s*([^"<>]+)\s*</h3>@i', $page, $title)) html_error('Error: Video title not found.');
		if (!preg_match('@flashvars.domain\s*=\s*"([^"]+)";\s+flashvars.file\s*=\s*"([^"]+)";\s+flashvars.filekey\s*=\s*(?:"([^"]+)"|([\$_A-Za-z][\$\w]*))@', $page, $matches)) html_error('Error: Download link not found.');
		if (empty($matches[3])) {
			if (!preg_match('@var\s+'.$matches[4].'\s*=\s*"([^"]+)"\s*;@i', $page, $fkey)) html_error('FileKey not Found.');
			$matches[3] = $fkey[1];
		}

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $matches[2] . '&pass=undefined&key=' . urlencode($matches[3]);
		$page2 = $this->GetPage($url);
		is_present($page2, ' is being transfered', 'Video is temporarily unavailable');
    
		if (!preg_match('@url=(http://[^&]+)@', $page2, $downl)) html_error('Error: Download link not found.');  

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [NovaMov][%s]%s', $matches[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  ReWritten by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class nowvideo_sx extends DownloadClass {
	public function Download($link) {
		$page = $this->GetPage($link);
		is_present($page, 'This file no longer exists', 'Video not found or it was deleted.');
		is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');

		if (($stepkey = cut_str($page, '"stepkey" value="', '"'))) {
			$post = array('stepkey' => $stepkey, 'submit' => 'submit');
			$cookie = GetCookiesArr($page);
			$page = $this->GetPage($link, $cookie, $post);
			is_present($page, 'This file no longer exists', 'Video not found or it was deleted..');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable..');
		}

		if (!preg_match('@<h4>\s*([^"<>]+)\s*</h4>@i', $page, $title)) html_error('Error: Video title not found.');
		if (!preg_match('@flashvars.domain\s*=\s*"([^"]+)";\s+flashvars.file\s*=\s*"([^"]+)";\s+flashvars.filekey\s*=\s*(?:"([^"]+)"|([\$_A-Za-z][\$\w]*))@', $page, $matches)) html_error('Error: Download link not found.');
		if (empty($matches[3])) {
			if (!preg_match('@var\s+'.$matches[4].'\s*=\s*"([^"]+)"\s*;@i', $page, $fkey)) html_error('FileKey not Found.');
			$matches[3] = $fkey[1];
		}

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $matches[2] . '&pass=undefined&key=' . urlencode($matches[3]);
		$page2 = $this->GetPage($url);
		is_present($page2, ' is being transfered', 'Video is temporarily unavailable');
    
		if (!preg_match('@url=(http://[^&]+)@', $page2, $downl)) html_error('Error: Download link not found.');  

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [NowVideo][%s]%s', $matches[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  ReWritten by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class ok_ru extends DownloadClass {
	private $xid, $streams, $formats = array('full' => 1080, 'hd' => 720, 'sd' => 480, 'low' => 360, 'lowest' => 240, 'mobile' => 144);
	public function Download($link) {
		if (!preg_match('@/video(?:embed)?/(\d+)@i', $link, $xid)) html_error('Video ID not found.');
		$this->xid = $xid[1];
		$this->link = 'https://ok.ru/video/' . $this->xid;

		$page = $this->GetPage($this->link);
		is_present($page, "Video has not been found", 'Video not found or it was deleted.');

		$json = cut_str($page, 'data-options="', '"');
		if (empty($json)) html_error('Video Data not Found.');
		$json = $this->json2array(html_entity_decode(str_replace('\\\\u0026', '&amp;', $json), ENT_QUOTES, 'UTF-8'), 'Error Parsing Video Data.');
		if (!empty($json['flashvars']['metadata']) && !is_array($json['flashvars']['metadata'])) $json['flashvars']['metadata'] = $this->json2array($json['flashvars']['metadata'], 'Error Parsing Video Metadata.');
		else if (empty($json['flashvars']['metadata'])) html_error('Video Metadata Not Found');
		$json = $json['flashvars']['metadata'];

		if (empty($json['movie']['title'])) html_error('Video Title Not Found');

		$this->streams = array();
		foreach ($json['videos'] as $video) {
			if (array_key_exists($video['name'], $this->formats) && !empty($video['url'])) $this->streams[$video['name']] = $video['url'];
		}
		if (empty($this->streams)) html_error('Non Aceptable Video Streams Found.');

		// I did see a couple of videos that links to youtube, i will add code to send them to the youtube plugin.
		if (count($json['videos']) == 1 && empty($json['movie']['collageInfo']))
		{
			// Looks Like A Video for a External Site.
			$extLink = $this->streams[key($this->streams)];
			if (preg_match('@youtube\.com/(?:v|embed)/([\w\-\.]{11})@i', $extLink, $YT)) {
				// It's a  YT link, send it to the youtube plugin.
				insert_location($this->DefaultParamArr('https://www.youtube.com/watch?v=' . $YT[1]));
				exit();
			}
			html_error('This video doesn\'t seems to be hosted on ok.ru, link: ' . htmlspecialchars($extLink));
		}

		if (empty($_POST['dlstream']) && !isset($_GET['audl'])) return $this->QSelector();
		elseif (empty($_POST['dlstream']) || !empty($this->streams[$_POST['dlstream']])) {
			$key = (empty($_POST['dlstream']) ? key($this->streams) : $_POST['dlstream']);
			$DL = $this->streams[$key];
		} else html_error('Selected video stream was not found.');

		$filename = preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($json['movie']['title']), ENT_QUOTES, 'UTF-8'));
		$filename .= " [OK-{$this->formats[$key]}p][{$this->xid}].mp4";

		$this->RedirectDownload($DL, $filename, 0, 0, 0, $filename);
	}

	private function QSelector() {
		echo "\n<br /><br /><h3 style='text-align: center;'>Video Quality Selector</h4>";
		echo "\n<center><form name='T8_QS' action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
		echo "<select name='dlstream' id='QS_fmt'>\n";
		foreach ($this->formats as $fmt => $res) if (array_key_exists($fmt, $this->streams)) echo "<option value='$fmt'>" . ucfirst($fmt) . " ({$res}p)</option>\n";
		echo "</select>\n";
		$data = $this->DefaultParamArr($this->link);
		foreach ($data as $n => $v) echo("<input type='hidden' name='$n' id='QS_$n' value='$v' />\n");
		echo "<input type='submit' name='Th3-822' value='" . lang(209) . "' />\n";
		echo "</form></center>\n</body>\n</html>";
		exit;
	}
}

//[18-11-2015] Written by Th3-822.
//[25-02-2017] Switched to HTTPS. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class openload_co extends DownloadClass {
	private $page, $cookie = array(), $elink, $pA, $DLRegexp = '@https?://\w+\.(?:openload\.co|oloadcdn\.net)/dl/[^\t\r\n\'\"<>\?]+@i';
	private $ignoreApiDLCaptcha = false;
	public function Download($link) {
		if (!preg_match('@https?://openload\.co/f/([\w-]+)@i', str_ireplace(array('://www.openload.co', '/embed/'), array('://openload.co', '/f/'), $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = str_ireplace('http://', 'https://', $fid[0]);
		$this->elink = str_ireplace('/f/', '/embed/', $this->link);
		$this->fid = $fid[1];

		if (empty($_POST['step'])) $this->testLink();
		else if ($_POST['step'] == '1') return $this->ApiDLPost();
		else if ($_POST['step'] == '42') return $this->processAnswer();

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['openload_co']['user']) && !empty($GLOBALS['premium_acc']['openload_co']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['openload_co']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['openload_co']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->Login($user, $pass);
		} else return $this->AnonDL();
	}

	private function testLink() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);
		if (stripos($this->page, 'We can\'t find the file you are looking for.') !== false) {
			$this->page = $this->GetPage($this->elink, $this->cookie);
			is_present($this->page, 'We can\'t find the file you are looking for.', 'File Not Found.');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}
	}

	private function processAnswer() {
		if (empty($_POST['streamurl'])) return html_error('Decoded Download-Link Empty');
		else if (($DL = $this->testStreamToken($_POST['streamurl']))) return $this->RedirectDownload($DL, urldecode(parse_url($DL, PHP_URL_PATH)));
		return html_error('Decoded Download-Link Invalid or Not Found');
	}

	private function AnonDL() {
		// ApiDL
		try {
			return $this->tryApiDL();
		} catch (Exception $e) {
			$this->changeMesg(sprintf('<br /><b>Anon_ApiDL Failed: "%s"</b>', htmlspecialchars($e->getMessage(), ENT_QUOTES)), true);
		}
		// WebDL
		return $this->WebDL();
	}

	private function tryApiDL($login = 0, $key = 0) {
		$query = array('file' => $this->fid);
		if (!empty($login) && !empty($key)) {
			$query['login'] = $login;
			$query['key'] = $key;
		}
		$ticket = $this->ApiReq('file/dlticket', $query);
		if (empty($ticket['ticket'])) throw new Exception('Token not Found');
		if (!empty($ticket['wait_time']) && $ticket['wait_time'] > 0) $this->CountDown($ticket['wait_time']);
		if (!empty($ticket['captcha_url'])) {
			// Got CAPTCHA
			if ($this->ignoreApiDLCaptcha) throw new Exception('ignoreApiDLCaptcha is true');
			$data = $this->DefaultParamArr($this->link);
			$data['step'] = '1';
			$data['ticket'] = $ticket['ticket'];
			list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($ticket['captcha_url']), 2);
			if (substr($headers, 9, 3) != '200') throw new Exception('Error downloading captcha img');
			$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');
			return $this->EnterCaptcha("data:$mimetype;base64," . base64_encode($imgBody), $data);
		}
		// Download
		unset($query['login'], $query['key']);
		$query['ticket'] = $ticket['ticket'];
		$DL = $this->ApiReq('file/dl', $query);
		if (empty($DL['url'])) throw new Exception('Download Link not Found');
		return $this->RedirectDownload($DL['url'], 'T8_ol_adl');
	}

	private function ApiDLPost() {
		if (empty($_POST['ticket'])) html_error('ApiDLPost: Ticket not Found.');
		if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
		try {
			$DL = $this->ApiReq('file/dl', array('file' => $this->fid, 'ticket' => $_POST['ticket'], 'captcha_response' => $_POST['captcha']));
		} catch (Exception $e) {
			html_error(sprintf('ApiDLPost Error: "%s"</b>', htmlspecialchars($e->getMessage(), ENT_QUOTES)));
		}
		if (empty($DL['url'])) html_error('ApiDLPost: Download Link not Found.');
		return $this->RedirectDownload($DL['url'], 'T8_ol_adl_c');
	}

	private function getAAScript($page) {
		if (preg_match_all('@ï¾Ïï¾ï¾.+?\(\'_\'\);@i', $page, $scripts)) {
			foreach ($scripts[0] as $script) {
				$script = (new AADecoder)->decode($script);
				if (stripos($script, 'String.fromCharCode') !== false && stripos($script, '#streamurl') !== false) {
					return $script;
				}
			}
		}
		return false;
	}

	private function testStreamToken($token) {
		if (!preg_match($this->DLRegexp, $token, $DL)) {
			if (!preg_match("@{$this->fid}~\d{10}~(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)~[\w\-]{8}(?:\?|$)@", $token)) return false;
			$page = $this->GetPage("https://openload.co/stream/$token?mime=true");
			if (!preg_match($this->DLRegexp, $page, $DL)) return html_error('Stream Download-Link Not Found.');
			if ($this->fid != 'KDA_8nZ2av4' && strpos($DL[0], '/KDA_8nZ2av4/x.mp4') !== false) return false; // :P
		}
		return $DL[0];
	}

	private function WebDL() {
		if (!($script = $this->getAAScript($this->page))) html_error('Obsfuscated JS Not Found.');
		# if (preg_match('@var\s+secondsdl\s*=\s*(\d+)\s*;@', $this->page, $cD) && $cD[1] > 0) $this->CountDown($cD[1]);
		$data = $this->DefaultParamArr($this->link);
		$data['step'] = '42';
		$data['streamurl'] = '';
		$T8 = '';
		if (preg_match_all('@\$[\s\t]*\([\s\t]*[\"\']#([a-z][\w\.\-]*)[\"\'][\s\t]*\)@i', $script, $ids) && count($ids[0]) > 1) {
			foreach (array_unique($ids[1]) as $id) {
				if ($id == 'streamurl') continue;
				if (!preg_match("@<([a-z][a-z\d]*)\s*(?:\w+\s*=\s*[\"\'][^\"\'<>]*[\"\']\s*)*(?:\s*id\s*=[\"\']{$id}[\"\']\s*)(?:\w+\s*=\s*[\"\'][^\"\'<>]*[\"\']\s*)*(?:\s*>([!-~]+)</\\1>|(/)?\s*>)@i", $this->page, $tag)) break; // If it doesn't found the tag the decode will fail, im not sure if break or continue...
				$T8 .= (!empty($tag[2]) ? $tag[0] : (empty($tag[3]) ? $tag[0].'</'.$tag[1].'>' : $tag[0]));
			}
		}
		$script = preg_replace('@\.text\(\s*(?!\))@', '.val(', str_replace('streamurl', 'T8_streamurl', $script));
		echo "\n<div style='display:none;'>$T8</div>\n<form name='ol_dcode' action='{$_SERVER['SCRIPT_NAME']}' method='POST'><br />\n";
		foreach ($data as $name => $input) echo "<input type='hidden' name='$name' id='T8_$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
		echo "</form>\n<span id='T8_emsg' class='htmlerror' style='text-align:center;display:none;'></span>\n<noscript><span class='htmlerror'><b>Sorry, this code needs JavaScript enabled to work.</b></span></noscript>\n<script type='text/javascript'>/* <![CDATA[ Th3-822 */\n\tvar T8 = true;\n\ttry {\n{$script}\n\t} catch(e) {\n\t\t$('#T8_emsg').html('<b>Cannot decode link: ['+e.name+'] '+e.message+'</b>').show();\n\t\tT8 = false;\n\t}\n\tif (T8) window.setTimeout(\"$('form[name=ol_dcode]').submit();\", 500); // 500 Âµs to make sure that the value was decoded and added.\n/* ]]> */</script>\n\n</body>\n</html>";
		exit;
	}

	private function Login($user, $pass) {
		$isApiLogin = (strpos($user, '@') === false ? true : false);

		// ApiDL
		if ($isApiLogin || (!$this->pA && !empty($GLOBALS['premium_acc']['openload_co']['apiuser']) && !empty($GLOBALS['premium_acc']['openload_co']['apipass']))) {
			try {
				if ($isApiLogin) return $this->tryApiDL($user, $pass);
				else return $this->tryApiDL($GLOBALS['premium_acc']['openload_co']['apiuser'], $GLOBALS['premium_acc']['openload_co']['apipass']);
			} catch (Exception $e) {
				if ($this->pA) html_error('Login_ApiDL Failed: ' . htmlspecialchars($e->getMessage(), ENT_QUOTES));
				else $this->changeMesg(sprintf('<br /><b>Login_ApiDL Failed: "%s"</b>', htmlspecialchars($e->getMessage(), ENT_QUOTES)), true);
			}
		}

		// Login
		if (!preg_match('@<meta name="csrf-token" content="([\w+/=]+)"@i', $this->page, $token)) {
			$page = $this->GetPage('https://openload.co/login', $this->cookie);
			$this->cookie = GetCookiesArr($page, $this->cookie);
			if (!preg_match('@<meta name="csrf-token" content="([\w+/=]+)"@i', $page, $token)) html_error('Login CSRF Token not Found.');
		}
		$post = array('_csrf' => $token[1]);
		$post['LoginForm%5Bemail%5D'] = urlencode($user);
		$post['LoginForm%5Bpassword%5D'] = urlencode($pass);
		$post['LoginForm%5BrememberMe%5D'] = 1;

		$page = $this->GetPage('https://openload.co/login', $this->cookie, $post);
		is_present($page, 'Incorrect username or password.', 'Login Error: Wrong Email/Password.');
		$this->cookie = GetCookiesArr($page, $this->cookie);
		if (empty($this->cookie['_identity'])) html_error('Login Error: Cookie "_identity" not Found.');

		// Update $this->page
		$this->testLink();
		// WebDL
		return $this->WebDL();
	}

	private function is_present($lpage, $mystr, $strerror = '') {
		if (stripos($lpage, $mystr) !== false) throw new Exception(!empty($strerror) ? $strerror : $mystr);
	}

	private function ApiReq($path, $query = array()) {
		if (!is_array($query)) $query = array();

		$query = !empty($query) ? '?'.http_build_query($query, '', '&') : '';
		$page = $this->GetPage("https://api.openload.co/1/$path$query", 0, 0, 'https://openload.co/');
		$reply = $this->json2array($page, "ApiReq($path) Error");

		switch ($reply['status']) {
			case 200: break;
			case 404: case 451: return html_error("[ApiReq($path)] File Deleted or Not Found.");
			case 509: throw new Exception(stripos($reply['msg'], 'bandwidth usage too high (peak hours)') !== false ? 'BW Usage Too High' : 'BW Limit Reached');
			case 403:
				$this->is_present($reply['msg'], 'Authentication failed', 'Incorrect API Login');
				$this->is_present($reply['msg'], 'Captcha not solved correctly', 'Incorrect CAPTCHA Answer');
				$this->is_present($reply['msg'], 'the owner of this file doesn\'t allow API', 'API Download Disabled for This File');
			default: throw new Exception("[ApiReq($path) Error {$reply['status']}] " . htmlspecialchars($reply['msg'], ENT_QUOTES));
		}

		return $reply['result'];
	}
}

/**
 * Class AADecoder
 * @author Andrey Izman <izmanw@gmail.com>
 * @link https://github.com/mervick/php-aaencoder
 * @license MIT
 */

/*
The MIT License (MIT)

Copyright (c) 2015 Andrey Izman <izmanw@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

/**
 * Class AADecoder
 */
class AADecoder
{
	const BEGIN_CODE = "ï¾Ïï¾ï¾=/ï½ï½Â´ï¼ï¾~â»ââ»/['_'];o=(ï¾ï½°ï¾)=_=3;c=(ï¾Îï¾)=(ï¾ï½°ï¾)-(ï¾ï½°ï¾);(ï¾Ðï¾)=(ï¾Îï¾)=(o^_^o)/(o^_^o);(ï¾Ðï¾)={ï¾Îï¾:'_',ï¾Ïï¾ï¾:((ï¾Ïï¾ï¾==3)+'_')[ï¾Îï¾],ï¾ï½°ï¾ï¾:(ï¾Ïï¾ï¾+'_')[o^_^o-(ï¾Îï¾)],ï¾Ðï¾ï¾:((ï¾ï½°ï¾==3)+'_')[ï¾ï½°ï¾]};(ï¾Ðï¾)[ï¾Îï¾]=((ï¾Ïï¾ï¾==3)+'_')[c^_^o];(ï¾Ðï¾)['c']=((ï¾Ðï¾)+'_')[(ï¾ï½°ï¾)+(ï¾ï½°ï¾)-(ï¾Îï¾)];(ï¾Ðï¾)['o']=((ï¾Ðï¾)+'_')[ï¾Îï¾];(ï¾oï¾)=(ï¾Ðï¾)['c']+(ï¾Ðï¾)['o']+(ï¾Ïï¾ï¾+'_')[ï¾Îï¾]+((ï¾Ïï¾ï¾==3)+'_')[ï¾ï½°ï¾]+((ï¾Ðï¾)+'_')[(ï¾ï½°ï¾)+(ï¾ï½°ï¾)]+((ï¾ï½°ï¾==3)+'_')[ï¾Îï¾]+((ï¾ï½°ï¾==3)+'_')[(ï¾ï½°ï¾)-(ï¾Îï¾)]+(ï¾Ðï¾)['c']+((ï¾Ðï¾)+'_')[(ï¾ï½°ï¾)+(ï¾ï½°ï¾)]+(ï¾Ðï¾)['o']+((ï¾ï½°ï¾==3)+'_')[ï¾Îï¾];(ï¾Ðï¾)['_']=(o^_^o)[ï¾oï¾][ï¾oï¾];(ï¾Îµï¾)=((ï¾ï½°ï¾==3)+'_')[ï¾Îï¾]+(ï¾Ðï¾).ï¾Ðï¾ï¾+((ï¾Ðï¾)+'_')[(ï¾ï½°ï¾)+(ï¾ï½°ï¾)]+((ï¾ï½°ï¾==3)+'_')[o^_^o-ï¾Îï¾]+((ï¾ï½°ï¾==3)+'_')[ï¾Îï¾]+(ï¾Ïï¾ï¾+'_')[ï¾Îï¾];(ï¾ï½°ï¾)+=(ï¾Îï¾);(ï¾Ðï¾)[ï¾Îµï¾]='\\\\';(ï¾Ðï¾).ï¾Îï¾ï¾=(ï¾Ðï¾+ï¾ï½°ï¾)[o^_^o-(ï¾Îï¾)];(oï¾ï½°ï¾o)=(ï¾Ïï¾ï¾+'_')[c^_^o];(ï¾Ðï¾)[ï¾oï¾]='\\\"';(ï¾Ðï¾)['_']((ï¾Ðï¾)['_'](ï¾Îµï¾+(ï¾Ðï¾)[ï¾oï¾]+";

	const END_CODE = "(ï¾Ðï¾)[ï¾oï¾])(ï¾Îï¾))('_');";


	/**
	 * Decode encoded-as-aaencode JavaScript code.
	 * @param string $js
	 * @return string
	 */
	public static function decode($js)
	{
		if (self::hasAAEncoded($js, $start, $next, $encoded)) {
			$decoded = self::deobfuscate($encoded);
			if (substr(rtrim($decoded), -1) !== ';') {
				$decoded .= ';';
			}
			return mb_substr($js, 0, $start, 'UTF-8') . $decoded . self::decode(mb_substr($js, $next, null, 'UTF-8'));
		}
		return $js;
	}

	/**
	 * @param string $js
	 * @return string
	 */
	protected static function deobfuscate($js)
	{
		$bytes = array(
			9 => '((ï¾ï½°ï¾)+(ï¾ï½°ï¾)+(ï¾Îï¾))',
			6 => '((o^_^o)+(o^_^o))',
			2 => '((o^_^o)-(ï¾Îï¾))',
			7 => '((ï¾ï½°ï¾)+(o^_^o))',
			5 => '((ï¾ï½°ï¾)+(ï¾Îï¾))',
			8 => '((ï¾ï½°ï¾)+(ï¾ï½°ï¾))',
			10 => '(ï¾Ðï¾).ï¾Ïï¾ï¾',
			11 => '(ï¾Ðï¾).ï¾Îï¾ï¾',
			12 => '(ï¾Ðï¾)[\'c\']',
			13 => '(ï¾Ðï¾).ï¾ï½°ï¾ï¾',
			14 => '(ï¾Ðï¾).ï¾Ðï¾ï¾',
			15 => '(ï¾Ðï¾)[ï¾Îï¾]',
			3 => '(o^_^o)',
			0 => '(c^_^o)',
			4 => '(ï¾ï½°ï¾)',
			1 => '(ï¾Îï¾)',
		);
		$native = array(
			'-~' => '1+',
			'!' => '1',
			'[]' => '0',
		);
		$native = array(
			array_keys($native),
			array_values($native),
		);
		$chars = array();
		$hex = '(oï¾ï½°ï¾o)+';
		$hexLen = mb_strlen($hex, 'UTF-8');
		$calc = function($expr) {
			return eval("return $expr;");
		};
		$convert = function ($block, $func) use ($bytes, $calc) {
			while (preg_match('/\([0-9\-\+\*\/]+\)/', $block)) {
				$block = preg_replace_callback('/\([0-9\-\+\*\/]+\)/', function($matches) use ($calc) {
					return $calc($matches[0]);
				}, $block);
			}
			$split = array();
			foreach (explode('+', trim($block, '+')) as $num) {
				if ($num === '') continue;
				$split[] = $func(intval(trim($num)));
			}
			return implode('', $split);
		};
		foreach ($bytes as $byte => $search) {
			$js = implode($byte, mb_split(preg_quote($search), $js));
		}
		foreach (mb_split(preg_quote('(ï¾Ðï¾)[ï¾Îµï¾]+'), $js) as $block) {
			$block = trim(trim(str_replace($native[0], $native[1], $block), '+'));
			if ($block === '') continue;
			if (mb_substr($block, 0, $hexLen, 'UTF-8') === $hex) {
				$code = hexdec($convert(mb_substr($block, $hexLen, null, 'UTF-8'), 'dechex'));
			}
			else {
				$code = octdec($convert($block, 'decoct'));
			}
			$chars[] = mb_convert_encoding('&#' . intval($code) . ';', 'UTF-8', 'HTML-ENTITIES');
		}
		return implode('', $chars);
	}

	/**
	 * Detect aaencoded JavaScript code.
	 * @param string $js
	 * @param null|int $start
	 * @param null|int $next
	 * @param null|string $encoded
	 * @return bool
	 */
	public static function hasAAEncoded($js, &$start=null, &$next=null, &$encoded=null)
	{
		$find = function($haystack, $needle, $offset=0) {
			$matches = array();
			for ($i = 0; $i < 6 && $offset !== false; $i ++) {
				if (($offset = mb_strpos($haystack, $needle, $offset, 'UTF-8')) !== false) {
					$matches[$i] = $offset;
					$offset ++;
				}
			}
			return count($matches) >= 6 ? array($matches[4], $matches[5]) : false;
		};
		$start = -1;
		while (($start = mb_strpos($js, 'ï¾Ïï¾ï¾', $start + 1, 'UTF-8')) !== false) {
			$clear = preg_replace('/\/\*.+?\*\//', '', preg_replace('/[\x03-\x20]/', '', $code = mb_substr($js, $start, null, 'UTF-8')));
			$len = mb_strlen(self::BEGIN_CODE, 'UTF-8');
			if (mb_substr($clear, 0, $len, 'UTF-8') === self::BEGIN_CODE &&
				mb_strpos($clear, self::END_CODE, $len, 'UTF-8') &&
				($matches = $find($js, 'ï¾oï¾', $start))
			) {
				list($beginAt, $endAt) = $matches;
				$beginAt = mb_strpos($js, '+', $beginAt, 'UTF-8');
				$endAt = mb_strrpos($js, '(', - mb_strlen($js, 'UTF-8') + $endAt, 'UTF-8');
				$next = mb_strpos($js, ';', $endAt + 1, 'UTF-8') + 1;
				$encoded = preg_replace('/[\x03-\x20]/', '', mb_substr($js, $beginAt, $endAt - $beginAt, 'UTF-8'));
				return true;
			}
		}
		return false;
	}
}

//[21-04-2016]  Written by Th3-822. (Using mervick's AADecoder class)
//[25-11-2016]  Rewritten Decoding Functions. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class ourupload_com extends GenericXFS_DL {
	public $pluginVer = 14;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class ozofiles_com extends GenericXFS_DL {
	public $pluginVer = 18;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class partagora_com extends DownloadClass {
	private $page, $cookie = array(), $pA, $DLRegexp = '@https?://s\d+\.partagora\.com/download\?[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://partagora\.com)/(?:[^/]+/)+[^\r\n\t/<>\"]+?,(\d+)[^\r\n\t/<>\"]*@i', preg_replace('@^(http)s?(://)(?:www\.)?(partagora)\.com(?=/)@i', '$1$2$3.com', $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0];
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['partagora_com']['user']) && !empty($GLOBALS['premium_acc']['partagora_com']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['partagora_com']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['partagora_com']['pass']);
			return $this->Login($user, $pass);
		} else return $this->TryDL();
	}

	private function TryDL() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!preg_match($this->DLRegexp, $this->page, $DL)) {
			if (substr($this->page, 9, 3) != '200') html_error('File Not Found or Private.');
			$download = $this->reqAction('DownloadFile', array('fileId' => $this->fid, '__RequestVerificationToken' => $this->getCSRFToken($this->page)));
			if (empty($download['DownloadUrl']) || !preg_match($this->DLRegexp, $download['DownloadUrl'], $DL)) {
				if (empty($this->cookie['.ASPXAUTH_v2']) && $download['Type'] == 'Window') html_error('Login is Required to Download This File.');
				html_error('Download-Link Not Found.');
			}
		}
		return $this->RedirectDownload($DL[0], 'partagora_placeholder_fname');
	}

	private function getCSRFToken($page, $errorPrefix = 'Error') {
		if (!preg_match('@name="__RequestVerificationToken"\s+type="hidden"\s+value="([\w\-+/=]+)"@i', $page, $token)) return html_error("[$errorPrefix]: Request Token Not Found.");
		return $token[1];
	}

	private function Login($user, $pass) {
		$page = $this->GetPage($this->baseurl . '/', $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$login = $this->reqAction('Account/Login', array('UserName' => $user, 'Password' => $pass, '__RequestVerificationToken' => $this->getCSRFToken($page, 'Login Error')));
		if (!empty($login['Content'])) is_present($login['Content'], 'Le nom d&#39;utilisateur ou le mot de passe fourni est incorrect.', 'Login Error: Wrong Login/Password.');
		if (empty($this->cookie['.ASPXAUTH_v2'])) html_error('Login Error: Cookie ".ASPXAUTH_v2" not Found.');

		return $this->TryDL();
	}

	private function reqAction($path, $post = array()) {
		$page = $this->GetPage("{$this->baseurl}/action/$path", $this->cookie, array_map('urlencode', $post), "{$this->baseurl}/\r\nX-Requested-With: XMLHttpRequest");
		$reply = $this->json2array($page, "reqAction($path) Error");
		if (empty($reply)) html_error("[reqAction($path) Error] Empty Response.");
		$this->cookie = GetCookiesArr($page, $this->cookie);

		return $reply;
	}
}

// [20-3-2016] Written by Th3-822.
// [22-4-2016] Renamed to partagora_com and fixed. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class picofile_com extends DownloadClass {
	public function Download($link) {
		$link = explode('|', str_ireplace('%7C', '|', $link), 2);
		$lpass = (count($link) > 1 ? rawurldecode($link[1]) : '');
		$link = $GLOBALS['Referer'] = $link[0];

		$page = $this->GetPage($link);
		$cookie = GetCookiesArr($page);
		if (substr($page, 9, 3) == '404') html_error('File Not Found.');
		if (!preg_match('@file/GenerateDownloadLink\?fileId=\d+@i', $page, $ajaxurl)) html_error('FileID Not Found.');
		$ajaxurl = $ajaxurl[0];

		$url = parse_url($link);
		$page = $this->GetPage(sprintf('%s://%s/%s', $url['scheme'], $url['host'], $ajaxurl), $cookie, array('password' => urlencode($lpass)), "$link\r\nX-Requested-With: XMLHttpRequest");
		$cookie = GetCookiesArr($page, $cookie);

		switch (intval(substr($page, 9, 3))) {
			case 200: break;
			case 404: html_error('File Not Found');break;
			case 403: html_error('Wrong File Password, Please add password on the format: link|password');break;
			default: html_error('Error While Requesting Download Link.');
		}

		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/d/[\w\-]+/[^\'\"\t<>\r\n\\\]+@i', $page, $DL)) html_error('Download Link Not Found.');
		$this->RedirectDownload($DL[0], urldecode(basename(parse_url($DL[0], PHP_URL_PATH))), $cookie);
	}
}

// [30-12-2015] Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once ("index.html");
	exit();
}

class plunder_com extends DownloadClass {

    public function Download($link) {

        $page = $this->GetPage($link);
        is_present($page, 'File or directory not found', 'The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.');

        if (preg_match('/Object moved to <a href="(.*)">/', $page, $temp)) {
            $link = 'http://www.plunder.com'.urldecode($temp[1]);
            $page = $this->GetPage($link);
        }
        if (!preg_match('#(http:\/\/tesla\.plunder\.com\/x\/[^"]+)"#', $page, $dl)) {
            html_error("Error : Plugin out of date!!!");
        }

        $dlink = trim($dl[1]);
        $Url = parse_url($dlink);
        $FileName = basename($Url['path']);
        $this->RedirectDownload($dlink, $FileName);
        exit();
    }
}

//Plunder free download plugin by Ruud v.Tony 24/04/2011
//updated 13/07/2011 by Ruud v.Tony
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class prefiles_com extends GenericXFS_DL {
	public $pluginVer = 19;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = false; // Force https on all the site, supersedes $this->sslLogin when true.
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}

	protected function findCountdown() {
		if (preg_match('@Your subsequent download will be started in next (?:(?:\s*|\s*<br\s*/?\s*>\s*)?\d+ \w+,?\s){0,2}\d+ \w+@i', $this->page, $err)) html_error('Error: ' . strip_tags($err[0]));
		if (preg_match('@\.circularCountDown\({\s*duration\s*:\s*{(?:\s*hours\s*:\s*(\d+)?\s*,)(?:\s*minutes\s*:\s*(\d+)\s*,)\s*seconds:\s*(\d+)\s*}@', $this->page, $count)) {
			$count = (!empty($count[1]) ? $count[1] * 3600 : 0) + (!empty($count[2]) ? $count[2] * 60 : 0) + (!empty($count[3]) ? $count[3] : 0);
			if ($count > 0) $this->CountDown($count + 2);
			return true;
		}
		return false;
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class rainy_la extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once ('index.html');
	exit();
}

class rapidgator_net extends DownloadClass {
	private $baseUrl, $link, $cJar, $page, $cookie, $referer, $DLregexp;
	public function Download($link) {
		$this->baseUrl = 'https://rapidgator.net/';

		$link = parse_url($link);
		$link['scheme'] = 'https';
		$link['host'] = 'rapidgator.net';
		$this->link = $GLOBALS['Referer'] = $link = rebuild_url($link);
		$this->cookie = array('lang' => 'en');
		$this->DLregexp = '@https?://(?:pr|(s))\d+\.rapidgator\.net/(?(1)download/)[^\s\"\'<>]+@i';
		if ((empty($_POST['step']) || !in_array($_POST['step'], array('1', '2', 'L'))) && (empty($_GET['rgredir']) || (stripos($_GET['rgredir'], '/auth/login') === false && stripos($_GET['rgredir'], '/site/ChangeLocation/key/') === false))) {
			// Weird RG redirects.
			$rdc = 0;
			$this->page = false; // False value for starting the loop.
			$redir = $this->link;
			$this->referer = !empty($GLOBALS['Referer']) ? $GLOBALS['Referer'] : $this->link;
			while (($redir = $this->ChkRGRedirs($this->page, $redir)) && $rdc < 15) {
				$this->page = cURL($redir, $this->cookie, 0, $this->referer);
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
				$this->referer = $redir;
				$rdc++;
			}

			// I haven't tested those redirects fine so i will check this too.
			if (stripos($redir, 'rapidgator.net/file/') === false) {
				$this->page = cURL($this->link, $this->cookie, 0, $this->referer);
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
			}

			is_present($this->page, '>File not found<', 'File not found.');
		}

		if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($GLOBALS['premium_acc']['rapidgator_net']['user']) && !empty($GLOBALS['premium_acc']['rapidgator_net']['pass'])))) {
			$this->Login();
		} else html_error('Login Failed: User or Password is empty.');
	}

	private function PremiumDL() {
		$page = cURL($this->link, $this->cookie);

		if (preg_match('@You have reached quota of downloaded information for premium accounts. At the moment, the quota is \d+ [GT]B(?: per \d+ day\(s\))?@i', $page, $err)) html_error($err[0]);

		if (!preg_match($this->DLregexp, $page, $dlink)) html_error('Error: Download-link not found.');

		$this->RedirectDownload($dlink[0], 'rapidgatorpr');
	}

	private function Login() {
		if (!empty($_REQUEST['pA_encrypted']) && !empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) {
			$_REQUEST['premium_user'] = decrypt(urldecode($_REQUEST['premium_user']));
			$_REQUEST['premium_pass'] = decrypt(urldecode($_REQUEST['premium_pass']));
			unset($_REQUEST['pA_encrypted']);
		}
		$pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		$user = ($pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['rapidgator_net']['user']);
		$pass = ($pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['rapidgator_net']['pass']);

		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');
		$this->cookie = array('lang' => 'en'); // Account is always showed as free if it comes from a file, as i don't send file's link as referer, lets reset the cookies.

		if (($page = $this->cJar_load($user, $pass))) {
			// Account loaded from Cookie Storage
			is_present($page, '>Free</a>', 'Account isn\'t premium');
			return $this->PremiumDL();
		}

		$post = array();
		$post['LoginForm%5Bemail%5D'] = urlencode($user);
		$post['LoginForm%5Bpassword%5D'] = urlencode($pass);
		$post['LoginForm%5BrememberMe%5D'] = '1';
		if (!empty($_POST['step']) && $_POST['step'] == 'L') {
			$_POST['step'] = false;
			if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
			$post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
		}

		// There are more of those redirects at login
		$rdc = 0;
		$page = false; // False value for starting the loop.
		$redir = $this->baseUrl . 'auth/login';
		$this->referer = !empty($GLOBALS['Referer']) && $GLOBALS['Referer'] != $this->link ? $GLOBALS['Referer'] : $this->baseUrl;
		while (($redir = $this->ChkRGRedirs($page, $redir, '(?:/auth/login|/site/ChangeLocation/key/)')) && $rdc < 15) {
			$page = cURL($redir, $this->cookie, $post, $this->referer);
			$this->cookie = GetCookiesArr($page, $this->cookie);
			$this->referer = $redir;
			$rdc++;
		}

		is_present($page, 'Wrong e-mail or password.', 'Login Failed: Email/Password incorrect.');
		is_present($page, 'E-mail is not a valid email address.', 'Login Failed: Login isn\'t an email address.');
		is_present($page, 'Frequent logins.', 'Too frequent logins, please wait and try again.');
		is_present($page, 'We discovered that you try to access your account from unusual location.', 'Login Failed: Login Blocked By IP, Check Account Email And Follow The Steps To Add IP to Whitelist.');
		if (stripos($page, 'The code from a picture does not coincide') !== false) {
			if (!empty($post['LoginForm%5BverifyCode%5D'])) html_error('Login Failed: Incorrect CAPTCHA response.');
			if (!preg_match('@(https?://(?:[^\./\r\n\'\"\t\:]+\.)?rapidgator\.net(?:\:\d+)?)?/auth/captcha/\w+/\w+@i', $page, $imgurl)) html_error('Error: CAPTCHA not found.');
			$imgurl = (empty($imgurl[1])) ? $this->baseUrl . substr($imgurl[0], 1) : $imgurl[0];
			//Download captcha img.
			$captcha = explode("\r\n\r\n", cURL($imgurl, $this->cookie), 2);
			if (substr($captcha[0], 9, 3) != '200') html_error('Error downloading captcha img.');
			$mimetype = (preg_match('@image/[\w+]+@', $captcha[0], $mimetype) ? $mimetype[0] : 'image/png');

			$data = $this->DefaultParamArr($this->link, CookiesToStr($this->cookie), 1, 1);
			$data['step'] = 'L';
			$data['premium_acc'] = 'on'; // I should add 'premium_acc' to DefaultParamArr()
			if ($pA) {
				$data['pA_encrypted'] = 'true';
				$data['premium_user'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
				$data['premium_pass'] = urlencode(encrypt($pass)); // And this too.
			}
			$this->EnterCaptcha("data:$mimetype;base64,".base64_encode($captcha[1]), $data, 5, 'Login');
			exit;
		}
		//is_present($page, 'The code from a picture does not coincide', 'Login Failed: Captcha... (T8: I will add it later)');

		if (empty($this->cookie['user__'])) html_error("Login Error: Cannot find 'user__' cookie.");
		$this->cookie['lang'] = 'en';
		$this->cJar_save();

		$page = cURL($this->baseUrl, $this->cookie, 0, $this->baseUrl . 'auth/login');
		is_present($page, '>Free</a>', 'Account isn\'t premium.');

		return $this->PremiumDL();
	}

	private function ChkRGRedirs($page, $lasturl, $rgpath = '/') {
		if (!is_array($lasturl)) $lasturl = parse_url($lasturl);
		if ($page === false) return rebuild_url($lasturl);
		$hpos = strpos($page, "\r\n\r\n");
		$headers = empty($hpos) ? $page : substr($page, 0, $hpos);

		if (stripos($headers, "\nLocation: ") === false && stripos($headers, "\nSet-Cookie: ") === false && stripos($headers, '<script') !== false && !(cut_str($page, '<title>', '</title>'))) {
			if (empty($_GET['rgredir'])) {
				if (!($body = cut_str($page, '<body>', '</body>'))) $body = $page;
				if (stripos($body, '<script') !== strripos($body, '<script')) html_error('Unknown error while getting redirect code.');
				$login = ($_REQUEST['premium_acc'] == 'on' && (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])));
				$data = $this->DefaultParamArr($this->link, 0, rebuild_url($lasturl));
				$data['rgredir'] = '';
				$data['premium_acc'] = $_REQUEST['premium_acc']; // I should add 'premium_acc' to DefaultParamArr()
				if ($login) {
					$data['pA_encrypted'] = 'true';
					$data['premium_user'] = urlencode(encrypt($_REQUEST['premium_user'])); // encrypt() will keep this safe.
					$data['premium_pass'] = urlencode(encrypt($_REQUEST['premium_pass'])); // And this too.
				}
				if (!($js = cut_str($body, '<script language="JavaScript">', '</script>')) && !($js = cut_str($body, '<script type="text/javascript">', '</script>'))) html_error('Cannot get the redirect code.');
				$js = str_ireplace(array('window.location.href','document.location.href'), 'document.getElementById("rgredir").value', $js);
				if (strpos($js, 'document.body.onmousemove') !== false) { // New redirect code
					$js = preg_replace('@^[\s\t]*\w+\([^\;]+;@i', '', $js);
					$js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*function[\s\t]*\(\)[\s\t]*\{@i', '', $js);
					$js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*\'\';?\};[\s\t]*window\.setTimeout\([\s\t]*((\"[^\"]+\")|(\'[^\']+\'))[^\;]+;[\s\t\r\n]*$@i', '', $js);
				} elseif (($funcPos = stripos($js, 'function WriteA(')) !== false) { // JS + aaaaaaaaaaaaaaaaaaaaaaaaa
					$links = array();
					if (preg_match_all('@<a\s*[^>]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"[^>]*\sid="([A-Za-z][\w\.\-]*)"@i', $body, $a)) $links = array_merge($links, array_combine($a[2], $a[1]));
					if (preg_match_all('@<a\s*[^>]*\sid="([A-Za-z][\w\.\-]*)"[^>]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"@i', $body, $a)) $links = array_merge($links, array_combine($a[1], $a[2]));
					if (empty($links)) html_error('Cannot get the redirect fields');
					unset($a);

					$jsLinks = '';
					foreach ($links as $key => $link) {
						if (strpos($link, '://') === false) $link = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net' . $link;
						$jsLinks .= "$key: '".addslashes($link)."', ";
					}
					unset($links, $key, $link);
					$jsLinks = '{' . substr($jsLinks, 0, -2) . '}';
					$func = substr($js, $funcPos);
					if (!preg_match('@\.getElementById\(([\$_A-Za-z][\$\w]*)\)@i', $func, $linkVar)) html_error('Cannot edit redirect JS');
					$linkVar = $linkVar[1];
					unset($func);
					$js = substr($js, 0, $funcPos)."\nvar T8RGLinks = $jsLinks;\nif ($linkVar in T8RGLinks) document.getElementById('rgredir').value = T8RGLinks[$linkVar];";
					unset($jsLinks, $funcPos, $linkVar);
				}
				echo "\n<form name='rg_redir' action='{$_SERVER['SCRIPT_NAME']}' method='POST'><br />\n";
				foreach ($data as $name => $input) echo "<input type='hidden' name='$name' id='$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
				echo "</form>\n<span id='T8_emsg' class='htmlerror' style='text-align:center;display:none;'></span>\n<noscript><span class='htmlerror'><b>Sorry, this code needs JavaScript enabled to work.</b></span></noscript>\n<script type='text/javascript'>/* <![CDATA[ Th3-822 */\n\tvar T8 = true;\n\ttry {{$js}\n\t} catch(e) {\n\t\t$('#T8_emsg').html('<b>Cannot decode challenge: ['+e.name+'] '+e.message+'</b>').show();\n\t\tT8 = false;\n\t}\n\tif (T8) window.setTimeout(\"$('form[name=rg_redir]').submit();\", 300); // 300 Âµs to make sure that the value was decoded and added.\n/* ]]> */</script>\n\n</body>\n</html>";
				exit;
			} else {
				$_GET['rgredir'] = rawurldecode($_GET['rgredir']);
				if (strpos($_GET['rgredir'], '://')) $_GET['rgredir'] = parse_url($_GET['rgredir'], PHP_URL_PATH);
				if (empty($_GET['rgredir']) || substr($_GET['rgredir'], 0, 1) != '/') html_error('Invalid redirect value.');
				$redir = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http') . '://rapidgator.net' . $_GET['rgredir'];
				unset($_GET['rgredir']);
			}
		} elseif (preg_match('@Location: ((https?://(?:[^/\r\n]+\.)?rapidgator\.net)?'.$rgpath.'[^\r\n]*)@i', $headers, $redir)) $redir = (empty($redir[2])) ? (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http') . '://rapidgator.net' . $redir[1] : $redir[1];

		return (empty($redir) ? false : $redir);
	}

	private function cJar_encrypt($data, $key) {
		if (empty($data)) return false;
		global $secretkey;
		$_secretkey = $secretkey;
		$secretkey = $key;
		$data = base64_encode(encrypt(json_encode($data)));
		$secretkey = $_secretkey;
		return $data;
	}

	private function cJar_decrypt($data, $key) {
		if (empty($data)) return false;
		global $secretkey;
		$_secretkey = $secretkey;
		$secretkey = $key;
		$data = json_decode(decrypt(base64_decode($data)), true);
		$secretkey = $_secretkey;
		return (!empty($data) ? $data : false);
	}

	private function cJar_load($user, $pass) {
		if (empty($user) || empty($pass)) return html_error('Login Failed: User or Password is empty.');

		$user = strtolower($user);
		$this->cJar['file'] = DOWNLOAD_DIR . get_class($this) . '_dl.php';
		$this->cJar['hash'] = base64_encode(sha1("$user$pass", true));
		$this->cJar['key'] = substr(base64_encode(hash('sha512', "$user$pass", true)), 0, 56);

		if (file_exists($this->cJar['file']) && ($cFile = file($this->cJar['file'])) && is_array($cFile = unserialize($cFile[1])) && array_key_exists($this->cJar['hash'], $cFile) && ($testCookie = $this->cJar_decrypt($cFile[$this->cJar['hash']]['cookie'], $this->cJar['key']))) {
			return $this->cJar_test($testCookie);
		} else return false;
	}

	private function cJar_test($cookie) {
		if (empty($this->cJar) || empty($cookie['user__'])) return false;
		$oldCookie = $this->cookie;
		$this->cookie = array_merge($cookie, array('lang' => 'en'));

		// Weird RG redirects.
		$rdc = 0;
		$page = false; // False value for starting the loop.
		$redir = $this->baseUrl;
		$referer = $this->baseUrl; // Account is always shown as free if referer is from a file. (I'm not sure if this still happens)
		while (($redir = $this->ChkRGRedirs($page, $redir)) && $rdc < 15) {
			$page = cURL($redir, $this->cookie, 0, $referer);
			$this->cookie = GetCookiesArr($page, $this->cookie);
			$referer = $redir;
			$rdc++;
		}

		if (!empty($this->cookie['user__']) && stripos($page, '/auth/logout') !== false)
		{
			$this->cookie['lang'] = 'en';
			$this->cJar_save(); // Update last used time.
			return $page;
		}

		$this->cookie = $oldCookie;
		return false;
	}

	private function cJar_save() {
		if (empty($this->cJar)) return;
		$maxTime = 31 * 86400; // Max time to keep unused cookies saved (31 days)
		if (file_exists($this->cJar['file']) && ($savedcookies = file($this->cJar['file'])) && is_array($savedcookies = unserialize($savedcookies[1]))) {
			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= $maxTime) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$savedcookies[$this->cJar['hash']] = array('time' => time(), 'cookie' => $this->cJar_encrypt($this->cookie, $this->cJar['key']));

		file_put_contents($this->cJar['file'], "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}
}

// [14-8-2012]  Written by Th3-822.
// [26-8-2012]  Fixed regexp on redirect code. -Th3-822
// [04-9-2012]  Added error msg in free dl. -Th3-822
// [09-9-2012]  Fixed redirect issues, more code added & small edits. -Th3-822
// [02-10-2012]  Fixed for new weird redirect code. - Th3-822
// [28-1-2013]  Added Login captcha support. - Th3-822
// [10-8-2013] Fixed redirects (again). - Th3-822
// [25-11-2013] Fixed redirects function (aagain :D ). - Th3-822
// [03-1-2014] Added support for rg.to domain. - Th3-822
// [24-3-2014] Fixed FreeDL. - Th3-822
// [20-5-2014] Fixed Login, bw error msg. - Th3-822
// [16-12-2015][WIP] Fixing Blocks, Redirect Handling & Forcing Plugin To Use cURL. - Th3-822
// [01-8-2016] Fixed FreeDL Captchas. - Th3-822
// [28-8-2017] Switched to HTTPs (Untested) - Th3-822
// [13-10-2019] Added Login Cookie Storage (login is rate-limited) & Removed FreeDL (as it now uses reCAPTCHA 2) - Th3-822
// [17-2-2020] Fixed download regexp. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class rapidrar_com extends GenericXFS_DL {
	public $pluginVer = 22;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder

		$this->Start($link);
	}

	protected function FreeDL($step = 1) {
		// Hacky Trick :P
		if ($step == 1) {
			$this->page = $this->GetPage($this->link, $this->cookie, array('op' => 'download1', 'id' => $this->fid, 'method_free' => 'Free%20Download'));
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
			$step++;
		}
		return parent::FreeDL($step);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class rapidu_net extends DownloadClass {
	private $page, $cookie = array(), $pA, $login, $DLRegexp = '@https?://\w+\d+\.rapiduservers\.net/download/[^\t\r\n\'\"<>]+@i';
	public function Download($link) {
		if (!preg_match('@(https?://rapidu.net/)(\d+)@i', str_ireplace('://www.rapidu.net', '://rapidu.net', $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = str_ireplace('http://', 'https://', $fid[0]);
		$this->baseurl = $fid[1];
		$this->fid = $fid[2];

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link, $this->cookie);
			is_present($this->page, '404 - File not found', 'File Not Found.');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['rapidu_net']['user']) && !empty($GLOBALS['premium_acc']['rapidu_net']['pass']))))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['rapidu_net']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['rapidu_net']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->Login($user, $pass);
		} else return $this->AnonDL();
	}

	private function AnonDL() {
		if (empty($_POST['step']) || $_POST['step'] != '1') {
			$page = $this->GetPage($this->baseurl . 'ajax.php?a=getLoadTimeToDownload', $this->cookie, '_go=', $this->link . "\r\nX-Requested-With: XMLHttpRequest");
			$this->cookie = GetCookiesArr($page, $this->cookie);
			$start_timer = $this->json2array($page, 'getLoadTimeToDownload Error');

			if (!isset($start_timer['timeToDownload']) || !is_numeric($start_timer['timeToDownload'])) {
				if (!empty($start_timer['timeToDownload']) && $start_timer['timeToDownload'] == 'stop') html_error('Your daily transfer limit has been reached');
				textarea($start_timer);
				html_error('Unknown error @ getLoadTimeToDownload');
			}
			$start_timer['timeToDownload'] -= time();

			$js = $this->GetPage($this->baseurl . 'js/global.engine.js', $this->cookie);
			if (!preg_match('@Recaptcha\.create\s*\(\s*\'([\w\.\-]+)\'@i', $js, $recaptcha)) html_error('Captcha Not Found.');

			if (!empty($start_timer['timeToDownload']) && $start_timer['timeToDownload'] > 0) {
				if ($start_timer['timeToDownload'] > 100) {
					return $this->JSCountdown($start_timer['timeToDownload'], $this->DefaultParamArr($this->link), 'AnonDL limit reached.');
				} else $this->CountDown($start_timer['timeToDownload']);
			}

			$data = $this->DefaultParamArr($this->link, $this->cookie, 1, true);
			$data['step'] = '1';
			return $this->reCAPTCHA($recaptcha[1], $data);
		} else {
			if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
			if (empty($_POST['recaptcha_challenge_field'])) html_error('Empty reCAPTCHA challenge.');
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

			$post = array();
			$post['captcha1'] = $_POST['recaptcha_challenge_field'];
			$post['captcha2'] = $_POST['recaptcha_response_field'];
			$post['fileId'] = $this->fid;
			$post['_go'] = '';

			$page = $this->GetPage($this->baseurl . 'ajax.php?a=getCheckCaptcha', $this->cookie, array_map('urlencode', $post));
			$chkCaptcha = $this->json2array($page, 'getCheckCaptcha Error');

			if (empty($chkCaptcha['message']) || $chkCaptcha['message'] != 'success') html_error('Wrong captcha entered.');
			if (empty($chkCaptcha['url'])) html_error('Download Link Not Found.');

			return $this->RedirectDownload($chkCaptcha['url'], urldecode(parse_url($chkCaptcha['url'], PHP_URL_PATH)));
		}
	}

	private function ApiDL() {
		$DL = $this->ApiReq('getFileDownload', array('id' => $this->fid));
		if (!empty($DL['message'])) {
			if (!empty($DL['message']['errorDateNextDownload'])) {
				$data = $this->DefaultParamArr($this->link);
				$data['premium_acc'] = 'on';
				if ($this->pA) {
					$data['pA_encrypted'] = 'true';
					$data['premium_user'] = urlencode($_REQUEST['premium_user']); // encrypt() will keep this safe.
					$data['premium_pass'] = urlencode($_REQUEST['premium_pass']); // And this too.
				}
				$waitTime = strtotime($DL['message']['errorDateNextDownload'] . ' UTC') - time();
				return $this->JSCountdown($waitTime, $data, 'FreeDL limit reached.');
			} else if ($DL['message']['error'] == 'errorAccountNotHaveDayTransfer') html_error('Your daily transfer limit has been reached.');
			else html_error('[ApiDL Error] ' . htmlspecialchars($DL['message']['error'], ENT_QUOTES));
		}

		if (empty($DL['fileLocation'])) html_error('Download-Link Not Found.');
		return $this->RedirectDownload($DL['fileLocation'], urldecode(parse_url($DL['fileLocation'], PHP_URL_PATH)));
	}

	private function Login($user, $pass) {
		$this->login = array('login' => $user, 'password' => $pass);
		$reply = $this->ApiReq('getAccountDetails');

		if (!empty($reply['message'])) html_error('[Login Error] ' . htmlspecialchars($reply['message']['error'], ENT_QUOTES));
		if (empty($reply['userPremium'])) $this->changeMesg('<br /><b>Account isn\'t premium</b>', true);

		return $this->ApiDL();
	}

	private function ApiReq($path, $post = array()) {
		if (!is_array($post)) $post = array();
		if ($path != 'getFileDetails') $post = array_merge($this->login, $post);

		$page = $this->GetPage("https://rapidu.net/api/$path/", 0, array_map('urlencode', $post), 'https://rapidu.net/');
		return $this->json2array($page, "ApiReq($path) Error");
	}
}

//[21-2-2016]  Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class rioupload_com extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class rodfile_com extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class samsung_firmware_org extends DownloadClass {
	public function Download($link) {textarea($link);
		if (!preg_match('@(https://samsung-firmware\.org/)(?:\w+/)?(download/[\w\-\%() ]+/[\w\-\.]+/\w{3}/(?:\w+/){1,2})@i', $link, $_link)) html_error('Invalid Link?.');
		$link = $GLOBALS['Referer'] = $_link[1] . $_link[2];

		$pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['premium_acc'] == 'on' && ($pA || (!empty($GLOBALS['premium_acc']['samsung_firmware_org']['user']) && !empty($GLOBALS['premium_acc']['samsung_firmware_org']['pass']))))) {
			$user = ($pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['samsung_firmware_org']['user']);
			$pass = ($pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['samsung_firmware_org']['pass']);
		} else return html_error('This Site Requires Login to Download');

		$cookie = array('hl' => 'en');
		$purl = 'https://samsung-firmware.org/login';
		$page = $this->GetPage($purl, $cookie);
		if (!($csrf = trim(cut_str($page, 'name="_csrf_token" value="', '"')))) html_error('Login CSRF Token Not Found');
		$loginCookie = GetCookiesArr($page, $cookie);

		$post = array();
		$post['_csrf_token'] = html_entity_decode($csrf);
		$post['_username'] = $user;
		$post['_password'] = $pass;
		$post['_submit'] = 'Login';

		$page = $this->GetPage('https://samsung-firmware.org/login_check', $loginCookie, array_map('urlencode', $post), $purl);
		is_present($page, $purl, 'Invalid Login?');
		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['PHPSESSID'])) html_error('Login Cookie Not Found');

		$page = $this->GetPage($link, $cookie);

		if (!preg_match('@https://dl\.samsung-firmware\.org/\w+/\w+/[^\r\n\t\"\'<>]+@i', $page, $DL)) html_error('Download Link Not Found');

		$this->RedirectDownload($DL[0]);
	}
}

//[30-12-2016] Written by Th3-822.
//[01-4-2017] Updated Link Regexp. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class sendmyway_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$link = str_ireplace('https://', 'http://', $link); // Remove https from links.

		$this->Start($link);
	}

	// This is for fix bad edits on host-side
	protected function FreeDL($step = 1) {
		if ($step == 3 && empty($_POST['step'])) $step = 2;
		return parent::FreeDL($step);
	}
}

// Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once("index.html");
	exit;
}

class sendspace_com extends DownloadClass {
	private $page, $cookie;
	public function Download($link) {
		global $premium_acc;
		$this->link = str_ireplace(array('https://', '://sendspace.com'), array('http://', '://www.sendspace.com'), $link);
		$this->pA = (empty($_GET['premium_user']) || empty($_GET['premium_pass']) ? false : true);
		if ($_GET['premium_acc'] == 'on' && ($this->pA || (!empty($premium_acc['sendspace_com']['user']) && !empty($premium_acc['sendspace_com']['pass'])))) $this->Login();
		else $this->Free();
	}

	private function Free() {
		$this->page = $this->GetPage($this->link);
		$this->cookie = GetCookiesArr($this->page);

		if (preg_match('@\nLocation: ((https?://www\.sendspace\.com)?/[^\r\n\"\'\t<>]+)@i', $this->page, $check)) {
			$check[1] = (empty($check[2])) ? 'http://www.sendspace.com'.$check[1] : $check[1];
			$this->page = $this->GetPage($check[1], $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}
		$this->chkCaptcha();

		is_present($this->page, 'Sorry, the file you requested is not available.');

		if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*sendspace\.com/dl/[^\r\n\"\'\t<>]+@i', $this->page, $dl)) html_error('Download Link Not Found.');

		$this->RedirectDownload($dl[0], basename(parse_url($dl[0], PHP_URL_PATH)), $this->cookie);
	}

	private function Premium() {
		$this->page = $this->GetPage($this->link, $this->cookie);
		if (preg_match('@\nLocation: ((https?://www\.sendspace\.com)?/[^\r\n\"\'\t<>]+)@i', $this->page, $check)) {
			$check[1] = (empty($check[2])) ? 'http://www.sendspace.com'.$check[1] : $check[1];
			$this->page = $this->GetPage($check[1], $this->cookie);
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}
		$this->chkCaptcha();
		is_present($this->page, 'Sorry, the file you requested is not available.');

		if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*sendspace\.com/dlp/[^\r\n\"\'\t<>]+@i', $this->page, $dl)) html_error('Download-Link Not Found.');

		$this->RedirectDownload($dl[0], basename(parse_url($dl[0], PHP_URL_PATH)), $this->cookie);
	}

	private function Login() {
		global $premium_acc;
		$site = 'https://www.sendspace.com';
		$post = array();
		$post['action'] = 'login';
		$post['submit'] = 'login';
		$post['target'] = '%252F';
		$post['action_type'] = 'login';
		$post['remember'] = '1';
		$post['username'] = urlencode($this->pA ? $_GET['premium_user'] : $premium_acc['sendspace_com']['user']);
		$post['password'] = urlencode($this->pA ? $_GET['premium_pass'] : $premium_acc['sendspace_com']['pass']);
		$post['remember'] = 'on';
		$page = $this->GetPage("$site/login.html", 0, $post, "$site/");

		is_present($page, 'check your username and password', 'Login Failed: Invalid User/Password.');
		$this->cookie = GetCookiesArr($page);
		if (empty($this->cookie['ssal'])) html_error('Login Error: Cannot find "ssal" cookie.');

		$page = $this->GetPage("$site/mysendspace/myindex.html", $this->cookie, 0, "$site/");
		is_present($page, '<b>Sendspace Free</b>', 'Login Failed: Account Isn\'t Premium.');

		$this->Premium();
	}

	private function chkCaptcha() {
		if (stripos($this->page, 'Please complete the form below:') === false) return;
		if (!empty($_POST['step']) && $_POST['step'] == '1') {
			if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
			$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
			$post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']);
			$this->page = $this->GetPage($this->link, $this->cookie, $post);
			if (stripos($this->page, 'You entered an invalid captcha') !== false) {
				echo "\n<span class='htmlerror'><b>You entered an invalid captcha, please try again.</b></span><br />";
				unset($_POST['step']);
				$this->chkCaptcha();
			}
		} else {
			if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)*(?:google\.com/recaptcha/api|recaptcha\.net)/(?:challenge|noscript)\?k=([\w\.\-]+)@i', $this->page, $cpid)) html_error('reCaptcha Not Found.');
			$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
			$data['step'] = '1';
			$this->reCAPTCHA($cpid[1], $data);
			exit;
		}
	}
}

// Use PREMIUM? [szalinski 09-May-09]
// fix free download by kaox 19-dec-2009
// Fix premium & free by Ruud v.Tony 03-Okt-2011
// [16-6-2013] Rewritten & Added captcha support. - Th3-822
// [09-1-2016] Fixed premium acc check. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
    require_once ("index.html");
    exit();
}

class share_online_biz extends DownloadClass {
  
    public function Download($link) {
        global $premium_acc;
        if (($_REQUEST ["premium_acc"] == "on" && $_REQUEST ["premium_user"] && $_REQUEST ["premium_pass"]) || ($_REQUEST ["premium_acc"] == "on" && $premium_acc ["share-online_biz"] ["user"] && $premium_acc ["share-online_biz"] ["pass"])) {
            $this->DownloadPremium($link);
        } else if ($_POST["step"] == "1") {
            $this->DownloadLink($link);
        } else if ($_POST["step"] =="captcha"){
            $this->DownloadFree($link);
        }else{
            $this->Retrieve($link);
        }
    }

    private function DownloadLink($link) {
        $Cookies = decrypt(urldecode($_POST['cookie']));
        $Referer = $_POST['referer'];
        $FileName = $_POST['filename'];
        $this->RedirectDownload(trim($link), $FileName, $Cookies, 0, $Referer);
        exit;
    }

    private function Retrieve($link) {
        $page = $this->GetPage($link);
        if (preg_match("#Location: (.+)#", $page, $temp)) {
            $link = "http://www.share-online.biz" . $temp[1];
            $page = $this->GetPage($link);
        }
        $Cookies = GetCookies($page);
        $post = array();
        $post['dl_free'] = "1";
        $post['choice'] = "free";
        $page = $this->GetPage(trim($link) . "/free/", $Cookies, $post, $link);
        //$nfo = getinfo(cut_str($page, 'var nfo="', '"'));

        is_present($page, "failure/full/", "No free slots for free users");
        if (!preg_match("#var wait=(\d+)#", $page, $count)) {
            html_error("Error 0x01: Plugin is out of date");
        }
        $dl = cut_str($page, 'dl="', '"');
        insert_timer($count[1]);
        $data = array();
        $data['dl']=$dl;
        $data['captchaid'] = str_replace("chk||", "", base64_decode($dl));        
        $data['Cookies'] = $Cookies;
        $data['checkcaptchaurl']=  str_replace("///","/free/captcha/", cut_str($page, ";var url='", "'"));
        $data['step']='captcha'; //overwrite step=1
        $this->Recaptcha($link, "6LdatrsSAAAAAHZrB70txiV5p-8Iv8BtVxlTtjKX", "share-online", $data);
        exit;
    }

    private function DownloadFree($link) {
        $post = array();
        $post['dl_free'] = "1";
        $post['captcha'] = $_POST['captchaid'];
        $post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
        $post['recaptcha_response_field'] = $_POST['captcha'];
        //$dl=$_POST['dl'];
        $Cookies=$_POST['Cookies'];
        $page=$this->GetPage($_POST['checkcaptchaurl'], $Cookies, $post, $referer);        
        preg_match("#[\r\n](\w{5,})[\r\n]#",$page,$tmp);        
        if ($tmp[1]=="0") html_error("Wrong captcha");        
        $dl=  base64_decode($tmp[1]);        
        insert_timer(30);
        $this->RedirectDownload($dl, "share-online", $Cookies,0,$link);
        exit;
    }

    private function DownloadPremium($link) {
        global $premium_acc;
        preg_match('#([A-Z0-9]+)#', $link, $link_id);
        $username = $_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc["share-online_biz"]["user"];
        $password = $_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc["share-online_biz"]["pass"];
        $url = 'http://api.share-online.biz/account.php?username=' . $username . '&password=' . $password . '&act=userDetails';
        $page = $this->GetPage($url, 0, 0, 0);
        is_present($page, "EXCEPTION input data invalid", "Check your login details!");
        preg_match('#(a=.+)#', $page, $details);
        $url = 'http://api.share-online.biz/account.php?username=' . $username . '&password=' . $password . '&act=download&lid=' . $link_id[1] . '';
        $page = $this->GetPage($url, $details[1], 0, $url);
        preg_match('#URL: (.+)#', $page, $newurl);
        $this->RedirectDownload(trim($newurl[1]), "share-online", $details[1], 0, $link);
        exit;        
    }
    
    private function getinfo($a) {
        $a = explode("a|b", implode("", array_reverse(preg_split("##", $a))));
        $a[1] = str_split($a[1], 3);
        $a[0] = preg_split("##", $a[0], -1, PREG_SPLIT_NO_EMPTY);
        $b = array();
        foreach ($a[1] as $key => $value) {
            $b[hexdec(strtoupper($value))] = $key;
        }
        ksort($b);
        $a[1] = "";
        foreach ($b as $key => $value) {
            if (isset($a[0][$value]))
                $a[1].=$a[0][$value];
            else
                $a[1].=" ";
        }
        return $a[1];
    }
}
<?php
if (!defined('RAPIDLEECH')) {
	require_once("index.html");
	exit;
}

class shareflare_net extends DownloadClass {

	public function Download($link) {
		global $premium_acc;

		if (!$_REQUEST['step']) {
			$this->cookie['lang'] = 'en';
			$this->page = $this->GetPage($link, $this->cookie);
			if (preg_match('/Location: (https?:\/\/[^\r\n]+)/i', $this->page, $rd)) {
				$link = trim($rd[1]);
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
				$this->page = $this->GetPage($link, $this->cookie);
			}
			is_present($this->page, 'File not found');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}
		$this->link = $link;
		if ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_pass']) || ($premium_acc['shareflare_net']['pass']))) {
			html_error('Not supported now!');
		} else {
			$this->Free();
		}
	}

	private function Free() {

		if ($_REQUEST['step'] == '1') {
			$post = array();
			$post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
			$post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
			$post['recaptcha_control_field'] = rawurlencode(rawurldecode($_POST['recaptcha_control_field']));
			$this->link = urldecode($_POST['link']);
			$this->cookie = urldecode($_POST['cookie']);
			$page = $this->GetPage($this->link, $this->cookie, $post, $this->link, 0, 1);
		} else {
			if (!preg_match('/https?:\/\/([^\/]+)\/download\/[^\r\n]+/', $this->link, $sv)) html_error('Error[Shareflare server not found!]');
			$server = trim($sv[1]);
			if (!preg_match('/<form action="(.*)" method="post" id="dvifree">/i', $this->page, $rl)) html_error('Error[Shareflare free link not found!]');
			$form = cut_str($this->page, "<form action=\"$rl[1]\"", "</form>");
			$post = $this->AutomatePost($form);
			$this->link = 'http://' . $server . $rl[1];
			$page = $this->GetPage($this->link, $this->cookie, $post, $this->link);
			$this->cookie = GetCookiesArr($page, $this->cookie);
			unset($post);
			if (!preg_match('/<form action="(.*)" method="post" id="dvifree">/i', $page, $rl)) html_error('Error: Redirect link 1 can\'t be found!');
			$this->link = trim($rl[1]);
			$form = cut_str($page, "<form action=\"$rl[1]\"", "</form>");
			$post = $this->AutomatePost($form);
			$post['frameset'] = cut_str($form, '<input class="clink lid-download" name="frameset" type="submit" value=\'', '\'/>');
			$page = $this->GetPage($this->link, $this->cookie, $post, $this->link);
			if (!preg_match('/(\d+)<\/span> seconds/', $page, $wait)) html_error('Error[Timer not found!]');
			$this->CountDown($wait[1]);
			$checklink = 'http://shareflare.net' . cut_str($page, "ajax_check_url = '", "'");
			$this->GetPage($checklink, $this->cookie, array(), $this->link, 0, 1); //empty array in post variable needed...

			if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $pid)) html_error('reCAPTCHA not found.');
			if (!preg_match('@var[\s\t]+recaptcha_control_field[\s\t]*=[\s\t]*\'([^\'\;]+)\'@i', $page, $ctrl)) html_error('Captcha control field not found.');

			$data = $this->DefaultParamArr("http://shareflare.net/ajax/check_recaptcha.php", $this->cookie);
			$data['step'] = '1';
			$data['recaptcha_control_field'] = rawurlencode($ctrl[1]);
			$this->reCAPTCHA($pid[1], $data);
			exit;
		}
		is_present($page, 'error_wrong_captcha', 'Error: Wrong Captcha Entered.');
		is_present($page, 'error_free_download_blocked', 'Error: FreeDL limit reached.');
		if (!preg_match('/https?:\/\/[\w.]+\/d\/[^\r\n]+/', $page, $dl)) html_error('Error[Download Link - FREE not found!]');
		$dlink = trim($dl[0]);
		$filename = basename(parse_url($dlink, PHP_URL_PATH));
		$this->RedirectDownload($dlink, $filename, $this->cookie, 0, $this->link);
		exit;
	}

	private function AutomatePost($form) {
		if (!preg_match_all('/<input type="hidden" name="([^"]+)" value="([^"]+)?" \/>/i', $form, $match)) html_error("Error: Post Data not found!");
		$post = array();
		$match = array_combine($match[1], $match[2]);
		foreach ($match as $k => $v)
			$post[$k] = $v;
		return $post;
	}

}

//shareflare.net free download plugin by Ruud v.Tony 14-10-2011
//fixed by Tony Fauzi Wihana/Ruud v.Tony 11-01-2013, some recaptcha code taken in letitbit plugin code by Th3-822
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class sharemods_com extends GenericXFS_DL {
	public $pluginVer = 14;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.
		$this->Start($link);

	}
}

//[2016-07-30] dumpweed
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class shrvid_com extends GenericXFS_DL {
	public $pluginVer = 18;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = false; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = true; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom Download Regexp
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w{60}/[^\t\r\n<>\'\"\?\&]+@i';

		$this->Start($link);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}


class solidfiles_com extends DownloadClass {

	public function Download($link) {
		
		echo 'Solidfiles.com Download Plugin by <b>The Devil</b>';
		$this->page = $this->GetPage($link);
		is_present($this->page,'The page you were looking for appears to no longer be there','File Unavailable');
		$devil = preg_match('~"downloadUrl":"(.*)"~U',$this->page,$dlocs);
		(!$devil)?html_error('[0]Error: Unable to Find Download Location'):'';
		is_notpresent($dlocs[1],'solidfilesusercontent.com','[1]Error: Check FileHost CDN');
		return $this->RedirectDownload($dlocs[1], urldecode(basename(parse_url($dlocs[1], PHP_URL_PATH))));
	}
	
}

// Written by The Devil
// [2016-06-09] Code Clean Up
// [2017-04-16] Fixed Download Regex

?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit;
}

class sourceforge_net extends DownloadClass {

    public function Download($link) {
        $page = $this->GetPage($link);
        $cookie = GetCookies($page);
        if (!preg_match('%<a href="(.*)" class="direct-download">%', $page, $tmp)) html_error('Can\'t find sourceforge redirect link!');
        $temp = html_entity_decode(urldecode(trim($tmp[1])), ENT_QUOTES, 'UTF-8');
        $t1 = cut_str($temp, 'http://downloads.', '?r');
        $t2 = cut_str($temp, 'use_mirror=', '\n');
        $dlink = "http://$t2.dl.$t1";
        $filename = parse_url($dlink);
        $FileName = basename($filename['path']);
        $this->RedirectDownload($dlink, $FileName, $cookie, 0, $link);
    }
}

/*
 * rewritten into OOP format by Ruud v.Tony 27-09-2011
 */
?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once ("index.html");
    exit();
}

class speedyshare_com extends DownloadClass {

    public function Download($link) {
        global $premium_acc;
        
        if (!$_REQUEST['step']) {
            $this->page = $this->GetPage($link);
            if (preg_match('@Location: (http:\/\/speedy.sh\/[^\r\n]+)@i', $this->page, $redir)) {
                $link = trim($redir[1]);
                $this->page = $this->GetPage($link);
            }
            is_present($this->page, 'File not found. It has been deleted or it never existed at all.');
            $this->cookie = GetCookiesArr($this->page);
        }
        if ($_REQUEST['premium_acc'] == 'on' && (($_REQUEST['premium_user'] && $_REQUEST['premium_pass'])||($premium_acc['speedyshare_com']['user'] && $premium_acc['speedyshare_com']['pass']))) {
            return $this->Premium($link);
        } else {
            return $this->Free($link);
        }
    }
    
    private function Free($link) {
        is_present($this->page, 'Private file ACCESS DISABLED');
        is_present($this->page, 'This file is not available for public download.');
        if (!preg_match("%<a class=downloadfilename href='([^']+)'>%", $this->page, $rd)) html_error('Error [Redirect Link FREE not found!]');
        $rlink = 'http://speedy.sh'.$rd[1];
        $page = $this->GetPage($rlink, $this->cookie, 0, $link);
        if (!preg_match('/Location: (http:\/\/[^\r\n]+)/i', $page, $dl)) html_error('Error [Download Link FREE not found!]');
        $dlink = trim($dl[1]);
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $this->cookie, 0, $link);
        exit();
    }
    
    private function Premium($link) {
        
        $cookie = $this->login();
        $page = $this->GetPage($link, $cookie);
        is_present($page, 'File not found. It has been deleted or it never existed at all.');
        if (!stripos($page, 'Location:')) {
            if (!preg_match("%<a class=downloadfilename href='([^']+)'>%", $this->page, $rd)) html_error('Error [Redirect Link PREMIUM not found!]');
            $rlink = 'http://speedy.sh'.$rd[1];
            $page = $this->GetPage($rlink, $cookie);
        }
        $dlink = trim(cut_str($page, "ocation: ", "\r\n"));
        if (empty($dlink)) html_error('Error [Download Link PREMIUM not found!]');
        $filename = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $filename, $cookie);
    }
    
    private function login() {
        global $premium_acc;
        
        $user = ($_REQUEST["premium_user"] ? trim($_REQUEST["premium_user"]) : $premium_acc ["speedyshare_com"] ["user"]);
        $pass = ($_REQUEST["premium_pass"] ? trim($_REQUEST["premium_pass"]) : $premium_acc ["speedyshare_com"] ["pass"]);
        if (empty($user) || empty($pass)) html_error("Login failed, $user [user] or $pass [password] is empty!");
        
        $post['redir'] = urlencode(cut_str($link, "http://speedy.sh", "\r\n"));
        $post['login'] = $user;
        $post['pass'] = $pass;
        $post['remember'] = 'on';
        $page = $this->GetPage('https://www.speedyshare.com/login.php', $this->cookie, $post, $link);
        is_present($page, 'Error occured', 'Invalid username or password!');
        $cookie = GetCookiesArr($page, $this->cookie);
        if (!$cookie['spl']) html_error('Error [Invalid account]');
        
        return $cookie;
    }

}

// Created by rajmalhotra on 20 Jan 2010
// rebuild by Ruud v.Tony 15-02-2012
// small fix in redirect link, now it pointed to speedy.sh, not speedyshare no more
?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit;
}

class stagevu_com extends DownloadClass {
    
    public function Download($link) {
        $page = $this->GetPage($link);
        is_present($page, 'Error: No video with the provided information exists');
        is_present($page, 'Restricted Content', 'Error: This video has been categorized as \'mature\' therefore can\'t be downloaded without an account!');
        if (!preg_match('@http:\/\/n\d+\.stagevu.com\/v\/[^\']+@i', $page, $dl)) html_error('Error: Download link not found!');
        $dlink = trim($dl[0]);
        $FileName = basename(parse_url($dlink, PHP_URL_PATH));
        $this->RedirectDownload($dlink, $FileName);
    }
}

/* stagevu download plug-in written by mrbrownee70 07/05/09
 * fixed by Ruud v.Tony 20-12-2011
 */
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class streamin_to extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom Download Regexp
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w{60}/[^\t\r\n<>\'\"\?\&]+@i';

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class subyshare_com extends GenericXFS_DL {
	public $pluginVer = 20;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = false; // Force https on all the site, supersedes $this->sslLogin when true.
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}

	// Edited to add login captcha decoder.
	protected function sendLogin($post) {
		$purl = (!empty($this->sslLogin) ? 'https://'.$this->host.'/' : $this->purl) . '?op=login';
		$page = $this->GetPage($purl, $this->cookie);
		if (!($form = cut_str($page, '<form', '</form>'))) html_error('Cannot find login form.');
		if (($post['rand'] = cut_str($page, 'name="rand" value="', '"')) === false) html_error('Login form "rand" not found.');
	
		if (substr_count($form, "<span style='position:absolute;padding-left:") > 3 && preg_match_all("@<span style='[^\'>]*padding-left\s*:\s*(\d+)[^\'>]*'[^>]*>((?:&#\w+;)|(?:\d))</span>@i", $form, $txtCaptcha)) {
			// Text Captcha (decodeable)
			$txtCaptcha = array_combine($txtCaptcha[1], $txtCaptcha[2]);
			ksort($txtCaptcha, SORT_NUMERIC);
			$txtCaptcha = trim(html_entity_decode(implode($txtCaptcha), ENT_QUOTES, 'UTF-8'));
			$post['code'] = $txtCaptcha;
		} else {
			// This captcha seems to be optional, so i will remove the error msg.
			// html_error('Login captcha not found.');
		}

		// Don't remove this sleep or you may get "Error Decoding Captcha. [Login]"
		sleep(3); // 2 or 3 seconds.
		return parent::sendLogin($post);
	}

	// Added login captcha error msg.
	protected function checkLogin($page) {
		is_present($page, '>Wrong captcha code<', 'Error: Error Decoding Captcha. [Login]');
		return parent::checkLogin($page);
	}
}

// Written by Th3-822.
<?php
if (!defined('RAPIDLEECH')) {
    require_once("index.html");
    exit;
}

class supershare_pl extends DownloadClass {
    
    public function Download($link) {
        $page = $this->GetPage($link);
        is_present($page, 'DL_FileNotFound', 'File not found!');
        $cookie = GetCookies($page);
        if (preg_match('/var odl = (\d+);/', $page, $w)) $this->CountDown ($w[1]);
        if (!preg_match("@var downloadlink = '([^\r\n']+)'@", $page, $dl)) html_error('Error [Download Link not found!]');
        $filename = urldecode(cut_str($dl[1], "name=", "\r\n"));
        $this->RedirectDownload($dl[1], $filename, $cookie, 0, $link);
        exit();
    }
}
/****************************************************\
  WRITTEN BY KAOX 07-oct-09
  CONVERTED INTO OOP FORMAT BY Ruud v.Tony 14-02-2012
\****************************************************/
?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class thevideo_me extends GenericXFS_DL {
	public $pluginVer = 20;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfsts'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder

		// Custom Download Regexp
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/(?:files|dl?|cgi-bin/dl\.cgi|[\da-zA-Z]{30,})/(?:[^\?\'\"\t<>\r\n\\\]{15,}|v(?:id(?:eo)?)?\.(?:flv|mp4))@i';

		$this->Start($link);
	}

	protected function checkLogin($page) {
		$return = parent::checkLogin($page);
		$cookie = GetCookiesArr($page);
		if (!empty($cookie['msg'])) {
			$err = htmlspecialchars(trim(rawurldecode($cookie['msg'])));
			is_present($err, 'Captcha is required', 'Login Is Asking For Captcha, Login with Cookie Instead');
			return html_error('Login Error: ' . $err);
		}
		return $return;
	}

	// I'm playing 'The Game' :P
	protected function testDL() {
		if (!empty($this->enableDecoders)) $this->runDecoders();

		if (preg_match_all($this->DLregexp, $this->page, $DL)) {
			$DL = array_reverse($DL[0]);

			if (!preg_match('@var\s+[\$_A-Za-z][\$\w]*\s*=\s*(\'|\")([\d\w+/=]{13,})\1@i', $this->page, $token)) html_error('[Error] Stream Token Not Found');
			$token = $token[2];

			$page = $this->GetPage($this->purl . 'vs'.'ig'.'n/pl'.'ayer/' . $token);
			if (!preg_match_all('@eval\s*\(\s*function\s*\(p,a,c,k,e,r\)\s*\{.+\}\s*\(\s*\'([^\r|\n]*)\'\s*,\s*\[\]\s*,\s*(\d+)\s*,\s*\'([^\']+)\'\.split\([\'|\"](.)[\'|\"]\)(?:\s*,\s*0\s*,\s*\{\})?\)\)@', $page, $js)) html_error('[Error] Encoded Stream Token Not Found');
			$cnt = count($js[0]);
			for ($i = 0; $i < $cnt; $i++) {
				$page = str_replace($js[0][$i], $this->XFSUnpacker($js[1][$i], 36, $js[2][$i], $js[3][$i], $js[4][$i]), $page);
			}
			if (!preg_match('@[\da-z]{50,}@', $page, $decToken)) html_error('[Error] Decoded Stream Token Not Found');

			$this->RedirectDownload($DL[0] . '?down'.'load=true&v'.'t=' . $decToken[0], basename($this->getFileName($DL[0])));
			return true;
		}
		return false;
	}

	protected function getVideoTitle() {
		if (preg_match('@<h2 class="page-header text-overflow">\s*([^"<>]+)\s*</h2>@i', $this->page, $title)) {
			return html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8');
		}
		return false;
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class thevideos_tv extends GenericXFS_DL {
	public $pluginVer = 14;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom download regexp to match last url from format list.
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w{60}/(?:v(?:id(?:eo)?)?|\w{12})?\.(?:flv|mp4)(?="\s*,[^{}]+}\s*])@i';

		$this->Start($link);
	}

	// Extra CountDown Time
	public function CountDown($countDown) {
		return parent::CountDown($countDown + 7);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class trainbit_com extends DownloadClass {
	private $page, $DLRegexp = '@https?://tb\d+\.trainbit\.com(?::\d+)?/files/\d+/\w+/[^\t\r\n\'\"<>]*@i';
	public function Download($link) {
		if (!preg_match('@https?://trainbit\.com/files/(\d+)@i', str_ireplace('://www.', '://', $link), $fid)) html_error('Invalid link?.');
		$this->link = $GLOBALS['Referer'] = $fid[0] . '/';
		$this->fid = $fid[1];

		$this->page = $this->GetPage($this->link);
		is_present($this->page, 'Desired file is removed.', 'File Not Found.');

		return $this->FreeDL();
	}

	private function FreeDL() {
		$post = array();
		$post['__VIEWSTATE'] = urlencode(cut_str($this->page, '="__VIEWSTATE" value="', '"')) or html_error('__VIEWSTATE Token Not Found.');
		$post['__VIEWSTATEGENERATOR'] = urlencode(cut_str($this->page, '="__VIEWSTATEGENERATOR" value="', '"')) or html_error('__VIEWSTATEGENERATOR Token Not Found.');
		$post['__EVENTVALIDATION'] = urlencode(cut_str($this->page, '="__EVENTVALIDATION" value="', '"')) or html_error('__EVENTVALIDATION Token Not Found.');
		$post['btnDownload'] = 'Get%20Link';

		/* Longer Regex: '@<div\s+id="indicator">(?>.*?<h5[^>]+?>)\s*(\d+)\s*</h5>(?>.*?</div>)@si' */
		if (!preg_match('@<h5(?:\s[^>]+)?>\s*(\d+)\s*</h5>@i', $this->page, $count)) html_error('Countdown Not Found.');
		if ($count[1] > 0) $this->CountDown($count[1] + 2);

		$page = $this->GetPage($this->link, 0, $post);

		if (!preg_match($this->DLRegexp, $page, $DL)) {
			textarea($this->page);
			textarea($page);
			html_error('Download-Link Not Found.');
		}
		return $this->RedirectDownload($DL[0], 'trainbit_placeholder_name');
	}
}

// [14-5-2016] Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH')) {
    require_once ('index.html');
    exit();
}

class transferbigfiles_com extends DownloadClass {

    public function Download($link) {
        $page = $this->GetPage($link);
        is_present($page, "This transfer has expired and the files are no longer available for download.");
        if (preg_match('@Location: (http(s)?:\/\/[^\r\n]+)@i', $page, $dl)) { //this is link that we have submit from autodownload
            $dlink = trim($dl[1]);
            $FileName = urldecode(cut_str($dlink, 'fn=', '\r\n'));
            $this->RedirectDownload($dlink, $FileName, 0, 0, $link);
        } else {
            if (!preg_match_all('@"DownloadUrl":"([^"]+)",@', $page, $temp)) html_error("Error [Redirect Link not found!]");
            $redir = array();
            foreach ($temp[1] as $k) {
                $redir[] = 'https://www.transferbigfiles.com' . $k;
            }
            if (count($redir) > 1) {
                $this->moveToAutoDownloader($redir);
                exit();
            } else {
                $page = $this->GetPage($redir[0], 0, 0, $link);
                if (!preg_match('@Location: (http(s)?:\/\/[^\r\n]+)@i', $page, $dl)) html_error('Error [Download Link not found!]');
                $dlink = trim($dl[1]);
                $FileName = urldecode(cut_str($dlink, 'fn=', '\r\n'));
                $this->RedirectDownload($dlink, $FileName, 0, 0, $link);
                exit();
            }
        }
    }
}

/*
 * written by Ruud v.Tony 15/02/2012
 */
?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class tune_pk extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@://(?:[^/]+\.)?tune\.pk/video/(\d+)@i', $link, $vid)) html_error('Video ID not found. Check url.');
		$page = $this->GetPage('http://tune.pk/video/'.$vid[1].'/');
		is_present($page, 'Video does not exist');
		is_present($page, '404 Page not found');

		if (!preg_match('@var \s*video_title\s*=\s*\'([^\']+)\';@i', $page, $title)) html_error('Video title not found.');
		$title = str_replace(str_split('<>:"/\\|?*\'@#+~{}[]^'), '_', html_entity_decode(trim($title[1]), ENT_QUOTES));

		if (stripos($page, 'watch_video_hd_button') !== false && preg_match('@var \s*hq_video_file\s*=\s*\'(http://[^\']+)\'@i', $page, $dl)) $title .= '_HQ';
		elseif (!preg_match('@var \s*normal_video_file\s*=\s*\'(http://[^\']+)\'@i', $page, $dl)) html_error('Download link not found.');
		$dllink = $dl[1];

		$ext = strrchr($dllink, '.');if (empty($ext)) $ext = '.flv';
		$fname = $title . $ext;
		$this->RedirectDownload($dllink, $fname);
	}
}

//[12-12-2012] Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class turbobit_net extends DownloadClass {
	private $link, $page, $cookie, $pA, $RDregexp, $DLregexp;
	public function Download($link) {
		if (!preg_match('@^https?://(?:[^/]+\.)?turbobit\.(?:net|ru)/(?:download/free/)?(\w+)(?:\.html)?@i', str_ireplace('unextfiles.com', 'turbobit.net', $link), $id)) html_error('Error: Invalid link entered.');
		$this->link = $GLOBALS['Referer'] = 'https://turbobit.net/' . $id[1] . '.html';
		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		$this->cookie = array('user_lang' => 'en');
		$this->RDregexp = '@(https?://(?:[^/\"\'\t\r\n<>]+\.)?turbobit\.(?:ru|net)(?:\:\d+)?)?//?download/redirect/[^\"\'\t\r\n<>]+@i';
		$this->DLregexp = '@https?://s\d+\.turbobit\.(?:ru|net)(?:\:\d+)?/download\.php\?[^\"\'\t\r\n<>]+@i';

		if (empty($_POST['step'])) {
			$this->page = $this->GetPage($this->link);
			is_present($this->page, '>Our service is currently unavailable in your country.<', 'Turbobit is not available in your server\'s country.');
			is_present($this->page, 'This document was not found in System', 'File Not Found.'); // 404
			is_present($this->page, 'File not found. Probably it was deleted.', 'The requested file is not found.');
			is_present($this->page, 'File was not found. It could possibly be deleted.', 'The requested file is not found');
			$this->cookie = GetCookiesArr($this->page, $this->cookie);
		}

		if (!empty($_REQUEST['premium_acc']) && $_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($GLOBALS['premium_acc']['turbobit_net']['user']) && !empty($GLOBALS['premium_acc']['turbobit_net']['pass'])))) {
			$user = ($this->pA ? $_REQUEST['premium_user'] : $GLOBALS['premium_acc']['turbobit_net']['user']);
			$pass = ($this->pA ? $_REQUEST['premium_pass'] : $GLOBALS['premium_acc']['turbobit_net']['pass']);
			if ($this->pA && !empty($_POST['pA_encrypted'])) {
				$user = decrypt(urldecode($user));
				$pass = decrypt(urldecode($pass));
				unset($_POST['pA_encrypted']);
			}
			return $this->CookieLogin($user, $pass);
		}
		html_error('Login Failed: User or Password is empty.');
	}

	private function PremiumDL() {
		$page = $this->GetPage($this->link, $this->cookie);
		if (preg_match($this->RDregexp, $page, $redir)) {
			$redir = (empty($redir[1])) ? 'https://turbobit.net'.$redir[0] : $redir[0];
			$page = $this->GetPage($redir, $this->cookie);

			if (!preg_match($this->DLregexp, $page, $dllink)) html_error('Download Link not Found.');
		} elseif (!preg_match($this->DLregexp, $page, $dllink)) html_error('Redirect Link not Found.');
		$this->RedirectDownload(html_entity_decode($dllink[0]), 'turbobit_pr', $this->cookie);
	}

	private function Login($user, $pass) {
		$purl = 'https://turbobit.net/';
		$post = array();
		$post['user%5Blogin%5D'] = urlencode($user);
		$post['user%5Bpass%5D'] = urlencode($pass);
		$post['user%5Bmemory%5D'] = 'on';
		$post['user%5Bsubmit%5D'] = 'Login';
		$page = $this->GetPage($purl.'user/login', $this->cookie, $post, $purl.'login');
		$this->cookie = GetCookiesArr($page, $this->cookie);

		$x = 0;
		while ($x < 3 && stripos($page, "\nLocation: ") !== false && preg_match('@\nLocation: ((https?://[^/\r\n]+)?/[^\r\n]*)@i', $page, $redir)) {
			$redir = (empty($redir[2])) ? 'https://turbobit.net'.$redir[1] : $redir[1];
			$page = $this->GetPage($redir, $this->cookie);
			$this->cookie = GetCookiesArr($page, $this->cookie);
			$x++;
		}
		if ($x < 1) html_error('Login Redirect not Found');

		is_present($page, 'Incorrect login or password', 'Login Failed: Login/Password incorrect');
		is_present($page, 'E-Mail address appears to be invalid.', 'Login Failed: Invalid E-Mail');
		is_present($page, 'Username(Email) does not exist', 'Login Failed: E-Mail is not registered.');
		// is_present($page, 'Limit of login attempts exceeded for your account. It has been temporarily locked.', 'Login Failed: Account Temporally Locked');

		is_present($page, 'Please enter the captcha code.', 'CAPTCHA not supported.');
		if (empty($this->cookie['user_isloggedin'])) html_error('Login Error: Cookie "user_isloggedin" not found or empty.');
		is_notpresent($page, '/user/logout', 'Login Failed.');

		$this->SaveCookies($user, $pass); // Update cookies file
		is_present($page, '<u>Turbo Access</u> denied', 'Login Failed: Account isn\'t premium');
		return $this->PremiumDL();
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass, $filename = 'turbobit_dl.php') {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');

		$filename = DOWNLOAD_DIR . basename($filename);
		if (!file_exists($filename)) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = sha1($user.':'.$pass);
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$page = $this->GetPage('https://turbobit.net/', $testCookie);
			if (stripos($page, '/user/logout') === false) return $this->Login($user, $pass);
			$this->cookie = GetCookiesArr($page, $testCookie); // Update cookies
			$this->SaveCookies($user, $pass); // Update cookies file
			is_present($page, '<u>Turbo Access</u> denied', 'Account isn\'t premium.');
			return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass, $filename = 'turbobit_dl.php') {
		global $secretkey;
		$maxdays = 31; // Max days to keep cookies saved
		$filename = DOWNLOAD_DIR . basename($filename);
		if (file_exists($filename)) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = sha1($user.':'.$pass);
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}
}

//[09-1-2013] Written by Th3-822.
//[07-6-2013] Added login recaptcha support. - Th3-822
//[12-2-2017] Removed CAPTCHA (Unsupported ATM) and Fixed Login. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class tusfiles_net extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class txxx_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@(https?://(?:www\.)?txxx\.com/videos/)(\d+)(/[^/]+/)@i', $link, $vid)) html_error('Invalid Link.');
		$link = $GLOBALS['Referer'] = $vid[1] . $vid[2] . $vid[3];

		$page = $this->GetPage($link);
		if (!preg_match('@ class="video-info__title">\s*<h1>\s*([^"<>]+)\s*</h1>@i', $page, $title)) html_error('Error: Video title not found. Video deleted?');
		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/get_file/[^\'\"\t<>\r\n\\\]+@i', $page, $DL)) html_error('Error: Download link not found.');
		if (!preg_match('@\.(?:mp4|flv|webm|avi)(?=/?br=\d+)?$@i', basename($DL[0]), $ext)) $ext = array('.mp4');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [txxx][%s]%s', $vid[2], $ext[0]);

		$this->RedirectDownload($DL[0], $filename, 0, 0, 0, $filename);
	}
}

//[20-2-2016]  Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once ('index.html');
	exit();
}

class ultramegabit_com extends DownloadClass {
	private $page, $cookie;
	public function Download($link) {
		global $premium_acc;

		$link = str_ireplace('http://', 'https://', $link);
		$this->page = $this->GetPage($link, $this->cookie);
		is_present($this->page, "\r\nContent-Length: 0\r\n", 'Invalid link?');
		is_present($this->page, '>File has been deleted.<', 'File deleted');
		$this->cookie = GetCookiesArr($this->page);

		if ($_REQUEST['premium_acc'] == 'on' && ((!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass'])) || (!empty($premium_acc['ultramegabit_com']['user']) && !empty($premium_acc['ultramegabit_com']['pass'])))) $this->Login($link);
		else $this->FreeDL($link);
	}

	private function FreeDL($link, $acc=false) {
		is_present($this->page, '>This download server is overloaded<', 'There are too many free users downloading from this server at this time.');
		$post = array();
		$post['csrf_token'] = cut_str($this->page, 'name="csrf_token" value="', '"');
		$post['encode'] = cut_str($this->page, 'name="encode" value="', '"');

		$page = $this->GetPage('https://ultramegabit.com/file/download', $this->cookie, $post);
		is_present('/user/confirm', 'Your account isn\'t validated.');
		if (preg_match('@/alert/delay/(\d+)@i', $page, $time)) {
			$wtime = $acc ? 20 : 60;
			$msg = $acc ? 'Free users' : 'Guests';
			$wait = ($time[1] - time()) + ($wtime * 60);

			$this->JSCountdown($wait, 0, "$msg are only able to download 1 file every $wtime minutes");
			return;
		}
		if (!preg_match('@https?://[^/\r\n]+/files/[^\'\"\s\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download link not found.');

		$FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)));
		$this->RedirectDownload($dlink[0], $FileName);
	}

	private function PremiumDL($link) {
		if (!preg_match('@https?://[^/\r\n]+/files/[^\'\"\s\t<>\r\n]+@i', $this->page, $dlink)) {
			$post = array();
			$post['csrf_token'] = cut_str($this->page, 'name="csrf_token" value="', '"');
			$post['encode'] = cut_str($this->page, 'name="encode" value="', '"');

			$page = $this->GetPage('https://ultramegabit.com/file/download', $this->cookie, $post);

			if (!preg_match('@https?://[^/\r\n]+/files/[^\'\"\s\t<>\r\n]+@i', $page, $dlink)) html_error('Error: Download-link not found.');
		}

		$FileName = urldecode(basename(parse_url($dlink[0], PHP_URL_PATH)));
		$this->RedirectDownload($dlink[0], $FileName);
	}

	private function Login($link) {
		global $premium_acc;
		$pA = (!empty($_REQUEST['premium_user']) && !empty($_REQUEST['premium_pass']) ? true : false);
		$user = ($pA ? $_REQUEST['premium_user'] : $premium_acc['ultramegabit_com']['user']);
		$pass = ($pA ? $_REQUEST['premium_pass'] : $premium_acc['ultramegabit_com']['pass']);
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty. Please check login data.');

		$purl = 'http://ultramegabit.com/';
		$post = array();
		$post['csrf_token'] = cut_str($this->page, 'name="csrf_token" value="', '"');
		$post['submit'] = 'Login';
		$post['return_url'] = urlencode($purl.'user/details');
		$post['username'] = urlencode($user);
		$post['password'] = urlencode($pass);

		$page = $this->GetPage($purl.'login', $this->cookie, $post, $purl);
		is_present($page, 'Invalid username or password', 'Login failed: User/Password incorrect.');
		is_notpresent($page, "\r\nContent-Length: 0\r\n", 'Login failed.');
		$this->cookie = GetCookiesArr($page);

		$page = $this->GetPage($purl.'user/details', $this->cookie, 0, $purl.'login');

		$this->page = $this->GetPage($link, $this->cookie);

		if (stripos($page, '"Premium Member"') === false) {
			$this->changeMesg(lang(300).'<br /><b>Account isn\'t premium</b><br />Using it as member.');
			return $this->FreeDL($link, true);
		} else return $this->PremiumDL($link);
	}
}

// [06-9-2012]  Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class up_4ever_com extends GenericXFS_DL {
	public $pluginVer = 16;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class upfile_mobi extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://upfile\.mobi/([\w\-]+)(?:\.([\dA-Fa-f]{32}))?@i', str_ireplace(array('://www.', 'index.php', '?page=file&f='), array('://'), $link), $fid)) html_error('Invalid link?.');
		$link = explode('|', str_ireplace('%7C', '|', $link), 2);
		if (count($link) > 1) $lpass = md5(rawurldecode($link[1]));
		$link = $GLOBALS['Referer'] = !empty($lpass) ? (empty($fid[2]) ? "{$fid[0]}.$lpass" : str_replace(".{$fid[2]}", ".$lpass", $fid[0])) : $fid[0];
		$fid = $fid[1];

		$page = $this->GetPage($link);
		is_present($page, 'File does not exist', 'File Not Found.');
		is_present($page, 'Enter password:', 'Incorrect Link Password.');

		if (!preg_match("@(https?://upfile\.mobi)?/(?:download/)?(?:index\.php)?\?page=download&server=\d+&f=$fid&[^\'\"\t<>\r\n]+@i", $page, $RD)) html_error('Redirect-Link Not Found.');
		$RD = (empty($RD[1])) ? parse_url($link, PHP_URL_SCHEME).'://upfile.mobi'.$RD[0] : $RD[0];
		$page = $this->GetPage(str_ireplace('/download/', '/', $RD));

		// Fix Bad Link Formatting.
		$page = preg_replace('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)([^/])@i', '$1/$2', $page);

		if (!preg_match("@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/(?:index\.php)?\?page=download_start&server=\d+&f=$fid&[^\'\"\t<>\r\n]+@i", $page, $DL)) html_error('Download-Link Not Found.');
		return $this->RedirectDownload($DL[0], 'upfile_mobi-placeholder-name');
	}
}

// [18-5-2016] Written by Th3-822.
// [04-8-2016] Fixed Link & Download Regexp. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class upload_mobi extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://upload\.mobi/(?:(\d+)/(\w+)|(?:index\.php)?\?page=file&id=(\d+)&code=(\w+))@i', str_ireplace('://www.', '://', $link), $_fid)) html_error('Invalid link?.');
		$link = $GLOBALS['Referer'] = $_fid[0];
		$fid = !empty($_fid[3]) ? $_fid[3] : $_fid[1];
		$fcode = !empty($_fid[4]) ? $_fid[4] : $_fid[2];

		$page = $this->GetPage($link);
		is_present($page, 'File does not exist', 'File Not Found.');

		if (!preg_match("@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/download/$fid/$fcode/\w+@i", $page, $DL)) {
			if (!preg_match("@/download\?(?:\w+=[^&\'\"]*&)?file_id=$fid&[^\'\"\t<>\r\n]+@i", $page, $DL)) html_error('Download-Link Not Found.');
			$url = parse_url($link);
			$DL[0] = sprintf('%s://%s%s', $url['scheme'], $url['host'], $DL[0]);
		}
		return $this->RedirectDownload($DL[0], 'upload_mobi-placeholder-name');
	}

	public function CheckBack($headers) {
		// Keep the referer
		$_GET['link'] = (!empty($_GET['referer']) && stripos($_GET['referer'], '://upload.mobi/') !== false) ? $_GET['referer'] : 'http://upload.mobi/';
	}
}

// [18-5-2016] Written by Th3-822.
// [04-8-2016] Fixed Download Regexp. - Th3-822
// [27-9-2016] Quick fix to keep original referer on redirects. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class upload_so extends GenericXFS_DL {
	public $pluginVer = 14;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uploadbaz_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uploadboy_com extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$link = parse_url($link);
		$link['host'] = 'uploadboy.com';
		$link = rebuild_url($link);
		$this->Start($link);
	}

	// Edited to add login captcha decoder.
	protected function sendLogin($post) {
		if (empty($_POST['step']) || $_POST['step'] != 'L') {
			$purl = (!empty($this->sslLogin) ? 'https://'.$this->host.'/' : $this->purl) . '?op=login';
			$page = $this->GetPage($purl, $this->cookie);
			if (!($form = cut_str($page, '<form', '</form>'))) html_error('Cannot find login form.');
			$post['rand'] = cut_str($form, 'name="rand" value="', '"');

			if (!empty($post['rand'])) {
				if (substr_count($form, "<span style='position:absolute;padding-left:") > 3 && preg_match_all("@<span style='[^\'>]*padding-left\s*:\s*(\d+)[^\'>]*'[^>]*>((?:&#\w+;)|(?:\d))</span>@i", $form, $txtCaptcha)) {
					// Text Captcha (decodeable)
					$txtCaptcha = array_combine($txtCaptcha[1], $txtCaptcha[2]);
					ksort($txtCaptcha, SORT_NUMERIC);
					$txtCaptcha = trim(html_entity_decode(implode($txtCaptcha), ENT_QUOTES, 'UTF-8'));
					$post['code'] = $txtCaptcha;

					// Don't remove this sleep or you will only see "Error Decoding Captcha. [Login]"
					sleep(3); // 2 or 3 seconds.
				} else if (preg_match('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)?/captchas/[\w\-]+\.(?:jpe?g|png|gif)@i', $form, $gdCaptcha)) {
					// gd Captcha (untested, but should work)
					if (empty($gdCaptcha[1])) $gdCaptcha[0] = $this->scheme . '://' . $this->host . $gdCaptcha[0];
					list($headers, $imgBody) = explode("\r\n\r\n", $this->GetPage($gdCaptcha[0]), 2);
					if (substr($headers, 9, 3) != '200') html_error('[Login] Error downloading CAPTCHA img.');
					$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpg');

					$data = $this->DefaultParamArr($this->link);
					$data['rand'] = $post['rand'];
					$data['step'] = 'L';
					if ($this->pA) {
						$data['pA_encrypted'] = 'true';
						$data['premium_user'] = urlencode(encrypt($_REQUEST['premium_user'])); // encrypt() will keep this safe.
						$data['premium_pass'] = urlencode(encrypt($_REQUEST['premium_pass'])); // And this too.
					}
					return $this->EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data);
				} else html_error('Login captcha not found.');
			}
		} else {
			$_POST['step'] = false;
			if (empty($_POST['captcha'])) html_error('[Login] You didn\'t enter the image verification code.');
			$post['rand'] = urlencode($_POST['rand']);
			$post['code'] = urlencode($_POST['captcha']);
		}
		return parent::sendLogin($post);
	}

	// Added login captcha error msg.
	protected function checkLogin($page) {
		is_present($page, 'Wrong%20captcha%20code', (empty($_POST['rand']) ? 'Error: Error Decoding Captcha. [Login]' : 'Error: Wrong Captcha Entered. [Login]'));
		return parent::checkLogin($page);
	}

	// They force https only on this page, it's weird.
	protected function isLoggedIn() {
		$page = $this->GetPage('https://'.$this->host.'/?op=my_account', $this->cookie, 0, $this->purl);
		if (stripos($page, '/?op=logout') === false && stripos($page, '/logout') === false) return false;
		return $page;
	}
}

// Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class uploaded_net extends DownloadClass {
	private $page, $cookie, $Login;
	public function Download($link) {
		global $premium_acc, $Referer;
		if (!preg_match('@https?://(?:www\.)?(?:uploaded\.(?:to|net)/file|ul\.to(?:/file)?)/([a-zA-Z\d]+)@i', $link, $fid)) html_error('Invalid link?.');
		$this->fid = $fid[1];
		$this->link = $Referer = 'http://uploaded.net/file/'.$fid[1];

		if (empty($_POST['step']) || $_POST['step'] != 1) {
			$x = 0;
			do {
				$this->page = $this->GetPage($this->link, $this->cookie);
				$header = substr($this->page, 0, strpos($this->page, "\r\n\r\n"));
				$this->cookie = GetCookiesArr($header, $this->cookie);
				$x++;
			} while ($x < 6 && substr($header, 9, 3) == '302' && stripos($header, "\nLocation: /file/{$fid[1]}") !== false);
			is_present($header, '/404', 'File Not Found');
			is_present($header, '/410', 'File Was Removed');
			is_present($header, 'Please check the URL for typing errors,', 'File not Found or Removed.');
		}

		$this->pA = (empty($_REQUEST['premium_user']) || empty($_REQUEST['premium_pass']) ? false : true);
		if (($_REQUEST['cookieuse'] == 'on' && preg_match('@login[\s\t]*=[\s\t]*([\w\%\-]+);?@i', $_REQUEST['cookie'], $c)) || ($_REQUEST['premium_acc'] == 'on' && !empty($premium_acc['uploaded_net']['cookie']))) {
			$cookie = (empty($c[1]) ? urldecode($premium_acc['uploaded_net']['cookie']) : urldecode($c[1]));
			if (strpos($cookie, '%')) $cookie = urldecode($cookie);
			$this->cookie = array('login' => urlencode($cookie));

			$x = 0;
			do {
				$this->page = $this->GetPage('http://uploaded.net/me', $this->cookie, 0, 'http://uploaded.net/'.($x > 0 ? 'me' : ''));
				$this->cookie = GetCookiesArr($this->page, $this->cookie);
				$x++;
			} while ($x < 6 && substr($this->page, 9, 3) == '302' && stripos($this->page, "\nLocation: /me") !== false);

			if (substr($this->page, 9, 3) != '200') html_error('Cookie Error: Invalid Cookie?.');
			if (stripos($this->page, '<em>Free</em>') !== false) {
				$this->changeMesg(lang(300).'<br /><b>Cookie: Account isn\'t premium</b><br />Using it as member.');
				$this->page = $this->GetPage($this->link, $this->cookie);
				return $this->FreeDL();
			}
			return $this->PremiumDL();
		} elseif (($_REQUEST['premium_acc'] == 'on' && ($this->pA || (!empty($premium_acc['uploaded_net']['user']) && !empty($premium_acc['uploaded_net']['pass']))))) {
			return $this->CookieLogin(($this->pA ? $_REQUEST['premium_user'] : $premium_acc['uploaded_net']['user']), ($this->pA ? $_REQUEST['premium_pass'] : $premium_acc['uploaded_net']['pass']));
		} else {
			return $this->FreeDL();
		}
	}

	private function FreeDL() {
		$url = 'http://uploaded.net';
		$errs = array('host' => 'Download of this file isn\'t available right now, try again later.', 'limit-dl' => 'Free download limit reached.', 'parallel' => 'You\'re already downloading a file.', 'size' => 'Only Premium users can download this file.', 'slot' => 'Free download of this file isn\'t available right now, try again later.', 'captcha' => 'Wrong CAPTCHA entered.');

		if (empty($_POST['step']) || $_POST['step'] != 1) {
			// Find countdown
			if (!preg_match('@<span[^>]*>[^<>]+<span[^>]*>(\d+)</span>[\s\t\r\n]+seconds[^<>]*</span>@i', $this->page, $cD)) html_error('Countdown not found.');
			// Check slots
			$page = $this->GetPage("$url/io/ticket/slot/".$this->fid, $this->cookie, 0, 0, 0, 1);
			if (stripos($page, 'succ:true') === false) {
				if (preg_match('@\"?err\"?\s*:\s*\"((?:[^\"]+(?:\\\")?)+)(?<!\\\)\"@i', $page, $err) && !empty($errs[$err[1]])) html_error($errs[$err[1]]);
				else html_error($errs['slot']);
			}
			// Download js and find site's recaptcha key
			$js = $this->GetPage("$url/js/download.js", $this->cookie);
			if (!preg_match('@Recaptcha\.create[\s\t]*\([\s\t]*\"[\s\t]*([\w\.\-]+)[\s\t]*\"@i', $js, $cpid)) html_error('reCAPTCHA Not Found.');
			// Do countdown
			if ($cD[1] > 0) $this->CountDown($cD[1]);
			// Prepare data for reCAPTCHA and call it
			$data = $this->DefaultParamArr($this->link, encrypt(CookiesToStr($this->cookie)));
			$data['step'] = '1';
			return $this->reCAPTCHA($cpid[1], $data);
		}

		if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
		$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

		$post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']);
		$page = $this->GetPage("$url/io/ticket/captcha/".$this->fid, $this->cookie, $post, 0, 0, 1);
		if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)+uploaded\.(?:net|to)/dl/[^\r\n\s\t\'\"<>]+@i', $page, $dl)) {
			if (preg_match('@\"?err\"?\s*:\s*\"((?:[^\"]+(?:\\\")?)+)(?<!\\\)\"@i', $page, $err)) {
				if (!empty($errs[$err[1]])) html_error($errs[$err[1]]);
				is_present($err[1], 'free downloads for this hour', $errs['limit-dl'].' Wait and hour an try again.');
				html_error('Unknown error after sending captcha: '.htmlentities($err[1]));
			}
			html_error('Download Link Not Found.');
		}

		$this->RedirectDownload($dl[0], 'uploaded_net_fr', $this->cookie);
	}

	private function PremiumDL() {
		// Parse and show BW from $this->page
		$cutted = cut_str($this->page, '<div id="traffic"', '</table>');
		if (!empty($cutted) && preg_match_all('@>(\d+(?:,\d+)?\s+(?:[KMGT]i?)?B)<@i', $cutted, $bw)) $this->changeMesg(lang(300)."<br />[Acc. Traffic] Download: {$bw[1][0]} + Hybrid: {$bw[1][1]} = Total: ".$bw[1][2]);

		$page = $this->GetPage($this->link, $this->cookie);
		if (!preg_match('@https?://(?:[a-zA-Z\d\-]+\.)+uploaded\.(?:net|to)/dl/[^\r\n\s\t\'\"<>]+@i', $page, $dl)) {
			$body = trim(substr($page, strpos($page, "\r\n\r\n") + 4));
			if ($body == '') html_error('Download-Link Not Found. (Empty page body)');
			if (stripos($body, 'Traffic is completely exhausted,') !== false || stripos($body, 'Su tr&#225;fico h&#237;brido esta completamente gastado') !== false) html_error('Premium account is out of bandwidth.');
			if (stripos($body, 'You used too many different IPs,') !== false || stripos($body, 'descarga bloqueada (ip)') !== false) html_error('Account blocked, too many IPs used for dl.');
			html_error('Account IP-blocked? | Not enough traffic? | Download-Link Not Found');
		}
		$this->RedirectDownload($dl[0], 'uploaded_net_pr', $this->cookie);
	}

	private function Login($user, $pass) {
		$post = array_map('urlencode', array('id' => $user, 'pw' => $pass));
		$page = $this->GetPage('http://uploaded.net/io/login', $this->cookie, $post, 'http://uploaded.net/', 0, 1);
		$body = trim(substr($page, strpos($page, "\r\n\r\n") + 4));
		is_present($body, 'No connection to database', 'Login failed: "No connection to database".');
		if (preg_match('@\{\"err\":\"([^\"]+)\"@i', $body, $err)) html_error('Login Error: "'.html_entity_decode(stripslashes($err[1])).'".');
		$this->cookie = GetCookiesArr($page, $this->cookie);
		if (empty($this->cookie['login'])) {
			if ($body == '') html_error('The host didn\'t replied the login request, wait 15-30 seconds and try again.');
			html_error('Login Error: Cannot find "login" cookie.');
		}

		$this->SaveCookies($user, $pass); // Update cookies file

		$this->page = $this->GetPage('http://uploaded.net/me', $this->cookie, 0, 'http://uploaded.net/');
		if (stripos($this->page, '<em>Free</em>') !== false) {
			$this->changeMesg(lang(300).'<br /><b>Account isn\'t premium</b><br />Using it as member.');
			$this->page = $this->GetPage($this->link, $this->cookie);
			return $this->FreeDL();
		}

		return $this->PremiumDL();
	}

	private function IWillNameItLater($cookie, $decrypt=true) {
		if (!is_array($cookie)) {
			if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
			return '';
		}
		if (count($cookie) < 1) return $cookie;
		$keys = array_keys($cookie);
		$values = array_values($cookie);
		$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
		$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
		return array_combine($keys, $values);
	}

	private function CookieLogin($user, $pass) {
		global $secretkey;
		if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
		$user = strtolower($user);

		$filename = DOWNLOAD_DIR . basename('uploaded_dl.php');
		if (!file_exists($filename) || filesize($filename) <= 6) return $this->Login($user, $pass);

		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		$hash = hash('crc32b', $user.':'.$pass);
		if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
			$_secretkey = $secretkey;
			$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
			$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? $this->IWillNameItLater($savedcookies[$hash]['cookie']) : '';
			$secretkey = $_secretkey;
			if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return $this->Login($user, $pass);

			$x = 0;
			do {
				$this->page = $this->GetPage('http://uploaded.net/me', $testCookie, 0, 'http://uploaded.net/'.($x > 0 ? 'me' : ''));
				$testCookie = GetCookiesArr($this->page, $testCookie);
				$x++;
			} while ($x < 6 && substr($this->page, 9, 3) == '302' && stripos($this->page, "\nLocation: /me") !== false);

			if (substr($this->page, 9, 3) != '200') return $this->Login($user, $pass);
			$this->cookie = $testCookie; // Update cookies
			$this->SaveCookies($user, $pass); // Update cookies file
			if (stripos($this->page, '<em>Free</em>') !== false) {
				$this->changeMesg(lang(300).'<br /><b>Account isn\'t premium</b><br />Using it as member.');
				$this->page = $this->GetPage($this->link, $this->cookie);
				return $this->FreeDL();
			}
			return $this->PremiumDL();
		}
		return $this->Login($user, $pass);
	}

	private function SaveCookies($user, $pass) {
		global $secretkey;
		$maxdays = 31; // Max days to keep cookies for more than 1 user.
		$filename = DOWNLOAD_DIR . basename('uploaded_dl.php');
		if (file_exists($filename) && filesize($filename) > 6) {
			$file = file($filename);
			$savedcookies = unserialize($file[1]);
			unset($file);

			// Remove old cookies
			if (is_array($savedcookies)) {
				foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
			} else $savedcookies = array();
		} else $savedcookies = array();
		$hash = hash('crc32b', $user.':'.$pass);
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => $this->IWillNameItLater($this->cookie, false));
		$secretkey = $_secretkey;

		file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
	}
}

//[29-5-2013] Written by Th3-822.
//[09-1-2013] Added '410 Gone' error. - Th3-822
//[06-12-2015] Added support for redirects blocking site access. #6DCambiemosVzla - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uploader_link extends GenericXFS_DL {
	public $pluginVer = 14;
	
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = true; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.
		$this->httpsOnly = true;
		
		$this->Start($link);
	}
	
	// Edited to add login captcha decoder.
	protected function Login() {
		$devil = preg_match('@uploader.link/f/[^\r\n\s\t<>\'\"]+@', $this->page, $dlink);
		if($devil==0){
			html_error('Unable to get download link');
		}
		$this->page = $this->GetPage('https://'.$dlink[0]);
		
		return parent::Login();
	}
}

// Written by miyuru

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uploadkadeh_com extends GenericXFS_DL {
	public $pluginVer = 23;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = false; // Force https on login post only.
		$this->cookieSave = false; // Save login cookies to file. (For hosts that limit/bans repeated logins)
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder

		$this->Start($link);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uploadrocket_net extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}

	protected function FindPost($formOp = 'download[1-3]') {
		$return = parent::FindPost($formOp);
		if (!empty($this->post['method_isfree']) && !empty($this->post['method_ispremium'])) $this->post['method_ispremium'] = '';
		return $return;
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uploads_to extends GenericXFS_DL {
	public $pluginVer = 13;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uplod_ir extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uploadex_com extends GenericXFS_DL {
	public $pluginVer = 8;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}

	// Some links doesn't work with https, let's switch to http
	public function RedirectDownload($link, $FileName = 0, $cookie = 0, $post = 0, $referer = 0, $force_name = 0, $auth = 0, $addon = array()) {
		$link = parse_url($link);
		$link['scheme'] = 'http';
		$link = rebuild_url($link);
		return parent::RedirectDownload($link, $FileName, $cookie, $post, $referer, $force_name, $auth, $addon);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uppit_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class uptobox_com extends GenericXFS_DL {
	public $pluginVer = 23;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->httpsOnly = true; // Force https on all the site, supersedes $this->sslLogin when true
		$this->sslLogin = true; // Force https on login post only.
		$this->cookieSave = true; // Save login cookies to file. (For hosts that limit/bans repeated logins)
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder

		// Custom link-check error messages
		$errMsgs = array('The file you were looking for could not be found',
				'The file was removed by administrator',
				'Unfortunately, the file you want is not available.',
				'Sorry, Uptobox.com is not available in your country'
		);

		$link = str_ireplace('uptostream.com', 'uptobox.com', $link);
		$this->Start($link, $errMsgs);
	}

	protected function findCountdown() {
		if (preg_match('@data-remaining-time=\'(\d+)\'@i', $this->page, $count)) {
			if ($count[1] > 0) $this->CountDown($count[1] + 2);
			return true;
		}
		return false;
	}

	// FreeDL is totally different now, so it needs it's own function
	protected function FreeDL($step = 1) {
		$this->page = $this->GetPage($this->link, $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		if (!$this->testDL()) {
			if (!preg_match('@name=\'waitingToken\'\s+value=\'([\w\-]+)\'@i', $this->page, $token)) {
				if (preg_match('@wait\s+(?:\d+ \w+,?\s){0,2}\d+ \w+ to launch a new download@i', $this->page, $err)) html_error('Error: You need to ' . strip_tags($err[0]));
				return html_error('FreeDL Token Not Found.');
			}
			if (!$this->findCountdown()) html_error('CountDown not Found.');

			$this->page = $this->GetPage($this->link, $this->cookie, array('waitingToken' => $token[1]));
			$this->cookie = GetCookiesArr($this->page, $this->cookie);

			if (!$this->testDL()) {
				return html_error('FreeDL Download Link not Found.');
			}
		}
		return true;
	}

	// Full login url, just in case.
	protected function sendLogin($post) {
		return $this->GetPage('https://uptobox.com/?op=login&referer=homepage', $this->cookie, $post, 'https://uptobox.com/?op=login&referer=homepage');
	}

	protected function isAccPremium($page) {
		if (stripos($page, 'Free member') === false) return true;
		else return false;
	}

	protected function checkLogin($page) {
		is_present($page, 'You are trying to log in from a different country', 'Login Failed: Login Blocked By IP, Check Account Email And Follow The Steps To Add IP to Whitelist.');
		return parent::checkLogin($page);
	}
}

// Written by Th3-822.
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class uptostream_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/(\w{12})(?=(?:[/\.]|(?:\.html?))?)@i', str_ireplace('/embed-', '/', $link), $link)) html_error('Invalid link?.');
		$vid = $link[1];
		$link = $link[0];

		$page = $this->GetPage($link);
		is_present($page, '404 (File not found)', 'File Not Found');

		if (!preg_match('@<title>(?>(.*?)</title>)@is', $page, $title)) html_error('Error: Video title not found.');
		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w+/(\d+)/0@i', $page, $DL)) html_error('Download link not found.');

		$filename = preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8'));
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', $filename);
		$filename .= " [UTS-{$DL[1]}p][$vid].mp4";

		$this->RedirectDownload($DL[0], $filename, 0, 0, 0, $filename);
	}
}

// [25-12-2015] Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class userscloud_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class usersfiles_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class vidbull_com extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = true; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = true; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.
		$this->customDecoder = true; // Enable custom pageDecoder().

		// Custom link-check error messages
		$errMsgs = array('The file you were looking for could not be found',
			'The file was removed by administrator',
			'No available download slots for this region please check back later'
		);

		$this->Start($link, $errMsgs);
	}

	// Decoder: http://vidbull.com/player/obc.swf
	protected function pageDecoder() {
		if (preg_match('@file\s*:\s*"((?:[0-9a-fA-F]{2})+)"@i', $this->page, $encoded)) {
			$encoded = $encoded[1];
			$this->page = str_replace($encoded, rtrim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, pack('H*', 'a949376e37b369f17bc7d3c7a04c5721'), pack('H*', $encoded), MCRYPT_MODE_ECB)), $this->page);
		}
	}

	protected function getFileName($url) {
		$fname = parent::getFileName($url);
		if (preg_match("@^(?:v(?:ideo)|{$this->fid})?\.(mp4|flv)$@i", $fname, $vExt) && preg_match('@<h3>Watch\s+([^\s<>\"\']+)\s*</h3>@i', $this->page, $title)) {
			$fname = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', trim($title[1])) . '_S.' . strtolower($vExt[1]);
		}
		return $fname;
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class videohut_to extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/)(?:file/|v/|embed\.php\?id=)(\w+)@i', $link, $vid)) html_error('Invalid Link.');
		$link = $GLOBALS['Referer'] = $vid[1] . 'v/' . $vid[2];

		$page = $this->GetPage($link);
		if (!preg_match('@<h4 class="title">\s*([^"<>]+)\s*</h4>@i', $page, $title) && !preg_match('@<title>\s*([^"<>|]+?)(?>\s+\|)@i', $page, $title))  {
			is_present($page, 'The video no longer exists', 'Video not found or it was deleted.');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');
			html_error('Error: Video title not found.');
		}

		$embed = $this->GetPage("{$vid[1]}embed.php?id={$vid[2]}&autoplay=1");
		if (!preg_match('@domain\s*:\s*"([^"]+)"\s*,\s*key\s*:\s*"([^"]+)"@', $embed, $matches)) html_error('Error: Download link not found.');

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $vid[2] . '&pass=undefined&key=' . urlencode($matches[2]);
		$page2 = $this->GetPage($url);
		is_present($page, ' is being transfered', 'Video is temporarily unavailable');

		if (!preg_match('@url=(http://[^&]+)@', urldecode($page2), $downl)) html_error('Error: Download link not found.');

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [Videohut][%s]%s', $vid[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  Written by Th3-822.
//[22-1-2016]  Fixed link parse & case when video reports not found, but still downloadable. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class videomega_tv extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/)(?:index.php|view\.php)?\?ref=(\w+)@i', $link, $vid)) html_error('Invalid Link.');
		$GLOBALS['Referer'] = $vid[1] . '?ref=' . $vid[2];
		$link = $vid[1] . 'view.php?ref=' . $vid[2];

		$page = $this->GetPage($link);
		if (!preg_match('@<title>Videomega.tv -\s+([^"<>]+)\s*</title>@i', $page, $title)) html_error('Error: Video title not found. Video deleted?');

		if (!preg_match('@eval\s*\(\s*function\s*\(p,a,c,k,e,d\)\s*\{.+\}\s*\(\s*\'([^\r|\n]*)\'\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*\'([^\']+)\'\.split\([\'|\"](.)[\'|\"]\)(?:\s*,\s*0\s*,\s*\{\})?\)\)@', $page, $js)) html_error('Error: Embed Code Not Found.');
		$embed = $this->VideoMegaUnpacker($js[1], $js[2], $js[3], explode($js[5], $js[4]));
		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/v/[^\'\"\t<>\r\n\\\]+@i', $embed, $DL)) html_error('Error: Download link not found.');

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($DL[0]), $ext)) $ext = array('.mp4');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [Videomega][%s]%s', $vid[2], $ext[0]);

		$this->RedirectDownload($DL[0], $filename, 0, 0, 0, $filename);
	}

	private function VideoMegaUnpacker($p,$a,$c,$k) {
		while ($c--) if($k[$c]) $p = preg_replace('@\b'.(($c = $c % $a) > 35 ? chr($c + 29) : base_convert($c, 10, 36)).'\b@', $k[$c], $p);
		return $p;
	}
}

//[20-2-2016]  Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class videoraj_to extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@(https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/)(?:file/|v/|embed\.php\?id=)(\w+)@i', $link, $vid)) html_error('Invalid Link.');
		$link = $GLOBALS['Referer'] = $vid[1] . 'v/' . $vid[2];

		$page = $this->GetPage($link);
		if (!preg_match('@<h4 class="title">\s*([^"<>]+)\s*</h4>@i', $page, $title) && !preg_match('@<title>\s*([^"<>|]+?)(?>\s+\|)@i', $page, $title))  {
			is_present($page, 'The video no longer exists', 'Video not found or it was deleted.');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');
			html_error('Error: Video title not found.');
		}

		$embed = $this->GetPage("{$vid[1]}embed.php?id={$vid[2]}&autoplay=1");
		if (!preg_match('@domain\s*:\s*"([^"]+)"\s*,\s*key\s*:\s*"([^"]+)"@', $embed, $matches)) html_error('Error: Download link not found.');

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $vid[2] . '&pass=undefined&key=' . urlencode($matches[2]);
		$page2 = $this->GetPage($url);
		is_present($page, ' is being transfered', 'Video is temporarily unavailable');

		if (!preg_match('@url=(http://[^&]+)@', urldecode($page2), $downl)) html_error('Error: Download link not found.');

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [Videoraj][%s]%s', $vid[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  Written by Th3-822.
//[22-1-2016]  Fixed link parse & case when video reports not found, but still downloadable. - Th3-822

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class videoweed_es extends DownloadClass {
	public function Download($link) {
		$page = $this->GetPage($link);
		is_present($page, 'This file no longer exists', 'Video not found or it was deleted.');
		is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');

		if (($stepkey = cut_str($page, '"stepkey" value="', '"'))) {
			$post = array('stepkey' => $stepkey, 'submit' => 'submit');
			$cookie = GetCookiesArr($page);
			$page = $this->GetPage($link, $cookie, $post);
			is_present($page, 'This file no longer exists', 'Video not found or it was deleted..');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable..');
		}

		if (!preg_match('@<h1 class="text_shadow">\s*([^"<>]+)\s*</h1>@i', $page, $title)) html_error('Error: Video title not found.');
		if (!preg_match('@flashvars.domain\s*=\s*"([^"]+)";\s+flashvars.file\s*=\s*"([^"]+)";\s+flashvars.filekey\s*=\s*(?:"([^"]+)"|([\$_A-Za-z][\$\w]*))@', $page, $matches)) html_error('Error: Download link not found.');
		if (empty($matches[3])) {
			if (!preg_match('@var\s+'.$matches[4].'\s*=\s*"([^"]+)"\s*;@i', $page, $fkey)) html_error('FileKey not Found.');
			$matches[3] = $fkey[1];
		}

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $matches[2] . '&pass=undefined&key=' . urlencode($matches[3]);
		$page2 = $this->GetPage($url);
		is_present($page2, ' is being transfered', 'Video is temporarily unavailable');
    
		if (!preg_match('@url=(http://[^&]+)@', $page2, $downl)) html_error('Error: Download link not found.');  

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [VideoWeed][%s]%s', $matches[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  ReWritten by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class vidgg_to extends DownloadClass {
	public function Download($link) {
		$page = $this->GetPage($link);
		is_present($page, 'This file no longer exists', 'Video not found or it was deleted.');
		is_present($page, 'The file is being transfered', 'Video is temporarily unavailable.');

		if (($stepkey = cut_str($page, '"stepkey" value="', '"'))) {
			$post = array('stepkey' => $stepkey, 'submit' => 'submit');
			$cookie = GetCookiesArr($page);
			$page = $this->GetPage($link, $cookie, $post);
			is_present($page, 'This file no longer exists', 'Video not found or it was deleted..');
			is_present($page, 'The file is being transfered', 'Video is temporarily unavailable..');
		}

		if (!preg_match('@<h5(?:[\s\t][^>]*)?>\s*([^"<>]+)\s*</h5>@i', $page, $title)) html_error('Error: Video title not found.');
		if (!preg_match('@flashvars.domain\s*=\s*"([^"]+)";\s+flashvars.file\s*=\s*"([^"]+)";\s+flashvars.filekey\s*=\s*(?:"([^"]+)"|([\$_A-Za-z][\$\w]*))@', $page, $matches)) html_error('Error: Download link not found.');
		if (empty($matches[3])) {
			if (!preg_match('@var\s+'.$matches[4].'\s*=\s*"([^"]+)"\s*;@i', $page, $fkey)) html_error('FileKey not Found.');
			$matches[3] = $fkey[1];
		}

		$url = $matches[1] . '/api/player.api.php?user=undefined&codes=1&file=' . $matches[2] . '&pass=undefined&key=' . urlencode($matches[3]);
		$page2 = $this->GetPage($url);
		is_present($page2, ' is being transfered', 'Video is temporarily unavailable');
    
		if (!preg_match('@url=(http://[^&]+)@', $page2, $downl)) html_error('Error: Download link not found.');  

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename($downl[1]), $ext)) $ext = array('.flv');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8')));
		$filename .= sprintf(' [NovaMov][%s]%s', $matches[2], $ext[0]);

		$this->RedirectDownload($downl[1], $filename, 0, 0, 0, $filename);
	}
}

//[28-12-2015]  Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class vidhos_com extends GenericXFS_DL {
	public $pluginVer = 9;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = true; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom Download Regexp
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w{60}/[^\'\"\t<>\r\n\\\]+@i';

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class vidzi_tv extends GenericXFS_DL {
	public $pluginVer = 10;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = true; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom Download Regexp
		$this->DLregexp = '@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/\w{60}/[^\t\r\n<>\'\"\?\&]+@i';

		$this->Start($link);
	}

	protected function getVideoTitle() {
		if (preg_match('@<h2 class="video-title">\s*([^"<>]+)\s*</h2>@i', $this->page, $title)) {
			return html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8');
		}
		return false;
	}
}

// Written by Th3-822.

?>
<?php
if (!defined('RAPIDLEECH'))
  {
  require_once("index.html");
  exit;
  }
   	

	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
	is_page($page);
	is_present($page,"File not found");
	preg_match('/http:\/\/vip-file\.com\/download[^"]+/i', $page, $loca);
	$Url = parse_url($loca[0]);
    $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
    preg_match('/Location:.+?\\r/i', $page, $loca);
    $redir = rtrim($loca[0]);
    preg_match('/http:.*/i', $redir, $loca);
    $Url=parse_url($loca[0]);
    $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"], $Referer, $cookie, 0, 0, $_GET["proxy"],$pauth);
    preg_match('/Location:.+?\\r/i', $page, $loca);
    $redir = rtrim($loca[0]);
    preg_match('/http:.*/i', $redir, $loca);
    $Url=parse_url($loca[0]);
    $FileName = !$FileName ? basename($Url["path"]) : $FileName;
insert_location("$PHP_SELF?filename=".urlencode($FileName)."&host=".$Url["host"]."&port=".$Url["port"]."&path=".urlencode($Url["path"].($Url["query"] ? "?".$Url["query"] : ""))."&referer=".urlencode($Referer)."&email=".($_GET["domail"] ? $_GET["email"] : "")."&partSize=".($_GET["split"] ? $_GET["partSize"] : "")."&cookie=".urlencode($cookie)."&method=".$_GET["method"]."&proxy=".($_GET["useproxy"] ? $_GET["proxy"] : "")."&saveto=".$_GET["path"]."&link=".urlencode($LINK).($_GET["add_comment"] == "on" ? "&comment=".urlencode($_GET["comment"]) : "")."&auth=".$auth.($pauth ? "&pauth=$pauth" : "").(isset($_GET["audl"]) ? "&audl=doum" : ""));
	// written by kaox 24/05/09

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class vshare_eu extends GenericXFS_DL {
	public $pluginVer = 11;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class xvideos_com extends DownloadClass {
	public function Download($link) {
		if (!preg_match('@https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?/(?:(?:video|embedframe/|swf/xv-player\.swf\?id_video=)(\d+)|video-(\w+)/)@i', $link, $vid)) html_error('Invalid Link.');
		$domain = strtolower(parse_url($link, PHP_URL_HOST));
		if (strpos($domain, 'www.') !== 0) $domain = "www.$domain";
		$link = $GLOBALS['Referer'] = "http://$domain/video" . (empty($vid[2]) ? $vid[1] : '-' . $vid[2]) . "/";

		$page = $this->GetPage($link);
		if (preg_match("@\nLocation: ((https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)?/video" . (empty($vid[2]) ? $vid[1] : '-' . $vid[2]) . "/\S+)@i", $page, $redir)) {
			$redir = empty($redir[2]) ? "http://$domain".$redir[1] : $redir[1];
			$page = $this->GetPage($redir, GetCookiesArr($page));
		}

		if (!preg_match('@setVideoTitle\(\'(.+?)\'\)@', $page, $title)) {
			is_present($page, 'Sorry but the page you requested was not found.', 'Video not found or it was deleted.');
			is_present($page, 'We received a request to have this video deleted.', 'Video disabled for dispute.');
			html_error('Error: Video title not found.');
		}

		if (!preg_match('@setVideoUrlHigh\(["\'](https?://[^"\'\s<>]+)@i', $page, $DL) && !preg_match('@setVideoUrl(?:Low)?\(["\'](https?://[^"\'\s<>]+)@i', $page, $DL) && !(preg_match('@(?<=flv_url=)(https?[^\"\'&]+)@', $page, $DL) && ($DL[1] = urldecode($DL[1])))) html_error('Error: Download link not found.');

		if (empty($vid[1])) $vid[1] = (preg_match('@id_video=(\d+)@i', $page, $_vid) ? $_vid[1] : -1);

		if (!preg_match('@\.(?:mp4|flv|webm|avi)$@i', basename(parse_url($DL[1], PHP_URL_PATH)), $ext)) $ext = array('.mp4');
		$filename = preg_replace('@(?:\.(?:mp4|flv|mkv|webm|wmv|(m2)?ts|rm(vb)?|mpe?g?|vob|avi|[23]gp))+$@i', '', preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', stripslashes(html_entity_decode(trim($title[1]), ENT_QUOTES, 'UTF-8'))));
		$filename .= sprintf(' [xvideos][%d]%s', $vid[1], $ext[0]);

		$this->RedirectDownload($DL[1], $filename, 0, 0, 0, $filename);
	}
}

//[25-1-2016]  Written by Th3-822.
//[30-12-2017] Updated. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

class youtube_com extends DownloadClass {
	private $page, $cookie, $fmtmaps, $vid, $sts = -1, $js, $playerJs, $sigJs, $jsVars, $cookieFile,
		$fmts = array(22 => '0|720|0|192', 45 => '1|720|1|192', 44 => '1|480|1|192', 35 => '2|480|0|128', 43 => '1|360|1|128', 34 => '2|360|0|128', 18 => '0|360|0|96', 6 => '2|270|3|64', 5 => '2|240|3|64', 36 => '3|240|0|36', 17 => '3|144|0|24');

	public function Download($link) {
		$this->cookieFile = DOWNLOAD_DIR.'YT_cookie.txt';
		$this->cookie = isset($_POST['step']) && !empty($_POST['cookie']) ? StrToCookies(decrypt(urldecode($_POST['cookie']))) : $this->loadCookie();
		$url = parse_url($link);
		$this->vid = array();

		if (host_matches('youtu.be', $url['host'])) preg_match('@/([\w\-\.]{11})@i', $url['path'], $this->vid);
		else if (empty($url['query']) || ($this->vid[1] = cut_str('&'.$url['query'].'&', '&v=', '&')) === false || !preg_match('@^[\w\-\.]{11}$@i', $this->vid[1])) preg_match('@/(?:v|(?:embed))/([\w\-\.]{11})@i', $url['path'], $this->vid);

		if (empty($this->vid[1])) html_error('Video ID not found.');
		$this->vid = $this->vid[1];
		$this->link = 'https://www.youtube.com/watch?v='.$this->vid;

		if (empty($_POST['step'])) $this->getFmtMaps();
		else $this->captcha();

		$yt_fmt = empty($_REQUEST['yt_fmt']) ? '' : $_REQUEST['yt_fmt'];
		if (empty($yt_fmt) && !isset($_GET['audl'])) return $this->QSelector();
		else if (isset($_REQUEST['ytube_mp4']) && $_REQUEST['ytube_mp4'] == 'on' && !empty($yt_fmt)) {
			//look for and download the highest quality we can find?
			if ($yt_fmt == 'highest') {
				foreach (array_keys($this->fmts) as $itag) if (!empty($this->fmtmaps[$itag])) break;
			} else if (!empty($this->fmtmaps[$yt_fmt])) {
				$itag = $yt_fmt;
			} else html_error('Specified video format not found');
		} else { //just get the one Youtube plays by default (in some cases it could also be the highest quality format)
			$itag = key($this->fmtmaps);
		}
		$fmt = $this->fmtmaps[$itag];
		$is_dash = empty($this->fmts[$itag]);

		if (empty($this->response['title'])) {
			if (empty($this->response['player_response']['videoDetails']['title'])) html_error('No video title found! Download halted.');
			else $this->response['title'] = $this->response['player_response']['videoDetails']['title'];
		}
		$filename = str_replace(str_split('\\\:*?"<>|=;'."\t\r\n\f"), '_', html_entity_decode(trim($this->response['title']), ENT_QUOTES));
		if (!empty($_REQUEST['cleanname'])) $filename = preg_replace('@[^ A-Za-z_\-\d\.,\(\)\[\]\{\}&\!\'\@\%\#]@u', '_', $filename);
		if (!empty($fmt['qualityLabel'])) $filename .= " [YT-{$fmt['qualityLabel']}]";
		else if (!empty($fmt['quality_label'])) $filename .= " [YT-{$fmt['quality_label']}]";
		else if (!$is_dash) {
			$v = explode('|', $this->fmts[$itag]);
			$filename .= " [YT-{$v[1]}p]";
		} else $filename .= " [YT-Audio]";
		$filename .= sprintf('[%s].%s', $this->vid, ($is_dash ? 'dash.' : '') . $fmt['_codecs']['container']);

		$this->RedirectDownload($fmt['url'], $filename, $this->cookie, 0, ($is_dash ? $this->link . "\r\nRange: bytes=0-" : 0), $filename);
	}

	private function FormToArr($content, $v1 = '&', $v2 = '=') {
		$rply = array();
		if (strpos($content, $v1) === false || strpos($content, $v2) === false) return $rply;
		foreach (array_filter(array_map('trim', explode($v1, $content))) as $v) {
			$v = array_map('trim', explode($v2, $v, 2));
			if ($v[0] != '') $rply[$v[0]] = $v[1];
		}
		return $rply;
	}

	private function captcha() {
		$url = 'https://www.youtube.com/das_captcha';
		if (!empty($_POST['step']) && $_POST['step'] == '1') {
			$post = $this->verifyReCaptchav2();
			$post['action_recaptcha_verify2'] = '1';
			$post['session_token'] = $_POST['session_token'];

			$page = $this->GetPage($url, $this->cookie, $post, $url);
			is_present($page, 'The verification code was invalid', 'The verification code was invalid or has timed out, please try again.');
			is_present($page, "\r\n\r\nAuthorization Error.", 'Error sending captcha.');
			is_notpresent($page, 'Set-Cookie: goojf=', 'Cannot get captcha cookie.');

			$this->cookie = GetCookiesArr($page, $this->cookie);
			unset($_POST['step']);
			$this->getFmtMaps();
		} else {
			$page = $this->GetPage($url, $this->cookie);
			$this->cookie = GetCookiesArr($page, $this->cookie);
			if (!preg_match('@class="g-recaptcha" data-sitekey="([\w\.\-]+)"@i', $page, $pid)) html_error('Error: reCAPTCHA2 not found.');

			$data = $this->DefaultParamArr($this->link, $this->cookie, 1, 1);
			$data['session_token'] = urlencode(cut_str($page, 'name="session_token" value="', '"'));
			if (isset($_REQUEST['ytube_mp4'])) $data['ytube_mp4'] = $_REQUEST['ytube_mp4'];
			if (isset($_REQUEST['ytdirect'])) $data['ytdirect'] = $_REQUEST['ytdirect'];
			if (isset($_REQUEST['yt_fmt'])) $data['yt_fmt'] = $_REQUEST['yt_fmt'];
			$data['step'] = '1';

			$this->reCAPTCHAv2($pid[1], $data);
		}
	}

	private function loadCookie() {
		if (@file_exists($this->cookieFile) && ($file = file_get_contents($this->cookieFile)) && ($saved = @unserialize($file)) && is_array($saved) && !empty($saved['hash']) && !empty($saved['cookie']) && ($saved['cookie'] = decrypt(base64_decode($saved['cookie']))) && sha1($saved['cookie']) == $saved['hash']) {
			return StrToCookies($saved['cookie']);
		}
		return array();
	}

	private function saveCookie() {
		if (!empty($this->cookie)) {
			$data = array('cookie' => CookiesToStr($this->cookie));
			$data['hash'] = sha1($data['cookie']);
			$data['cookie'] = base64_encode(encrypt($data['cookie']));
			file_put_contents($this->cookieFile, serialize($data));
		}
	}

	// Special Function Called by verifyReCaptchav2 When Captcha Is Incorrect, To Allow Retry. - Required
	protected function retryReCaptchav2() {
		$data = $this->DefaultParamArr($this->link, $this->cookie, 1, 1);
		foreach (array('step', 'action_recaptcha_verify2', 'session_token', 'ytube_mp4', 'ytdirect', 'yt_fmt') as $name) {
			if (!empty($_POST[$name])) $data[$name] = $_POST[$name];
		}
		return $this->reCAPTCHAv2($_POST['recaptcha2_public_key'], $data);
	}

	private function queryVideo() {
		$this->page = $this->GetPage('https://www.youtube.com/get_video_info?hl=en_US&video_id=' . $this->vid . '&eurl=https%3A%2F%2Fgoogle.com%2F&html5=1' . ($this->sts > 0 ? '&sts=' . $this->sts : ''), $this->cookie);
		$this->cookie = GetCookiesArr($this->page, $this->cookie);
		$this->response = array_map('urldecode', $this->FormToArr(substr($this->page, strpos($this->page, "\r\n\r\n") + 4)));
		if (!empty($this->response['requires_purchase'])) html_error('[Unsupported Video] This Video or Channel Requires a Payment to Watch.');
		$this->response['player_response'] = json_decode($this->response['player_response'], true);
	}

	private function getFmtMaps() {
		$this->queryVideo();

		if (!empty($this->response['reason'])) html_error('['.htmlspecialchars($this->response['errorcode']).'] '.htmlspecialchars($this->response['reason']));

		if (!empty($this->response['player_response']['playabilityStatus']['reason'])) html_error('['.htmlspecialchars($this->response['player_response']['playabilityStatus']['reason']).'] '.htmlspecialchars($this->response['player_response']['playabilityStatus']['errorScreen']['playerErrorMessageRenderer']['subreason']['runs'][0]['text']));

		if (!empty($this->response['player_response']['streamingData']['formats'])) {
			$this->response['_formats'] = $this->response['player_response']['streamingData']['formats'];
		}
		if (!empty($this->response['player_response']['streamingData']['adaptiveFormats'])) {
			$this->response['_adaptiveFormats'] = $this->response['player_response']['streamingData']['adaptiveFormats'];
		}

		if (in_array(substr($this->page, 9, 3), array('402', '429')) || preg_match('@Location: https?://(www\.)?youtube\.com/das_captcha@i', $this->page)) return $this->captcha();

		if (!empty($this->cookie['goojf'])) $this->saveCookie();

		$this->fmtmaps = array();
		$keys2Merge = array('cipher', 'signatureCipher');
		foreach (array('url_encoded_fmt_stream_map', 'adaptive_fmts', '_formats', '_adaptiveFormats') as $map) {
			if (empty($this->response[$map])) continue;
			if (!is_array($this->response[$map])) $this->response[$map] = explode(',', $this->response[$map]);
			foreach ($this->response[$map] as $fmt) {
				if (!is_array($fmt)) $fmt = array_map('urldecode', $this->FormToArr($fmt));
				foreach($keys2Merge as $key) if (!empty($fmt[$key])) {
					$fmt += array_map('urldecode', $this->FormToArr($fmt[$key]));
				}

				if (empty($fmt['itag']) || empty($fmt['url'])) continue;
				if (!empty($fmt['s']) && empty($this->encS)) {
					if ($this->sts < 1) return $this->getCipher();
					else html_error('[' . $this->sts . '] No decoded steps');
				}
				$fmt['url'] = parse_url($fmt['url']);
				$fmt['url']['query'] = array_map('urldecode', $this->FormToArr($fmt['url']['query']));
				if (!empty($fmt['s']) && !empty($fmt['sp']))
				{
					$fmt['url']['query']["{$fmt['sp']}"] = $this->sigDecode($fmt['s']);
				}
				else if (empty($fmt['s']) && !empty($fmt['sig']))
				{
					if (empty($fmt['url']['query']['signature'])) $fmt['url']['query']['signature'] = $fmt['sig'];
				}
				else if (empty($fmt['url']['query']['signature']) && empty($fmt['url']['query']['sig'])) html_error("Cannot get signature key name");

				if (empty($fmt['url']['query']['ratebypass'])) $fmt['url']['query']['ratebypass'] = 'yes'; // Fix for Slow Downloads of DASH Formats

				ksort($fmt['url']['query']);
				$fmt['url']['query'] = http_build_query($fmt['url']['query']);
				$fmt['url'] = rebuild_url($fmt['url']);

				if (!empty($fmt['mimeType']) && preg_match('@(audio|video)/(?:x-)?(\w+); codecs="(\w+)(?:\.\w+)*(?:, (\w+)(?:\.\w+)*)?"@', $fmt['mimeType'], $mimeType)) {
					$fmt['_codecs'] = array();
					$fmt['_codecs']['type'] = $mimeType[1];
					$fmt['_codecs']['container'] = $mimeType[2];
					if (!empty($mimeType[4])) {
						$fmt['_codecs']['type'] = 'dual';
						$fmt['_codecs']['video'] = $mimeType[3];
						$fmt['_codecs']['audio'] = $mimeType[4];
					} else if ($mimeType[1] == 'video') {
						$fmt['_codecs']['video'] = $mimeType[3];
					} else {
						$fmt['_codecs']['container'] = str_replace(array('mp4a', 'vorbis'), array('m4a', 'ogg'), $mimeType[3]);
						$fmt['_codecs']['audio'] = $mimeType[3];
					}
					if (!empty($fmt['_codecs']['video'])) $fmt['_codecs']['video'] = strtoupper(str_replace(array('av01', 'avc1'), array('AV1', 'H264'), $fmt['_codecs']['video']));
					if (!empty($fmt['_codecs']['audio'])) $fmt['_codecs']['audio'] = ucfirst(str_replace('mp4a', 'AAC', $fmt['_codecs']['audio']));
				}

				$this->fmtmaps[$fmt['itag']] = $fmt;
			}
		}

		if (empty($this->fmtmaps)) html_error('[' . $this->sts . '] Video links not found.');
	}

	private function decError($msg) {
		html_error("Error while decoding [{$this->sts}][{$this->js[2]}]: $msg");
	}

	private function findFunction($fName, $num) {
		if ($fName == 'T8') return "w$num";
		$obj = explode('.', $fName, 3);
		if (count($obj) > 2) $this->decError("Cannot search function: '$fName'");
		if (count($obj) > 1) {
			$fName = $obj[1];
			$obj = $obj[0];
			if (empty($this->jsVars[$obj]['src'])) {
				if (($spos = strpos($this->playerJs, "var $obj={")) === false || ($epos = strpos($this->playerJs, '};', $spos)) === false) $this->decError("Cannot find object '$obj'");
				$spos += strlen("var $obj={");
				$this->jsVars[$obj] = array('src' => substr($this->playerJs, $spos, $epos - $spos), 'fn' => array());
			}
			if (empty($this->jsVars[$obj]['fn'][$fName]['step'])) {
				$v = '[\$_A-Za-z][\$\w]*';
				if (!preg_match("@(?<=^|,)\s*$fName:function\($v(?:,($v))?\)\{([^}]+)\}\s*(?=,|$)@", $this->jsVars[$obj]['src'], $src)) $this->decError("Cannot find function '$obj.$fName'");
				$src[0] = trim($src[0]);
				$this->jsVars[$obj]['fn'][$fName] = array('src' => $src);

				if (empty($src[1])) return $this->jsVars[$obj]['fn'][$fName]['step'] = 'r';
				else if (preg_match("@var\s+($v)=($v)\[0\];\\2\[0\]=\\2\[{$src[1]}%\\2(?:\.length|\[$v\])\];\\2\[{$src[1]}(?:%\\2(?:\.length|\[$v\]))?\]=\\1@", $src[2])) {
					$this->jsVars[$obj]['fn'][$fName]['step'] = 'w%d';
					return "w$num";
				} else if (preg_match("@(?:$v=)?$v(?:\.s(p)?lice|\[$v\])\((?(1)0,){$src[1]}\)@", $src[2])) {
					$this->jsVars[$obj]['fn'][$fName]['step'] = 's%d';
					return "s$num";
				} else if (preg_match("@(?:$v=)?$v(?:\.reverse|\[$v\])\(\)@", $src[2])) return $this->jsVars[$obj]['fn'][$fName]['step'] = 'r';
				else $this->decError("Error parsing function '$obj.$fName'");
			} else return sprintf($this->jsVars[$obj]['fn'][$fName]['step'], $num);
		}
		if (empty($this->jsVars[$fName]['step'])) {
			if (($spos = strpos($this->playerJs, "function $fName(")) === false || ($epos = strpos($this->playerJs, '};', $spos)) === false) $this->decError("Cannot find function '$fName'");
			$this->jsVars[$fName] = array('src' => substr($this->playerJs, $spos, $epos - $spos));
			$v = '[\$_A-Za-z][\$\w]*';
			if (!preg_match("@^function\s+$fName\($v(?:,($v))?\)\{(.*)$@", $this->jsVars[$fName]['src'], $pars)) $this->decError("Cannot parse function '$fName'");
			if (empty($pars[1])) return $this->jsVars[$fName]['step'] = 'r';
			else if (preg_match("@var\s+($v)=($v)\[0\];\\2\[0\]=\\2\[{$pars[1]}%\\2(?:\.length|\[$v\])\];\\2\[{$pars[1]}(?:%\\2(?:\.length|\[$v\]))?\]=\\1@", $src[2])) {
				$this->jsVars[$fName]['step'] = 'w%d';
				return "w$num";
			} else if (preg_match("@(?:$v=)?$v(?:\.s(p)?lice|\[$v\])\((?(1)0,){$src[1]}\)@", $src[2])) {
				$this->jsVars[$fName]['step'] = 's%d';
				return "s$num";
			} else if (preg_match("@(?:$v=)?$v(?:\.reverse|\[$v\])\(\)@", $src[2])) return $this->jsVars[$fName]['step'] = 'r';
			else $this->decError("Error parsing function '$fName'");
		} else return sprintf($this->jsVars[$fName]['step'], $num);
	}

	// getCipher & sigDecode are based on jwz's youtubedown code.
	private function getCipher() {
		$this->changeMesg('<br />Video with ciphered signature, trying to decode it.', 1);
		$page = $this->GetPage('https://www.youtube.com/embed/'.$this->vid, $this->cookie);
		$this->cookie = GetCookiesArr($page, $this->cookie);

		if (preg_match('@"sts"\s*:\s*(\d+)@i', $page, $this->sts) && intval($this->sts[1])) {
			$this->sts = intval($this->sts[1]);
		}

		$savefile = DOWNLOAD_DIR.'YT_lastjs.txt';
		if (!preg_match('@(?<=[\"\'])(?:(?:https?:?)?//((?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?))?(/(?:[^\"\'/]+/)+?(?:html5)?player[-_][\w\-\.]+(?:(?:/\w+)?/[\w\-\.]+)?)\.js@i', str_replace('\\/', '/', $page), $this->js)) html_error('YT\'s player javascript not found.');

		$this->changeMesg(sprintf('<br />Found player: %s.js', $this->js[2]), 1);

		if (@file_exists($savefile) && ($file = file_get_contents($savefile, false, NULL, 0, 822)) && ($saved = @unserialize($file)) && is_array($saved) && !empty($saved['js']) && !empty($saved['sts']) && !empty($saved['steps']) && ((!$this->sts && $saved['js'] == $this->js[2]) || $saved['sts'] == $this->sts) && preg_match('@^\s*([ws]\d+|r)( ([ws]\d+|r))*\s*$@', $saved['steps'])) {
			$this->changeMesg(sprintf('<br />Using cached decoder: [%d] %s.', $saved['sts'], $saved['steps']), 1);
			$this->encS = explode(' ', trim($saved['steps']));
			if (empty($this->sts)) $this->sts = $saved['sts'];
		} else {
			$this->changeMesg('<br />Loading video player data.', 1);
			$this->playerJs = $this->GetPage('https://' . (!empty($this->js[1]) ? $this->js[1] : 'www.youtube.com') . $this->js[2] . '.js', $this->cookie, 0, 'https://www.youtube.com/embed/'.$this->vid);
			$v = '[\$_A-Za-z][\$\w]*';
			$v3 = '[\$_A-Za-z][\$\w]{3,}';
			if (empty($this->sts)) {
				if (preg_match('@\b(?:sts|signatureTimestamp)\s*[:=]\s*(\d+)@i', $this->playerJs, $sts)) {
					$this->sts = intval($sts[1]);
				} else if (preg_match("@[:=]($v+(?:\.$v+)?\(\s*\"STS\"[^()?:]+?\))\s*\?\s*\1\s*:\s*(\d\d+)\b@i", $this->playerJs, $sts)) {
					$this->sts = intval($sts[2]);
				} else if (preg_match("@\b(?:sts|signatureTimestamp)\s*[:=]\s*($v)@", $this->playerJs, $sts, PREG_OFFSET_CAPTURE) && preg_match("@(?:var\s+|[,{};])\s*{$sts[1][0]}\s*[=:]\s*(\d\d+)@", $this->playerJs, $sts2, 0, strrpos($this->playerJs, "\n", $sts[0][1] - strlen($this->playerJs)))) {
					$this->sts = intval($sts2[1]);
				}
				if (empty($this->sts)) html_error('Signature TimeStamp not found.');
			}
			//if (($spos = strpos($this->playerJs, '.sig||')) === false) $this->decError('Not found (".sig||")');
			//if (($cut1 = cut_str(substr($this->playerJs, $spos), '{', '}')) == false) $this->decError('Cannot get inner content of "if(X.sig||X.s)"');
			if (!preg_match("@(?:\.sig\|\||\.set\(\"signature\",|\|\"signature\",|$v\.sp,|$v=)(?:\(0,$v(?:\.$v)*\)\(|$v3\()?($v)\((?:\(0,$v(?:\.$v)*\)\(|$v3\()?$v\.s\)@", $this->playerJs, $fn)) $this->decError('Cannot get decoder function name');
			$fn = preg_quote($fn[1], '@');
			if (!preg_match("@(?:function\s+$fn\s*\(|var\s+$fn\s*=\s*function\s*\(|(?<=(?:{|,|;))\s*$fn\s*=\s*function\s*\()@", $this->playerJs, $fpos, PREG_OFFSET_CAPTURE)) $this->decError('Cannot find decoder function');
			$fpos = $fpos[0][1];
			if (($cut2 = cut_str(substr($this->playerJs, $fpos), '{', '}')) == false) $this->decError('Cannot get decoder function contents');
			$this->sigJs = preg_replace("@var $v=$v\[0\];$v\[0\]=($v)\[(\d+)%$v(?:\.length|\[$v\])\];$v\[\d+\]=$v;@", '$1=T8($1,$2);', trim($cut2));
			$this->encS = array();
			foreach (array_map('trim', explode(';', '{'.$this->sigJs.'}')) as $step) {
				if (($step[0] == '{' || substr($step, strlen($step) - 1, 1) == '}') && (preg_match("@^\{(?:var\s+)?$v=$v(?:\.split|\[$v\])\(\"\"\)$@", $step) || preg_match("@^return\s+$v(?:\.join|\[$v\])\(\"\"\);?\}$@", $step))) continue;
				else if (preg_match("@^(?:$v=)?((?:$v.)*$v)\($v\,(\d+)\)$@", $step, $s)) $this->encS[] = $this->findFunction($s[1], $s[2]);
				else if (preg_match("@^(?:$v=)?$v(?:\.s(p)?lice|\[$v\])\((?(1)0,)(\d+)\)$@", $step, $s)) $this->encS[] = 's'.$s[2];
				else if (preg_match("@^(?:$v=)?$v(?:\.reverse|\[$v\])\(\)$@", $step)) $this->encS[] = 'r';
				else $this->decError($step.' | Unknown step on decoder function.');
			}

			if (empty($this->encS)) $this->decError('Empty decoded result');
			$this->changeMesg(sprintf('<br />Decoder: [%d] %s.', $this->sts, implode(' ', $this->encS)), 1);
			file_put_contents($savefile, serialize(array('js' => $this->js[2], 'sts' => $this->sts, 'steps' => implode(' ', $this->encS))));
		}

		// Request video fmts with the current sts
		$this->getFmtMaps();
	}

	private function sigDecode($sig) {
		if (empty($this->encS)) $this->decError('sigDecode() can\'t be called before getCipher()');
		$_sig = $sig;
		$sig = str_split($sig);
		foreach ($this->encS as $_step) {
			if (!preg_match('@^\s*([wrs])(\d*)\s*$@', $_step, $step) || ($step[1] != 'r' && !array_key_exists(2, $step))) $this->decError("Unknown decoding step \"$_step\"");
			switch ($step[1]) {
				case 'w': $step[2] = (int)$step[2];$x = $sig[0];$sig[0] = $sig[$step[2] % count($sig)];$sig[$step[2]] = $x; break;
				case 's': $step[2] = (int)$step[2];$sig = array_slice($sig, $step[2]); break;
				case 'r': $sig = array_reverse($sig); break;
			}
		}
		return implode($sig);
	}

	private function bitrate2KMG($bitrate) {
		if (!is_numeric($bitrate)) return 'Unknown';
		$s = array('', 'K', 'M', 'G');
		$e = min(floor(log($bitrate) / log(1000)), count($s) - 1);
		return sprintf("%.2f {$s[$e]}bps", ($bitrate / pow(1000, $e)));
	}

	private function QSelector() {
		$C = array('V' => array('MP4', 'WebM', 'FLV', '3GP'), 'A' => array('AAC', 'Vorbis', 'Opus', 'MP3'));

		$sizes = array();
		/* Add a // at the start of this line for enable this code.
		if (extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') && !trim(ini_get('open_basedir'))) {
			$sizes = array();
			$opt = array(CURLOPT_FOLLOWLOCATION => true, CURLOPT_MAXREDIRS => 5, CURLOPT_NOBODY => true);
			foreach ($this->fmtmaps as $itag => $fmt) {
				if (empty($this->fmts[$itag]) || !empty($fmt['contentLength']) || !empty($fmt['clen'])) continue;
				$headers = explode("\r\n\r\n", cURL($fmt['url'], $this->cookie, 0, 0, 0, $opt));
				$headers = ((count($headers) > 2) ? $headers[count($headers) - 2] : $headers[0]) . "\r\n\r\n";
				if (substr($headers, 9, 3) == '200' && ($CL = cut_str($headers, "\nContent-Length: ", "\n")) && $CL > 1024) $sizes[$itag] = bytesToKbOrMbOrGb(trim($CL));
				if (substr($headers, 9, 3) == '403') {
					$this->changeMesg('<br />Cannot Ask Video Filesize of (' . $itag . ') (Signature Error?)');
					break;
				}
			}
			unset($headers, $CL);
		} //*/

		echo "\n<br /><br /><h3 style='text-align: center;'>".lang(216).".</h4>";
		echo "\n<center><form name='YT_QS' action='{$_SERVER['SCRIPT_NAME']}' method='POST'>\n";
		echo "<input type='hidden' name='yt_QS' value='on' />\n";
		echo '<label><input type="checkbox" name="cleanname" checked="checked" value="1" /><small>&nbsp;Remove non-supported characters from filename</small></label><br />';
		echo "<select name='yt_fmt' id='QS_fmt'>\n";
		foreach ($this->fmtmaps as $itag => $fmt) {
			if (!empty($this->fmts[$itag])) {
				// Classic Formats
				$size = (!empty($fmt['contentLength']) ? ' ('.bytesToKbOrMbOrGb($fmt['contentLength']).')' : (!empty($fmt['clen']) ? ' ('.bytesToKbOrMbOrGb($fmt['clen']).')' : (!empty($sizes[$itag]) ? ' ('.$sizes[$itag].')' : '')));
				if (($I = explode('|', $this->fmts[$itag]))) printf('<option value="%d"' . ($itag == '22' ? ' selected="selected"' : '') . ">[%1\$d] Video: %s %dp | Audio: %s ~%d Kbps%s</option>\n", $itag, $C['V'][$I[0]], $I[1], $C['A'][$I[2]], $I[3], $size);
			} else if (!empty($fmt['_codecs'])) {
				// DASH Streams
				$size = (!empty($fmt['contentLength']) ? ' ('.bytesToKbOrMbOrGb($fmt['contentLength']).')' : (!empty($fmt['clen']) ? ' ('.bytesToKbOrMbOrGb($fmt['clen']).')' : ''));
				switch ($fmt['_codecs']['type']) {
					case 'video':
						printf("<option value='%d'>[%1\$d] Video only: %s (%s) @ %s%s</option>\n", $itag, str_replace('WEBM', 'WebM', strtoupper($fmt['_codecs']['container'])), $fmt['_codecs']['video'], (!empty($fmt['qualityLabel']) ? $fmt['qualityLabel'] : $fmt['quality_label']), $size);
						break;
					case 'audio':
						printf("<option value='%d'>[%1\$d] Audio only: %s @ ~%s%s</option>\n", $itag, $fmt['_codecs']['audio'], $this->bitrate2KMG((!empty($fmt['averageBitrate']) ? $fmt['averageBitrate'] : $fmt['bitrate'])), $size);
						break;
				}
			}
		}
		echo "</select>\n";

		$data = $this->DefaultParamArr($this->link);
		$data['ytube_mp4'] = 'on';
		foreach ($data as $n => $v) echo("<input type='hidden' name='$n' id='QS_$n' value='$v' />\n");

		echo "<input type='submit' name='Th3-822' value='".lang(209)."' />\n";
		echo "</form></center>\n</body>\n</html>";
		exit;
	}
}

//re-written by szal based on original plugin by eqbal
//updated 07 June 2010
// [28-03-2011]  Fixed (!$video_id) regex. - Th3-822
// [29-03-2011]  Added support for captcha. - Th3-822
// [02-04-2011]  Fixed redirect error. [26-04-2011]  Added error msgs.  - Th3-822
// [04-8-2011]  Fixed for recent changes in fmt_stream_map content & some edits maded for work fine. (Redirect is needed yet) - Th3-822
// [12-8-2011]  Added support for videos that need login for verify age & Changed fmt order by quality & Fixed regexps for fileext. - Th3-822
// [13-8-2011]  Some fixes & removed not working code & fixed verify_age function. - Th3-822
// [17-9-2011]  Added function for skip 'verify_controversy' on youtube && Fixed cookies after captcha && Little changes. - Th3-822
// [26-1-2012]  Fixed regexp for get title, added a quality selector (if the one in template is removed) and some changes in the code. - Th3-822
// [17-5-2012]  Fixed captcha (Now uses reCaptcha). - Th3-822
// [14-9-2012]  Fixed Download links & small changes. - Th3-822
// [07-10-2012]  Fixed for redirect at link. - Th3-822
// [02-1-2013]  Using new way for getting links and video info, now it doesn't need login for restricted videos. - Th3-822
// [02-10-2013]  Fixed issues with videos with ciphered signature & Rewritten quality selector (Now it doesn't use lang) & Remove direct-link option & Added option for sanitize filenames & small changes. - Th3-822
// [04-3-2014]  Re-Added Support for 3GP quality. - Th3-822
// [16-3-2014]  Added functions for decoding ciphered signatures. - Th3-822
// [28-7-2014]  Fixed signature decoding functions. - Th3-822
// [17-12-2014]  Forced https on all the requests for avoid redirect errors. - Th3-822
// [14-1-2015]  Fixed Age Restrictions. (Please, do not annoy my inbox when a plugin fails, go to the forum) - Th3-822
// [21-1-2015]  Fixed backslash in filename when cleanname is off. - Th3-822
// [13-4-2015]  Fixed captcha detection. - Th3-822
// [05-2-2016]  Fixed captcha (Now uses reCaptcha2) & Added cookie storage for it. - Th3-822
// [08-6-2016]  Added support to download DASH formats & Revised video formats handling. - Th3-822
// [30-8-2016]  Fixed slow speed while downloading DASH streams. - Th3-822
// [30-4-2017]  Fixed signature decoding functions. - Th3-822
// [25-1-2018]  Fixed get_video_info. - Th3-822
// [03-2-2019]  Fixed signature decoding functions. - Th3-822
// [25-5-2019]  Fixed embed JS regex. - Th3-822
// [19-6-2019]  Fixed signature key name. - Th3-822
// [10-7-2019]  Fixed signature search and related functions. - Th3-822
// [27-8-2019]  Fixed video title code. - Th3-822
// [04-1-2020]  Fixed fmts handling & Fixed signature search. - Th3-822
// [02-2-2020]  Fixed signature search. - Th3-822
// [15-3-2020]  Fixed embed JS regex. - Th3-822
// [31-5-2020]  Fixed signature search & Rewrote quality selector to parse and show all available formats. - Th3-822
// [17-8-2020]  Fixed signature timestamp search. - Th3-822
// [30-5-2021]  Fixed get_video_info & Now MP4 @ 720p is default (if available) on the selector. - Th3-822
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class youwatch_org extends GenericXFS_DL {
	public $pluginVer = 6;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = true; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		// Custom Download Regexp
		$this->DLregexp = '@https?://fs\d+\.youwatch\.org(?:\:\d+)?/\w{58}/[^\t\r\n<>\'\"\?\&]+@i';

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php
if(!defined('RAPIDLEECH')) {
    require_once ('index.html');
    exit();
}

class ziddu_com extends DownloadClass {
    
    public function Download($link) {
        
        if ($_REQUEST['step'] == '1') {
            $post['fid'] = $_POST['fid'];
            $post['tid'] = urlencode($_POST['tid']);
            $post['securitycode'] = $_POST['captcha'];
            $post['fname'] = $_POST['fname'];
            $post['Keyword'] = 'Ok';
            $post['submit'] = $_POST['submit'];
            $dlink = urldecode($_POST['link']);
            $cookie = urldecode($_POST['cookie']);
            $Referer = urldecode($_POST['referer']);
            $filename = $_POST['fname'];
            $this->RedirectDownload($dlink, $filename, $cookie, $post, $Referer);
            exit();
        } else {
            $page = $this->GetPage($link);
            is_present($page, "/errortracking.php?msg=File not found", "File not found");
            if (preg_match('@Location: (http:\/\/[^\r\n]+)@i', $page, $redir)) {
                $link = trim($redir[1]);
                $page = $this->GetPage($link);
            }
            $cookie = GetCookies($page);
            if (!preg_match('%<form action="((http:\/\/[^\/]+)\/[^"]+)" method="POST"%', $page, $fr)) html_error('Error [Post Link not found!]');
            $rlink = trim($fr[1]);
            $server = trim($fr[2]);
            if (!preg_match_all('%<input type="hidden" name="([^"]+)" id="([^"]+)" value="([^"]+)?" \/>%', $page, $one) || !preg_match_all('%<input type="submit" name="([^"]+)" value="([^"]+)" \/>%', $page, $two)) html_error('Error Post Data 1 not found!');
            $match = array_merge(array_combine($one[1], $one[3]), array_combine($two[1], $two[2]));
            $post = array();
            foreach ($match as $k => $v) {
                $post[$k] = $v;
            }
            $page = $this->GetPage($rlink, $cookie, $post, $link);
            is_present($page, "File not found");
            $form = cut_str($page, '<form name="securefrm"', '</form>');
            if (!preg_match('@action="([^"]+)" method="post"@', $form, $dl)) html_error('Error [Download Link not found]');
            $dlink = $server.$dl[1];
            if (!preg_match_all('%<input type="(hidden|submit)" name="([^"]+)" id="([^"]+)" value="([^"]+)?"\/?>%', $form, $match)) html_error('Error [Post Data 2 not found!]');
            $match = array_combine($match[2], $match[4]);
            if (!preg_match('%mg src="([^"]+)"%', $form, $c)) html_error('Error [Captcha Data not found!]');
            
            // download captcha image
            $cap = $this->GetPage($server.$c[1], $cookie);
            $capt_img = substr($cap, strpos($cap, "\r\n\r\n") + 4);
            $imgfile = DOWNLOAD_DIR . "ziddu_captcha.png";

            if (file_exists($imgfile)) unlink($imgfile);
            if (empty($capt_img) || !write_file($imgfile, $capt_img)) html_error("Error getting CAPTCHA image.");
            // Captcha img downloaded
            
            $data = array_merge($this->DefaultParamArr($dlink, $cookie, $rlink), $match);
            $data['step'] = '1';
            $this->EnterCaptcha($imgfile, $data);
            exit();
        }
    }
    
    public function CheckBack($header) {
        is_notpresent($header, 'ontent-Disposition: attachment', 'You have entered wrong captcha!');
    }
}
/*
 * WRITTEN by kaox 17-sep-2009
 * UPDATE by kaox 15-sep-2010
 * CONVERTED INTO OOP FORMAT by Ruud v.Tony 15-02-2012
 */

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit();
}

if (!file_exists(HOST_DIR . 'download/GenericXFS_DL.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'download/GenericXFS_DL.php" (File doesn\'t exists)');
require_once(HOST_DIR . 'download/GenericXFS_DL.php');

class ziifile_com extends GenericXFS_DL {
	public $pluginVer = 14;
	public function Download($link) {
		$this->wwwDomain = false; // Switch to true if filehost forces it's domain with www.
		$this->cname = 'xfss'; // Session cookie name
		$this->sslLogin = false; // Force https on login.
		$this->embedDL = false; // Try to unpack player's js for finding download link. (Only hosts with video player)
		$this->unescaper = false; // Enable JS unescape decoder.

		$this->Start($link);
	}
}

// Written by Th3-822.

?>
<?php

if (!defined('RAPIDLEECH')) {
	require_once('index.html');
	exit;
}

class zippyshare_com extends DownloadClass {
	public $link;
	private $page, $cookie, $fid;
	public function Download($link) {
		$this->link = str_ireplace('http://', 'https://', $link);
		$this->cookie = array('ziplocale' => 'en');

		if (!preg_match('@https?://(?:[\w\-]+\.)*zippyshare\.com/\w/(\w+)@i', $this->link, $this->fid)) html_error('File ID not found at link. Invalid link?');
		$this->fid = $this->fid[1];

		if (!empty($_POST['step'])) switch ($_POST['step']) {
			case '1': return $this->CheckCaptcha();
			case '2': return $this->GetDecodedLink();
		}

		$this->page = $this->GetPage($this->link, $this->cookie);
		is_present($this->page, '>File does not exist on this server<', 'File does not exist.');
		is_present($this->page, '>File has expired and does not exist anymore on this server', 'File does not exist.');
		$this->cookie = GetCookiesArr($this->page, $this->cookie);

		//if (($pos = stripos($this->page, 'getElementById(\'dlbutton\').href')) !== false || ($pos = stripos($this->page, 'getElementById("dlbutton").href')) !== false) return $this->GetJSEncodedLink();
		if ($this->findJS()) return $this->GetJSEncodedLink();
		else return $this->GetCaptcha();
	}

	private function GetDecodedLink() {
		if (empty($_POST['dllink']) || ($dlink = parse_url($_POST['dllink'])) == false || empty($dlink['path'])) html_error('Empty decoded link field.');
		$this->cookie = urldecode($_POST['cookie']);

		$dlink = 'http://' . parse_url($this->link, PHP_URL_HOST) . $dlink['path'] . (!empty($dlink['query']) ? '?' . $dlink['query'] : '');
		$fname = urldecode(basename(parse_url($dlink, PHP_URL_PATH)));
		$this->RedirectDownload($dlink, $fname, $this->cookie);
	}

	private function findJS() {
		if (!preg_match_all('@<script(?:\s[^>]*)?>([^<]+)</script>@i', $this->page, $scripts)) html_error('No inline JS found at page.');
		foreach ($scripts[1] as $script) {
			if (preg_match('@\.getElementById\(\s*(?:(\'|\")(?i)(?:dlbutton|fimage)(?-i)\1|([\$_A-Za-z][\$\w]*))\)\.href\s*=\s*[\'\"](?i)(?:https?://(?:[\w\-]+\.)*zippyshare\.com)?/d/(?-i)'.$this->fid.'@', $script, $match)) {
				if (!empty($match[2])) $this->vname = $match[2];
				$this->script = $script;
				return true;
			}
			if (preg_match('@((?:[\$_A-Za-z][\$\w]*\.)*[\$_A-Za-z][\$\w]*)\s*\(\s*(?:(\'|\")(?:dlbutton|fimage)(?-i)\2|([\$_A-Za-z][\$\w]*))\s*,\s*[\'\"](?:https?://(?:[\w\-]+\.)*zippyshare\.com)?/d/(?-i)'.$this->fid.'@i', $script, $match)) {
				$this->fname = $match[1];
				if (!empty($match[3])) $this->vname = $match[3];
				$this->script = $script;
				return true;
			}
		}
		return false;
	}

	private function GetJSEncodedLink() {
		$this->script = rtrim(str_replace(array(').href', "'dlbutton'", '"dlbutton"', '    '), array(').value', "'T8_dllink'", '"T8_dllink"', "\t\t"), $this->script));
		if (!empty($this->fname)) $this->script = str_replace($this->fname, 'zsWriteLink', $this->script);
		if (empty($this->script)) html_error('Error while getting js code.');

		$T8 = '';
		if (preg_match_all('@getElementById[\s\t]*\([\s\t]*[\"\']([a-z][\w\.\-]*)[\"\'][\s\t]*\)@i', $this->script, $ids) && count($ids[0]) > 1) foreach (array_unique($ids[1]) as $id) {
			if ($id == 'T8_dllink') continue;
			if (!preg_match("@<([a-z][a-z\d]*)\s*(?:\w+\s*=\s*[\"\'][^\"\'<>]*[\"\']\s*)*(?:\s*id\s*=[\"\']{$id}[\"\']\s*)(?:\w+\s*=\s*[\"\'][^\"\'<>]*[\"\']\s*)*(?:(\s*>[^<>]*</\1)|(/)?[\s]*>)@i", $this->page, $tag)) break; // If it doesn't found the tag the decode will fail, im not sure if break or continue...
			$T8 .= (!empty($tag[2]) ? $tag[0].'>' : (empty($tag[3]) ? $tag[0].'</'.$tag[1].'>' : $tag[0]));
		}
		$this->script = preg_replace('@^\s*(?:function\s+[\$_A-Za-z][\$\w]*|(?:var\s+)?[\$_A-Za-z][\$\w]*\s*=\s*function)\s*\([^)]*\)\s*\{\s*[\$_A-Za-z][\$\w]*\.\w+\s*\(\s*[\'\"]\w+[\'\"]\s*\)\.value\s*=\s*[\'\"][^\'\"]?[\'\"]*\s*;\s*\};?@', '', $this->script, 1);
		if (preg_match('@^\s*function\s+([\$_A-Za-z][\$\w]*)\s*\(@i', $this->script, $funcName) || preg_match('@^\s*(?:var\s+)?([\$_A-Za-z][\$\w]*)\s*=\s*function\s*\(@i', $this->script, $funcName)) $this->script .= "\n\t\t{$funcName[1]}();";

		$data = $this->DefaultParamArr($this->link, $this->cookie);
		$data['step'] = '2';
		$data['dllink'] = '';
		echo "\n<div style='display:none;'>$T8</div>\n<form name='zs_dcode' action='{$GLOBALS['PHP_SELF']}' method='POST'><br />\n";
		foreach ($data as $name => $input) echo "<input type='hidden' name='$name' id='T8_$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
		echo("</form>\n<span id='T8_emsg' class='htmlerror' style='text-align:center;display:none;'></span>\n<noscript><span class='htmlerror'><b>Sorry, this code needs JavaScript enabled to work.</b></span></noscript>\n<script type='text/javascript'>/* <![CDATA[ Th3-822 */\n\tvar T8 = true;\n\tfunction zsWriteLink(a, b) {\n\t\tdocument.getElementById(a).value = b;\n\t}\n\ttry {{$this->script}\n\t} catch(e) {\n\t\t$('#T8_emsg').html('<b>Cannot decode link: ['+e.name+'] '+e.message+'</b>').show();\n\t\tT8 = false;\n\t}\n\tif (T8) window.setTimeout(\"$('form[name=zs_dcode]').submit();\", 300); // 300 Âµs to make sure that the value was decoded and added.\n/* ]]> */</script>\n\n</body>\n</html>");
		exit;
	}

	private function GetCaptcha() {
		if (!preg_match('@/d/\w+/(\d+)/[^\r\n\t\'\"<>\;]+@i', $this->page, $dlpath)) html_error('Download Link Not Found.');
		if (!preg_match('@\'sitekey\'\s*:\s*[\'\"]([\w\.\-]+)[\'\"]@i', $this->page, $cpid)) html_error('reCAPTCHA2 Not Found.');
		//if (!preg_match('@\Wshortencode[\s\t]*:[\s\t]*\'?(\d+)\'?@i', $this->page, $short)) html_error('Captcha Data Not Found.');

		$data = $this->DefaultParamArr($this->link, $this->cookie);
		$data['step'] = '1';
		$data['dlpath'] = $dlpath[0];
		$data['shortencode'] = $dlpath[1];

		$this->reCAPTCHAv2($cpid[1], $data);
	}

	// Special Function Called by verifyReCaptchav2 When Captcha Is Incorrect, To Allow Retry. - Required
	protected function retryReCaptchav2() {
		$data = $this->DefaultParamArr($this->link, $this->cookie);
		$data['step'] = '1';
		$data['shortencode'] = (!empty($_POST['shortencode']) ? $_POST['shortencode'] : '');
		$data['dlpath'] = (!empty($_POST['dlpath']) ? $_POST['dlpath'] : '');

		return $this->reCAPTCHAv2($_POST['recaptcha2_public_key'], $data);
	}

	private function CheckCaptcha() {
		$host = 'https://' . parse_url($this->link, PHP_URL_HOST);
		$this->cookie = urldecode($_POST['cookie']);

		$post = array();
		$post['response'] = $this->verifyReCaptchav2(true);
		$post['shortencode'] = urlencode($_POST['shortencode']);

		$page = $this->GetPage($host . '/rest/captcha/test', $this->cookie, $post, $this->link . "\r\nX-Requested-With: XMLHttpRequest");
		$body = strtolower(trim(substr($page, strpos($page, "\r\n\r\n"))));

		if ($body == 'false') html_error('Error: Wrong CAPTCHA Entered.');
		elseif ($body != 'true') html_error('Unknown Reply from Server.');

		$dlink = $host . $_POST['dlpath'];
		$fname = urldecode(basename(parse_url($dlink, PHP_URL_PATH)));
		$this->RedirectDownload($dlink, $fname, $this->cookie);
	}
}

// [24-11-2012]  Written by Th3-822. (Only for rev43 :D)
// [05-2-2013]  Added support for links that need user-side decoding of the link. - Th3-822
// [04-3-2013]  Fixed File doesn't exists error msg... - Th3-822
// [25-3-2014]  Fixed link decoder function. - Th3-822
// [11-1-2015] Fixed link regexp. (Happy new year) - Th3-822
// [07-3-2015]  Added Support for v2 reCAPTCHAs. - Th3-822
// [13-3-2015]  Quick fix to decoder function. - Th3-822
// [24-6-2018] Switched to https & small changes. - Th3-822
<html>
<head>
<title>RAPIDLEECH V2.2</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
@import url("../images/style.css");
-->
</style>
</head>
<body>
<center>
<img src="../images/logo_pm.gif" alt="RAPIDLEECH V2.2">
<h1>403: RapidLeech -> Forbidden</h1>
<hr />
You have reached this page in error, please use
your back button to return to RapidLeech.
</center>
</body>
</html>
order deny,allow
deny from all
<?php 
$upload_services[] = "115.com";
$max_file_size["115.com"] = 1024;
$page_upload["115.com"] = "115.com.php";  
?>
<?php

####### Account Info. ###########
$u115_login = ""; //Set you username
$u115_pass = ""; //Set your password
##############################

$not_done=true;
$continue_up=false;
if ($u115_login & $u115_pass)
    {
        $_REQUEST['my_login'] = $u115_login;
        $_REQUEST['my_pass'] = $u115_pass;
        $_REQUEST['action'] = "FORM";
        echo "<b><center>Use Default login/pass.</center></b>\n";
    }

if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["115.com"]; ?></b></small></tr>
</table>
</form>
<?php
    }

if ($continue_up)
    {
        $not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id="login" width=100% align=center>Login to U.115.com</div>
<?php 
        $post['login[account]'] = $_REQUEST['my_login'];
        $post['login[passwd]'] = $_REQUEST['my_pass'];
        $post['back'] = "http://www.115.com";
        $post['goto'] = "http%3A%2F%2F115.com";

        $page = geturl("passport.115.com", 80, "/?action=login", 0, 0, $post);            
        is_page($page);
        $cookie1 = GetCookies($page);
        
      //  echo (" <div> Page : $page </div>");
        
        $errorcode =cut_str ($page , "name='error_code' value='","'");
      //  echo (" <div> errorcode : $errorcode </div>");
      
        if($errorcode)
        {
             html_error("Error logging in - are your logins correct!");
        } 
      
      //  $linkaction =cut_str ($page ,' Location: ','');
      //  echo (" <div> linkaction : $linkaction </div>");
      //  
      //  if(!$linkaction)
      //  {
      //       html_error("Error logging in - are your logins correct!");
      //  } 
      //  $Url = parse_url($linkaction);
      //  $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie1, 0, 0, $_GET["proxy"],$pauth);    
      //  is_page($page);
      //  $cookie = GetCookies($page);
?>
<script>document.getElementById('login').style.display='none';</script>
<div id="info" width=100% align="center">Retrive upload ID</div>

<?php 
        $Url = parse_url("http://115.com/");
        $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""),"http://www.115.com/", $cookie1, 0, 0, $_GET["proxy"],$pauth);    
        
        $cookie = GetCookies($page);
        
        $Upload_url=cut_str ($page ,'"aid":1,"upload_url":"','",');
        $Upload_url=str_replace('\/','/',$Upload_url);
        
       // echo (" <div> Upload_url : $Upload_url </div>");
        
        $cookie_up =cut_str ($page ,"var USER_COOKIE = '","';");
        
        if(!$Upload_url)
        {
            html_error($Upload_url);
        }
?>
<script>document.getElementById('info').style.display='none';</script>
<?php 
        $url = parse_url ($Upload_url); 
        //$url= parse_url("http://up.u.115.com/upload");
        $fpost = array();
        $fpost['Filename'] = $lname;
        $fpost['cookie'] = $cookie_up;
        $fpost['aid'] = '1';
        $agent='Shockwave Flash';
        $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),"http://u.115.com/?ct=index&ac=my", $cookie, $fpost, $lfile, $lname, "Filedata" );
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
        //,"pick_code":"e65lenbo","ico":"
        $pickcode =cut_str ($upfiles ,'"pick_code":"','","ico"');
        //echo (" <div> pickcode : $pickcode </div>");
        //echo (" <div> upfiles : $upfiles  </div>");
        if(!$pickcode)
        {
             html_error("Finished, Go to your account to see Download-URL.");
        }
        else
        {
            echo (" <div> Note: You required login before you can see it. </div>");
            $download_link = "http://115.com/file/$pickcode";
        }
        // echo (" <div> Mark </div>");
    }
?>
<?php
$upload_services[] = '1fichier.com';
$max_file_size['1fichier.com'] = 2048;
$page_upload['1fichier.com'] = '1fichier.com.php';
?>
<?php
######## Account Info ########
$upload_acc['1fichier_com']['user'] = ''; //Set your login
$upload_acc['1fichier_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['1fichier_com']['user'] && $upload_acc['1fichier_com']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['1fichier_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['1fichier_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;EMail*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = '1fichier.com';
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('LG' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$post = array();
		$post['mail'] = urlencode($_REQUEST['up_login']);
		$post['pass'] = urlencode($_REQUEST['up_pass']);
		$post['lt'] = 'on';
		$post['restrict'] = 'on';
		$post['valider'] = 'Send';

		$page = geturl($domain, 443, '/login.pl', $referer, $cookie, $post, 0, 0, 0, 0, 'https');is_page($page);
		$cookie = GetCookiesArr($page, $cookie);

		is_present($page, 'Invalid email address');
		is_present($page, 'Invalid username or password', 'Login Failed: Email/Password incorrect.');

		$page = geturl($domain, 443, '/', $referer.'login.pl', $cookie, 0, 0, 0, 0, 0, 'https');is_page($page);
		is_notpresent($page, 'logout.pl">Logout', 'Login Error.');

		$login = true;
	} else {
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		$login = false;
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	if (!$login) {
		$page = geturl($domain, 443, '/', $referer, $cookie, 0, 0, 0, 0, 0, 'https');is_page($page);
		$cookie = GetCookiesArr($page, $cookie);
	}

	if (!preg_match('@action="((https?://(?:[\w-]+\.)*1fichier\.com)?(/)?upload\.cgi\?id=(?:[^\"\'\s<>]+))"@i', $page, $up)) html_error('Error: Upload url not found.');

	$post = array();
	$post['domain'] = '0';
	$post['message'] = $post['mails'] = $post['user'] = $post['dpass'] = $post['mail'] = '';
	if ($login) $post['did'] = '0';
	$post['submit'] = 'Send';

	$up_url = (empty($up[2]) ? "https://$domain".(empty($up[3]) ? '/' : '').$up[1] : $up[1]);

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'file[]', '', 0, 0, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (!preg_match('@\nLocation: ((https?://(?:[\w-]+\.)*1fichier\.com)?/end\.pl\?\w?id=(?:[^\"\'\s<>]+))@i', $upfiles, $end_url)) html_error('Error: Post Upload url not found.');

	$end_url = parse_url(empty($end_url[2]) ? (empty($up[2]) ? "https://$domain" : $up[2]) . $end_url[1] : $end_url[1]);

	$page = geturl($end_url['host'], defport($end_url), $end_url['path'].(!empty($end_url['query']) ? '?'.$end_url['query'] : ''), $up_url, $cookie, 0, 0, 0, 0, 0, $end_url['scheme']);is_page($page);

	if (preg_match('@https?://(?:\w+\.)*1fichier\.com/remove/([\w\-]+)/[^\s<>\"\']+@i', $page, $lnk)) {
		$download_link = $referer . '?' . $lnk[1];
		$delete_link = $lnk[0];
	} else if (preg_match('@https://(?:\w+\.)*1fichier\.com/\?\w+(?="|<)@i', $page, $lnk)) {
		$download_link = $lnk[0];
	} else html_error('Download link not found.');
}

//[18-3-2015]  Written by Th3-822.
//[25-6-2018] Fixed download link regexp for Member uploads & Fixed upload url regexp. - Th3-822
<?php 
$upload_services[]="2shared.com";
$max_file_size["2shared.com"]=1000;
$page_upload["2shared.com"] = "2shared.com.php";
?>
<?php
####### Account Info. ###########
$upload_acc['2shared_com']['user'] = ""; //Set your user
$upload_acc['2shared_com']['pass'] = ""; //Set your password
##########################

$_GET["proxy"] = isset($_GET["proxy"]) ? $_GET["proxy"] : '';
$not_done = true;
$continue_up = false;

if ($upload_acc['2shared_com']['user'] && $upload_acc['2shared_com']['pass']) {
	$_REQUEST['up_login'] = $upload_acc['2shared_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['2shared_com']['pass'];
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Using Default Login.</center></b>\n";
}

if (!empty($_REQUEST['action']) && $_REQUEST['action'] == "FORM") $continue_up = true;
else {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
}

if ($continue_up) {
	$not_done = false;
	$referer = "http://www.2shared.com/";
	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to 2shared.com</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post['login'] = $_REQUEST['up_login'];
		$post['password'] = $_REQUEST['up_pass'];

		$page = geturl("www.2shared.com", 80, "/login", $referer, $cookie, $post, 0, $_GET["proxy"], $pauth);is_page($page);
		is_present($page, "Invalid e-mail address or password", "Login Failed: Invalid Email or Password.");
		if (stripos($page, '"ok":false') !== false) {
			if ($err=cut_str($page, '"rejectReason":"', '"')) html_error("Login Failed: 2S says: '$err'.");
			else html_error("Login Failed.");
		}
		$cookie = GetCookiesArr($page);
		$login = true;
	} else html_error("Login Failed: Email or Password are empty. Please check login data.");

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl("www.2shared.com", 80, "/", $referer, $cookie, 0, 0, $_GET["proxy"], $pauth);is_page($page);
	if (!preg_match('@action="(https?://[^/|\"|\<|\>]+/[^\"|\<|\>]+)"@i', $page, $up)) html_error('Error: Cannot find upload server.');

	$post = array('mainDC' => cut_str($page, 'name="mainDC" value="', '"'));

	$up_url = $up[1];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url["host"], 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), $referer, $cookie, $post, $lfile, $lname, 'fff', '', $_GET["proxy"], $pauth);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";

	is_page($upfiles);

	if (stripos($upfiles, 'Your upload has successfully completed') === false) html_error('Error at upload');
	$page = geturl("www.2shared.com", 80, "/uploadComplete.jsp?".$url["query"], $referer, $cookie, 0, 0, $_GET["proxy"], $pauth);is_page($page);

	if (preg_match('@action="(https?://[^/|\"|\<|\>]+/[^\"|\<|\>]+)"[^\<|\>]*name="downloadForm@i', $page, $lnk)) {
		$download_link = $lnk[1];
		if (preg_match('@action="(https?://[^/|\"|\<|\>]+/[^\"|\<|\>]+)"[^\<|\>]*name="adminForm@i', $page, $admlnk)) $adm_link = $admlnk[1];
	} else html_error("Download link not found.");
}

//[17-6-2012] Rewritten (for adding login support) by Th3-822.

?>
<?
$upload_services[]="4share.vn_member";
$max_file_size["4share.vn_member"]= 200;
$page_upload["4share.vn_member"] = "4share.vn_member.php";
?>
<?php
####### Account Info. ###########
$fourshare_vn_login = ""; //Set your user id (login)
$fourshare_vn_pass = ""; //Set your password
##############################

$not_done = true;
$continue_up = false;
if ($fourshare_vn_login && $fourshare_vn_pass) {
    $_REQUEST['my_login'] = $fourshare_vn_login;
    $_REQUEST['my_pass'] = $fourshare_vn_pass;
    $_REQUEST['action'] = "FORM";
    echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up = true;
else {
    ?>
    <table border=0 style="width:270px;" cellspacing=0 align=center>
        <form method=post>
            <input type=hidden name=action value='FORM' />
            <tr><td nowrap>&nbsp;Username*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
            <tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
            <tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
            <tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["4share.vn"];
    exit; ?></b></small></tr>
    </table>
    </form>

    <?php
}
$continue_up = true;
if ($continue_up) {
    $not_done = false;
    ?>
    <table width=600 align=center>
    </td></tr>
    <tr><td align=center>
            <div id=login width=100% align=center>Login to up.4share.vn</div>
            <?php
            $page = geturl("up.4share.vn", 80, "/", 0, 0, 0, 0, $_GET["proxy"], $pauth);
            is_page($page);
            $cookie = GetCookies($page);
            $post = array();
            $post['inputUserName'] = trim($_REQUEST['my_login']);
            $post['inputPassword'] = trim($_REQUEST['my_pass']);
            $post['rememberlogin'] = 'on';
            $page = geturl("up.4share.vn", 80, "/", 0, $cookie, $post, 0, $_GET["proxy"], $pauth);
            if (!stristr($page, 'Location: /?act=accinfo')) {
                html_error('Login failed!');
            }
            $cookie = GetCookies($page);
            $page = geturl("up.4share.vn", 80, "/", 0, $cookie, 0, 0, $_GET["proxy"], $pauth);
            if (!preg_match('/SHARINGSESSID=[[:alnum:]]+;/i', $page, $lcook)) {
                html_error('Error getting login-cookie');
            }
//			print_r($lcook[0].' '.$cookie); exit();
//			echo '<textarea style="width:100%;">'.htmlentities($page).'</textarea>'; exit();
            ?>
            <script>document.getElementById('login').style.display='none';</script>
            <div id=info width=100% align=center>Retrive test</div>
            <script>document.getElementById('info').style.display='none';</script>
            <?php
            $url_up = "http://up.4share.vn/scripts/uploadify1.php";
            $fpost=array(
                'Filename'=>$lname,
                'name'=>trim($_REQUEST['my_login']),
                'folder'=>'/files'
            );
            $url = parse_url($url_up);
            $upfiles = upfile($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), "http://up.4share.vn/", $cookie, $fpost, $lfile, $lname, "Filedata");
            ?>
            <script>document.getElementById('progressblock').style.display='none';</script>
            <?php
            is_page($upfiles);
            preg_match("%<a href='(.*)' target='_blank'>%", $upfiles, $match);
            if (!$match[1])
                html_error('Error getting return url');
            $download_link = $match[1];
        }

// written by VinhNhaTrang 08/11/2010
        ?>
<?php 
$upload_services[] = '4shared.com_member';
$max_file_size['4shared.com_member'] = 2048;
$page_upload['4shared.com_member'] = '4shared.com_member.php';
?>
<?php
######## Account Info ########
$upload_acc['4shared_com']['user'] = ''; //Set your login
$upload_acc['4shared_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

// Check https support for requests.
$use_curl = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$chttps = false;
$use_https = true;
if ($use_curl) {
	$cV = curl_version();
	if (in_array('https', $cV['protocols'], true)) $chttps = true;
}
if (!extension_loaded('openssl') && !$chttps) $use_https = false;
else if (!$chttps) $use_curl = false;

if ($upload_acc['4shared_com']['user'] && $upload_acc['4shared_com']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['4shared_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['4shared_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'www.4shared.com';
	$referer = "https://$domain/";

	$home_url = $referer . 'account/home.jsp';

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('4langcookie' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$post = array();
		$post['login'] = urlencode($_REQUEST['up_login']);
		$post['password'] = urlencode($_REQUEST['up_pass']);
		$post['returnto'] = urlencode($home_url);
		$post['_remember'] = $post['remember'] = 'on';

		$page = ul_GetPage($referer . 'web/login', $cookie, $post, $referer);
		is_present($page, 'Invalid e-mail address or password', 'Login Failed: Email/Password incorrect.');

		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['Login']) || empty($cookie['Password'])) html_error('Login Error.');

		$login = true;
	} else {
		html_error('Login Failed: Login/Password empty.');
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$page = ul_GetPage($referer . 'account/home.jsp', $cookie, 0, $referer);
	$cookie = GetCookiesArr($page, $cookie);

	if (!preg_match('@dc_path\s*:\s*[\'\"](https?://dc\d+\.4shared\.com)[\'\"]@i', $page, $up_server)) html_error('Upload Server Not Found.');
	$up_server = $up_server[1];
	if (!preg_match('@(?:id="jsRootFolderIdForCurrentUser"|class="jsRootId") value="([\w\-\.]+)"@i', $page, $folder_id)) html_error('Root Folder ID Not Found.');
	$folder_id = urlencode($folder_id[1]);

	$up_url = "$up_server/main/upload.jsp?x-upload-dir=$folder_id";

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer . 'account/home.jsp', $cookie, array(), $lfile, $lname, 'tfff0', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (!preg_match('@https?://(?:www\.)?4shared\.com/\w+/[\w\-\.]+/[^\r\n\"\'<>]+\.html?@i', $upfiles, $download_link)) {
		if (preg_match('@id="alert"\s+value=\"([^\"\r\n<>]+)\"@i', $upfiles, $err)) html_error('Upload Error: ' . htmlspecialchars($err[1]));
		is_notpresent($upfiles, 'Your upload has successfully completed!', 'Upload Failed.');
		html_error('Download-Link not Found.');
	}

	$download_link = $download_link[0];
}

function ul_GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0) {
	if (!$referer && !empty($GLOBALS['Referer'])) {
		$referer = $GLOBALS['Referer'];
	}

	if ($GLOBALS['use_curl']) {
		if ($XMLRequest) $referer .= "\r\nX-Requested-With: XMLHttpRequest";
		$page = cURL($link, $cookie, $post, $referer, $auth);
	} else {
		global $pauth;
		$Url = parse_url($link);
		$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
		is_page($page);
	}
	return $page;
}

//[11-11-2015] ReWritten by Th3-822.
//[13-11-2015] Fixed Link Regexp. - Th3-822

?>
<?php
/*
@h@	/hosts/upload/GenericXFSHost.inc.php

@h@		Do not edit this file directly
@h@		as it's used by many plugins.
@h@		- Th3-822
*/
if (!defined('RAPIDLEECH')) exit;

// Check include
if (!isset($_T8) || !is_array($_T8) || empty($_T8['domain']) || $_T8['domain'] == 'domain.tld' || empty($_T8['v'])) {
	if (strtolower(basename(__FILE__)) == strtolower($page_upload[$_REQUEST['uploaded']])) html_error('This plugin can\'t be called directly.');
	html_error('Error: Called from non configured plugin "' . htmlentities($page_upload[$_REQUEST['uploaded']]) . '".');
}
if ($_T8['v'] > 9) html_error('Error: '.basename(__FILE__).' is outdated, please install last version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');

/* # Default Settings # */
$default = array();
$default['port'] = 80; // Server's port, default: 80 | 443 = https.
$default['path'] = '/'; // URL path to XFS script, default: '/'
$default['xfsFree'] = false; // Change to true if the host is using XFS free.
$default['sslLogin'] = false; // Force https on login.
$default['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
$default['anonUploadDisable'] = false; // Disallow non registered users upload. (XFS Pro)
$default['anonUploadLimit'] = 0; // File-size limit for non registered users (MB) - 0 = Plugin's limit | (XFS Pro)
$default['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$_T8 = array_merge($default, array_filter($_T8)); // Merge default settings with loader's settings

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$pauth = !empty($pauth) ? $pauth : false;
$not_done = true;

if (!$_T8['xfsFree'] && !empty($upload_acc[$acc_key_name]['user']) && !empty($upload_acc[$acc_key_name]['pass'])) {
	$_REQUEST['up_login'] = $upload_acc[$acc_key_name]['user'];
	$_REQUEST['up_pass'] = $upload_acc[$acc_key_name]['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
}

if (!$_T8['xfsFree'] && (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM')) {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='FORM' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".$page_upload[$_REQUEST['uploaded']]."</b></small></td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	$not_done = false;
	if (substr($_T8['path'], 0, 1) != '/') $_T8['path'] = '/'.$_T8['path'];
	if (substr($_T8['path'], -1) != '/') $_T8['path'] .= '/';
	$_T8['port'] = (!empty($_T8['port']) && $_T8['port'] > 0 && $_T8['port'] < 65536) ? (int)$_T8['port'] : 80;
	$scheme = ($_T8['port'] == 443) ? 'https' : 'http';
	$referer = $scheme.'://'.$_T8['domain'].$_T8['path'];

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to ".str_ireplace('www.', '', $_T8['domain'])."</div>\n";

	$cookie = (!empty($cookie)) ? (is_array($cookie) ? $cookie : StrToCookies($cookie)) : array();
	$cookie['lang'] = 'english';
	if ($_T8['xfsFree']) $login = false;
	elseif (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post['op'] = 'login';
		$post['redirect'] = '';
		$post['login'] = urlencode($_REQUEST['up_login']);
		$post['password'] = urlencode($_REQUEST['up_pass']);

		if (empty($_T8['fw_sendLogin']) || !is_callable($_T8['fw_sendLogin'])) {
			$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op=login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, ($_T8['sslLogin'] ? 'https' : $scheme));is_page($page);
		} else $page = call_user_func($_T8['fw_sendLogin'], $post);
		$header = substr($page, 0, strpos($page, "\r\n\r\n"));
		if (stripos($header, "\nLocation: ") !== false && preg_match('@\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($_T8['domain']) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$_T8['domain'] to 'www.{$_T8['domain']}'.");
		if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.');
		is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
		is_present($page, 'Please%20enter%20your%20e-mail', "Login failed: Missing account's email, login at site and set the email.");
		$cookie = GetCookiesArr($header, $cookie);
		if (empty($cookie['xfss']) && empty($cookie['login'])) html_error('Error: Login cookies not found.');
		$cookie['lang'] = 'english';
		$login = true;
	} else {
		if ($_T8['anonUploadDisable']) html_error('Login failed: User/Password empty.');
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		if ($_T8['anonUploadLimit'] > 0 && $fsize > $_T8['anonUploadLimit']*1024*1024) html_error('File is too big for anon upload');
		$login = false;
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op='.(empty($_T8['opUploadName']) ? 'upload' : $_T8['opUploadName']), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
	if (substr($page, 9, 3) != '200') {
		$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'], $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
	}
	$header = substr($page, 0, strpos($page, "\r\n\r\n"));
	if (!$login && stripos($header, "\nLocation: ") !== false && preg_match('@\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($_T8['domain']) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$_T8['domain'] to 'www.{$_T8['domain']}'.");

	if (preg_match('@var[\s\t]+max_upload_filesize[\s\t]*=[\s\t]*[\'\"]?(\d+)[\'\"]?[\s\t]*;@i', $page, $fzlimit) && $fzlimit[1] > 0 && $fsize > $fzlimit[1]*1024*1024) html_error('Error: '.lang(66)); // Max upload filesize test

	if (!preg_match('@action=["\']((https?://[^/"\']+)?/(?:[^\?"\'/]+/)*[\w\-]+(?:\.cgi)?)\?(?:\w+=\w+&)*(?:upload_id=|upload_type=file)@i', $page, $up) && (empty($_T8['flashUpload']) || !preg_match('@[\'"]?uploader[\'"]?\s*:\s*[\'"]((https?://[^/"\']+)?/(?:[^\?"\'/]+/)*'.preg_quote((is_string($_T8['flashUpload']) ? $_T8['flashUpload'] :'up_flash.cgi'), '@').')[\'"]@i', $page, $up))) {
		is_present($page, 'We\'re sorry, there are no servers available for upload at the moment.', 'Site isn\'t accepting uploads.');
		is_present($page, 'Uploads are disabled for your country:', 'Site isn\'t accepting uploads from your server\'s country.');
		is_present($page, 'Uploads are disabled for your user type', 'Uploads are disabled for your account type.');
		if (!$login) {
			if (stripos($header, "\nLocation: ") !== false) is_present(cut_str($header, "\nLocation: ", "\n"), '?op=login', 'Please set '.($_T8['xfsFree'] ? '$_T8[\'xfsFree\'] to false and ' : '').'$_T8[\'anonUploadDisable\'] to true.');
			is_present($page, '>Register on site to be able to upload files<', 'Please set '.($_T8['xfsFree'] ? '$_T8[\'xfsFree\'] to false and ' : '').'$_T8[\'anonUploadDisable\'] to true.');
		}
		html_error('Error: Cannot find upload server.');
	}
	$up_url = (empty($up[2])) ? $scheme.'://'.$_T8['domain'].$up[1] : $up[1];

	// File-ext checks
	if (preg_match('@var[\s\t]+ext_allowed[\s\t]*=[\s\t]*[\'\"]\|?(\w+(?:\|\w+)*)\|?[\'\"][\s\t]*;@i', $page, $allowedExts) || preg_match('@var[\s\t]+ext_not_allowed[\s\t]*=[\s\t]*[\'\"]\|?(\w+(?:\|\w+)*)\|?[\'\"][\s\t]*;@i', $page, $notAllowedExts)) {
		$fExt = (strpos($lname, '.') !== false) ? strtolower(substr(strrchr($lname, '.'), 1)) : '';
		if (!empty($allowedExts[1])) {
			$allowedExts = array_map('strtolower', array_filter(explode('|', $allowedExts[1])));
			if (!in_array($fExt, $allowedExts)) html_error('Server doesn\'t allow upload of files with this ext: "'.htmlentities($fExt).'".');
		}
		if (!empty($notAllowedExts[1])) {
			$notAllowedExts = array_map('strtolower', array_filter(explode('|', $notAllowedExts[1])));
			if (in_array($fExt, $notAllowedExts)) html_error('Server doesn\'t allow upload of files with this ext: "'.htmlentities($fExt).'".');
		}
	}

	$post = array();
	if (empty($_T8['flashUpload'])) {
		$post['upload_type'] = 'file';
		$post['sess_id'] = !empty($cookie['xfss']) ? $cookie['xfss'] : cut_str($page, 'name="sess_id" value="', '"');
		foreach (array('srv_tmp_url', 'utype', 'srv_id', 'disk_id') as $tmpName) {
			if (stripos($page, "name=\"$tmpName\" value=\"") !== false && ($tmp = cut_str($page, "name=\"$tmpName\" value=\"", '"'))) $post["$tmpName"] = $tmp;
		}
		$post['link_pass'] = $post['link_rcpt'] = '';
		$post['file_descr'] = 'Uploaded with Rapidleech.';
		$post['file_public'] = '1';
		$post['tos'] = '1';
		$post['submit_btn'] = ' Upload! ';

		$up_url .= '?upload_id=';
		for ($i = 0; $i < 12; $i++) $up_url .= mt_rand(0,9);
		$up_url .= '&js_on=1';
		if (!$_T8['xfsFree']) {
			if (empty($post['utype']) && ($tmp = cut_str($page, "var utype='", "'"))) $up_url .= "&utype=$tmp";
			$up_url .= '&upload_type=file'.(!empty($post['disk_id']) ? '&disk_id=' . urlencode($post['disk_id']) : '');
		}
	} else {
		$post['Filename'] = $lname;
		if ($login) if (!($post['sess_id'] = cut_str($page, 'name="sess_id" value="', '"'))) {
			if (!empty($cookie['xfss'])) $post['sess_id'] = $cookie['xfss'];
			elseif (preg_match('@["\']sess_id["\']\s*:\s*["\'](\w+)["\']@i', $page, $sid)) $post['sess_id'] = $sid[1];
			else html_error('Flash upload session key not found.');
		}
		$post['Upload'] = 'Submit Query';
	}

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	if (!empty($_T8['flashUpload'])) $url['path'] = substr($url['path'], 0, strrpos($url['path'], '/') + 1).(is_string($_T8['flashUpload']) ? $_T8['flashUpload'] : 'up_flash.cgi');
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, $cookie, $post, $lfile, $lname,
	(empty($_T8['flashUpload']) ? 'file' : 'Filedata'), '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (!$login && stripos($page, 'Uploads not enabled for this type of users') !== false) html_error('Please set '.($_T8['xfsFree'] ? '$_T8[\'xfsFree\'] to false and ' : '').'$_T8[\'anonUploadDisable\'] to true.');

	$statuscode = intval(substr($upfiles, 9, 3));
	if ($statuscode >= 400 || preg_match('@<body><b>([^<>]+)</b></body></html>@i', $upfiles, $err)) html_error("Upload server isn't working or has failed (HTTP $statuscode)".(!empty($err[1]) ? ', response: ' . htmlspecialchars($err[1]) : '.'));

	$page = (empty($_T8['flashUpload']) ? cut_str($upfiles, '<Form name=\'F1\'', '</Form>') : false);
	if (!empty($page)) {
		// Normal Upload (F1 Form)
		if (!preg_match_all('@<textarea [^<>]*name=\'([^\']+)\'[^<>]*>([^>]*)</textarea>@i', $page, $textareas)) html_error('Error: upload_result data not found.');
		$post = array_map('urlencode', array_map('html_entity_decode', array_combine(array_map('trim', $textareas[1]), array_map('trim', $textareas[2]))));
		if (empty($post['op']) || strtolower(urldecode($post['op'])) != 'upload_result') html_error('Error: "upload_result" value not found.');
		if (empty($post['fn'])) html_error('Error: "fn" input not found.');
		if (strtolower($post['st']) != 'ok') html_error('Upload failed, response: '.htmlspecialchars(urldecode($post['st'])));
	} else if (!empty($_T8['flashUpload'])) {
		// Flash Upload (EOL?)
		$body = trim(substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4));
		if (strpos($body, ':') === false || !($reply = explode(':', $body, 6)) || strlen($reply[0]) != 12) html_error('Bad response from flash uploader, response: ' . htmlspecialchars($body));
		//$download_link = $referer.$reply[0];
		//return;
		$post = array('op' => 'upload_result', 'fn' => urlencode($reply[0]), 'st' => 'OK');
	} elseif (preg_match('@"file_status"\s*:\s*"([^\"\'\]\}]+)"@', $upfiles, $reply) && (strtolower($reply[1]) != 'ok' || preg_match('@"file_code"\s*:\s*"(\w{12})"@', $upfiles, $fileid))) {
		// New JSON response.
		if (empty($fileid)) html_error('Upload failed, json response: '.htmlspecialchars($reply[1]));
		$post = array('op' => 'upload_result', 'fn' => urlencode($fileid[1]), 'st' => urlencode($reply[1]));
	} else html_error('Error: upload_result form/json not found.');

	$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'], $up_url, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);

	$host_rexexp = 'https?://(?:www\.)?'.preg_quote(str_ireplace('www.', '', $_T8['domain']).$_T8['path'], '@');
	if (preg_match('@('.$host_rexexp.'\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?)\?killcode=\w+@i', $page, $lnk)) {
		$download_link = $lnk[1];
		$delete_link = $lnk[0];
	} elseif (preg_match('@'.$host_rexexp.'del-(\w{12})-\w+/([^<>\"\'\r\n]+)@i', $page, $lnk)) {
		$download_link = substr($lnk[0], 0, (stripos($lnk[0], '/del-') + 1)) . $lnk[2] . '/' . $lnk[3];
		$delete_link = $lnk[0];
	} elseif (preg_match('@'.$host_rexexp.'\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?(?=[\r\n\t\s\'\"<>])@i', $page, $lnk)) $download_link = $lnk[0];
	else html_error('Download link not found.');
}

//[17-8-2012] Written by Th3-822
//[30-9-2012] Using ?op=upload for some sites that need it. - Th3-822
//[17-10-2012] Added "domain requires the www." check. - Th3-822
//[08-11-2012] Added XFS Free support. - Th3-822
//[16-3-2013] Some updates, it should support more sites now & Added more error msgs. - Th3-822
//[05-8-2013] Plugin rewritten for making it a include (for saving space) & Added file-ext check & Small edits. - Th3-822
//[21-9-2013] Fixed upload url regexp (Now it will work on hosts that change upload.cgi filename/path) & Edits for allow extra cookies & Added support for XFS's flash upload. - Th3-822
//[22-1-2014] Added support for custom port and https on whole site, login or upload. - Th3-822
//[21-4-2014] Added urlencode on login $post. - Th3-822
//[29-10-2015] Fixed upload server regexp & added callback for login post & fixed upload response. - Th3-822

?>
<?php 
$upload_services[] = "adrive.com";
$max_file_size["adrive.com"] = 2048;
$page_upload["adrive.com"] = "adrive.com.php";  
?>
<?php
(!extension_loaded('curl')) ? html_error("Error: cURL is not enabled", 0) : '';

####### Account Info. ###########
$adrive_com_login = ""; //Set you email
$adrive_com_pass = ""; //Set your password
##############################

function get_ssl_page($url, $post='', $cookie=''){
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_COOKIE, $cookie);
	//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_HEADER, 1);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_POST, 1);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
	$page = curl_exec($ch);
	curl_close($ch);
	return $page;
}

$not_done=true;
$continue_up=false;
if ($adrive_com_login & $adrive_com_pass){
	$_REQUEST['my_login'] = $adrive_com_login;
	$_REQUEST['my_pass'] = $adrive_com_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Email*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["adrive.com"]; ?></b></small></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to ADrive.com</div>
<?php 
			$page = get_ssl_page("https://www.adrive.com/login/login", "email=".$_REQUEST['my_login']."&passwrd=".$_REQUEST['my_pass']."&forcelogout=1");
			$cookies = GetCookies($page);
			preg_match('/symfony=(.*?);/i', $cookies, $cook);
			$cookie = 'symfony='.$cook[1].'; '.'orig_ref=https://www.adrive.com/login';
?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php 
			$Url = parse_url("http://www.adrive.com/home/httpuploadfile?dir=%3E");
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, 0, 0, $_GET["proxy"],$pauth);
			preg_match('/action="(.*?)"/i', $page, $up_url);
			$url_action = 'http://www.adrive.com'.$up_url[1];
			$fpost['directory'] = '/';
			$fpost['commit'] = 'Upload';
?>
<script>document.getElementById('info').style.display='none';</script>
<?php 		
			$url = parse_url($url_action);
			$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),"http://www.adrive.com/home/httpuploadfile?dir=%3E", $cookie, $fpost, $lfile, $lname, "userfile[]");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
			$Url = parse_url("http://www.adrive.com/login/logout");
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, 0, 0, $_GET["proxy"],$pauth);
			html_error("Finished, Go to your account to see Download-URL.");
	}
?>
<?php
$upload_services[] = 'alfafile.net_member';
$max_file_size['alfafile.net_member'] = false;
$page_upload['alfafile.net_member'] = 'alfafile.net_member.php';  
?>
<?php
######## Account Info ########
$upload_acc['alfafile_net']['user'] = ''; //Set your login
$upload_acc['alfafile_net']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

// Check https support for requests.
$use_curl = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$chttps = false;
$use_https = true;
if ($use_curl) {
	$cV = curl_version();
	if (in_array('https', $cV['protocols'], true)) $chttps = true;
}
if (!extension_loaded('openssl') && !$chttps) $use_https = false;
else if (!$chttps) $use_curl = false;

if ($upload_acc['alfafile_net']['user'] && $upload_acc['alfafile_net']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['alfafile_net']['user'];
	$_REQUEST['up_pass'] = $upload_acc['alfafile_net']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'alfafile.net';
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('lang' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$login_json = ApiReq('user/login', array('login' => $_REQUEST['up_login'], 'password' => $_REQUEST['up_pass']));
		if (empty($login_json['token'])) html_error('Login Token Not Found.');
		if (empty($login_json['user'])) html_error('User Data Not Found.');
		if (!empty($login_json['user']['upload']['max_file_size']) && $fsize > $login_json['user']['upload']['max_file_size']) html_error('User does not have enough space for this file.');

		$login = true;
	} else {
		html_error('Login Failed: Login/Password empty.');
	}

	// Hashing File
	echo "<script type='text/javascript'>document.getElementById('info').innerHTML = 'Hashing File...';</script>\n";

	$fileHash = md5_file($lfile, false);

	// Preparing Upload
	echo "<script type='text/javascript'>document.getElementById('info').innerHTML = 'Preparing Upload';</script>\n";

	$preUpload = ApiReq('file/upload', array('name' => $lname, 'size' => $fsize, 'hash' => $fileHash));
	if (empty($preUpload['upload'])) html_error('Empty PreUpload Response.');
	$preUpload = $preUpload['upload'];

	if (empty($preUpload['url'])) html_error('Upload URL not found.');
	if ($preUpload['state'] !== 0) {
		if ($preUpload['state_label'] == 'Done' && !empty($preUpload['file']['url'])) return $download_link = $preUpload['file']['url']; // Instantupload
		html_error(sprintf('Invalid PreUpload State: [%d] %s', $preUpload['state'], htmlspecialchars($preUpload['state_label'], ENT_QUOTES)));
	}

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($preUpload['url']);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, array(), $lfile, $lname, 'file', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	is_page($upfiles);

	$postUpload = json2array($upfiles, 'Post-Upload Error');
	if (empty($postUpload['response']) && !empty($postUpload['details'])) html_error('[Post-Upload Error] ' . htmlspecialchars($postUpload['details'], ENT_QUOTES));
	$postUpload = $postUpload['response'];
	if (empty($postUpload['upload'])) html_error('Empty PostUpload Response.');
	$postUpload = $postUpload['upload'];

	if (empty($postUpload['state']) || $postUpload['state'] > 1) {
		if ($postUpload['state'] == 2 && $postUpload['state_label'] == 'Done' && !empty($postUpload['file']['url'])) return $download_link = $postUpload['file']['url'];
		html_error(sprintf('Invalid PostUpload State: [%d] %s', $postUpload['state'], htmlspecialchars($postUpload['state_label'], ENT_QUOTES)));
	}

	// Check Upload
	echo "<div id='T8_div' width='100%' align='center'>Checking Finished Upload : Try <span id='T8_try'>0</span><br /><span id='T8_status'></span></div>\n";

	$x = 1;
	do {
		echo "<script type='text/javascript'>document.getElementById('T8_try').innerHTML = '$x';</script>\n";

		sleep($x);
		$uploadInfo = ApiReq('file/upload_info', array('upload_id' => $preUpload['upload_id']));
		if (empty($uploadInfo['upload'])) html_error('Empty uploadInfo Response.');
		$uploadInfo = $uploadInfo['upload'];

		echo "<script type='text/javascript'>document.getElementById('T8_status').innerHTML += '" . htmlspecialchars($uploadInfo['state_label'], ENT_QUOTES) . "<br />';</script>\n";
	} while ($x++ < 10 && $uploadInfo['state'] == 1);

	if ($uploadInfo['state'] != 2 && $uploadInfo['state_label'] != 'Done') {
		html_error(sprintf('Invalid uploadInfo State: [%d] %s', $uploadInfo['state'], htmlspecialchars($uploadInfo['state_label'], ENT_QUOTES)));
	}

	if (empty($uploadInfo['file']['url'])) html_error('Error: File URL not found.');
	$download_link = $uploadInfo['file']['url'];
}

function ul_GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0) {
	if (!$referer && !empty($GLOBALS['Referer'])) {
		$referer = $GLOBALS['Referer'];
	}

	if ($GLOBALS['use_curl']) {
		if ($XMLRequest) $referer .= "\r\nX-Requested-With: XMLHttpRequest";
		$page = cURL($link, $cookie, $post, $referer, $auth);
	} else {
		global $pauth;
		$Url = parse_url($link);
		$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
		is_page($page);
	}
	return $page;
}

function ApiReq($path, $post = array()) {
	if (!is_array($post)) $post = array();
	if ($path != 'user/login' && !empty($GLOBALS['login_json']['token'])) $post['token'] = $GLOBALS['login_json']['token'];

	$page = ul_GetPage("https://alfafile.net/api/v1/$path", 0, array_map('urlencode', $post), 'https://alfafile.net/');
	$reply = json2array($page, "ApiReq($path) Error");

	if (empty($reply['response']) && !empty($reply['details'])) html_error("[ApiReq($path) Error] " . htmlspecialchars($reply['details'], ENT_QUOTES));

	return $reply['response'];
}

function json2array($content, $errorPrefix = 'Error') {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (empty($content)) return NULL;
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error("[$errorPrefix]: JSON start braces not found.");
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error("[$errorPrefix]: No JSON content.");
	$rply = json_decode($content, true);
	if ($rply === NULL) html_error("[$errorPrefix]: Error reading JSON.");
	return $rply;
}

//[24-12-2015]  Written by Th3-822.

?>
<?php
$upload_services[]="amonshare.com";
$max_file_size["amonshare.com"]=300;
$page_upload["amonshare.com"] = "amonshare.com.php";
?>
<?php

####################################################################################################################
######################### MODULE UPLOAD PLUGIN FOR RAPIDLEECH - WRITTEN BY KAOX ####################################
####################################################################################################################

$site_login = '';            // site_login
$site_pass = '';             // site_pass
$mode = "member";            // switch this variable if must upload in "guest" "member" or "premium"
 
 
$form =<<<FORM
     
<table border=0 style="width:350px;" cellspacing=0 align=center> <form method=post> <input type=hidden name=action value='FORM' /> <tr><td nowrap>&nbsp;Username*</td><td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</td></tr> <tr><td nowrap>&nbsp;Password*</td><td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</td></tr> <tr><td colspan=2 align=center><input type=submit value='Upload'></td></tr> </form> </table>       
FORM;
            
$not_done= true;

	if ($mode!="guest" && $mode!="member" && $mode!="premium")
	{
	html_error("mistake in \$mode - Please riedit the plugin not let \$mode variable blank or different from guest,member or premium value" , 0 ); 
	}
	if ($mode == "member" or $mode == "premium")
	{
		if ($_REQUEST['action'] == "FORM")
		{
		$continue_up = true;
		$user= $_REQUEST['my_login'];
		$pass= $_REQUEST['my_pass'];
		}elseif($site_login && $site_pass)
		{
		$continue_up = true;
		$user = $site_login;
		$pass = $site_pass;
		echo "<b><center>Use Default login/pass.</center></b>";
		}else{ 
 
        
		echo $form;
		     }
	}
?>
<table width=600 align=center> </td></tr> <tr><td align=center> <script>document.getElementById('login').style.display='none';</script> <script>document.getElementById('info').style.display='none';</script> <script>document.getElementById('progressblock').style.display='none';</script> 
<?php

switch ($mode){
  
	case "guest":
	echo ('<b><center style="color: #C0C0C0"><span style="background-color: #F8F8B6">Use guest mode</span></center></b><br>');
///////////////////////////////////////////////////// START ////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////// END //////////////////////////////////////////////////////////
	$not_done= false;
	break;

	case "member":
	if ($continue_up){
	echo ('<b><center style="color: #00FF00"><span style="background-color: #F8F8B6">Use member mode</span></center></b><br>');
///////////////////////////////////////////////////// START ////////////////////////////////////////////////////////

	$refer="http://amonshare.com/";
	$Url=parse_url($refer);
	$post=array();
	$post["op"]="login";
	$post["redirect"]="";
	$post["login"]=$user;
	$post["password"]=$pass;
	$post["x"]=rand(5,90);
	$post["y"]=rand(5,90);
	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://amonshare.com/login.html", 0, $post, 0, $_GET["proxy"],$pauth);
	is_page($page);
	$cookie=GetCookies($page);
	if ($cookie=="") html_error( "Login failed . Please check your login detail" , 0 );
	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://amonshare.com/?op=my_files", $cookie, 0, 0, $_GET["proxy"],$pauth);
	is_page($page);
	unset($post);

	$sess_id = cut_str($page,'e="sess_id" value="','"');
	$id=str_replace('.','',microtime(1)).'0';
	$url = parse_url(cut_str( $page ,'action="' ,'"' ).$id."&js_on=1&utype=reg&upload_type=file");
	$post['upload_type']='file';
	$post['sess_id']=$sess_id;
	$post['link_rcpt']='';
	$post['link_pass']='';
	$post['tos']='1';
	$post['submit_btn']=' Upload! ';

	$page = upfile($url["host"], defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""), $refer , $cookie, $post, $lfile, $lname, "file_0");
	is_page($page);
	$snap = cut_str ( $page ,"textarea name='st'>" ,"<" );
	if ($snap !=="OK") html_error( "Error upload file" , 0 );
	unset($post);
	$fn = cut_str ( $page ,"name='fn'>" ,"<" );
	$post["fn"]=$fn;
	$post["st"]="OK";
	$post["op"]="upload_result";

	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $UrlAct, $cookie, $post, 0, $_GET["proxy"],$pauth);
	is_page($page);

	$snap = cut_str ( $page ,'Delete Link:' ,'</tr>' );
	$download_link = cut_str ( $page ,'[URL=' ,']' );
	$delete_link  = cut_str ( $snap ,'value="' ,'"' );


///////////////////////////////////////////////////// END //////////////////////////////////////////////////////////
	$not_done= false;
	break; 
}

	case "premium":
	if ($continue_up){
	echo ('<b><center style="color: #FF0000"><span style="background-color: #F8F8B6">Use premium mode</span></center></b><br>');
///////////////////////////////////////////////////// START ////////////////////////////////////////////////////////

///////////////////////////////////////////////////// END //////////////////////////////////////////////////////////
	$not_done= false;
	break; 

}
}
/*************************\
 WRITTEN BY KAOX 06-oct-09
\*************************/
?>
<?php
$upload_services[] = 'anafile.com';
$max_file_size['anafile.com'] = 1024;
$page_upload['anafile.com'] = 'anafile.com.php';
?>
<?php  

$upload_acc['anafile_com']['user'] = ""; //Set your username
$upload_acc['anafile_com']['pass'] = ""; //Set your password
////////////////////////////////////////////////////////////////////////////

//Do Not Edit Below//
////////////////////////////////////////////////////////////////////////////

$not_done = true;

if (!empty($upload_acc['anafile_com']['user']) && !empty($upload_acc['anafile_com']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['anafile_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['anafile_com']['pass'];
	$_REQUEST['action'] = '_TD_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_TD_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='_TD_' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'>**Leave Login Details Empty for Anon Upload**</td></tr>\n";
	echo "</form>\n</table>\n";
} else {

	$login = $not_done = false;
	$domain = 'anafile.com';
	$navi = 'http://www.anafile.com/';
	$cookie = array('lang'=>'english');
	$sid = '';
	echo "<center>Anafile.com plugin by <b>The Devil</b></center><br />\n";
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])){
		$devil = array('op'=>'login','redirect'=>urlencode($navi),
			'login'=>urlencode($_REQUEST['up_login']),'password'=>urlencode($_REQUEST['up_pass']));
		$logs = cURL($navi,$cookie,$devil,$navi.'login.html');
		$cookie = GetCookiesArr($logs,$cookie);
		(empty($cookie['xfss']) || empty($cookie['login'])) ? html_error('Login Failed, Auth Cookie Not Found') : $login = true;
		$logs = cURL($navi,$cookie,0,$navi);
		$sid = cut_str($logs,'name="sess_id" value="','"');
	}elseif((!empty($_REQUEST['up_login']) && empty($_REQUEST['up_pass'])) || (empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass']))){
		html_error('Login Details Were Only Partially Entered!');
	}else{
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		$devil = getSize($lfile);
		($devil>51904512) ? html_error('Anon Upload is Limited at 50MB') : '';
	}

	// Retrive upload ID
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrieve Upload ID</div>\n";

	$page = cURL($domain);
	$uploc = 'http://anaflz.net/cgi-bin/upload.cgi';
	for($x=0; $x<=11; $x++){
		$uid = $uid.mt_rand(0,9);
	}
	$qdata = array('upload_id'=>$uid,'js_on'=>'1','utype'=>'anon','upload_type'=>'file');
	$query = http_build_query($qdata);
	$pdata = array('upload_type'=>'file','sess_id'=>$sid,'srv_tmp_url'=>'http://anaflz.net/tmp','link_rcpt'=>'',
		'link_pass'=>'','tos'=>'1','submit_btn'=>'');
	$url = parse_url($uploc);
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfiles = upfile($url['host'],0,$url['path'].'?'.$query,$navi,$cookie,$pdata,$lfile,$lname,'file_0','','',0,0,0,$url['scheme']);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";
	is_notpresent($upfiles,"<textarea name='st'>OK</textarea>",'Error: Upload Failed');
	$fid = cut_str($upfiles,"<textarea name='fn'>",'<');
	$download_link = 'http://www.anafile.com/'.$fid;

}

// Written by The Devil

?>
<?php
$upload_services[] = 'archive.org_member';
$max_file_size['archive.org_member'] = 2048;
$page_upload['archive.org_member'] = 'archive.org_member.php';
?>
<?php
######## Account Info ########
$upload_acc['archive_org']['accessKey'] = ''; //Set your login
$upload_acc['archive_org']['secretKey'] = ''; //Set your password
# Get your Api Keys @ https://archive.org/account/s3.php
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

// Check https support for requests.
$use_curl = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$chttps = false;
$use_https = true;
if ($use_curl) {
	$cV = curl_version();
	if (in_array('https', $cV['protocols'], true)) $chttps = true;
}
if (!extension_loaded('openssl') && !$chttps) $use_https = false;
else if (!$chttps) $use_curl = false;

$media_types = array('data', 'audio', 'image', 'movies', 'software', 'texts');

if ($upload_acc['archive_org']['accessKey'] && $upload_acc['archive_org']['secretKey']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['archive_org']['accessKey'];
	$_REQUEST['up_pass'] = $upload_acc['archive_org']['secretKey'];
	$_REQUEST['action'] = 'FORM';
	// Edit data here for AuUL usage:
	$_REQUEST['bucket'] = ''; // Must not be empty. - Use only unaccented letters, numbers, dashes, underscores or periods. - If empty: Filtered filename.
	$_REQUEST['up_mediatype'] = 'data'; // 'data', 'audio', 'image', 'movies', 'software', 'texts' (Case sensitive) - If Invalid: 'data'.
	// $_REQUEST['is_test_item'] = '1'; // Uncomment to create bucket as a test item
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>Access Key*</td><td>&nbsp;<input type='text' name='up_login' value='' required='required' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>Secret Key*</td><td>&nbsp;<input type='password' name='up_pass' value='' required='required' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br />Upload options *<br /><br /></td></tr>
	<tr><td style='white-space:nowrap;'>Identifier (Bucket):</td><td>&nbsp;<input type='text' name='bucket' pattern='[0-9a-zA-Z_\.\-]{3,255}' title='Please use only unaccented letters, numbers, dashes, underscores or periods.' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>Media Type:</td><td>&nbsp;<select name='up_mediatype' style='width:160px;'>\n";
	foreach($media_types as $type) echo "\t<option value='$type'>".ucfirst($type)."</option>\n";
	echo "</select></td></tr>\n";
	echo "<tr><td style='white-space:nowrap;'>This is a test item?</td><td>&nbsp;<input type='checkbox' name='is_test_item' value='yes' /> <i>(remove after 30 days)</i></td></tr>";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><i>*You can set it as default in <b>".basename(__FILE__)."</b></i></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'archive.org';
	$referer = "https://$domain/";

	// Clean and Validate Filename
	$lname = preg_replace('@^\.|\.\.|\.$|[^0-9a-zA-Z_\.\-]@', '', str_replace(' ', '_', $lname));
	if (empty($lname)) html_error('Filename not allowed: "Please use only unaccented letters, numbers, dashes, underscores or periods".');

	// Validate bucket name.
	if (isset($_REQUEST['bucket'])) $_REQUEST['bucket'] = trim($_REQUEST['bucket']);
	if (!empty($_REQUEST['bucket'])) {
		$len = strlen($_REQUEST['bucket']);
		if ($len < 3 || $len > 255 || preg_match('@^\.|\.\.|\.$|[^0-9a-zA-Z_\.\-]@', $_REQUEST['bucket'])) html_error('Error: Invalid Bucket Name.');
	} else {
		//$_REQUEST['bucket'] = preg_replace('/\.\w{2,4}$/', '', $lname);
		$_REQUEST['bucket'] = pathinfo($lname, PATHINFO_FILENAME);
		if (strlen($_REQUEST['bucket']) < 3) html_error('Error: Empty Bucket Name.');
	}

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$iaS3AccessKey = trim($_REQUEST['up_login']);
		$iaS3SecretKey = trim($_REQUEST['up_pass']);

		if (preg_match('@[^A-Za-z\d+/=]@', $iaS3AccessKey.$iaS3SecretKey)) {
			// Simple check for invalid chars at API keys.
			html_error('Error: Invalid Character Found at API Key.');
		}

		// Test API Keys:
		$page = ias3Request();
		if (intval(substr($page, 9, 3)) != 200) html_error('[Login Error]: HTTP ' . substr($page, 9, 3));
		$dom = page2xmldom($page, 'Login Error');
		if (strtolower(trim($dom->getElementsByTagName('DisplayName')->item(0)->nodeValue)) == 'readable id goes here' && !$dom->getElementsByTagName('Buckets')->item(0)->hasChildNodes()) {
			// When user's account is new, the api doesn't return neither a name or any buckets (including the profile itself).
			// So i can't check if the AccessKey is valid without uploading something.
			// Regenerating the API keys seems to fix that issue.
			html_error('Login Error: Invalid API Keys?, upload something via the new uploader or "Regenerate your API Keys".');
		}
		unset($dom);

		$login = true;
	} else {
		html_error('Error: Empty Access Key or Secret Key.');
	}

	// Preparing Upload
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Preparing Upload</div>\n";

	$uploadHeaders = array();

	// Test Bucket
	$page = ias3Request($_REQUEST['bucket']);
	$status = intval(substr($page, 9, 3));
	if ($status == 200) {
		if (!empty($_REQUEST['is_test_item'])) html_error('Bucket must not exist for upload a test item.');
		$bucketExists = true;
		$bucket = page2xmldom($page, 'Error Loading Bucket');
		if (ias3FileExists($bucket, $lname)) {
			html_error('Error: A file already exists with the same name.');
		}
	} else if ($status == 404) {
		$bucketExists = $bucket = false;
		$uploadHeaders['x-archive-auto-make-bucket'] = '1';
		$uploadHeaders['x-archive-meta-submitter'] = 'Rapidleech';
		if (!empty($_REQUEST['is_test_item'])) {
			$uploadHeaders['x-archive-meta-description'] = $uploadHeaders['x-archive-meta-subject'] = 'test item';
			$uploadHeaders['x-archive-meta-collection'] = 'test_collection';
		} else {
			$uploadHeaders['x-archive-meta-description'] = 'Uploaded with Rapidleech';
			$uploadHeaders['x-archive-meta-subject'] = 'Rapidleech';
		}
		if (!empty($_REQUEST['up_mediatype']) && in_array($_REQUEST['up_mediatype'], $media_types)) {
			$uploadHeaders['x-archive-meta-mediatype'] = $_REQUEST['up_mediatype'];
		}
	} else {
		html_error('[Error Pre Checking Bucket]: HTTP ' . $status);
	}

	// Pre-Upload test
	$page = ul_GetPage(($GLOBALS['use_https'] ? 'https' : 'http').'://s3.us.archive.org/?check_limit=1&accesskey='.urlencode($iaS3AccessKey).'&bucket='.urlencode($_REQUEST['bucket']));
	$json = json2array($page, 'Pre-Upload Error');
	if ($json['over_limit'] != 0) {
		textarea($json);
		html_error('The server is overloaded, please try to upload later.');
	}

	if (!empty($uploadHeaders)) $uploadHeaders = array_map('iaS3HeaderEncode', $uploadHeaders);
	$uploadHeaders['Authorization'] = 'LOW ' . $iaS3AccessKey . ':' . $iaS3SecretKey;
	$uploadReferer = $referer;
	foreach ($uploadHeaders as $tok => $val) {
		$uploadReferer .= "\r\n$tok: $val";
	}

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url('http://s3.us.archive.org/' . urlencode($_REQUEST['bucket']) . '/' . urlencode($lname));
	$upfiles = putfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $uploadReferer, $cookie, $lfile, $lname, $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (intval(substr($upfiles, 9, 3)) != 200) {
		if (preg_match('@<Error><Code>(\w+)</Code><Message>(?>(.*?)</Message>)@i', $upfiles, $err)) {
			switch ($err[1]) {
				case 'AccessDenied': html_error('Upload Error: Access to bucket denied, make sure that this bucket is yours.');
				case 'InvalidAccessKeyId': html_error('Upload Error: Invalid AccessKey.');
				case 'SignatureDoesNotMatch': html_error('Upload Error: Invalid or Incorrect SecretKey.');
				case 'SlowDown': case 'ServiceUnavailable': html_error('The server is overloaded and discarted this upload, please try to upload later.');
				default: html_error("Upload Error [{$err[1]}]: " . htmlspecialchars($err[2]));
			}
		}
		textarea($upfiles);
		html_error('Unknown Upload Error');
	}

	$download_link = $referer . 'download/' . urlencode($_REQUEST['bucket']) . '/' . urlencode($lname);
	$stat_link = $referer . 'catalog.php?history=1&identifier=' . urlencode($_REQUEST['bucket']);
}

function ias3FileExists($bucket, $filename) {
	$files = $bucket->getElementsByTagName('Contents');
	if ($files->length > 0 && !empty($filename)) {
		$filename = strtolower($filename);
		foreach ($files as $file) {
			if (strtolower($file->getElementsByTagName('Key')->item(0)->nodeValue) == $filename) return $file;
		}
	}
	return false;
}

function ias3Request($path = '', $header = array()) {
	if (!is_array($header)) $header = array();
	if (!empty($header)) $header = array_map('iaS3HeaderEncode', $header);
	$header['Authorization'] = 'LOW ' . $GLOBALS['iaS3AccessKey'] . ':' . $GLOBALS['iaS3SecretKey'];

	$headers = '';
	foreach ($header as $tok => $val) {
		$headers .= "\r\n$tok: $val";
	}

	$count = 0;
	$host = 's3.us.archive.org';
	do {
		$page = ul_GetPage(($GLOBALS['use_https'] ? 'https' : 'http')."://$host/$path", 0, 0, $GLOBALS['referer'].$headers);
		$status = intval(substr($page, 9, 3));
		if ($status == 307) {
			if ($count >= 2) html_error('Redirect Loop Detected.');
			if (!preg_match('@(?:\nLocation: https?://|<Endpoint>)((?:[\w\-]+\.)*archive.org)@i', $page, $host)) html_error('Redirect endpoint not found.');
			$host = $host[1];
		}
	} while ($count++ < 2 && $status == 307);

	return $page;
}

function iaS3HeaderEncode($v) {
	return (preg_match('/[^\x20-\x7E]/', $v) ? 'uri('.rawurlencode($v).')' : $v);
}

function page2xmldom($page, $errorPrefix = 'Error') {
	if (!class_exists('DOMDocument')) html_error('Error: Please install/enable the DOM module in php.');
	// Remove Headers
	if (($pos = strpos($page, "\r\n\r\n")) > 0) $body = trim(substr($page, $pos + 4));

	$dom = new DOMDocument();
	if (!$dom->loadXML($body)) html_error("[$errorPrefix]: Error reading XML.");

	return $dom;
}

function json2array($content, $errorPrefix = 'Error') {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (empty($content)) return NULL;
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error("[$errorPrefix]: JSON start braces not found.");
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error("[$errorPrefix]: No JSON content.");
	$rply = json_decode($content, true);
	if ($rply === NULL) html_error("[$errorPrefix]: Error reading JSON.");
	return $rply;
}

function ul_GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0) {
	if (!$referer && !empty($GLOBALS['Referer'])) {
		$referer = $GLOBALS['Referer'];
	}

	if ($GLOBALS['use_curl']) {
		if ($XMLRequest) $referer .= "\r\nX-Requested-With: XMLHttpRequest";
		$page = cURL($link, $cookie, $post, $referer, $auth);
	} else {
		global $pauth;
		$Url = parse_url($link);
		$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
		is_page($page);
	}
	return $page;
}

//[28-9-2015]  Written by Th3-822.

?>
<?php
$upload_services[]="backup.bz";
$max_file_size["backup.bz"]=5120;
$page_upload["backup.bz"] = "backup.bz.php";  
?>
<?php

//////////ACCOUNT INFO//////////////////////////////////////////////////////
$upload_acc['backup_bz']['user'] = ""; //Set your Username Here
$upload_acc['backup_bz']['pass'] = ""; //Set your Password Here
////////////////////////////////////////////////////////////////////////////

//Do Not Edit Below//
////////////////////////////////////////////////////////////////////////////

$not_done = true;
$domain = 'backup.bz';

if (!empty($upload_acc['backup_bz']['user']) && !empty($upload_acc['backup_bz']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['backup_bz']['user'];
	$_REQUEST['up_pass'] = $upload_acc['backup_bz']['pass'];
	$_REQUEST['action'] = '_TD_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_TD_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='_TD_' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'>**Leave Login Details Empty for Anon Upload**</td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	
	$login = $not_done = false;
	echo "<center>Backup.bz plugin by <b>The Devil</b></center><br />\n";
	
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])){
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
		$data = array('username'=>urlencode($_REQUEST['up_login']),'password'=>urlencode($_REQUEST['up_pass']),'submitme'=>'1');
		$url = 'https://backup.bz/ajax/_account_login.ajax.php';
		$url = parse_url($url);
		$page = geturl($url['host'],$url['port'],$url['path'],0,0,$data,0,0,0,0,$url['scheme'],0,1);is_page($page);
		$resp = jsonreply($page);
		($resp['login_status']!='success')?html_error('[0]Error: Login Error, Check Your Login Info'):'';
		$cookie = GetCookiesArr($page);
		
		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
	
	//Retrieve Upload ID
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$page = cURL('https://backup.bz/index.html',$cookie);
	$block = cut_str($page,'file upload widget','setUploadFolderId');
	$lck = preg_match_all('~http?s://backup.bz/core/page/ajax/file_upload_handler.ajax.php[\w\d\/\?&.=]+~',$page,$uplocs);
	$uploc = $uplocs[0][0];
	(!$lck)?html_error('[1]Error: Unable to Retrieve Upload Location'):'';
	$mchk = preg_match_all('~data.formData = {(.*)};~',$block,$datablock);
	(!$mchk)?html_error('[2]Error: Unable to Retrieve Token Array'):'';
	is_notpresent($datablock[1][0],'sessionid','[2]Error: Tokens May Have Changed, Plugin Revision Required');
	$data = $datablock[1][0];
	$data = explode(',',$data);
	$data = str_replace("'",'',$data);
	$data = preg_replace('/\s+/', '', $data);
	$sid = explode(':',$data[0]);
	$cTrak = explode(':',$data[1]);
	$post = array($sid[0]=>$sid[1],$cTrak[0]=>$cTrak[1],'maxChunkSize'=>'100000000','folderId'=>'null');
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($uploc);
	$upfiles = upfile($url['host'],0,$url['path'].'?'.$url['query'],'https://backup.bz/',$cookie,$post,$lfile,$lname,'files[]','',0,0,0,$url['scheme']);is_page($upfiles);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	preg_match('~"url":"(.*)"~U',$upfiles,$dloc);
	$dloc = $dloc[1];
	$dloc = stripslashes($dloc);
	preg_match('~"delete_url":"(.*)"~U',$upfiles,$dlt);
	$dlt = $dlt[1];
	$dlt = stripslashes($dlt);
	$download_link = $dloc;
	$delete_link = $dlt;
	}

function jsonreply($resp){
		$tmp = stristr($resp,'{');
		$json = json_decode($tmp,true);
		return $json;
}

//[2016-08-16] Written by The Devil
?>

<?php
$upload_services[]="bigfile.to";
$max_file_size["bigfile.to"]=5120;
$page_upload["bigfile.to"] = "bigfile.to.php";  
?>
<?php

//////////ACCOUNT INFO//////////////////////////////////////////////////////
$upload_acc['bigfile_to']['user'] = ""; //Set your username
$upload_acc['bigfile_to']['pass'] = ""; //Set your password
////////////////////////////////////////////////////////////////////////////

//Do Not Edit Below//
////////////////////////////////////////////////////////////////////////////
if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
$not_done = true;
if (!empty($upload_acc['bigfile_to']['user']) && !empty($upload_acc['bigfile_to']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['bigfile_to']['user'];
	$_REQUEST['up_pass'] = $upload_acc['bigfile_to']['pass'];
	$_REQUEST['action'] = '_TD_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_TD_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='_TD_' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'>**Leave Login Details Empty for Anon Upload**</td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	$login = $not_done = false;
	$navi = 'https://www.bigfile.to/';
	$domain = 'bigfile.to';
	echo "<center>Bigfile.to plugin by <b>The Devil</b></center><br />\n";
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])){
		$post = array('userName'=>urlencode($_REQUEST['up_login']),'userPassword'=>urlencode($_REQUEST['up_pass']),
			'autoLogin'=>'on','action__login'=>'normalLogin');
		$page = cURL($navi.'login.php',0,$post,$navi.'login.php',0,0);
		$cookie = GetCookiesArr($page);
		if(empty($cookie['autologin'])) html_error('Login Failed, Auth Cookie Not Found');
		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
	// Retrive upload ID
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	if(!$login){
		$tmp = 'https://up.bigfile.to/u/-1';
		$url = parse_url($tmp);
		echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
		$pfiles = putfile($url['host'],0,$url['path'].($url["query"] ? "?" . $url["query"] : ""),$navi,0,$lfile,$lname,0,0,0,$url['scheme']);is_page($pfiles);
		echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";
		$devil = strstr($pfiles,'{');
		if(empty($devil)){
			html_error('Error Getting Download and Delete Links');
		}
		$devil = json_decode($devil,true);
		$download_link = $navi.'file/'.$devil['shortenCode'].'/'.$devil['fileName'];
		$delete_link = $navi.'file/'.$devil['shortenCode'].'/delete/'.$devil['deleteCode'];
	}else{
		$page = cURL($navi.'upload.php',$cookie,0,$navi);is_page($page);
		$uplocs = preg_match_all('@https?://(.*).bigfile.to[\d\w/:._-]+@', $page, $TD);
		$url = parse_url($TD[0][0]);
		echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
		$pfiles = putfile($url['host'],0,$url['path'].($url["query"] ? "?" . $url["query"] : ""),$navi,$cookie,$lfile,$lname,0,0,0,$url['scheme']);is_page($pfiles);
		echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";
		$devil = strstr($pfiles,'{');
		if(empty($devil)){
			html_error('Error Getting Download and Delete Links');
		}
		$devil = json_decode($devil,true);
		$download_link = $navi.'file/'.$devil['shortenCode'].'/'.$devil['fileName'];
		$delete_link = $navi.'file/'.$devil['shortenCode'].'/delete/'.$devil['deleteCode'];
	}
}

// Written by The Devil

?>
<?php
$upload_services[] = 'biggerupload.com';
$max_file_size['biggerupload.com'] = 200;
$page_upload['biggerupload.com'] = 'biggerupload.com.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 3); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'biggerupload.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 10; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [22-1-2014]

?>
<?
$upload_services[]="bitshare.com_member";
$max_file_size["bitshare.com_member"]= 1000;
$page_upload["bitshare.com_member"] = "bitshare.com_member.php";
?>
<?php

####### Free Account Info. ###########
$bitshare_login = "xxxxxx"; //Set your id (login)
$bitshare_pass = "xxxxxx"; //Set your  password
##############################

$not_done=true;
$continue_up=false;
if ($bitshare_login && $bitshare_pass){
	$_REQUEST['my_login'] = $bitshare_login;
	$_REQUEST['my_pass'] = $bitshare_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["bitshare.com"]; ?></b></small></tr>
</table>
</form>
<?php
	}
if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to Bitshare.com</div>
<?php 
                        $post['user'] = $_REQUEST['my_login'];
			$post['password'] = $_REQUEST['my_pass'];
                        $post['submit'] = "Login";
			$page = geturl("bitshare.com", 80, "/login.html", "http://bitshare.com/", 0, $post, 0, $_GET["proxy"], $pauth);
			is_page($page);
                        is_notpresent($page, 'HTTP/1.1 302', 'Error logging in - are your logins correct!');
                        $cookie = GetCookies($page);
                        $page = geturl("bitshare.com", 80, "/", "http://bitshare.com/", $cookie, 0, 0, $_GET["proxy"], $pauth);
                        is_page($page);		
	?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<script>document.getElementById('info').style.display='none';</script>
<?php 
                        preg_match('/<form action="(.*)" id="uploadform" method="post"/', $page, $upurl);
                        $url_up = trim($upurl[1]);
                        $progress_key = cut_str($page, '<input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key"  value="','"/>');
                        $usergroup_key = cut_str($page, '<input type="hidden" name="APC_UPLOAD_USERGROUP" id="usergroup_key"  value="','"/>');
                        $fpost = array(
			'APC_UPLOAD_PROGRESS' => $progress_key,
			'APC_UPLOAD_USERGROUP' => $usergroup_key,
			'UPLOAD_IDENTIFIER' => $progress_key,
                        'file[]"; filename="' => '');
                        $ID = GRC();
                        $upurl=$url_up.'?X-Progress-ID=undefined'.$ID.'';
			$url=parse_url($upurl);
		        $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), "http://bitshare.com/", $cookie, $fpost, $lfile, $lname, "file[]");                        
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
                        $dwn=trim(cut_str($upfiles,"Location: ","\n"));
                        $Url=parse_url($dwn);
                        $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://bitshare.com/", $cookie, 0, 0, $_GET["proxy"],$pauth);  		
			is_notpresent($page,'Download Link','Error Get Download Link!!!');
                        preg_match('%http://bitshare.com/files/(.*)%', $page, $dlink);
                        preg_match('%http://bitshare.com/delete/(.*)%', $page, $delink);
                        $download_link=$dlink[0];
                        $delete_link= $delink[0];		
	}
function GRC($length=32,$letters='abcdefklmnoupqrstvx1234567890')
  {
      $s = '';
      $lettersLength = strlen($letters)-1;
      for($i = 0 ; $i < $length ; $i++)
      {
      $s .= $letters[rand(0,$lettersLength)];
      }
      return $s;
  } 
// written by VinhNhaTrang 04/11/2010
?>
<?php
$upload_services[] = 'br2share.net';
$max_file_size['br2share.net'] = 2048;
$page_upload['br2share.net'] = 'br2share.net.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'www.br2share.net'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 100; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php
$upload_services[] = 'brupload.net';
$max_file_size['brupload.net'] = 51200;
$page_upload['brupload.net'] = 'brupload.net.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 8); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'www.brupload.net'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 100; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php 

$upload_services[] = "crocko.com_member";

$max_file_size["crocko.com_member"] = 2048;

$page_upload["crocko.com_member"] = "crocko.com_member.php";

?>
<?php
// Default Account Info =================
$crocko_user = ""; //  Set you username
$crocko_pass = ""; //  Set your password
//=======================================

			$not_done = true;
			$continue_up = false;
			if ($crocko_user & $crocko_pass) {
				$_REQUEST['cr_user'] = $crocko_user;
				$_REQUEST['cr_pass'] = $crocko_pass;
				$_REQUEST['action'] = "FORM";
				echo "<b><center>Automatic Login</center></b>\n";
			}
			if ($_REQUEST['action'] == "FORM"){
				$continue_up = true;
			}else {
?>
					<script>document.getElementById('info').style.display='none';</script>
                    <div id='info' width='100%' align='center' style="font-weight:bold; font-size:16px">LOGIN</div> 
    <table border=0 style="width:270px;" cellspacing=0 align=center>
        <form method="post">
        <input type='hidden' name='action' value='FORM' />
            <tr><td nowrap>&nbsp;User*<td>&nbsp;<input type='text' name='cr_user' value='' style="width:160px;" />&nbsp;</tr>
            <tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type='password' name='cr_pass' value='' style="width:160px;" />&nbsp;</tr>
            <tr><td colspan=2 align=center><input type='submit' value='Upload' /></tr>
            <tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["crocko.com_member"]; ?></b></small></tr>
        </form>
    </table>
<?php
			}
			if ($continue_up) {
				$not_done = false;
?>
    <table width=600 align=center>
    </td></tr>
    <tr><td align=center>
    		<script>document.getElementById('info').style.display='none';</script>
            <div id='info' width='100%' align='center'>Login to crocko.com</div>
        <?php
        if (!empty($_REQUEST['cr_user']) && !empty($_REQUEST['cr_pass'])){
        $Url = parse_url("https://www.crocko.com/accounts/login/");
        $post["remember"] = "1";
        $post["login"] = $_REQUEST['cr_user'];
        $post["password"] = $_REQUEST['cr_pass'];
        $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "https://www.crocko.com/accounts/login/", 0, $post, 0, $_GET["proxy"], $pauth);
	is_page($page);
		preg_match('#/pages([a-z/]+)#', $page, $blocked);
		if($blocked[0] == '/pages/blocked'){
		html_error ('Sorry, but you have over 5 invalid login attempts per minute. Please wait at least 10 minutes and try again. Or use proxy.');}
	$cookies = GetCookies($page);
		}else{
		html_error ('Error, user and/or password is empty, please go back and try again!');
	}
	preg_match('#PHPSESSID=([0-9a-zA-Z%]+);#', $cookies, $sid);
	if(empty($sid[1])){
		html_error ('Invalid login or password!');
	}else{
        ?>
        		<script>document.getElementById('info').style.display='none';</script>
				<div id='info' width='100%' align='center'>Retrive upload ID</div> 
        <?php 
	$uplink = 'http://upload.crocko.com/accounts/upload_backend/perform/ajax';
	$url = parse_url($uplink);
	$post = array();
	$post['folder']='0';
	$post['PHPSESSID'] = $sid[1];
	$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),'https://crocko.com/accounts/upload/#/ajax/', $cookies, $post, $lfile, $lname, '');
?>
				<script>document.getElementById('progressblock').style.display='none';</script>
<?php
			is_page($upfiles);
			preg_match('#value="([^"]+)#', $upfiles, $dll);
			 if (!empty($dll[1]))
			$download_link =  $dll[1];
			else
              html_error ('Didn\'t find downloadlink!');
			preg_match('#href="javascript:;">([/a-zA-Z0-9.:]+)#', $upfiles, $del);
			if (!empty($del[1]))
			$delete_link =  $del[1];
			else
              html_error ('Didn\'t find deletelink!');
	}
	}
	/*
	upload plugin produced by simplesdescarga day 03/01/2011 at 18:47.
	Easy-share.com === Crocko.com
	*/
?>
<?php 
$upload_services[]="dailymotion.com";
$max_file_size["dailymotion.com"]=2000;
$page_upload["dailymotion.com"] = "dailymotion.com.php";
?>
<?php
####### Account Info. ###########
$dailymotion_login = '';
$dailymotion_pass = '';
##############################

$not_done = true;
$continue_up = false;
if ($dailymotion_login && $dailymotion_pass) {
    $_REQUEST['my_login'] = $dailymotion_login;
    $_REQUEST['my_pass'] = $dailymotion_pass;
    $_REQUEST['action'] = "FORM";
    echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up = true;
else {
    ?>
    <table border=0 style="width:270px;" cellspacing=0 align=center>
        <form method=post>
            <input type=hidden name=action value='FORM' />
            <tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
            <tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
            <tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
            <tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["dailymotion.com"]; ?></b></small></tr>
    </table>
    </form>

    <?php
}

if ($continue_up) {
    $not_done = false;
    ?>
    <table width=600 align=center>
    </td></tr>
    <tr><td align=center>
            <div id=login width=100% align=center>Login to Dailymotion.com</div>
    <?php
    $rnd = time() . rndNum(3);
    $post = array();
    $post['form_name'] = "dm_pageitem_login";
    $post['username'] = trim($_REQUEST['my_login']);
    $post['password'] = trim($_REQUEST['my_pass']);
    $post['login_submit'] = "Login";
    $page = geturl("www.dailymotion.com", 80, "/login", "http://www.dailymotion.com/us", 0, $post, 0);
    is_page($page);
    is_present($page, "Wrong login data!", "Error logging in - are your logins correct!", "0");
    $cookie = GetCookies($page);
    $page = geturl("www.dailymotion.com", 80, "/upload", "http://www.dailymotion.com/us", $cookie, 0, 0);
    is_page($page);
    $rand = time();
    $cookie .= "; " . GetCookies($page) . "; " . "dmuat=$rand ";
    unset($post);
    $post["ajax_function"] = "create";
    $post["ajax_arg[]"] = urlencode($serv . "/upload#hp-h-10");
    $post["ajax_arg[]"] = urlencode($lname);
    $post["ajax_rnd"] = $rnd;
    $post["from_request"] = "%2Fupload";
    $page = geturl("www.dailymotion.com", 80, "/ajax/video", "http://www.dailymotion.com/upload\r\nX-Requested-With: XMLHttpRequest", $cookie, $post, 0);
    is_page($page);
    $vid = cut_str($page, 'video_id":', '}');
    $rnt = "0." . rndNum(17);
    $page = geturl("www.dailymotion.com", 80, "/pageitem/upload/file?request=%2F&t=$rnt&from_request=%2Fupload&loop=0", "http://www.dailymotion.com/upload\r\nX-Requested-With: XMLHttpRequest", $cookie, 0, 0);
    is_page($page);
    ?>
            <script>document.getElementById('login').style.display='none';</script>
            <div id=info width=100% align=center>Retrive upload ID</div>
            <?php
            $upurl = cut_str($page, 'xuploadUrl = \"', '"');
            $upurl = htmlspecialchars_decode($upurl);
            $upurl = str_replace("\\", "", $upurl);
            $url = parse_url($upurl);
            unset($post);
            $post = array();
            $post["Filename"] = $lname;
            $post["Upload"] = 'Submit Query';
            $upfiles = upfile($url["host"], defport($url), $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), 0, 0, $post, $lfile, $lname, "file");
            is_page($upfiles);
            ?>
            <script>document.getElementById('progressblock').style.display='none';</script>
            <?php
            is_page($upfiles);
            $format = urlencode(cut_str($upfiles, 'format":"', '"'));
            $acodec = urlencode(cut_str($upfiles, 'acodec":"', '"'));
            $vcodec = urlencode(cut_str($upfiles, 'vcodec":"', '"'));
            $duration = cut_str($upfiles, 'duration":', ',');
            $bitrate = cut_str($upfiles, 'bitrate":', ',');
            $dimension = cut_str($upfiles, 'dimension":"', '"');
            $name = urlencode(cut_str($upfiles, 'name":"', '"'));
            $size = cut_str($upfiles, 'size":', ',');
            $ulink = cut_str($upfiles, 'url":"', '"');
            $uurl = urlencode($ulink);
            $hash = cut_str($upfiles, 'hash":"', '"');
            $seal = cut_str($upfiles, 'seal":"', '"');

            $daturl = "http://www.dailymotion.com/ajax/getVideoFromXUpload?xupload_response=1&video_id=$vid&formUpload=upload_0&format=$format&acodec=$acodec&vcodec=$vcodec&duration=$duration&bitrate=$bitrate&dimension=$dimension&name=$name&size=$size&url=$uurl&hash=$hash&seal=$seal";
            $Url = parse_url($daturl);
            $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://www.dailymotion.com/upload\r\nX-Requested-With: XMLHttpRequest", $cookie, 0, 0, $_GET["proxy"], $pauth);
            is_page($page);
            if ($error = cut_str($page, 'message":"', '",')) {
                html_error("$error");
            }
            $rng = "0." . rndNum(16);
            $Url = parse_url("http://www.dailymotion.com/pageitem/video/edit?request=%2F&t=$rng&from_request=%2Fupload&loop=0");
            $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://www.dailymotion.com/upload", $cookie, 0, 0, $_GET["proxy"], $pauth);
            $latitude = cut_str($page, 'name="latitude" value="', '"');
            $longitude = cut_str($page, 'name="longitude" value="', '"');
            $title = $name;
            $save = cut_str($page, 'name="save" value="', '"');
            $recordedOn=cut_str($page, 'id="more_details_0_recordedOn" value="', '"');
            $dpost=array(
                "form_name"=>"dm_pageitem_video_edit_0",
                "video_title"=>$title,
                "user_category"=>"shortfilms",
                "tags"=>"clip " . $title,
                "description"=>"Upload by rapidleech",
                "privacy"=>"public",
                "allow_comments"=>"1",
                "allow_in_group"=>"1",
                "language"=>"vi",
                "recordedOn"=>$recordedOn,
                "save_geolocation"=>0,
                "is_remove_geoloc"=>0,
                "latitude"=>$latitude,
                "longitude"=>$longitude,
                "coming_next"=>"",
                "videoId"=>$vid,
                "uploadType"=>"file",
                "save"=>$save,
            );            
            $Url = parse_url("http://www.dailymotion.com/pageitem/video/edit?request=%2F&loop=0");
            $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://www.dailymotion.com/upload", $cookie, $dpost, 0, $_GET["proxy"], $pauth);
            is_page($page);
            $Url = parse_url("http://www.dailymotion.com/ajax/video");
            unset($post);
            $post = array(
                "ajax_function" => "get_url",
                "ajax_arg[]" => $vid,
                "ajax_rnd" => round(microtime(true) * 1000),
                "from_request" => "%2Fupload"
            );
            $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://www.dailymotion.com/upload", $cookie, $post, 0, $_GET["proxy"], $pauth);
            is_page($page);
            $linkul = cut_str($page, "+:", "\n");
            $Url = parse_url("http://www.dailymotion.com/ajax/video");
            unset($dpost);
            $dpost = array(
                "ajax_function" => "generate_vs_upload_tag",
                "ajax_arg[]" => "Save",
                "ajax_arg[]" => "1",
                "ajax_rnd" => round(microtime(true) * 1000),
                "from_request" => "%2Fupload"
            );
            $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://www.dailymotion.com/upload\r\nX-Requested-With: XMLHttpRequest\r\nX-Prototype-Version: 1.7", $cookie, $dpost, 0, $_GET["proxy"], $pauth);
            is_page($page);
            echo "<h3><font color='green'>File successfully uploaded to your account</font></h3>";                        
            $download_link = "http://www.dailymotion.com" . $linkul;
        }

        function rndNum($lg) {
            $str = "0123456789";
            for ($i = 1; $i <= $lg; $i++) {
                $st = rand(1, 9);
                $pnt.=substr($str, $st, 1);
            }
            return $pnt;
        }

//VinhNhaTrang 19/12/2010
//fix by vdhdevil 14/10/2011
        ?>
<?php
$upload_services[] = 'datafilehost.com';
$max_file_size['datafilehost.com'] = 512;
$page_upload['datafilehost.com'] = 'datafilehost.com.php';
?>
<?php

	echo "<center>Datafilehost.com plugin by <b>The Devil</b></center><br />\n";

	$domain = 'datafilehost.com';
	$page = cURL('https://www.'.$domain);
	$cookies = GetCookiesArr($page);
	$ind = preg_match_all('~"max_file_size" value="(.*)"~i',$page,$mfs);
	(!$ind)?html_error('Error[0]: Unable to Retrieve Max File Size of Upload - Check Host'):'';
	$max_fs = $mfs[1][0];

	//Retrieve Upload ID
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$uploc = 'https://www.'.$domain.'/upload.php';
	$url = parse_url($uploc);
	$post = array('MAX_FILE_SIZE'=>$max_fs);
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfiles = upfile($url['host'],0,$url['path'],0,$cookie,$post,$lfile,$lname,'upfile','',0,0,0,$url['scheme']);is_page($upfiles);
	unset($cookies);
	$cookies = GetCookiesArr($upfiles);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	$upfiles = cURL('https://www.'.$domain.'/codes.php',$cookies);
	$ind = preg_match_all('~clip[\d].setText\(\s\'([\d\w:/.-]+)~',$upfiles,$links);
	(!$ind)?html_error('Error[1]: Unable to Retrieve Download and Delete Links'):'';
	$download_link = $links[1][0];
	$delete_link = $links[1][1];


//[23-3-2014]  Written by Th3-822.
//[2016-09-28] Re-Written by The Devil

?>

<?php
$upload_services[]="datei.to";
$max_file_size["datei.to"]=500;
$page_upload["datei.to"] = "datei.to.php";
?>
<?php
####### Account Info. ###########
$datei_login = "";
$datei_pass = "";
##############################

$not_done=true;
$continue_up=false;
if ($datei_login & $datei_pass){
	$_REQUEST['bin_login'] = $datei_login;
	$_REQUEST['bin_pass'] = $datei_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Let it empty for free user</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=1 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM'><input type=hidden value=uploaded value'<?php $_REQUEST[uploaded]?>'>
<input type=hidden name=filename value='<?php echo base64_encode($_REQUEST[filename]); ?>'>
<tr><td nowrap>&nbsp;Login<td>&nbsp;<input name=bin_login value='' style="width:160px;">&nbsp;</tr>
<tr><td nowrap>&nbsp;Password<td>&nbsp;<input name=bin_pass value='' style="width:160px;">&nbsp;</tr>
<tr><td colspan=2 align=center>Let it empty for free user</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload'></tr>
</table>
</form>
<?php
}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center> 
</td></tr> 
<tr><td align=center> 
<div id=login width=100% align=center></div> 
<?php
			$page = geturl("datei.to", 80, "/", 0, 0, 0, 0);
			$cookie=GetCookies($page);
			$cookies = "".$cookie."; Username=".$_REQUEST['bin_login']."; Password=".md5(trim($_REQUEST['bin_pass']))."";
			$Url=parse_url('http://datei.to/ajax/account.php');
			if ($_REQUEST['action'] == "FORM")
			{
				$post["Menue"]=0;
				$post["Seite"]="";
			
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://datei.to/account", $cookies, $post, 0, $_GET["proxy"], $pauth);
			
			$Url=parse_url('http://datei.to/upload');
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), 0, $cookies, 0, 0, $_GET["proxy"], $pauth);
			is_present($page, ' Login', 'Your login details are wrong!');
			$UserID = cut_str($page,'name="UserID" value="','">');
			$Server = cut_str($page,'Datei.upload_server_name = "','";');
			}	
?>
<script>document.getElementById('info').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div> 
<?php
			$Url=parse_url('http://datei.to/ajax/upload_start.php');
            $post["UserID"] = $UserID;
            $post["upload_file[]"] = $lname;
            $post["Server"] = $Server;
			
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://datei.to/upload", $cookies, $post, 0, $_GET["proxy"], $pauth);
			$upload_id = cut_str($page,'Datei.startUpload("','"');
			
			$cookies2 = "Username=".$_REQUEST['bin_login']."; Password=".md5(trim($_REQUEST['bin_pass']))."";
			$url=parse_url('http://'.$Server.'.datei.to/cgi-bin/Datei.pl?upload_id='.$upload_id.'');
			$fpost["UserID"] = $UserID;
			$upfiles = upfile($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), 0, $cookies2, $fpost, $lfile, $lname, "upfile_1");
			
			$Url=parse_url('http://datei.to/ajax/upload_finish.php?upload_id='.$upload_id.'&Server='.$Server.'');
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://datei.to/upload", $cookies, 0, 0, $_GET["proxy"], $pauth);
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
			$ddl = cut_str($page,'id="DateiLink" value="','"');
			$del = cut_str($page,'id="RemoveLink" value="','"');
			if (!empty($ddl))
			$download_link = $ddl;
			else
			html_error ('Didn\'t find downloadlink!');
			if (!empty($del))
			$delete_link= $del;
			else
			html_error ('Didn\'t find deletelink!');
}       
?>
<?php
$upload_services[] = 'depositfiles.com_member';
$max_file_size['depositfiles.com_member'] = 10240;
$page_upload['depositfiles.com_member'] = 'depositfiles.com_member.php';
<?php
######## Account Info ########
$upload_acc['depositfiles_com']['user'] = ''; //Set your login
$upload_acc['depositfiles_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$continue_up = false;

if ($upload_acc['depositfiles_com']['user'] && $upload_acc['depositfiles_com']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['depositfiles_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['depositfiles_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up = true;
else {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
}

if ($continue_up) {
	$login = $not_done = false;
	$cookie = array('lang_current' => 'en');
	$domain = CheckDomain('depositfiles.com');
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!$default_acc && !empty($_POST['up_encrypted']) && $_POST['up_encrypted'] == 'true') {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
		}
		SkipLoginC(strtolower($_REQUEST['up_login']), $_REQUEST['up_pass']);
		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = cURL($referer, $cookie, 0, $referer);

	if (!preg_match('@https?://fileshare\d+\.(?:depositfiles|dfiles)\.[^/:\r\n\t\"\'<>]+(?:\:\d+)?/[\w\-]+/[^\'"\r\n\<>;\s\t]*@i', $page, $up)) html_error('Error: Cannot find upload server.');

	$post = array();
	$post['format'] = 'html5';
	$post['member_passkey'] = cut_str($page, 'sharedkey="', '"');
	$post['fm'] = '_root';
	$post['fmh'] = '';

	if (empty($post['member_passkey'])) html_error('Upload sharedkey Not Found.');

	$up_url = $up[0];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$url['scheme'] = 'http'; // Force HTTP on upload.
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, 0, $post, $lfile, $lname, 'files', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$json = json2array($upfiles, 'Upload Error');

	if (!empty($json['download_url'])) {
		$download_link = $json['download_url'];
		if (!empty($json['delete_url'])) $delete_link = $json['delete_url'];

		// Optional?
		cURL($referer.'api/upload/add_info?url='.urlencode($json['download_url']).'&size='.$fsize, $cookie, 0, $referer);
	} else {
		if (!$default_acc) textarea($upfiles);
		html_error('Download link not found.');
	}
}

function CheckDomain($domain) {
	global $cookie, $pauth;
	$domain = strtolower($domain);
	$url = "https://$domain/";
	$page = cURL($url, $cookie, 0, $url);
	if (($hpos = strpos($page, "\r\n\r\n")) > 0) $page = substr($page, 0, $hpos);
	if (stripos($page, "\nLocation: ") !== false && preg_match('@\nLocation: (?:https?:)?//(?:[^/\r\n]+\.)?((?:depositfiles|dfiles)\.[^/:\r\n\t\"\'<>]+)(?:\:\d+)?/@i', $page, $redir_domain)) {
		$redir_domain = strtolower($redir_domain[1]);
		if ($domain != $redir_domain) $domain = $redir_domain;
	}
	return $domain;
}

function json2array($content, $errorPrefix = 'Error') {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (empty($content)) html_error("[$errorPrefix]: No content.");
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error("[$errorPrefix]: JSON start braces not found.");
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error("[$errorPrefix]: No JSON content.");
	$rply = json_decode($content, true);
	if ($rply === NULL) html_error("[$errorPrefix]: Error reading JSON.");
	return $rply;
}

function Login($user, $pass) {
	global $default_acc, $cookie, $domain, $referer, $pauth;
	$errors = array('CaptchaInvalid' => 'Wrong CAPTCHA entered.', 'InvalidLogIn' => 'Invalid Login/Pass.', 'CaptchaRequired' => 'Captcha Required.');
	if (!empty($_POST['step']) && $_POST['step'] == '1') {
		html_error('reCAPTCHA2 Not Supported ATM.');
		/*
		if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
		$post = array('recaptcha_challenge_field' => $_POST['recaptcha_challenge_field'], 'recaptcha_response_field' => $_POST['recaptcha_response_field']);
		$post['login'] = urlencode($user);
		$post['password'] = urlencode($pass);

		$page = cURL($referer . 'api/user/login', $cookie, $post, $referer.'login.php?return=%2F');
		$json = json2array($page, 'Login Error P');
		if (!empty($json['error'])) html_error('Login Error'. (!empty($errors[$json['error']]) ? ': ' . $errors[$json['error']] : '..'));
		elseif ($json['status'] != 'OK') html_error('Login Failed');

		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['autologin'])) html_error('Login Error: Cannot find "autologin" cookie');

		SaveCookies($user, $pass); // Update cookies file
		return true;
		*/
	} else {
		$post = array();
		$post['login'] = urlencode($user);
		$post['password'] = urlencode($pass);

		$page = cURL($referer . 'api/user/login', $cookie, $post, $referer.'login.php?return=%2F');
		$json = json2array($page, 'Login Error');
		if (!empty($json['error']) && $json['error'] != 'CaptchaRequired') html_error('Login Error'. (!empty($errors[$json['error']]) ? ': ' . $errors[$json['error']] : '.'));
		elseif ($json['status'] == 'OK') {
			$cookie = GetCookiesArr($page, $cookie);
			if (empty($cookie['autologin'])) html_error('Login Error: Cannot find "autologin" cookie.');
			SaveCookies($user, $pass); // Update cookies file
			return true;
		} elseif (empty($json['error']) || $json['error'] != 'CaptchaRequired') html_error('Login Failed.');

		// Captcha Required
		$page = cURL($referer.'login.php?return=%2F', $cookie, 0, $referer);
		$cookie = GetCookiesArr($page, $cookie);

		if (!preg_match('@(https?://([^/\r\n\t\s\'\"<>]+\.)?(?:depositfiles|dfiles)\.[^/:\r\n\t\"\'<>]+(?:\:\d+)?)/js/base2\.js@i', $page, $jsurl)) html_error('Cannot find captcha.');
		$jsurl = (empty($jsurl[1])) ? 'https://' . $domain . $jsurl[0] : $jsurl[0];
		$page = cURL($jsurl, $cookie, 0, $referer.'login.php?return=%2F');

		if (!preg_match('@recaptcha2PublicKey\s*=\s*[\'\"]([\w\.\-]+)@i', $page, $cpid)) html_error('reCAPTCHA2 Not Found.');

		$post = array('action' => 'FORM');
		$post['step'] = '1';
		if (!$default_acc) {
			$post['up_encrypted'] = 'true';
			$post['up_login'] = urlencode(encrypt($user));
			$post['up_pass'] = urlencode(encrypt($pass));
		}
		html_error('reCAPTCHA2 Not Supported ATM.');
	}
}

function IWillNameItLater($cookie, $decrypt=true) {
	if (!is_array($cookie)) {
		if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
		return '';
	}
	if (count($cookie) < 1) return $cookie;
	$keys = array_keys($cookie);
	$values = array_values($cookie);
	$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
	$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
	return array_combine($keys, $values);
}

function SkipLoginC($user, $pass) {
	global $cookie, $domain, $referer, $secretkey, $pauth;
	if (!defined('DOWNLOAD_DIR')) {
		global $options;
		if (substr($options['download_dir'], -1) != '/') $options['download_dir'] .= '/';
		define('DOWNLOAD_DIR', (substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']));
	}

	$filename = DOWNLOAD_DIR.basename('depositfiles_ul.php');
	if (!file_exists($filename)) return Login($user, $pass);

	$file = file($filename);
	$savedcookies = unserialize($file[1]);
	unset($file);

	$hash = hash('crc32b', $user.':'.$pass);
	if (array_key_exists($hash, $savedcookies)) {
		$_secretkey = $secretkey;
		$secretkey = sha1($user.':'.$pass);
		$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
		$secretkey = $_secretkey;
		if ((is_array($testCookie) && count($testCookie) < 1) || empty($testCookie)) return Login($user, $pass);

		$page = cURL($referer, $testCookie, 0, $referer);
		if (stripos($page, 'style="display: none;" data-type="guest"') === false) return Login($user, $pass);
		$cookie = $testCookie; // Update cookies
		SaveCookies($user, $pass); // Update cookies file
		return true;
	}
	return Login($user, $pass);
}

function SaveCookies($user, $pass) {
	global $cookie, $secretkey;
	$maxdays = 31; // Max days to keep cookies saved
	$filename = DOWNLOAD_DIR.basename('depositfiles_ul.php');
	if (file_exists($filename)) {
		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		// Remove old cookies
		foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
	} else $savedcookies = array();
	$hash = hash('crc32b', $user.':'.$pass);
	$_secretkey = $secretkey;
	$secretkey = sha1($user.':'.$pass);
	$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($cookie, false));
	$secretkey = $_secretkey;

	write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
}

//[06-9-2012] Written by Th3-822.
//[01-1-2013] Fixed login. - Th3-822 (Happy New Year)
//[20-1-2013] Updated for df's new domains. - Th3-822
//[25-3-2017] Switched to cURL/https, fixed domain checker & fixed login & upload. - Th3-822
<?php
$upload_services[]="dl.free.fr";
$max_file_size["dl.free.fr"]=1024;
$page_upload["dl.free.fr"] = "dl.free.fr.php";  
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
	
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
			$ref='http://dl.free.fr/';
			$page = geturl("dl.free.fr", 80, "/", "", 0, 0, 0, "");
?>
<script>document.getElementById('info').style.display='none';</script>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php
			is_page($page);
			
			$url_action=cut_str($page,'/upload.pl?','"');
			if (!$url_action)
				{	
					html_error("Error retrive upload id".$page);
				}
			
			$post["mail1"]='';
			$post["mail2"]='';
			$post["mail3"]='';
			$post["mail4"]='';
			$post["message"]=$descript;
			$post["password"]='';

			$url=parse_url($ref.'upload.pl?'.$url_action);

			$upfiles=upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),$ref, 0, $post, $lfile, $lname, "ufile");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<div id=final width=100% align=center>Get final code</div>
<?php		
			is_page($upfiles);
			$locat=trim(cut_str($upfiles,'Location:',"\n"));
			if (!$locat) {html_error("Error get location".$upfiles);}
			$Url=parse_url($locat);
			echo "Pass: ";
			for ($i=1;$i<10;$i++)
				{
				sleep(3);
				$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $ref, 0, 0, 0, $_GET["proxy"],$pauth);
				is_page($page);
				echo "$i ";
				if (strpos($page,"proc&eacute;dure termin&eacute;e avec succ&egrave;s")){break;}
				}

			$tmp=cut_str($page,'adresse suivante',true);
			
			$download_link=cut_str($tmp,'"underline" href="','"');
			$tmpd=cut_str($tmp,'http://dl.free.fr/rm.pl?','"');
			if ($tmpd){
				$tmpd='http://dl.free.fr/rm.pl?'.$tmpd;
				$tmpd=str_replace("&amp;","&",$tmpd);
			}
			$delete_link=$tmpd;
?>
<script>document.getElementById('final').style.display='none';</script>
<?php
// sert 30.07.2008
// andykimpe 23.08/2018 update get download link
?>
<?php
$upload_services[]="downace.com";
$max_file_size["downace.com"]=500;
$page_upload["downace.com"] = "downace.com.php";
?>
<?php

//////////ACCOUNT INFO//////////////////////////////////////////////////////
$upload_acc['downace_com']['user'] = ""; //Set your Username Here
$upload_acc['downace_com']['pass'] = ""; //Set your Password Here
////////////////////////////////////////////////////////////////////////////

//Do Not Edit Below//
////////////////////////////////////////////////////////////////////////////

$not_done = true;
if (!empty($upload_acc['downace_com']['user']) && !empty($upload_acc['downace_com']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['downace_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['downace_com']['pass'];
	$_REQUEST['action'] = '_TD_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_TD_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='_TD_' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'>**Leave Login Details Empty for Anon Upload**</td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	$login = $not_done = false;
	echo "<center>Downace.com plugin by <b>The Devil</b></center><br />\n";
	$domain = 'downace.com';
	$https_path = 'https://'.$domain.'/';
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])){

	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
		$login_path = 'https://'.$domain.'/login.html';
		$post = array('username'=>urlencode($_REQUEST['up_login']),'password'=>urlencode($_REQUEST['up_pass']),'submitme'=>'1');
		$lin = cURL($login_path,0,$post,$login_path);
		is_notpresent($page,'account_home.html','[4]Error: Login Failed, Check Login Details!');
		$cookies = GetCookiesArr($lin);
		
		(empty($cookies['filehosting']))?html_error('Error[0]: Unable to Obtain Login Cookie'):'';
		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$page = cURL($https_path,$cookies);
	$ind = preg_match_all('~https?://[\d\w]+.downace.com/[\d\w/.?=&]+~',$page,$uplocs);
	(!$ind)?html_error('Error[1]: Unable to find upload location'):'';
	$uploc = $uplocs[0][0];
	$block = cut_str($page,'file upload widget','setUploadFolderId');
	$mchk = preg_match_all('~data.formData = {(.*)};~',$block,$datablock);
	(!$mchk)?html_error('Error[2]: Unable to Retrieve Token Array'):'';
	is_notpresent($datablock[1][0],'sessionid','Error[3]: Tokens May Have Changed, Plugin Revision Required');
	$data = $datablock[1][0];
	$data = explode(',',$data);
	$data = str_replace("'",'',$data);
	$data = preg_replace('/\s+/', '', $data);
	$sid = explode(':',$data[0]);
	$cTrak = explode(':',$data[1]);
	$upost = array($sid[0]=>$sid[1],$cTrak[0]=>$cTrak[1],'maxChunkSize'=>'0','folderId'=>'');
	$url = parse_url($uploc);

	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfiles = upfile($url['host'],0,$url['path']."?".$url['query'],$https_path."\r\nAccept:application/json, text/javascript, */*; q=0.01",$cookie,$upost,$lfile,$lname,'files[]','',0,0,0,$url['scheme']);is_page($upfiles);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	preg_match('~"url":"(.*)"~U',$upfiles,$dloc);
	$dloc = $dloc[1];
	$dloc = stripslashes($dloc);
	preg_match('~"delete_url":"(.*)"~U',$upfiles,$dlt);
	$dlt = $dlt[1];
	$dlt = stripslashes($dlt);
	$download_link = $dloc;
	$delete_link = $dlt;
	}

//[17-12-2016] Written by The Devil

	
?>

<?php
$upload_services[] = 'ex-load.com';
$max_file_size['ex-load.com'] = 2000;
$page_upload['ex-load.com'] = 'ex-load.com.php';
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 4); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'ex-load.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 100; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'page'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)
	$_T8['fw_sendLogin'] = 'SendLogin'; // Callable function

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

function SendLogin($post) {
	global $_T8, $referer, $cookie, $pauth;
	$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op=login', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);

	if (!($form = cut_str($page, '<form', '</form>'))) html_error('Cannot find login form.');
	if (!($post['rand'] = cut_str($page, 'name="rand" value="', '"'))) html_error('Login form "rand" not found.');

	if (substr_count($form, "<span style='position:absolute;padding-left:") > 3 && preg_match_all("@<span style='[^\'>]*padding-left\s*:\s*(\d+)[^\'>]*'[^>]*>((?:&#\w+;)|(?:\d))</span>@i", $form, $txtCaptcha)) {
		// Text Captcha (decodeable)
		$txtCaptcha = array_combine($txtCaptcha[1], $txtCaptcha[2]);
		ksort($txtCaptcha, SORT_NUMERIC);
		$txtCaptcha = trim(html_entity_decode(implode($txtCaptcha), ENT_QUOTES, 'UTF-8'));
		$post['code'] = $txtCaptcha;
	} else html_error('Login captcha not found.');

	// Don't remove this sleep or you will only see "Error Decoding Captcha. [Login]"
	sleep(3); // 2 or 3 seconds.

	$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op=login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
	is_present($page, '>Wrong captcha code<', 'Error: Error Decoding Captcha. [Login]');
	return $page;
}

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [15-5-2015]

?>
<?php
$upload_services[]="ex.ua";
$max_file_size["ex.ua"]=100;
$page_upload["ex.ua"] = "ex.ua.php";
?>
<?php

####################################################################################################################
######################### MODULE UPLOAD PLUGIN FOR RAPIDLEECH - WRITTEN BY KAOX ####################################
####################################################################################################################

$site_login = '';            // site_login
$site_pass = '';             // site_pass
$mode = "guest";            // switch this variable if must upload in "guest" "member" or "premium"

$form =<<<FORM
     
<table border=0 style="width:350px;" cellspacing=0 align=center> <form method=post> <input type=hidden name=action value='FORM' /> <tr><td nowrap>&nbsp;Username*</td><td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</td></tr> <tr><td nowrap>&nbsp;Password*</td><td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</td></tr> <tr><td colspan=2 align=center><input type=submit value='Upload'></td></tr> </form> </table>       
FORM;

$not_done= true;

	if ($mode!="guest" && $mode!="member" && $mode!="premium")
	{
	html_error("mistake in \$mode - Please riedit the plugin not let \$mode variable blank or different from guest,member or premium value" , 0 ); 
	}
	if ($mode == "member" or $mode == "premium")
	{
		if ($_REQUEST['action'] == "FORM")
		{
		$continue_up = true;
		$user= $_REQUEST['my_login'];
		$pass= $_REQUEST['my_pass'];
		}elseif($site_login && $site_pass)
		{
		$continue_up = true;
		$user = $site_login;
		$pass = $site_pass;
		echo "<b><center>Use Default login/pass.</center></b>";
		}else{ 
		     echo $form;
		     }
	}
?>
<table width=600 align=center> </td></tr> <tr><td align=center> <script>document.getElementById('login').style.display='none';</script> <script>document.getElementById('info').style.display='none';</script> <script>document.getElementById('progressblock').style.display='none';</script> 
<?php

switch ($mode){
  
	case "guest":
	echo ('<b><center style="color: #C0C0C0"><span style="background-color: #F8F8B6">Use guest mode</span></center></b><br>');
///////////////////////////////////////////////////// START ////////////////////////////////////////////////////////
$Url=parse_url("http://www.ex.ua/edit_storage");
$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://www.ex.ua/storage", 0, 0, 0, $_GET["proxy"],$pauth);
is_page($page);
$locat=cut_str ($page ,"Location: ","\r"); 
$Url=parse_url($locat);
$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://www.ex.ua/storage", 0, 0, 0, $_GET["proxy"],$pauth);
is_page($page);

$key = cut_str ( $page ,'key		: "' ,'"' );
$object_id = cut_str ( $page ,'object_id	: ' ,',' );
$action_id = cut_str ( $page ,"action_id	: ","\r" );
$time=str_replace('.','',microtime(1)).'0';

$post=array();
$post['Filename']=$lname;
$post['key']=$key;
$post['object_id']=$object_id;
$post['action_id']=$action_id;
$post['time']=$time;
$post['Upload']='Submit Query';

$url=parse_url("http://fs19.www.ex.ua/r_upload");

$page = upfile($url["host"], defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""), $referrer , $cookie, $post, $lfile, $lname, "Filedata");
is_page($page);

	echo
<<<HTML
<table border=0 style="width:270px;" cellspacing=0 align=center>
<tr><td nowrap>&nbsp;File succesfull uploaded. Go in your tempdirectory<td></tr>
<tr><td align="center"><a href="http://www.ex.ua/view_storage/$key" target="_blank"> -= Click =-</a><td></tr>
</table>
HTML;

 
///////////////////////////////////////////////////// END //////////////////////////////////////////////////////////
	$not_done= false;
	break;

	case "member":
	if ($continue_up){
	echo ('<b><center style="color: #00FF00"><span style="background-color: #F8F8B6">Use member mode</span></center></b><br>');
///////////////////////////////////////////////////// START ////////////////////////////////////////////////////////

///////////////////////////////////////////////////// END //////////////////////////////////////////////////////////
	$not_done= false;
	break; 
}

	case "premium":
	if ($continue_up){
	echo ('<b><center style="color: #FF0000"><span style="background-color: #F8F8B6">Use premium mode</span></center></b><br>');
///////////////////////////////////////////////////// START ////////////////////////////////////////////////////////

///////////////////////////////////////////////////// END //////////////////////////////////////////////////////////
	$not_done= false;
	break; 

}
}

?>
<?php
$upload_services[] = 'file.karelia.ru_member';
$max_file_size['file.karelia.ru_member'] = 25;
$page_upload['file.karelia.ru_member'] = 'file.karelia.ru_member.php';
?>
<?php
######## Account Info ########
$upload_acc['karelia_ru']['user'] = ''; //Set your login
$upload_acc['karelia_ru']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['karelia_ru']['user'] && $upload_acc['karelia_ru']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['karelia_ru']['user'];
	$_REQUEST['up_pass'] = $upload_acc['karelia_ru']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'file.karelia.ru';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('cookieon' => '1');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$page = geturl($domain, 80, '/login/img', $referer, $cookie);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);

		$x = 0;
		while ($x < 2 && preg_match('@\nLocation: (https?://([\w\-]+\.)*(?:karelia|sampo)\.ru/[^\r\n]+)@i', $page, $redir)) {
			$redir = parse_url($redir[1]);
			$page = geturl($redir['host'], defport($redir), $redir['path'].(!empty($redir['query']) ? '?'.$redir['query'] : ''), $referer.'login/img', $cookie, 0, 0, 0, 0, 0, $redir['scheme']);is_page($page);
			$cookie = GetCookiesArr($page, $cookie);
			$x++;
		}

		$post = array();
		$post['nigol'] = urlencode($_REQUEST['up_login']);
		$post['drowssap'] = urlencode($_REQUEST['up_pass']);

		$page = geturl($domain, 80, '/login', "$referer\r\nX-Requested-With: XMLHttpRequest", $cookie, $post);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);

		is_present($page, '\u041b\u043e\u0433\u0438\u043d \u0438\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u0432\u0435\u0440\u043d\u044b\u0439.', 'Login Failed: Email/Password incorrect.');
		is_notpresent($page, '"success":true', 'Login Error.');
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$page = geturl($domain, 80, '/', $referer, $cookie);is_page($page);
	$cookie = GetCookiesArr($page, $cookie);

	$x = 0;
	while ($x < 3 && preg_match('@\nLocation: (https?://([\w\-]+\.)*(?:karelia|sampo)\.ru/[^\r\n]*)@i', $page, $redir)) {
		$redir = parse_url($redir[1]);
		$page = geturl($redir['host'], defport($redir), $redir['path'].(!empty($redir['query']) ? '?'.$redir['query'] : ''), $referer.'login/img', $cookie, 0, 0, 0, 0, 0, $redir['scheme']);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);
		$x++;
	}

	if (!preg_match('@https?://(?:[\w\-]+\.)+file\.(?:karelia|sampo)\.ru/upload[^\s\'\"<>]*@i', $page, $up)) html_error('Error: Upload URL not found.');
	if (!preg_match('@uploadStart\s*\(\s*\'?(\d+)\'?\s*,\s*\'(\w+)\'\s*\)@i', $page, $id_hash)) html_error('Error: Upload ID not found.');
	if (!preg_match('@"login"\s*:\s*"([^\"]+)"\s*,\s*"login_hash"\s*:\s*"(\w+)"@i', $page, $login_lhash)) html_error('Error: Userdata not found.');

	$post = array();
	$post['Filename'] = $lname;
	$post['login'] = $login_lhash[1];
	$post['login_hash'] = $login_lhash[2];
	$post['uploader'] = 'swf';
	$post['uploadId'] = $id_hash[1];
	$post['uploadId_hash'] = $id_hash[2];
	$post['Upload'] = 'Submit Query';

	$up_url = $up[0];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'Filedata[]', '', 0, 0, 'Shockwave Flash', $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$json = Get_Reply($upfiles);
	if (empty($json['result']) || $json['result'] != 'success' || empty($json['url'])) html_error('Download link not found.');
	$download_link = $json['url'];
}

function Get_Reply($content) {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, $pos + 4);
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error('Json start braces not found.');
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error('No json content.');
	$rply = json_decode($content, true);
	if (!$rply || count($rply) == 0) html_error('Error reading json.');
	return $rply;
}

//[09-3-2014]  Written by Th3-822.

?>
<?php 
$upload_services[] = 'filecad.com';
$max_file_size['filecad.com'] = 100;
$page_upload['filecad.com'] = 'filecad.com.php';
?>
<?php

//////////ACCOUNT INFO//////////////////////////////////////////////////////
$upload_acc['filecad_com']['user'] = ""; //Set your Username Here
$upload_acc['filecad_com']['pass'] = ""; //Set your Password Here
////////////////////////////////////////////////////////////////////////////

//Do Not Edit Below//
////////////////////////////////////////////////////////////////////////////

$not_done = true;
if (!empty($upload_acc['filecad_com']['user']) && !empty($upload_acc['filecad_com']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['filecad_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['filecad_com']['pass'];
	$_REQUEST['action'] = '_TD_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;
if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_TD_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='_TD_' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	$login = $not_done = false;
	$domain = 'www.filecad.com';
	echo "<center>Filecad.com plugin by <b>The Devil</b></center><br />\n";
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])){
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
		$post = array('username'=>urlencode($_REQUEST['up_login']), 'password'=>urlencode($_REQUEST['up_pass']),'submitme'=>'1');
		$page = cURL('https://'.$domain.'/login.html',0,$post,'https://'.$domain.'/login.html');
		is_notpresent($page,'account_home.html','[4]Error: Login Failed, Check Login Details!');
		$cookie = GetCookiesArr($page);
		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
	
	//Retrieve Upload ID
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	if($login == false){
		html_error('[5]Error: Anon Upload is NOT Allowed For This Host!');
	}
	$page = cURL('https://'.$domain.'/account_home.html',$cookie);
	$block = cut_str($page,'<div id="fileUploadWrapper"','</script');
	$mchk = preg_match_all("~url: '(.*)'~",$block,$acts);
	(!$mchk)?html_error('[1]Error: Unable to Retrieve Upload Location'):'';
	is_notpresent($acts[1][0],"file_upload_handler","[0]Error: Check Upload Location");
	$uploc = $acts[1][0];
	$mchk = preg_match_all('~data.formData = {(.*)};~',$block,$datablock);
	(!$mchk)?html_error('[2]Error: Unable to Retrieve Token Array'):'';
	is_notpresent($datablock[1][0],'sessionid','[3]Error: Tokens May Have Changed, Plugin Revision Required');
	$data = $datablock[1][0];
	$data = explode(',',$data);
	$data = str_replace("'",'',$data);
	$data = preg_replace('/\s+/', '', $data);
	$sid = explode(':',$data[0]);
	$cTrak = explode(':',$data[1]);
	$post = array($sid[0]=>$sid[1],$cTrak[0]=>$cTrak[1],'maxChunkSize'=>'100000000','folderId'=>'null');
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($uploc);
	$upfiles = upfile($url['host'],0,$url['path'].'?'.$url['query'],'https://www.filecad.com/account_home.html',$cookie,$post,$lfile,$lname,'files[]','',0,0,0,$url['scheme']);is_page($upfiles);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	preg_match('~"url":"(.*)"~U',$upfiles,$dloc);
	$dloc = $dloc[1];
	$dloc = stripslashes($dloc);
	preg_match('~"delete_url":"(.*)"~U',$upfiles,$dlt);
	$dlt = $dlt[1];
	$dlt = stripslashes($dlt);
	$download_link = $dloc;
	$delete_link = $dlt;
	}
	
//[2017-02-24] - Written by The Devil
//[2017-05-30] - Small fix to referer after they changed from vip-shared.com
?>

<?php
$upload_services[] = 'filecloud.io_member';
$max_file_size['filecloud.io_member'] = 5120;
$page_upload['filecloud.io_member'] = 'filecloud.io_member.php';
?>
<?php

//////////ACCOUNT INFO//////////////////////////////////////////////////////
$upload_acc['filecloud_io']['apikey'] = ""; //Set your filecloud.io apikey here.
////////////////////////////////////////////////////////////////////////////

//Do Not Edit Below//
////////////////////////////////////////////////////////////////////////////
if (!function_exists('json_decode')) html_error('[2]Error: Please enable JSON in php.');
$minz = 2000; // Minimum bytes to upload is 1023 bytes, but should increase this just to be safe
$ss = getSize($lfile); ($ss<$minz) ? html_error('Minimum File Size to Upload is '.$minz.' bytes'):'';
$not_done = true;

if (!empty($upload_acc['filecloud_io']['apikey'])) {
	$default_acc = true;
	$_REQUEST['apikey'] = $upload_acc['filecloud_io']['apikey'];
	$_REQUEST['action'] = '_TD_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_TD_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='_TD_' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;API Key*</td><td>&nbsp;<input type='text' name='apikey' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'>**NOTE: Create API Key in Account Settings and Allow Upload!**</td></tr>\n";
	echo "</form>\n</table>\n";
} else {

	$login = $not_done = false;
	$domain = 'filecloud.io';
	$aloc = 'https://filecloud.io/?m=api&a=upload&akey=';
	$cloc = 'https://filecloud.io/?m=api&a=fetch_account_info&akey=';
	echo "<center>Filecloud.io plugin by <b>The Devil</b></center><br/>\n";
	(empty($_REQUEST['apikey']))?html_error('API Key Was Not Entered'):'';
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";
	$resp = jsonreply(cURL($cloc.$_REQUEST['apikey']));
	if(!($resp['status']=='ok')){
		is_present($resp['message'],'No permission granted','Unable to Check Login, Please Allow Account Info Fetch in Account/API Settings');
		is_present($resp['message'],'no akey parameter provided','Login Failed, Please Check You Login Details');
		html_error('[1]Error: Bad API Response: '.$resp['message']);
	}else $login=true;
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$devil = jsonreply(cURL($aloc.$_REQUEST['apikey']));
	if((!($devil['status']=='ok')) || empty($devil['upload_url'])){
		is_present($devil['message'],'No permission granted','Please Allow Uploading in Account/API Settings');
		html_error('[3]Error: Unable to Retrieve Upload Link - '.$devil['message']);
	}
	$url = parse_url($devil['upload_url']);
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfiles = upfile($url['host'], 0, $url["path"].($url["query"] ? "?".$url["query"] : ""), 0, 0, 0, $lfile, $lname, 'Filedata', '', 0, 0, 0, $url['scheme']);is_page($upfiles);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	$devil = jsonreply($upfiles);
	if(!($devil['status']=='ok')){
		html_error('[4]Error: Upload Failed '.$devil['message']);
	}
	$download_link = $devil['furl'];
}

function jsonreply($resp){
		$tmp = stristr($resp,"{");
		(empty($tmp)) ? html_error('[0]Error: Cannot Find API Response') : '';
		$devil = json_decode($tmp,true);
		return $devil;
}

// Written by The Devil

?>
<?php
$upload_services[]="filedropper.com";
$max_file_size["filedropper.com"]=5000;
$page_upload["filedropper.com"] = "filedropper.com.php";  
?>
<?php

	echo "<center>Filedropper.com plugin by <b>The Devil</b></center><br />\n";
	$uploc = 'http://www.filedropper.com/index.php?xml=true';
	$domain = 'http://www.filedropper.com/';
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$url = parse_url($uploc);
	$post = array('Filename'=>$lname,'Upload'=>'Submit Query');
	$heads = "\r\nX-Requested-With: ShockwaveFlash/23.0.0.207";
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfiles = upfile($url['host'],0,$url['path']."?".$url['query'],$domain.$heads,0,$post,$lfile,$lname,'file');
	is_page($upfiles);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	$resp = cut_str($upfiles,'/index.php','\r\n');
	$page = cURL($domain.$resp);
	preg_match_all('~https?://(www)?.filedropper.com/[\d\w./]+~',$page,$redirs);
	$redir = $redirs[0][0];
	$resp = cURL($redir);
	$ind = preg_match_all('~https?://(www)?.filedropper.com/[\d\w]+~',$resp,$dlocs);
	(!$ind)?html_error('Error[0]: Unable to Retrieve Download Link'):'';
	$download_link = $dlocs[0][0];

//[15-12-2016] Re-Written by The Devil	

?>

<?php
$upload_services[] = 'filefactory.com_member';
$max_file_size['filefactory.com_member'] = 5120;
$page_upload['filefactory.com_member'] = 'filefactory.com_member.php';
<?php
######## Account Info ########
$upload_acc['filefactory_com']['user'] = ''; //Set your email
$upload_acc['filefactory_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if (!empty($upload_acc['filefactory_com']['user']) && !empty($upload_acc['filefactory_com']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['filefactory_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['filefactory_com']['pass'];
	$_REQUEST['action'] = '_T8_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_T8_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='_T8_' />
	<tr><td style='white-space:nowrap;'>&nbsp;EMail*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	$login = $not_done = false;
	$domain = 'www.filefactory.com';
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('ff_locale' => 'en_US.utf8');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$post = array();
		$post['loginEmail'] = urlencode($_REQUEST['up_login']);
		$post['loginPassword'] = urlencode($_REQUEST['up_pass']);
		$post['Submit'] = 'Sign+In';
		$page = geturl($domain, 443, '/member/signin.php', $referer.'member/signin.php', $cookie, $post, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);

		is_present($page, 'The Email Address submitted was invalid', 'Login Failed: Invalid email address.');
		is_present($page, 'The email address or password you have entered is incorrect.', 'Login Failed: The Email/Password you have entered is incorrect.');

		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['auth'])) html_error('Login Failed, auth cookie not found.');

		// Check account messages
		$page = geturl($domain, 443, '/account/', $referer.'member/signin.php', $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
		is_present($page, "\nLocation: /member/settos.php", 'TOS have changed and need to be approved at the site.');
		is_present($page, "\nLocation: /member/setpwd.php", 'Your password has expired, please change it.');

		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrieve upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$post = array();
	$post['cookie'] = rawurldecode($cookie['auth']);

	$up_loc = 'https://upload.filefactory.com/upload';
	$up_loc .= '-beta.php'; // Old Url

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_loc);
	$upfiles = upfile($url['host'], defport($url), $url['path'] . (!empty($url['query']) ? '?' . $url['query'] : ''), $referer.'upload/', 0, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";

	is_page($upfiles);

	if (!preg_match('@\s(\w+)\s*$@i', $upfiles, $uid)) html_error('Upload ID not found.');
	$page = geturl($domain, 443, '/upload/results.php?files='.$uid[1], $referer.'upload/', $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);

	if (preg_match('@(?<=/)file/\w+(/[^\r\n\"\'<>\s\t]+)?@i', $page, $dl)) {
		$download_link = $referer.$dl[0];
	} else html_error("Download link not found. (ID: {$uid[1]})");
}

//[17-6-2011]  Written by Th3-822.
//[15-9-2013]  Rewritten and fixed for new FF site & Removed anon user support. - Th3-822
//[24-10-2013] Added a error at login. - Th3-822
//[02-12-2016] Fixed login error msgs & revised plugin. - Th3-822
//[30-5-2021] Switched to HTTPS. - Th3-822
<?php 
$upload_services[]="fileflyer.com";
$max_file_size["fileflyer.com"]=2048;
$page_upload["fileflyer.com"] = "fileflyer.com.php";
?>
<?php
$continue_up=false;
$not_done=true;
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Recipient Email Address<td>&nbsp;<input type=text name=remail value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
</table>
</form>

<?php
	}
if ($continue_up)
	{
	$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php 
			$page = geturl("www.fileflyer.com", 80, "/", "", 0, 0, 0, "");
			is_page($page);
			
			$cookies = GetCookies($page);
			preg_match('/ASP.NET_SessionId=(.*?);/i', $cookies, $cook);
			$cookie = 'ASP.NET_SessionId=='.$cook[1];
			
			preg_match('/var txt *= *"(.*)"/i', $page, $up_host);
			preg_match('/__VIEWSTATE.*value="(.*?)"/i', $page, $up_vstat);
			preg_match('/__EVENTVALIDATION.*value="(.*?)"/i', $page, $up_even);
			preg_match('/action="(.*?)"/i', $page, $up_url);
			
			$action_url = $up_host[1].'Default.aspx?UploadID='.rand(10000000, 99999999);
			$url = parse_url($action_url);
			$post['__VIEWSTATE'] = $up_vstat[1];
			$post['__EVENTVALIDATION'] = $up_even[1];
			$post['R_email'] = $_REQUEST['remail'];
			$post['FieldCounter'] = 0;
?>
<script>document.getElementById('info').style.display='none';</script>

<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php 
            $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),'http://www.fileflyer.com/', $cookie, $post, $lfile, $lname, "file1");
			is_page($upfiles);
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 
			preg_match('/Location: *(.*)/i', $upfiles, $redir);
			$new_loc = trim($redir[1]);
			$Url = parse_url($new_loc);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 'http://www.fileflyer.com/', $cookie, 0, 0, $_GET["proxy"],$pauth);
			
			preg_match('/HyperLink1".*href="(.*?)"/i', $page, $flink);
			preg_match('/RemovalLink.*href="(.*?)"/i', $page, $dlink);
			
			$download_link = 'http://www.fileflyer.com/'.$flink[1];
			$delete_link = 'http://www.fileflyer.com/'.$dlink[1];
	}
?>
<?php 
$upload_services[]="filefront.com";
$max_file_size["filefront.com"]=1000;
$page_upload["filefront.com"] = "filefront.com.php";  
?>
<?php 

####### Free Account Info. ###########
$filefront_username=""; //  Set you username
$filefront_password=""; //  Set your password
##############################

$not_done=true;
$continue_up=false;
if ($filefront_username & $filefront_password){
	$_REQUEST['my_login'] = $filefront_username;
	$_REQUEST['my_pass'] = $filefront_password;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")  
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Username*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["filefront.com"]; ?></b></small></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
            $usr=$_REQUEST['my_login'];
            $pass=$_REQUEST['my_pass'];
            $referrer="http://hosted.filefront.com/".$usr; 
            $Url = parse_url("http://signup.filefront.com/");
			$post['uploadID'] = "";
			$post['existingUser'] = "1";	
            $post['redirectTo'] = $referrer;
			$post['pageID'] = "49";
			$post['loginUser'] = $usr;
			$post['loginPass'] = $pass;
			$post['x'] = rand(1,50);
            $post['y'] = rand(1,20);
            $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $referrer, 0, $post, 0, $_GET["proxy"],$pauth);
			is_page($page);
            is_present($page,"signup","Not logged in. Check your login details in filefront.com.php");
		    preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
            $cook = $temp[1];
            $cookie = implode(';',$cook);	
			$Url = parse_url("http://uploadhosted.filefront.com/");
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $referrer, $cookie, 0, 0, $_GET["proxy"],$pauth);
			is_page($page);			
			$formact=cut_str($page, '<div class="rightColUpload">', '</div>');
			$url_action=cut_str($formact, 'action="', '"');
			$fpost['UPLOAD_IDENTIFIER'] = cut_str($page, 'UPLOAD_IDENTIFIER value="', '"');
			$fpost['FL'] = "k";
			$fpost['upload'] = "1";
			$fpost['game'] = "";		
			

			
	?>
<script>document.getElementById('info').style.display='none';</script>

		<table width=600 align=center>
			</td>
			</tr>
			<tr>
				<td align=center>
<?php		
			$referrer="http://uploadhosted.filefront.com/";
			$url = parse_url($url_action);
			$upagent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1";
			$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),$referrer, $cookie, $fpost, $lfile, $lname, "upload_formdata[0]");

?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	

			preg_match('/location: *(.*)/i', $upfiles, $redir);
			$Href = rtrim($redir[1]);
			$Url = parse_url($Href);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $referrer, $cookie, 0, 0, $_GET["proxy"],$pauth);
			is_present($page,"Duplicate file","You attempted to upload a file that already exists in your directory. Please rename the file or delete the existing file.",0);
			is_notpresent($page,"Upload Successful!","Error upload file",0);
			preg_match('/http:\/\/files\.filefront\.com\/\w+/i', $page, $down);

			$download_link=$down[0];
			}
			
			// written by kaox 09/06/2009
?>
<?php
$upload_services[] = 'filehosting.org';
$max_file_size['filehosting.org'] = false;
$page_upload['filehosting.org'] = 'filehosting.org.php';  
?>
<?php
######## Account Info ########
$upload_acc['filehosting_org']['user'] = ''; //Set your Email
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['filehosting_org']['user']) {
	$default_acc = true;
	$_REQUEST['up_email'] = $upload_acc['filehosting_org']['user'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Email.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_email' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'www.filehosting.org';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('language' => 'en');
	if (!empty($_REQUEST['up_email'])) {
		$uploader_email = trim($_REQUEST['up_email']);

		if (!preg_match('/^[\w\.\-]+@([a-zA-Z\d\-]+\.){1,3}[a-zA-Z\d]{2,4}$/', $uploader_email)) html_error('Invalid email address.');

		$login = true;
	} else html_error('Login Failed: Email or Password are empty. Please check login data.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	$cookie = GetCookiesArr($page, $cookie);

	if (!preg_match('@<form\s+(?:[^<>]+\s+)?action="(https?://(?:[\w\-]+\.)*filehosting\.org(/[^\"\s<>]*)?)"@i', $page, $up_url)) {
		textarea($page);
		html_error('Upload Server Not Found.');
	} else $up_url = $up_url[1] . (empty($up_url[2]) ? '/' : '');

	$post = array();
	$post['uploader_email'] = $uploader_email;
	$post['accept_tos'] = '1';
	$post['submit'] = 'Upload now';

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'upload_file', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	is_page($upfiles);

	if (!preg_match('@(?><form(?:\s[^\>]*)?\>)(?>.*?</form>)@is', $upfiles, $form) || !preg_match('@^<form\s+(?:[^<>]+\s+)?action=\'(https?://(?:[\w\-]+\.)*filehosting\.org(/[^\"\'\s<>]*)?)\'@i', $form[0], $form_url)) {
		textarea($upfiles);
		html_error('Post-Upload Form Not Found');
	}

	$form = $form[0];
	$form_url = $form_url[1] . (empty($form_url[2]) ? '/' : '');

	preg_match_all("@<input\s*[^>]*\stype='hidden'[^>]*\sname='(\w+)'[^>]*\svalue='([^']*)'@i", $form, $inputs);
	$post = array_map('urlencode', array_map('html_entity_decode', array_combine($inputs[1], $inputs[2])));

	$cookie = GetCookiesArr($upfiles, $cookie);
	$url = parse_url($form_url);
	$page = geturl($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $up_url, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, $url['scheme']);is_page($page);
	$cookie = GetCookiesArr($page, $cookie);

	if (preg_match('@\nLocation: (https?://(?:[\w\-]+\.)*filehosting\.org)?(/[^\s]*)@i', $page, $redir)) {
		$redir = (empty($redir[1]) ? $url['scheme'] . '://' . $url['host'] : $redir[1]) . $redir[2];
		$url = parse_url($redir);
		$page = geturl($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $form_url, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $url['scheme']);is_page($page);
	}

	if (stripos($page, 'A link to the file and a download link were sent to your email address') === false) {
		textarea($page);
		html_error('Unknown Post-Upload Error.');
	}

	$download_link = 'Check Your Email: "' . $uploader_email . '"';
}

//[15-12-2015]  Written by Th3-822.

?>
<?php 
$upload_services[] = 'filejoker.net_member';
$max_file_size['filejoker.net_member'] = 2048;
$page_upload['filejoker.net_member'] = 'filejoker.net_member.php';  
?>
<?php
######## Account Info ########
$upload_acc['filejoker_net']['user'] = ''; //Set your login
$upload_acc['filejoker_net']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['filejoker_net']['user'] && $upload_acc['filejoker_net']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['filejoker_net']['user'];
	$_REQUEST['up_pass'] = $upload_acc['filejoker_net']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;EMail*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$scheme = 'https';
	$domain = 'filejoker.net';
	$referer = "$scheme://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('lang' => 'english');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}
		CookieLogin($_REQUEST['up_login'], $_REQUEST['up_pass']);
		$login = true;
	} else html_error('Login failed: Email/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$page = geturl($domain, 443, '/', $referer, $cookie, '', 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
	if (!preg_match('@action=["\']((https?://(?:[\w\-]+\.)+[\w\-]+(?:\:\d+)?)?/upload/\d+)["\']@i', $page, $up_url)) html_error('Error: Cannot find upload server.');
	$up_url = (empty($up_url[2])) ? $scheme.'://'.$_T8['domain'].$up_url[1].'/' : $up_url[1].'/';

	$post = array();
	$post['upload_type'] = 'file';
	$post['sess_id'] = !empty($cookie['xfss']) ? $cookie['xfss'] : cut_str($page, 'name="sess_id" value="', '"');
	foreach (array('srv_tmp_url', 'utype', 'srv_id', 'disk_id') as $tmpName) {
		if (stripos($page, "name=\"$tmpName\" value=\"") !== false && ($tmp = cut_str($page, "name=\"$tmpName\" value=\"", '"'))) $post["$tmpName"] = $tmp;
	}
	$post['link_pass'] = $post['link_rcpt'] = '';
	$post['file_descr'] = 'Uploaded with Rapidleech.';
	$post['file_public'] = '1';
	$post['tos'] = '1';
	$post['submit_btn'] = ' Upload! ';

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'file_1', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (!$login && stripos($page, 'Uploads not enabled for this type of users') !== false) html_error('Please set '.($_T8['xfsFree'] ? '$_T8[\'xfsFree\'] to false and ' : '').'$_T8[\'anonUploadDisable\'] to true.');

	$statuscode = intval(substr($upfiles, 9, 3));
	if ($statuscode >= 400 || preg_match('@<body><b>([^<>]+)</b></body></html>@i', $upfiles, $err)) html_error("Upload server isn't working or has failed (HTTP $statuscode)".(!empty($err[1]) ? ', response: ' . htmlspecialchars($err[1]) : '.'));

	if ($page = cut_str($upfiles, '<Form name=\'F1\'', '</Form>')) {
		// Normal Upload (F1 Form)
		if (!preg_match_all('@<input\s+[^<>]*name=\'([^\']+)\'\s+value=\'([^\']+)\'@i', $page, $inputs)) html_error('Error: upload_result data not found.');
		$post = array_map('urlencode', array_map('html_entity_decode', array_combine(array_map('trim', $inputs[1]), array_map('trim', $inputs[2]))));
		if (empty($post['op']) || strtolower(urldecode($post['op'])) != 'upload_result') html_error('Error: "upload_result" value not found.');
		if (empty($post['fn'])) html_error('Error: "fn" input not found.');
		if (strtolower($post['st']) != 'ok') html_error('Upload failed, response: '.htmlspecialchars(urldecode($post['st'])));
	} else if (preg_match('@"file_status"\s*:\s*"([^\"\'\]\}]+)"@', $upfiles, $reply) && (strtolower($reply[1]) != 'ok' || preg_match('@"file_code"\s*:\s*"(\w{12})"@', $upfiles, $fileid))) {
		// New JSON response.
		if (empty($fileid)) html_error('Upload failed, json response: '.htmlspecialchars($reply[1]));
		$post = array('op' => 'upload_result', 'fn' => urlencode($fileid[1]), 'st' => urlencode($reply[1]));
	} else html_error('Error: upload_result form/json not found.');

	$page = geturl($domain, 443, '/', $up_url, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);

	$host_rexexp = 'https?://(?:www\.)?'.preg_quote(str_ireplace('www.', '', $domain), '@').'/';
	if (preg_match('@('.$host_rexexp.'\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?)\?killcode=\w+@i', $page, $lnk)) {
		$download_link = $lnk[1];
		$delete_link = $lnk[0];
	} else if (preg_match('@'.$host_rexexp.'del-(\w{12})-\w+/([^<>\"\'\r\n]+)@i', $page, $lnk)) {
		$download_link = substr($lnk[0], 0, (stripos($lnk[0], '/del-') + 1)) . $lnk[2] . '/' . $lnk[3];
		$delete_link = $lnk[0];
	} else if (preg_match('@'.$host_rexexp.'\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?(?=[\r\n\t\s\'\"<>])@i', $page, $lnk)) $download_link = $lnk[0];
	else html_error('Download link not found.');
}

// Edited For upload.php usage.
function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5', $sname = 'Enter Captcha', $iname = 'captcha') {
	echo "\n<form name='captcha' method='POST'>\n";
	foreach ($inputs as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='$input' />\n";
	echo "\t<h4>" . lang(301) . " <img alt='CAPTCHA Image' src='$captchaImg' /> " . lang(302) . ": <input type='text' id='captcha' name='$iname' size='$captchaSize' />&nbsp;&nbsp;\n\t\t<input type='submit' onclick='return check();' value='$sname' />\n\t</h4>\n\t<script type='text/javascript'>/* <![CDATA[ */\n\t\tfunction check() {\n\t\t\tvar captcha=document.getElementById('captcha').value;\n\t\t\tif (captcha == '') {\n\t\t\t\twindow.alert('You didn\'t enter the image verification code');\n\t\t\t\treturn false;\n\t\t\t} else return true;\n\t\t}\n\t/* ]]> */</script>\n</form>\n</body>\n</html>";
}

// Edited For upload.php usage.
function reCAPTCHA($publicKey, $inputs, $sname = 'Upload File') {
	global $cookie, $domain, $referer, $pauth;
	if (empty($publicKey) || preg_match('/[^\w\.\-]/', $publicKey)) html_error('Invalid reCAPTCHA public key.');
	if (!is_array($inputs)) html_error('Error parsing captcha post data.');
	// Check for a global recaptcha key
	$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, 'http://fakedomain.tld/fakepath', 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	if (substr($page, 9, 3) != '200') html_error('Invalid or deleted reCAPTCHA public key.');

	if (strpos($page, 'Invalid referer') === false) {
		// Embed captcha
		echo "<script language='JavaScript'>var RecaptchaOptions = {theme:'red', lang:'en'};</script>\n\n<center><form name='recaptcha' method='POST'><br />\n";
		foreach ($inputs as $name => $input) echo "<input type='hidden' name='$name' id='C_$name' value='$input' />\n";
		echo "<script type='text/javascript' src='//www.google.com/recaptcha/api/challenge?k=$publicKey'></script><noscript><iframe src='//www.google.com/recaptcha/api/noscript?k=$publicKey' height='300' width='500' frameborder='0'></iframe><br /><textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br /><input type='submit' name='submit' onclick='javascript:return checkc();' value='$sname' />\n<script type='text/javascript'>/*<![CDATA[*/\nfunction checkc(){\nvar capt=document.getElementById('recaptcha_response_field');\nif (capt.value == '') { window.alert('You didn\'t enter the image verification code.'); return false; }\nelse { return true; }\n}\n/*]]>*/</script>\n</form></center>\n</body>\n</html>";
	} else {
		// Download captcha
		$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		if (!preg_match('@[\{,\s]challenge\s*:\s*[\'\"]([\w\-]+)[\'\"]@', $page, $challenge)) html_error('Error getting reCAPTCHA challenge.');
		$inputs['recaptcha_challenge_field'] = $challenge = $challenge[1];

		$imgReq = geturl('www.google.com', 0, '/recaptcha/api/image?c=' . $challenge, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($imgReq);
		list($headers, $imgBody) = explode("\r\n\r\n", $imgReq, 2);
		unset($imgReq);
		if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
		$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpeg');

		EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $inputs, 20, $sname, 'recaptcha_response_field');
	}
	exit;
}

function Login($user, $pass) {
	global $cookie, $scheme, $domain, $referer, $pauth, $default_acc;

	$is_step = (!empty($_POST['step']) && $_POST['step'] == '1');
	if ($is_step) {
		$_POST['step'] = false;
		if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
	}

	$post = array();
	$post['op'] = 'login';
	$post['redirect'] = '';
	$post['email'] = urlencode($_REQUEST['up_login']);
	$post['password'] = urlencode($_REQUEST['up_pass']);
	$post['recaptcha_response_field'] = !empty($_POST['recaptcha_response_field']) ? urlencode($_POST['recaptcha_response_field']) : '';
	$post['recaptcha_challenge_field'] = !empty($_POST['recaptcha_challenge_field']) ? urlencode($_POST['recaptcha_challenge_field']) : '';
	$post['rand'] = '';

	$page = geturl($domain, 443, '/login', "$referer\r\nX-Requested-With: XMLHttpRequest", $cookie, $post, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);

	if (stripos($page, 'data-captcha="yes"') !== false) {
		if ($is_step) html_error('Wrong Captcha Entered.');
		$data = array();
		$data['step'] = '1';
		$data['cookie'] = urlencode(encrypt(CookiesToStr($cookie)));
		$data['action'] = 'FORM';
		if (!$default_acc) {
			$data['A_encrypted'] = 'true';
			$data['up_login'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
			$data['up_pass'] = urlencode(encrypt($pass)); // And this too.
		}
		reCAPTCHA('6LetAu0SAAAAACCJkqZLvjNS4L7eSL8fGxr-Jzy2', $data, 'Login'); // Hardcoded reCAPTCHA id.
		exit();
	}
	is_present($page, 'Incorrect Login or Password', 'Login failed: Email/Password incorrect.');
	is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
	is_present($page, 'Please%20enter%20your%20e-mail', "Login failed: Missing account's email, login at site and set the email.");
	$cookie = GetCookiesArr($page, $cookie);
	if (empty($cookie['xfss']) && empty($cookie['email'])) html_error('Error: Login cookies not found.');
	$cookie['lang'] = 'english';

	$page = geturl($domain, 443, '/profile', $referer.'login', $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
	is_notpresent($page, '>Logout</a>', 'Login Error');

	SaveCookies($user, $pass); // Update cookies file
	return true;
}

function IWillNameItLater($cookie, $decrypt=true) {
	if (!is_array($cookie)) {
		if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
		return '';
	}
	if (count($cookie) < 1) return $cookie;
	$keys = array_keys($cookie);
	$values = array_values($cookie);
	$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
	$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
	return array_combine($keys, $values);
}

function CookieLogin($user, $pass) {
	global $scheme, $domain, $referer, $secretkey, $pauth;
	if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
	$user = strtolower($user);

	$filename = 'filejoker_ul.php';
	if (!defined('DOWNLOAD_DIR')) {
		if (substr($GLOBALS['options']['download_dir'], -1) != '/') $GLOBALS['options']['download_dir'] .= '/';
		define('DOWNLOAD_DIR', (substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']));
	}
	$filename = DOWNLOAD_DIR.basename($filename);
	if (!file_exists($filename)) return Login($user, $pass);

	$file = file($filename);
	$savedcookies = unserialize($file[1]);
	unset($file);

	$hash = hash('crc32b', $user.':'.$pass);
	if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
		$secretkey = $_secretkey;
		if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return Login($user, $pass);

		$page = geturl($domain, 443, '/profile', $referer.'login', $testCookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
		if (stripos($page, '>Logout</a>' === false)) return Login($user, $pass);

		$GLOBALS['cookie'] = $testCookie; // Update cookies
		SaveCookies($user, $pass); // Update cookies file
		return true;
	}
	return Login($user, $pass);
}

function SaveCookies($user, $pass) {
	global $secretkey;
	$maxdays = 31; // Max days to keep cookies saved

	$filename = 'filejoker_ul.php';
	$filename = DOWNLOAD_DIR.basename($filename);
	if (file_exists($filename)) {
		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		// Remove old cookies
		foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 86400)) unset($savedcookies[$k]);
	} else $savedcookies = array();
	$hash = hash('crc32b', $user.':'.$pass);
	$_secretkey = $secretkey;
	$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
	$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($GLOBALS['cookie'], false));
	$secretkey = $_secretkey;

	write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
}

//[05-6-2016]  Written by Th3-822.

?>
<?php
$upload_services[] = "filepost.com_member";
$max_file_size["filepost.com_member"] = 1000;
$page_upload["filepost.com_member"] = "filepost.com_member.php";  
?>
<?php

####### Account Info. ###########
$upload_acc['filepost_com']['user'] = ""; //Set your email
$upload_acc['filepost_com']['pass'] = ""; //Set your password
##############################

$not_done = true;
$continue_up = false;

if ($upload_acc['filepost_com']['user'] && $upload_acc['filepost_com']['pass']) {
	$_REQUEST['up_login'] = $upload_acc['filepost_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['filepost_com']['pass'];
	$_REQUEST['action'] = "FORM";
	echo "<p style='text-align:center;font-weight:bold;'>Using Default Login and Pass.</p>\n";
}

if ($_REQUEST['action'] == "FORM") $continue_up=true;
else {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>
	<tr><td colspan='2' align='center'><small>*You can set it as default in <b>{$page_upload["filepost.com_member"]}</b></small></td></tr>\n</table>\n</form>\n";
}

if ($continue_up) {
	$not_done = $login = false;
	$cookie = array();

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to Filepost</div>\n";

	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post["email"] = urlencode($_REQUEST['up_login']);
		$post["password"] = urlencode($_REQUEST['up_pass']);

		$page = geturl ('filepost.com', 80, '/general/login_form/?JsHttpRequest='.time().'-xml', 'http://filepost.com/', 0, $post);
		is_page($page);

		is_present($page, 'Incorrect e-mail\/password combination', 'Login Failed: Invalid username and/or password.');
		$cookie = GetCookiesArr($page);
		if (empty($cookie['SID'])) html_error('Login Failed: Session cookie not found');
		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	// Start loop here
	$try = 0;
	$max_trys = 4;
	do {
		$try++;
		$page = geturl("filepost.com", 80, "/", 0, $cookie);is_page($page);
		if ($try > $max_trys) {
			$try = $try-1;
			if (stristr($page, 'Upload will be available a bit later')) html_error("Error@$try: Upload will be available a bit later.");
			else html_error("Error: No useable upload server found in $try trys.");
		}
		$cookie = array_merge($cookie, GetCookiesArr($page));

		if (stristr($page, 'Upload will be available a bit later')) {
			sleep(1); // Let's wait...
			continue;
		}

		if (!preg_match("@upload_url:\s+'(http://fs\d+\.filepost\.com/)([^\']+)'@i", $page, $loc)) html_error("Upload url not found.");

		//Testing server.
		$test = @file_get_contents($loc[1].'crossdomain.xml');
		if ($try+1 == $max_trys && !$test) { // To be removed later...
			//Do code at last try
			// With my acc logged in, selected server doesn't connect... But without it  work...
			$loc[1] = 'http://fs470.filepost.com/'; //I will use one of the working servers
			$test = file_get_contents($loc[1].'crossdomain.xml');
		}
	} while (!$test);
	// Now we have a useable upload server...

	$post = array();
	$post['Filename'] = $lname;
	$post['SID'] = cut_str($page, "SID: '", "'");
	$post['Upload'] = 'Submit Query';

	$up_loc = $loc[1].$loc[2];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_loc);
	$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), '', 0, $post, $lfile, $lname, "file", '', 0, 0, 'Shockwave Flash');

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";

	is_page($upfiles);
	if (!preg_match('@\{"answer":"(\w+)"\}@i', $upfiles, $udid)) html_error("File-Adm id not found.");
	$page = geturl("filepost.com", 80, "/files/done/".$udid[1], 'http://filepost.com/', $cookie);is_page($page);

	if (preg_match('@id="down_link"[^<|>]+value="(http://[^\"]+)"@i', $page, $dl)) {
		$download_link = $dl[1];
		if (preg_match('@id="edit_link"[^<|>]+value="(http://[^\"]+)"@i', $page, $adml)) $adm_link = $adml[1];
	} else html_error("Download link not found.");
}

//[07-12-2011]  Written by Th3-822.

?>
<?php 
$upload_services[] = 'filerio.in';
$max_file_size['filerio.in'] = 10000;
$page_upload['filerio.in'] = 'filerio.in.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 3); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'filerio.in'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [22-1-2014]

?>
<?php 
$upload_services[] = 'filescdn.com';
$max_file_size['filescdn.com'] = 2048;
$page_upload['filescdn.com'] = 'filescdn.com.php';  
?>
<?php
if (!defined('RAPIDLEECH')) exit;


$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'filescdn.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 443; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = true; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// [2016-10-18] Written by The Devil

?>
<?php 
$upload_services[]="filesin.com_member";
$max_file_size["filesin.com_member"]=100;
$page_upload["filesin.com_member"] = "filesin.com_member.php";  
?>
<?php
// Default Account Info =================
$Filesin_user = ''; //  Set you username
$Filesin_pass = ''; //  Set your password
//=======================================

			$not_done = true;
			$continue_up = false;
			if ($Filesin_user & $Filesin_pass) {
				$_REQUEST['fi_user'] = $Filesin_user;
				$_REQUEST['fi_pass'] = $Filesin_pass;
				$_REQUEST['action'] = "FORM";
				echo "<b><center>Automatic Login Filesin.com</center></b>\n";
			}
			if ($_REQUEST['action'] == "FORM"){
				$continue_up = true;
			}else {
?>
					<script>document.getElementById('info').style.display='none';</script>
                    <div id='info' width='100%' align='center' style="font-weight:bold; font-size:16px">Login</div> 
    <table border=0 style="width:270px;" cellspacing=0 align=center>
        <form method="post">
        <input type='hidden' name='action' value='FORM' />
            <tr><td nowrap>&nbsp;User*<td>&nbsp;<input type='text' name='fi_user' value='' style="width:160px;" />&nbsp;</tr>
            <tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type='password' name='fi_pass' value='' style="width:160px;" />&nbsp;</tr>
            <tr><td colspan=2 align=center><input type='submit' value='Upload' /></tr>
            <tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["filesin.com_member"]; ?></b></small></tr>
        </form>
    </table>
<?php
			}
			if ($continue_up) {
				$not_done = false;
?>
    <table width=600 align=center>
    </td></tr>
    <tr><td align=center>
    		<script>document.getElementById('info').style.display='none';</script>
            <div id='info' width='100%' align='center'>Login to Filesin.com</div>
        <?php
        if (!empty($_REQUEST['fi_user']) && !empty($_REQUEST['fi_pass'])){
		$post["username"] = trim($_REQUEST['fi_user']);
        $post["password"] = trim($_REQUEST['fi_pass']);
		$Url = parse_url("http://filesin.com/login.php");
		$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "www.filesin.com/login.php", 0, $post, 0, $_GET["proxy"], $pauth);
		is_page($page);
		is_present($page, "Please enter Username and Password", "Please enter Username and Password");
		is_present($page, "Wrong Username or Password", "Wrong Username or Password");
		$cookie = GetCookies($page);
		}else{
		html_error ('Error, user and/or password is empty, please go back and try again!');
	}
        ?> 
<script>document.getElementById('info').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div> 
<?php
		$url = parse_url('http://filesin.com/');
		$page = geturl($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), "http://www.filesin.com/", $cookie, 0, 0, $_GET["proxy"], $pauth);
		if(!preg_match('#name="UPLOAD_IDENTIFIER"[\r|\n|\s]+value="([^"]+)"#', $page, $id)){
				html_error('Cannot get id.');
		}
		$url = parse_url('http://filesin.com/');
        $post["UPLOAD_IDENTIFIER"] = $id[1];
        $post["terms"] = 1;
		$upfiles = upfile($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), "http://www.filesin.com/", $cookie, $post, $lfile, $lname, "file1");
?>

<script>document.getElementById('progressblock').style.display='none';</script>
<?php
is_page($upfiles);
				if(!preg_match("#ocation: (.*)#", $upfiles, $link)){
					html_error('Error in upload.');
				}
				$dl = explode('=', $link[1]);
				if(!empty($dl)){
					$download_link = 'http://www.filesin.com/'.$dl[1].'/download.html';
				}else{
					html_error ("Didn't find download link!");
				}
					
			}
				
/**
written by SD-88 07.04.2012
**/   
?>
<?php 
$upload_services[]="filesin.com_premium";
$max_file_size["filesin.com_premium"]=2048;
$page_upload["filesin.com_premium"] = "filesin.com_premium.php";  
?>
<?php
// Default Account Info =================
$Filesin_user = ''; //  Set you username
$Filesin_pass = ''; //  Set your password
//=======================================

			$not_done = true;
			$continue_up = false;
			if ($Filesin_user & $Filesin_pass) {
				$_REQUEST['fi_user'] = $Filesin_user;
				$_REQUEST['fi_pass'] = $Filesin_pass;
				$_REQUEST['action'] = "FORM";
				echo "<b><center>Automatic Login Filesin.com</center></b>\n";
			}
			if ($_REQUEST['action'] == "FORM"){
				$continue_up = true;
			}else {
?>
					<script>document.getElementById('info').style.display='none';</script>
                    <div id='info' width='100%' align='center' style="font-weight:bold; font-size:16px">Login</div> 
    <table border=0 style="width:270px;" cellspacing=0 align=center>
        <form method="post">
        <input type='hidden' name='action' value='FORM' />
            <tr><td nowrap>&nbsp;User*<td>&nbsp;<input type='text' name='fi_user' value='' style="width:160px;" />&nbsp;</tr>
            <tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type='password' name='fi_pass' value='' style="width:160px;" />&nbsp;</tr>
            <tr><td colspan=2 align=center><input type='submit' value='Upload' /></tr>
            <tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["filesin.com_premium"]; ?></b></small></tr>
        </form>
    </table>
<?php
			}
			if ($continue_up) {
				$not_done = false;
?>
    <table width=600 align=center>
    </td></tr>
    <tr><td align=center>
    		<script>document.getElementById('info').style.display='none';</script>
            <div id='info' width='100%' align='center'>Login to Filesin.com</div>
        <?php
        if (!empty($_REQUEST['fi_user']) && !empty($_REQUEST['fi_pass'])){
		$post["username"] = trim($_REQUEST['fi_user']);
        $post["password"] = trim($_REQUEST['fi_pass']);
		$Url = parse_url("http://filesin.com/login.php");
		$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "www.filesin.com/login.php", 0, $post, 0, $_GET["proxy"], $pauth);
		is_page($page);
		is_present($page, "Please enter Username and Password", "Please enter Username and Password");
		is_present($page, "Wrong Username or Password", "Wrong Username or Password");
		$cookie = GetCookies($page);
		}else{
		html_error ('Error, user and/or password is empty, please go back and try again!');
	}
        ?> 
<script>document.getElementById('info').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div> 
<?php
		$url = parse_url('http://filesin.com/');
		$page = geturl($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), "http://www.filesin.com/", $cookie, 0, 0, $_GET["proxy"], $pauth);
		if(!preg_match('#name="UPLOAD_IDENTIFIER"[\r|\n|\s]+value="([^"]+)"#', $page, $id)){
				html_error('Cannot get id.');
		}
		$url = parse_url('http://filesin.com/');
        $post["UPLOAD_IDENTIFIER"] = $id[1];
        $post["terms"] = 1;
		$upfiles = upfile($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), "http://www.filesin.com/", $cookie, $post, $lfile, $lname, "file1");
?>

<script>document.getElementById('progressblock').style.display='none';</script>
<?php
is_page($upfiles);
				if(!preg_match("#ocation: (.*)#", $upfiles, $link)){
					html_error('Error in upload.');
				}
				$dl = explode('=', $link[1]);
				if(!empty($dl)){
					$download_link = 'http://www.filesin.com/'.$dl[1].'/download.html';
				}else{
					html_error ("Didn't find download link!");
				}
					
			}
				
/**
written by SD-88 07.04.2012
**/   
?>
<?php
$upload_services[] = 'fshare.vn_member';
$max_file_size['fshare.vn_member'] = 500;
$page_upload['fshare.vn_member'] = 'fshare.vn_member.php';
?>
<?php
######## Account Info ########
$upload_acc['fshare_vn']['user'] = ''; //Set your login
$upload_acc['fshare_vn']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['fshare_vn']['user'] && $upload_acc['fshare_vn']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['fshare_vn']['user'];
	$_REQUEST['up_pass'] = $upload_acc['fshare_vn']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'www.fshare.vn';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}
		CookieLogin($_REQUEST['up_login'], $_REQUEST['up_pass']);
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$page = geturl('up.fshare.vn', 80, '/index.php?keepThis=false&', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	$cookie = GetCookiesArr($page, $cookie);

	if (!preg_match('@upload_url\s*:\s*"((https?://(?:\w+\.)*fshare\.vn)?(/)?[^\s\'\"<>]+)",@i', $page, $up)) html_error('Error: Upload url not found.');
	if (!preg_match('@\{"SESSID"\s*:\s*"(\w+)"@i', $page, $sid)) html_error('Error: Upload session not found.');

	$post = array();
	$post['Filename'] = $lname;
	$post['folder_id'] = '-1';
	$post['direct_link'] = $post['secure'] = 'null';
	$post['desc'] = 'Uploaded with Rapidleech.';
	$post['SESSID'] = $sid[1];
	$post['Upload'] = 'Submit Query';

	$up_url = (empty($up[2]) ? 'http://up.fshare.vn'.(empty($up[3]) ? '/' : '').$up[1] : $up[1]);

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'fileupload', '', 0, 0, 'Shockwave Flash', $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (!preg_match('@https?://(?:www\.)?fshare\.vn/file/\w+/?@i', $upfiles, $lnk)) html_error('Download link not found.');
	$download_link = $lnk[0];
}

// Edited For upload.php usage.
function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5') {
	echo "\n<form name='captcha' method='POST'>\n";
	foreach ($inputs as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='$input' />\n";
	echo "\t<h4>" . lang(301) . " <img alt='CAPTCHA Image' src='$captchaImg' /> " . lang(302) . ": <input type='text' name='captcha' size='$captchaSize' />&nbsp;&nbsp;\n\t\t<input type='submit' onclick='return check();' value='Enter Captcha' />\n\t</h4>\n\t<script type='text/javascript'>/* <![CDATA[ */\n\t\tfunction check() {\n\t\t\tvar captcha=document.dl.captcha.value;\n\t\t\tif (captcha == '') {\n\t\t\t\twindow.alert('You didn\'t enter the image verification code');\n\t\t\t\treturn false;\n\t\t\t} else return true;\n\t\t}\n\t/* ]]> */</script>\n</form>\n</body>\n</html>";
}

function DL_reCaptcha($pid, $data) {
	global $pauth;
	$page = geturl('www.google.com', 80, "/recaptcha/api/challenge?k=$pid", 0, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	if (!preg_match('/challenge \: \'([^\']+)/i', $page, $ch)) html_error('Error getting CAPTCHA data.');
	$challenge = $ch[1];

	$data['challenge'] = $challenge;

	//Download captcha img.
	$page = geturl('www.google.com', 80, "/recaptcha/api/image?c=$challenge", 0, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	$capt_img = substr($page, strpos($page, "\r\n\r\n") + 4);
	$imgfile = DOWNLOAD_DIR . 'fsharevn_captcha.jpg';

	if (file_exists($imgfile)) unlink($imgfile);
	if (!write_file($imgfile, $capt_img)) html_error('Error getting CAPTCHA image.');

	EnterCaptcha($imgfile.'?'.time(), $data, 20);
	exit;
}

function Login($user, $pass) {
	global $cookie, $domain, $referer, $pauth, $default_acc;
	if (!empty($_POST['step']) && $_POST['step'] == '1') {
		$captcha = true;
		$_POST['step'] = false;
	} else $captcha = false;

	$post = array();
	$post['login_useremail'] = urlencode($user);
	$post['login_password'] = urlencode($pass);
	$post['url_refe'] = 'http%3A%2F%2Fwww.fshare.vn%2F';
	$post['auto_login'] = 1;
	if ($captcha) {
		if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
		$cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
		$post['recaptcha_challenge_field'] = urlencode($_POST['challenge']);
		$post['recaptcha_response_field'] = urlencode($_POST['captcha']);
	}

	$page = geturl($domain, 0, '/login.php', $referer.'login.php', $cookie, $post, 0, 0, 0, 0, 'https');is_page($page);
	$cookie = GetCookiesArr($page, $cookie);
	if (preg_match('@\nLocation: ((https?://(\w+\.)*fshare.vn)?/active\.php\?code=[^\r\n]+)@i', $page, $redir)) {
		$redir = parse_url((empty($redir[2]) ? 'https://www.fshare.vn'.$redir[1] : $redir[1]));
		$page = geturl($redir['host'], defport($redir), $redir['path'], $referer.'login.php', $cookie, 0, 0, 0, 0, 0, $redir['scheme']);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);
	}

	if ($captcha) is_present($page, 'MÃ£ xÃ¡c nháº­n khÃ´ng chÃ­nh xÃ¡c', 'Login Failed: Wrong CAPTCHA entered.');
	elseif (stripos($page, 'MÃ£ xÃ¡c nháº­n khÃ´ng chÃ­nh xÃ¡c') !== false) {
		if (!preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w|\-]+)@i', $page, $pid)) html_error('Login Error: Captcha not found.');
		$data = array();
		$data['step'] = '1';
		$data['cookie'] = urlencode(encrypt(CookiesToStr($cookie)));
		$data['action'] = 'FORM';
		if (!$default_acc) {
			$data['A_encrypted'] = 'true';
			$data['up_login'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
			$data['up_pass'] = urlencode(encrypt($pass)); // And this too.
		}
		DL_reCaptcha($pid[1], $data);
		exit;
	}

	is_present($page, 'Máº­t kháº©u pháº£i cÃ³ Ã­t nháº¥t 6 kÃ½ tá»±.', 'Login Failed: Password too short (< 6).');
	is_present($page, 'Báº¡n cáº§n nháº­p chÃ­nh xÃ¡c email vÃ  máº­t kháº©u.', 'Login Failed: Email/Password incorrect.');
	if (empty($cookie['fshare_userpass'])) html_error('Login Error: Cannot find "fshare_userpass" cookie.');

	SaveCookies($user, $pass); // Update cookies file
	return true;
}

function IWillNameItLater($cookie, $decrypt=true) {
	if (!is_array($cookie)) {
		if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
		return '';
	}
	if (count($cookie) < 1) return $cookie;
	$keys = array_keys($cookie);
	$values = array_values($cookie);
	$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
	$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
	return array_combine($keys, $values);
}

function CookieLogin($user, $pass) {
	global $cookie, $domain, $referer, $secretkey, $pauth;
	if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
	$user = strtolower($user);

	$filename = 'fsharevn_ul.php';
	if (!defined('DOWNLOAD_DIR')) {
		global $options;
		if (substr($options['download_dir'], -1) != '/') $options['download_dir'] .= '/';
		define('DOWNLOAD_DIR', (substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']));
	}
	$filename = DOWNLOAD_DIR.basename($filename);
	if (!file_exists($filename)) return Login($user, $pass);

	$file = file($filename);
	$savedcookies = unserialize($file[1]);
	unset($file);

	$hash = hash('crc32b', $user.':'.$pass);
	if (array_key_exists($hash, $savedcookies)) {
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$cookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
		$secretkey = $_secretkey;
		if ((is_array($cookie) && count($cookie) < 1) || empty($cookie)) return Login($user, $pass);

		$page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		if (stripos($page, '>ThoÃ¡t</a>') === false) return Login($user, $pass);
		$cookie = GetCookiesArr($page, $cookie); // Update cookies
		SaveCookies($user, $pass); // Update cookies file
		return true;
	}
	return Login($user, $pass);
}

function SaveCookies($user, $pass) {
	global $cookie, $secretkey;
	$maxdays = 31; // Max days to keep cookies saved

	$filename = 'fsharevn_ul.php';
	$filename = DOWNLOAD_DIR.basename($filename);
	if (file_exists($filename)) {
		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		// Remove old cookies
		foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
	} else $savedcookies = array();
	$hash = hash('crc32b', $user.':'.$pass);
	$_secretkey = $secretkey;
	$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
	$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($cookie, false));
	$secretkey = $_secretkey;

	write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
}

//[21-2-2014]  Written by Th3-822.

?>
<?php
$upload_services[] = 'ge.tt';
$max_file_size['ge.tt'] = 2000;
$page_upload['ge.tt'] = 'ge.tt.php';
?>
<?php
######## Account Info ########
$upload_acc['ge_tt']['user'] = ''; //Set your login
$upload_acc['ge_tt']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['ge_tt']['user'] && $upload_acc['ge_tt']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['ge_tt']['user'];
	$_REQUEST['up_pass'] = $upload_acc['ge_tt']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;EMail*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'ge.tt';
	$referer = "http://$domain/";
	$referer_json = "$referer\r\nContent-Type: application/json";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$post = array();
		$post['email'] = $_REQUEST['up_login'];
		$post['password'] = $_REQUEST['up_pass'];

		if (!function_exists('json_encode')) html_error('Error: Please enable JSON in php.');

		$page = geturl('api.gett.pro', 80, '/1/users/login', $referer_json, $cookie, json_encode($post), 0, $_GET['proxy'], $pauth);is_page($page);
		//$cookie = GetCookiesArr($page, $cookie);

		is_present($page, 'User not found', 'Invalid email address or user doesn\'t exists.');
		is_present($page, 'Wrong email or password', 'Login Failed: Email/Password incorrect.');

		$userInfo = json2array($page, 'Login Error');
		if (!empty($userInfo['message'])) html_error('Login Error: ' . htmlspecialchars((!empty($userInfo['body']['err']) ? "[{$userInfo['message']}] {$userInfo['body']['err']}" : $userInfo['message'])));
		if (empty($userInfo['login'])) html_error('Login Failed.');
		if ($fsize > $userInfo['user']['storage']['free']) html_error('You don\'t have the enough free space in your account for upload this file.');

		$login = true;
	} else {
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		$login = false;

		// Anon Login
		$page = geturl('api.ge.tt', 80, '/anon/signup', $referer_json, $cookie, '{}', 0, $_GET['proxy'], $pauth);is_page($page);
		if (!preg_match('@"accesstoken"\s*:\s*"([^\"]+)"@i', $page, $anonToken)) html_error('Anonymous Session not Found.');
		$anonToken = $anonToken[1];

		// Get Anon User Info
		$page = geturl('api.ge.tt', 80, '/1/users/me?accesstoken='.urlencode($anonToken), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		$userInfo = json2array($page, 'Anon Login Error');
		$userInfo['accesstoken'] = $anonToken;
		if ($fsize > $userInfo['user']['storage']['free']) html_error('You don\'t have the enough free space in your anon account for upload this file.');
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	// Create Share
	$page = geturl('api.ge.tt', 80, '/1/shares/create?accesstoken='.urlencode($userInfo['accesstoken']).'&t='.jstime(), $referer, $cookie, '', 0, $_GET['proxy'], $pauth);is_page($page);
	$share = json2array($page, 'Create Share Error');
	if (empty($share['sharename'])) html_error('Cannot get Share ID');

	// Create File
	$post = array('filename' => $lname);
	$page = geturl('api.ge.tt', 80, '/1/files/'.urlencode($share['sharename']).'/create?accesstoken='.urlencode($userInfo['accesstoken']).'&t='.jstime(), $referer_json, $cookie, json_encode($post), 0, $_GET['proxy'], $pauth);is_page($page);
	$file = json2array($page, 'Create File Error');
	if (empty($file['getturl'])) $file['getturl'] = 'http://ge.tt/' . urlencode($share['sharename']);
	if (empty($file['upload']['posturl'])) html_error('Upload URL not Found.'); // posturl		puturl

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($file['upload']['posturl']); // .'&nounce='.exports_uuid()
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $file['getturl'], $cookie, array(), $lfile, $lname, 'blob', '', $_GET['proxy'], $pauth, 0, $url['scheme']);
	//$upfiles = putfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $file['getturl'], $cookie, $lfile, $lname, $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (stripos($upfiles, 'computer says yes') === false) {
		textarea($upfiles);
		html_error('Unknown Upload Error.');
	}

	$download_link = $file['getturl'];
}

function json2array($content, $errorPrefix = 'Error') {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (empty($content)) return NULL;
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error("[$errorPrefix]: JSON start braces not found.");
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error("[$errorPrefix]: No JSON content.");
	$rply = json_decode($content, true);
	if ($rply === NULL) html_error("[$errorPrefix]: Error reading JSON.");
	return $rply;
}

function exports_uuid() {
	$ALPHA = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
	$uuid = '';
	for ($i = 0; $i < 36; $i++) {
		$uuid .= $ALPHA[mt_rand(0, 61)];
	}
	return $uuid . '-' . $ALPHA[mt_rand(0, 61)];
}

//[16-8-2015]  Written by Th3-822.
//[18-4-2017]  Fixed. - Th3-822
<?php
$upload_services[]="gettyfile.ru";
$max_file_size["gettyfile.ru"]=4812;
$page_upload["gettyfile.ru"] = "gettyfile.ru.php";  
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
	
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
			$ref='http://gettyfile.ru/create/';
			$page = geturl("gettyfile.ru", 80, "/create/", 0, 0, 0, 0, "");
			is_page($page);
?>
<script>document.getElementById('info').style.display='none';</script>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php

			$hdd=cut_str($page,'"hdd" value="','"');
			$id=str_replace('.','',microtime(1)).'0';
			$post["hdd"]=$hdd;
			$post["header"]='my_files';
			$post["quest"]='';
			$post["answ"]='';
			$post["text"]=$descript;
			$post["tg"]='1';
			$post["term"]='1';
			$Url=parse_url($ref.'ubr/ubr_link_upload.php?rnd_id='.$id.'&hdd='.$hdd);
			$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
			$uid=cut_str($page,'startUpload("','"');
			if (!$uid) html_error ('Error get UploadID');
			$url=parse_url($ref.'cgi-bin/ubr_upload.pl?upload_id='.$uid.'&hdd='.$hdd);

			$upfiles=upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),$ref, 0, $post, $lfile, $lname, "upfile_0");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<div id=final width=100% align=center>Get final code</div>
<?php		
			is_page($upfiles);
			$locat=trim(cut_str($upfiles,'Location:',"\n"));
			if (!$locat) html_error ('Error get location'.$upfiles);
			$Url=parse_url($locat);
			$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $ref, 0, 0, 0, $_GET["proxy"],$pauth);
			is_page($page);
			$locat=trim(cut_str($page,'Location:',"\n"));
			if (!$locat) html_error ('Error get location2'.$page);
			$locat=$ref.str_replace('./','',$locat);
			$Url=parse_url($locat);
			$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $ref, 0, 0, 0, $_GET["proxy"],$pauth);
			echo 'ftp://'.cut_str($page,'"ftp://','"').'<br>';
			$download_link=cut_str($page,"copy('","')");
?>
<script>document.getElementById('final').style.display='none';</script>
<?php

// sert 17.08.2008
?>
<?php 
$upload_services[] = "gigasize.com_premium";
$max_file_size["gigasize.com_premium"] = 2000;
$page_upload["gigasize.com_premium"] = "gigasize.com_premium.php";  
?>
<?php

####### Account Info. ###########
$gigasize_login = ""; //Set you username
$gigasize_pass = ""; //Set your password
##############################

$not_done=true;
$continue_up=false;
if ($gigasize_login & $gigasize_pass){
	$_REQUEST['my_login'] = $gigasize_login;
	$_REQUEST['my_pass'] = $gigasize_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Login*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["gigasize.com_premium"]; ?></b></small></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to Gigasize</div>
<?php 
	        $post['uname'] = $_REQUEST['my_login'];
            $post['passwd'] = $_REQUEST['my_pass'];
            $post['d'] = 'Login';
			$post['login'] = '1';
			
            $page = geturl("www.gigasize.com", 80, "/login.php", 0, 0, $post);			
			is_page($page);
			$cookie = GetCookies($page);
?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php 
			$login_url = "http://www.gigasize.com/myfiles.php";
			$Url = parse_url($login_url);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, 0, 0, $_GET["proxy"],$pauth);
			is_page($page);
			preg_match('/UPLOAD_IDENTIFIER.*value="(.*)"/i', $page, $id);
			preg_match('%(/up\.php.*?)"%i', $page, $act);
			$url_action = "http://www.gigasize.com".$act[1];
			$fpost['UPLOAD_IDENTIFIER'] = $id[1];
			$fpost['titlel'] = '';
			$fpost['description'] = '';
			$fpost['accept'] = '1';
?>
<script>document.getElementById('info').style.display='none';</script>
<?php 		
			$url = parse_url($url_action);
			$upagent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1";
			$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),$login_url, $cookie, $fpost, $lfile, $lname, "file_0", "file_1");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
			preg_match('/sid=(.*)&/i', $act[1], $sid);
			$post = array();
			$post['sid'] = $sid[1];
			$page = geturl("www.gigasize.com", 80, "/upload_progress.php", 0, 0, $post);
			preg_match('/done (.*)-- *(.*)--/i', $page, $query);
			$dl_page = 'http://www.gigasize.com/index.php?f='.$query[1].'--&pass='.$query[2].'--';
			
			$Url = parse_url($dl_page);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, 0, 0, $_GET["proxy"],$pauth);
			preg_match('%<a.*(http://.*get\.php\?.*?)"%i', $page, $flink);
			$download_link = $flink[1];
	}
?>
<?
$upload_services[]="hitfile.net";
$max_file_size["hitfile.net"]= 100000;
$page_upload["hitfile.net"] = "hitfile.net.php";
?>
<?php

####### Account Info. ###########
$hitfile_login = ""; //Set your hitfile user
$hitfile_pass = ""; //Set your hitfile password
##############################

$not_done=true;
$continue_up=false;
if ($hitfile_login && $hitfile_pass){
	$_REQUEST['my_login'] = $hitfile_login;
	$_REQUEST['my_pass'] = $hitfile_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Email*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["hitfile.net"]; ?></b></small></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to hitfile.net</div>
<?php 
			$page = geturl("hitfile.net", 80, "/", 0, 0, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);			
			$cookie = GetCookies($page);
			
			$postlog = array();
			$postlog['user[login]'] = $_REQUEST['my_login'];
			$postlog['user[pass]'] = $_REQUEST['my_pass'];
			$postlog['user[memory]'] = 'on';
			$postlog['user[submit]'] = 'Login';
			
			$Url=parse_url('http://hitfile.net/user/login');
			$page = geturl($Url["host"], $url["port"] ? $url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 'http://hitfile.net/', $cookie, $postlog, 0, $_GET["proxy"], $pauth);
			is_page($page);		
			$cookie = GetCookies($page);
			
			is_notpresent($cookie, 'sid=', 'Error logging in - hitfile.net');
			
			$Url=parse_url('http://hitfile.net/');
			$page = geturl($Url["host"], $url["port"] ? $url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), '', $cookie, $postlog, 0, $_GET["proxy"], $pauth);
			is_page($page);
			preg_match('/flashvars="cancelLang=Cancel&browserLang=Add&downloadLang=Upload&maxSize=(.*?)&domain=main&urlSite=(.*?)&userId=(.*?)&apptype=(.*?)"/', $page, $hitup);
			
		
			
?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive test</div>
<script>document.getElementById('info').style.display='none';</script>
<?php 		
			$upload_url = $hitup[2];
			$agent = 'Shockwave Flash';
			$data['Filename'] = $lname;
			$data['stype'] = 'null';
			$data['apptype'] = $hitup[4];
			$data['user_id'] = $hitup[3];
			$data['id'] = 'null';
			$url = parse_url($upload_url);
			$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), '', $cookie, $data, $lfile, $lname, "Filedata", "", 0, 0, $agent);
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
			preg_match('/"result":true,"id":"(.*?)","message":"Everything is ok"/', $upfiles, $link);
			if(!empty($link[1]))
			{
				$download_link = 'http://hitfile.net/'.$link[1].'/'.$lname.'.html';	
			}
			else
			{
	    			html_error("Error - Unable to retrive the download link, please try again later.");
	 		}
	}

?>
<html><head><title>RAPIDLEECH V2.2</title><meta http-equiv="Content-Type" content="text/html; charset=windows-1251"><style type="text/css"><!--@import url("../images/style.css");--></style></head><body><center><img src="../../images/logo_pm.gif" alt="RAPIDLEECH V2.2"><h1>403: RapidLeech -> Forbidden</h1><hr />You have reached this page in error, please useyour back button to return to RapidLeech.</center></body></html>
<?php
$upload_services[] = 'katfile.com';
$max_file_size['katfile.com'] = 2048; // Filesize limit (MB)
$page_upload['katfile.com'] = 'katfile.com.php';
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'katfile.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = true; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822
<?php
$upload_services[] = 'keep2share.cc_member';
$max_file_size['keep2share.cc_member'] = 5000;
$page_upload['keep2share.cc_member'] = 'keep2share.cc_member.php';
<?php
######## Account Info ########
$upload_acc['keep2share_cc']['user'] = ''; //Set your login
$upload_acc['keep2share_cc']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['keep2share_cc']['user'] && $upload_acc['keep2share_cc']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['keep2share_cc']['user'];
	$_REQUEST['up_pass'] = $upload_acc['keep2share_cc']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'keep2share.cc';
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('use_new_design' => 0);
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}
		CookieLogin($_REQUEST['up_login'], $_REQUEST['up_pass']);
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$uploadData = k2s_apireq('getUploadFormData');
	k2s_checkErrors($uploadData, 'Pre-Upload Error');

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($uploadData['form_action']);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, 0, $uploadData['form_data'], $lfile, $lname, $uploadData['file_field'], '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$status = intval(substr($upfiles, 9, 3));
	$ulResult = ($status >= 500) ? array('status' => 'fail', 'code' => $status, 'message' => "HTTP Error $status.") : Get_Reply($upfiles);
	k2s_checkErrors($ulResult, $prefix = 'Upload error');

	if (empty($ulResult['user_file_id'])) html_error('Download link not found.');
	$download_link = 'https://k2s.cc/file/'.$ulResult['user_file_id'];
}

// Edited For upload.php usage.
function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5', $sname = 'Enter Captcha', $iname = 'captcha') {
	echo "\n<form name='captcha' method='POST'>\n";
	foreach ($inputs as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='$input' />\n";
	echo "\t<h4>" . lang(301) . " <img alt='CAPTCHA Image' src='$captchaImg' /> " . lang(302) . ": <input type='text' id='captcha' name='$iname' size='$captchaSize' />&nbsp;&nbsp;\n\t\t<input type='submit' onclick='return check();' value='$sname' />\n\t</h4>\n\t<script type='text/javascript'>/* <![CDATA[ */\n\t\tfunction check() {\n\t\t\tvar captcha=document.getElementById('captcha').value;\n\t\t\tif (captcha == '') {\n\t\t\t\twindow.alert('You didn\'t enter the image verification code');\n\t\t\t\treturn false;\n\t\t\t} else return true;\n\t\t}\n\t/* ]]> */</script>\n</form>\n</body>\n</html>";
}

// Edited For upload.php usage.
function reCAPTCHA($publicKey, $inputs, $sname = 'Upload File') {
	global $cookie, $domain, $referer, $pauth;
	if (empty($publicKey) || preg_match('/[^\w\.\-]/', $publicKey)) html_error('Invalid reCAPTCHA public key.');
	if (!is_array($inputs)) html_error('Error parsing captcha post data.');
	// Check for a global recaptcha key
	$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, 'http://fakedomain.tld/fakepath', 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	if (substr($page, 9, 3) != '200') html_error('Invalid or deleted reCAPTCHA public key.');

	if (strpos($page, 'Invalid referer') === false) {
		// Embed captcha
		echo "<script language='JavaScript'>var RecaptchaOptions = {theme:'red', lang:'en'};</script>\n\n<center><form name='recaptcha' method='POST'><br />\n";
		foreach ($inputs as $name => $input) echo "<input type='hidden' name='$name' id='C_$name' value='$input' />\n";
		echo "<script type='text/javascript' src='//www.google.com/recaptcha/api/challenge?k=$publicKey'></script><noscript><iframe src='//www.google.com/recaptcha/api/noscript?k=$publicKey' height='300' width='500' frameborder='0'></iframe><br /><textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br /><input type='submit' name='submit' onclick='javascript:return checkc();' value='$sname' />\n<script type='text/javascript'>/*<![CDATA[*/\nfunction checkc(){\nvar capt=document.getElementById('recaptcha_response_field');\nif (capt.value == '') { window.alert('You didn\'t enter the image verification code.'); return false; }\nelse { return true; }\n}\n/*]]>*/</script>\n</form></center>\n</body>\n</html>";
	} else {
		// Download captcha
		$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		if (!preg_match('@[\{,\s]challenge\s*:\s*[\'\"]([\w\-]+)[\'\"]@', $page, $challenge)) html_error('Error getting reCAPTCHA challenge.');
		$inputs['recaptcha_challenge_field'] = $challenge = $challenge[1];

		$imgReq = geturl('www.google.com', 0, '/recaptcha/api/image?c=' . $challenge, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($imgReq);
		list($headers, $imgBody) = explode("\r\n\r\n", $imgReq, 2);
		unset($imgReq);
		if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
		$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpeg');

		EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $inputs, 20, $sname, 'recaptcha_response_field');
	}
	exit;
}

function Login($user, $pass) {
	global $cookie, $domain, $referer, $pauth, $default_acc;

	$post = array();
	$post['LoginForm%5Busername%5D'] = urlencode($user);
	$post['LoginForm%5Bpassword%5D'] = urlencode($pass);
	$post['LoginForm%5BrememberMe%5D'] = 1;
	if (empty($_POST['step']) || !in_array($_POST['step'], array('1', '2'))) {
		$page = geturl($domain, 0, '/login.html', $referer, 0, $post, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
		$cookie = GetCookiesArr($page);

		if (stripos($page, 'The verification code is incorrect.') !== false) {
			$data = array();
			$data['cookie'] = urlencode(encrypt(CookiesToStr($cookie)));
			$data['action'] = 'FORM';
			if (!$default_acc) {
				$data['A_encrypted'] = 'true';
				$data['up_login'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
				$data['up_pass'] = urlencode(encrypt($pass)); // And this too.
			}
			if (preg_match('@https?://(?:[^/]+\.)?(?:(?:google\.com/recaptcha/api)|(?:recaptcha\.net))/(?:(?:challenge)|(?:noscript))\?k=([\w\.\-]+)@i', $page, $cpid)) {
				$data['step'] = '1';
				reCAPTCHA($pid[1], $data, 'Login');
			} elseif (preg_match('@\W(auth/captcha\.html\?v=\w+)@i', $page, $cpid)) {
				$data['step'] = '2';

				$imgReq = geturl($domain, 0, '/' . $cpid[1], $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($imgReq);
				list($headers, $imgBody) = explode("\r\n\r\n", $imgReq, 2);
				unset($imgReq);
				if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
				$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/png');

				EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $data, 20, 'Login');
			} else html_error('Login CAPTCHA not found.');
			exit;
		}

		is_present($page, 'Incorrect username or password', 'Login Failed: Email/Password incorrect.');
		is_present($page, 'You logged in from different country IP', 'Login Failed: Your account was locked for security reasons, to unlock your account check your email.');
		if (empty($cookie['c903aeaf0da94d1b365099298d28f38f'])) html_error('Login Cookie Not Found.');
		if (empty($cookie['sessid'])) html_error('Session Cookie Not Found.');

		$test = k2s_apireq('test');
		if ($test['code'] != 403) k2s_checkErrors($test, 'Login error');
		else {
			$page = geturl($domain, 0, '/', $referer.'login.html', $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
			is_notpresent($page, '/auth/logout.html">Logout', 'Login Error.');
		}

		SaveCookies($user, $pass); // Update cookies file
		return true;
	}

	if ($_POST['step'] == '1') {
		if (empty($_POST['recaptcha_response_field'])) html_error('You didn\'t enter the image verification code.');
		$post['LoginForm%5BverifyCode%5D'] = '';
		$post['recaptcha_challenge_field'] = urlencode($_POST['recaptcha_challenge_field']);
		$post['recaptcha_response_field'] = urlencode($_POST['recaptcha_response_field']);
	} else {
		if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
		$post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
	}

	$_POST['step'] = false;
	$cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));

	$page = geturl($domain, 0, '/login.html', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
	$cookie = GetCookiesArr($page, $cookie);

	is_present($page, 'The verification code is incorrect.');
	is_present($page, 'Incorrect username or password', 'Login Failed: Email/Password incorrect');
	is_present($page, 'You logged in from different country IP', 'Login Failed: Your account was locked for security reasons, to unlock your account check your email');
	if (empty($cookie['c903aeaf0da94d1b365099298d28f38f'])) html_error('Login Cookie Not Found');
	if (empty($cookie['sessid'])) html_error('Session Cookie Not Found');
	$cookie['use_new_design'] = 0;

	$test = k2s_apireq('test');
	if ($test['code'] != 403) k2s_checkErrors($test, 'Login Error');
	else {
		$page = geturl($domain, 0, '/', $referer.'login.html', $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
		is_notpresent($page, '/auth/logout.html">Logout', 'Login Error');
	}

	SaveCookies($user, $pass); // Update cookies file
	return true;
}

function IWillNameItLater($cookie, $decrypt=true) {
	if (!is_array($cookie)) {
		if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
		return '';
	}
	if (count($cookie) < 1) return $cookie;
	$keys = array_keys($cookie);
	$values = array_values($cookie);
	$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
	$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
	return array_combine($keys, $values);
}

function CookieLogin($user, $pass) {
	global $domain, $referer, $secretkey, $pauth;
	if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
	$user = strtolower($user);

	$filename = 'keep2share_ul.php';
	if (!defined('DOWNLOAD_DIR')) {
		if (substr($GLOBALS['options']['download_dir'], -1) != '/') $GLOBALS['options']['download_dir'] .= '/';
		define('DOWNLOAD_DIR', (substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']));
	}
	$filename = DOWNLOAD_DIR.basename($filename);
	if (!file_exists($filename)) return Login($user, $pass);

	$file = file($filename);
	$savedcookies = unserialize($file[1]);
	unset($file);

	$hash = hash('crc32b', $user.':'.$pass);
	if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
		$secretkey = $_secretkey;
		if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return Login($user, $pass);

		$testCookie['use_new_design'] = 0;
		$test = k2s_apireq('test', array('auth_token' => urldecode($testCookie['sessid'])));
		if ($test['code'] != 403) k2s_checkErrors($test, 'Login error');
		else {
			// If session is expired, try to get a updated one from the site with the cookies
			$page = geturl($domain, 0, '/', $referer.'login.html', $testCookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
			$testCookie = GetCookiesArr($page, $testCookie);
			if (stripos($page, '/auth/logout.html">Logout') === false || empty($testCookie['sessid'])) return Login($user, $pass);
			// Test possibly updated session
			$test2 = k2s_apireq('test', array('auth_token' => urldecode($testCookie['sessid'])));
			if ($test2['code'] == 403) return Login($user, $pass);
			k2s_checkErrors($test2, 'Login error');
		}
		$GLOBALS['cookie'] = $testCookie; // Update cookies
		SaveCookies($user, $pass); // Update cookies file
		return true;
	}
	return Login($user, $pass);
}

function SaveCookies($user, $pass) {
	global $secretkey;
	$maxdays = 31; // Max days to keep cookies saved

	$filename = 'keep2share_ul.php';
	$filename = DOWNLOAD_DIR.basename($filename);
	if (file_exists($filename)) {
		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		// Remove old cookies
		foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 86400)) unset($savedcookies[$k]);
	} else $savedcookies = array();
	$hash = hash('crc32b', $user.':'.$pass);
	$_secretkey = $secretkey;
	$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
	$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($GLOBALS['cookie'], false));
	$secretkey = $_secretkey;

	write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
}

function Get_Reply($content) {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in PHP.');
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error('JSON start braces not found.');
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error('No JSON content.');
	$rply = json_decode($content, true);
	if ($rply === NULL) html_error('Error reading JSON.');
	return $rply;
}

function k2s_checkErrors($reply, $prefix = 'Error') {
	if (strtolower($reply['status']) != 'fail') return;
	switch ($reply['code']) {
		default: $msg = ($reply['message'] ? $reply['message'] : '*No message for this error*');break;
		case 429: $msg = 'Too many requests to the API, please try again later';break;
		case 500: $msg = 'Server error while processing your request, please try again later';break;
		case 503: $msg = 'API temporarily not available, please try again later';break;
	}
	html_error("$prefix: [{$reply['code']}] $msg.");
}

function k2s_apireq($actionPath, $post = array()) {
	if (!function_exists('json_encode')) html_error('Error: Please enable JSON in PHP.');
	if (!is_array($post)) html_error('k2s_apireq: Parameter 2 must be passed as an array.');
	$post['auth_token'] = (!empty($post['auth_token']) ? $post['auth_token'] : (!empty($GLOBALS['cookie']['sessid']) ? urldecode($GLOBALS['cookie']['sessid']) : false));

	$page = geturl($GLOBALS['domain'], 0, '/api/v1/'.$actionPath, $GLOBALS['referer'], 0, json_encode($post), 0, $_GET['proxy'], $GLOBALS['pauth'], 0, 'https');
	is_page($page);

	$status = intval(substr($page, 9, 3));
	if ($status >= 500) return array('status' => 'fail', 'code' => $status, 'message' => "k2s_apireq: HTTP Error $status.");

	return Get_Reply($page);
}

//[31-7-2014]  Written by Th3-822.
//[04-4-2017] Switched to https and added cookie to avoid site's new design. - Th3-822
<?php
$upload_services[] = "letitbit.net_member";
$max_file_size["letitbit.net_member"] = 2000;
$page_upload["letitbit.net_member"] = "letitbit.net_member.php";
?>
<?php
####### Account Info. ###########
$upload_acc['letitbit_net']['user'] = ''; //Set your email
$upload_acc['letitbit_net']['pass'] = ''; //Set your password
##############################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['letitbit_net']['user'] && $upload_acc['letitbit_net']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['letitbit_net']['user'];
	$_REQUEST['up_pass'] = $upload_acc['letitbit_net']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'letitbit.net';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('lang' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}
		CookieLogin(strtolower($_REQUEST['up_login']), $_REQUEST['up_pass']);
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Preparing upload</div>\n";

	$page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);
	is_page($page);

	if (!preg_match("@\.server\s*=\s*'([^\']+)'\s*;@i",$page, $up)) html_error('Error: Cannot find upload server.');
	if (!($props = cut_str($page, '.props = {', '}'))) html_error('Error: Cannot find upload data.');

	function rndStr($lg, $num = false) {
		if ($num) $str = "0123456789";
		else {
			$str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
			$str .= strtolower($str)."0123456789";
		}
		$str = str_split($str);
		$ret = '';
		for ($i = 1; $i <= $lg; $i++) $ret .= $str[array_rand($str)];
		return $ret;
	}

	$UID = strtoupper(base_convert(time().rndStr(3, true),10,16)).'_'.rndStr(40);

	$post = array();
	//$post['MAX_FILE_SIZE'] = cut_str($page, 'name="MAX_FILE_SIZE" value="', '"');
	$post['owner'] = cut_str($props, "username:'", "'");
	$post['pin'] = cut_str($props, "pin:'", "'");
	$post['base'] = cut_str($props, "base:'", "'");
	$post['host'] = cut_str($props, "host:'", "'");
	$post['source'] = cut_str($props, "source:'", "'");

	$up_url = "http://{$up[1]}/marker=$UID";
	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'file0', '', $_GET['proxy'], $pauth);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (preg_match('@"uids"\s*:\s*\["([\w\.\-]+)"\]@i', $upfiles, $uid)) {
		$download_link = 'http://letitbit.net/download/'.$uid[1].'/'.str_replace(array(' ', '?'), '_', $lname).'.html';
	} else {
		html_error("Error: Download link not found.");
	}
}

function Login($user, $pass) {
	global $cookie, $domain, $referer, $pauth, $default_acc;
	$post = array();
	$post['act'] = 'login';
	$post['login'] = urlencode($user);
	$post['password'] = urlencode($pass);

	$page = geturl($domain, 80, '/ajax/auth.php', $referer, 'lang=en', $post, 0, $_GET['proxy'], $pauth);is_page($page);
	is_present($page, 'Authorization data is invalid', 'Login failed: User/Password incorrect.');
	is_notpresent($page, 'Set-Cookie: log=', 'Login failed: Cannot find login cookie.');
	is_notpresent($page, 'Set-Cookie: pas=', 'Login failed: Cannot find paswword cookie.');
	$cookie = GetCookiesArr($page);
	$cookie['lang'] = 'en';

	SaveCookies($user, $pass);
	return true;
}

function IWillNameItLater($cookie, $decrypt=true) {
	if (!is_array($cookie)) {
		if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
		return '';
	}
	if (count($cookie) < 1) return $cookie;
	$keys = array_keys($cookie);
	$values = array_values($cookie);
	$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
	$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
	return array_combine($keys, $values);
}

function CookieLogin($user, $pass) {
	global $domain, $referer, $secretkey, $pauth;
	if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
	$user = strtolower($user);

	$filename = 'letitbit_ul.php';
	if (!defined('DOWNLOAD_DIR')) {
		if (substr($GLOBALS['options']['download_dir'], -1) != '/') $GLOBALS['options']['download_dir'] .= '/';
		define('DOWNLOAD_DIR', (substr($GLOBALS['options']['download_dir'], 0, 6) == 'ftp://' ? '' : $GLOBALS['options']['download_dir']));
	}
	$filename = DOWNLOAD_DIR.basename($filename);
	if (!file_exists($filename)) return Login($user, $pass);

	$file = file($filename);
	$savedcookies = unserialize($file[1]);
	unset($file);

	$hash = hash('crc32b', $user.':'.$pass);
	if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : false;
		$secretkey = $_secretkey;
		if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return Login($user, $pass);

		$page = geturl($domain, 80, '/', $referer, $testCookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		if (stripos($page, 'title="Logout">Logout</a>') === false) return Login($user, $pass);
		$GLOBALS['cookie'] = GetCookiesArr($page, $testCookie); // Update cookies
		SaveCookies($user, $pass); // Update cookies file
		return true;
	}
	return Login($user, $pass);
}

function SaveCookies($user, $pass) {
	global $secretkey;
	$maxdays = 31; // Max days to keep cookies saved

	$filename = 'letitbit_ul.php';
	$filename = DOWNLOAD_DIR.basename($filename);
	if (file_exists($filename)) {
		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		// Remove old cookies
		foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 86400)) unset($savedcookies[$k]);
	} else $savedcookies = array();
	$hash = hash('crc32b', $user.':'.$pass);
	$_secretkey = $secretkey;
	$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
	$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($GLOBALS['cookie'], false));
	$secretkey = $_secretkey;

	write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
}

//[01-1-2012] Written by Th3-822. // Happy New Year!
//[16-2-2012] Added functions for save encrypted cookies in a file (Works with more than 1 login) and for keep the cookies saved for 3 days since the last login (can be changed). - Th3-822
//[09-10-2014] Updated & Fixed upload. - Th3-822

?>
<?php 
$upload_services[] = "load.to";
$max_file_size["load.to"] = 300;
$page_upload["load.to"] = "load.to.php";
?>
<?php

	echo "<center>Load.to plugin by <b>The Devil</b></center><br />\n";
	$page = cURL('https://www.load.to/');
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$ind = preg_match_all('~action="(.*)"~U',$page,$uplocs);
	(!$ind)?html_error('Error[0]: Unable to Retrieve Upload Location'):'';
	$uploc = $uplocs[1][0];
	$url = parse_url($uploc);
	is_notpresent($url['query'],'tmp_sid','Error[1]: Plugin Update Required');
	$sid = cut_str($url['query'],'tmp_sid=','&');
	$post = array('imbedded_progress_bar'=>'1','upload_range'=>'1','email'=>'','filecomment'=>'Uploaded with Rapidleech');
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfiles = upfile($url['host'],0,$url['path'].($url["query"] ? "?".$url["query"] : ""),'http://www.load.to/',0,$post,$lfile,$lname,'upfile_0','');
	is_page($upfiles);
	$ind = preg_match('~https?://[\d\w]+.load.to/[\d\w?.=]+~',$upfiles,$redirs);
	(!$ind)?html_error('Error[1]: Unable to Get Completed Upload Redirect'):'';
	$resp = cURL($redirs[0]);
	$ind = preg_match_all('~(https?://(www.)?load.to/(.*))"~U',$resp,$rlinks);
	(!$ind)?html_error('Error[2]: Unable to Get Download and Delete Links'):'';
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	$download_link = $rlinks[1][0];
	$delete_link = $rlinks[1][1];

//[15-12-2016] - Re-Written by The Devil

?>
<?php
$upload_services[] = 'maknyos.indowebster.com';
$max_file_size['maknyos.indowebster.com'] = 384;
$page_upload['maknyos.indowebster.com'] = 'maknyos.indowebster.com.php';
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'maknyos.indowebster.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 128; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload_files'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 (Finally, a plugin for IDWS that works fine)

?>
<?php
$upload_services[] = 'mediafire.com_member';
$max_file_size['mediafire.com_member'] = 499; // Set to 20480 after fixing #130
$page_upload['mediafire.com_member'] = 'mediafire.com_member.php';
<?php
######## Account Info ########
$upload_acc['mediafire_com']['user'] = ''; //Set your login
$upload_acc['mediafire_com']['pass'] = ''; //Set your password
########################

// Uncomment the next line to force default upload settings: Instant Upload: ON and Default Action on Duplicate Name: Skip Upload
// define('MF_forceDefaultUploadOptions');

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

$cURL = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$chttps = false;
if ($cURL) {
	$cV = curl_version();
	if (in_array('https', $cV['protocols'], true)) $chttps = true;
}
if (!extension_loaded('openssl') && !$chttps) html_error('You need to install/enable PHP\'s OpenSSL extension to support HTTPS connections.');
elseif (!$chttps) $cURL = false;

/* Not Final */
if (!function_exists('curl_upfile')) {
	function curl_upfile($host, $port, $url, $referer, $cookie, $post, $file, $filename, $fieldname, $field2name = '', $proxy = 0, $pauth = 0, $upagent = 0, $scheme = 'http') {
		static $ch;
		if (empty($upagent)) $upagent = rl_UserAgent;
		$scheme = strtolower("$scheme://");
		$fileSize = filesize($file);

		if (!is_readable($file)) return html_error(sprintf(lang(65), $file));
		if ($scheme == 'https://' && ($port == 0 || $port == 80)) $port = 443;
		elseif ($port == 0) $port = 80;

		if (!extension_loaded('curl') || !function_exists('curl_init') || !function_exists('curl_exec')) return html_error('cURL isn\'t enabled or cURL\'s functions are disabled');
		$arr = explode("\r\n", $referer);
		$header = array();
		if (count($arr) > 1) {
			$referer = $arr[0];
			unset($arr[0]);
			$header = array_filter(array_map('trim', $arr));
		}
		$opt = array(CURLOPT_HEADER => 1, CURLOPT_SSL_VERIFYPEER => 0,
			CURLOPT_SSL_VERIFYHOST => 0, CURLOPT_RETURNTRANSFER => 1,
			CURLOPT_FOLLOWLOCATION => 0, CURLOPT_FAILONERROR => 1,
			CURLOPT_FORBID_REUSE => 0, CURLOPT_FRESH_CONNECT => 0,
			CURLINFO_HEADER_OUT => 1, CURLOPT_URL => $scheme . $host . ($port != 80 && $port != 443 ? ":" . $port : "") . str_replace(array(' ', "\r", "\n"), array('%20'), $url),
			CURLOPT_USERAGENT => $upagent);

		$opt[CURLOPT_REFERER] = !empty($referer) ? $referer : false;
		$opt[CURLOPT_COOKIE] = !empty($cookie) ? (is_array($cookie) ? CookiesToStr($cookie) : trim($cookie)) : false;

		if (!empty($_GET['useproxy']) && !empty($_GET['proxy'])) {
			$opt[CURLOPT_HTTPPROXYTUNNEL] = ($scheme == 'https://') ? true : false;
			// $opt[CURLOPT_HTTPPROXYTUNNEL] = false; // Uncomment this line for disable https proxy over curl.
			$opt[CURLOPT_PROXY] = $_GET['proxy'];
			$opt[CURLOPT_PROXYUSERPWD] = (!empty($pauth) ? base64_decode($pauth) : false);
		} else $opt[CURLOPT_PROXY] = false;

		// Send more headers...
		$headers = array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language: en-US;q=0.7,en;q=0.3', 'Pragma: no-cache', 'Cache-Control: no-cache', 'Connection: Close');
		if (empty($opt[CURLOPT_REFERER])) $headers[] = 'Referer:';
		if (empty($opt[CURLOPT_COOKIE])) $headers[] = 'Cookie:';
		if (!empty($opt[CURLOPT_PROXY]) && empty($opt[CURLOPT_PROXYUSERPWD])) $headers[] = 'Proxy-Authorization:';
		if (count($header) > 0) $headers = array_merge($headers, $header);
		$opt[CURLOPT_HTTPHEADER] = $headers;

		$opt[CURLOPT_HTTPAUTH] = false;

		if (empty($post)) $post = array();
		$opt[CURLOPT_POST] = 1;
		if (!is_array($post)) return html_error('Error: $post must be a array!');
		if (function_exists('curl_file_create')) {
			$post[$fieldname] = curl_file_create($file, '', $filename);
		} else {
			$post = array_map(function($val) {
				return ltrim($val, '@');
			}, $post);
			$post[$fieldname] = sprintf('@%s;filename=%s', realpath($file), $filename);
			if (defined('CURLOPT_SAFE_UPLOAD')) $opt['CURLOPT_SAFE_UPLOAD'] = false;
		}
		$opt[CURLOPT_POSTFIELDS] = $post;

		// Progress bar
		$opt[CURLOPT_NOPROGRESS] = false;
		$opt[CURLOPT_BUFFERSIZE] = GetChunkSize($fileSize);
		$opt[CURLOPT_PROGRESSFUNCTION] = function($ch, $download_size = 0, $downloaded = 0, $upload_size = 0, $uploaded = 0) {
			if (version_compare(PHP_VERSION, '5.5.0') < 0) {
				$uploaded = $upload_size;
				$upload_size = $downloaded;
				$downloaded = $download_size;
				$download_size = $ch;
			}
			static $lastUploaded = 0;
			static $time = 0;
			static $lastChunkTime;
			if (!isset($lastChunkTime)) $lastChunkTime = microtime(true);

			if ($uploaded != $lastUploaded && (time() > $time || $uploaded == $upload_size)) {
				$mtime = microtime(true);
				$ctime = $mtime - $lastChunkTime;
				$ctime = ($ctime > 0) ? $ctime : 1;
				$lastChunkTime = $mtime;
				$speed = round(($uploaded - $lastUploaded) / 1024 / $ctime, 2);
				$progress = min(round(($uploaded / $upload_size) * 100, 2), 100);
				echo "<script type='text/javascript'>pr('$progress', '" . bytesToKbOrMbOrGb($uploaded) . "', '$speed');</script>\n";
				flush();
				$lastUploaded = $uploaded;
				$time = time();
			}
		};

		$opt[CURLOPT_CONNECTTIMEOUT] = $opt[CURLOPT_TIMEOUT] = 120;

		// Creating curl resource
		if (!isset($ch)) $ch = curl_init();

		foreach ($opt as $O => $V) curl_setopt($ch, $O, $V); // Using this instead of 'curl_setopt_array'

		if ($proxy) echo '<p>' . sprintf(lang(89), $proxyHost, $proxyPort) . '<br />UPLOAD: <b>' . htmlspecialchars($url) . "</b>...<br />\n";
		else echo '<p>'.sprintf(lang(90), $host, $port).'</p>';

		echo(lang(104) . ' <b>' . htmlspecialchars($filename) . '</b>, ' . lang(56) . ' <b>' . bytesToKbOrMbOrGb($fileSize) . '</b>...<br />');
		$GLOBALS['id'] = md5(time() * rand(0, 10));
		require (TEMPLATE_DIR . '/uploadui.php');
		flush();

		$page = curl_exec($ch);
		$info = curl_getinfo($ch);
		$errz = curl_errno($ch);
		$errz2 = curl_error($ch);
		curl_close($ch);

		if ($errz != 0) return html_error("[cURL-Upload:$errz] $errz2");

		if (substr($page, 9, 3) == '100' || !empty($opt[CURLOPT_HTTPPROXYTUNNEL])) $page = preg_replace("@^HTTP/1\.[01] \d{3}(?:\s[^\r\n]+)?\r\n\r\n(HTTP/1\.[01] \d+ [^\r\n]+)@i", "$1", $page, 1); // The "100 Continue" or "200 Connection established" can break some functions in plugins, lets remove it...
		return $page;
	}
}

if ($upload_acc['mediafire_com']['user'] && $upload_acc['mediafire_com']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['mediafire_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['mediafire_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'www.mediafire.com';
	$referer = "https://$domain/";
	$app = array('id' => '44595', 'api_version' => '1.5'); // Application ID for MediaFire's API @ https://www.mediafire.com/#settings/applications

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}
		Login($_REQUEST['up_login'], $_REQUEST['up_pass']);
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Hashing File
	echo "<script type='text/javascript'>document.getElementById('info').innerHTML = 'Hashing File';</script>\n";

	$fileHash = (in_array('sha256', hash_algos()) ? hash_file('sha256', $lfile, false) : ''); // sha256 is needed for Instant upload and extra checks.

	// Preparing Upload
	echo "<script type='text/javascript'>document.getElementById('info').innerHTML = 'Preparing Upload';</script>\n";

	$uploadCheck = array_map('strtolower_nr', mf_apireq('upload/check', array('size' => $fsize, 'hash' => $fileHash, 'filename' => $lname)));
	mf_checkErrors($uploadCheck, 'Pre-Upload Check Error');

	if ($uploadCheck['storage_limit_exceeded'] == 'yes') html_error('User storage limit exceeded.');
	if ($fsize > $uploadCheck['available_space']) html_error('User does not have enough space for this file.'); // $fsize > ($uploadCheck['storage_limit'] - $uploadCheck['used_storage_size'])

	if (!empty($fileHash) && $uploadCheck['file_exists'] == 'yes' && !empty($uploadCheck['different_hash']) && $uploadCheck['different_hash'] == 'no') html_error('A file with the same name already exists in your root directory and it\'s contents are identical.');

	if (!defined('MF_forceDefaultUploadOptions')) {
		$uploadPrefs = array_map('strtolower', mf_apireq('upload/get_options'));
		mf_checkErrors($uploadPrefs, 'Cannot Get Upload Preferences');
	} else $uploadPrefs = array('disable_instant' => 'no', 'action_on_duplicate' => 'skip');

	if ($uploadCheck['file_exists'] == 'yes' && $uploadPrefs['action_on_duplicate'] == 'skip') html_error('A file with the same name already exists in your root directory.');

	if ($uploadCheck['hash_exists'] == 'yes' && $uploadPrefs['disable_instant'] == 'no') {
		// Instant Upload
		echo "<script type='text/javascript'>document.getElementById('info').innerHTML = 'Instant Upload Mode';</script>\n";

		$instantUpload = mf_apireq('upload/instant', array('size' => $fsize, 'hash' => $fileHash, 'filename' => $lname, 'action_on_duplicate' => $uploadPrefs['action_on_duplicate']));
		mf_checkErrors($instantUpload, 'Instant Upload Error');

		if (empty($instantUpload['quickkey'])) html_error('Instant Upload: quickkey not found.');
		$download_link = "$referer?" . $instantUpload['quickkey'];
		return; // Stop this include
	}

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display = 'none';</script>\n";

	// action_token
	$getAToken = mf_apireq('user/get_action_token', array('type' => 'upload', 'lifespan' => 1440)); //24 Hours Lifespan
	mf_checkErrors($getAToken, 'Error Getting Action Token');

	$up_url = $referer . "api/{$app['api_version']}/upload/simple.php?response_format=json&session_token={$getAToken['action_token']}&action_on_duplicate=" . $uploadPrefs['action_on_duplicate'];

	$url = parse_url($up_url);
	$upfiles = curl_upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer.(!empty($fileHash) ? "\r\nX-Filehash: $fileHash" : ''), 0, 0, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$status = intval(substr($upfiles, 9, 3));
	if ($status >= 500) $ulResult = array('result' => 'Error', 'error' => $status, 'message' => "Upload: HTTP Error $status.");
	else {
		$ulResult = Get_Reply($upfiles);
		if (count($ulResult) == 1 && !empty($ulResult['response'])) $ulResult = $ulResult['response'];
	}
	mf_checkErrors($ulResult, $prefix = 'Upload error');

	if (empty($ulResult['doupload']['key'])) html_error('Upload error: Key not found.');

	// Kill Action Token and test the Session Token with it too
	$test = mf_apireq('user/destroy_action_token', array('action_token' => $getAToken['action_token']));
	if (strtolower($test['result']) == 'error' && $test['error'] == '105') {
		// Re-Login
		Login($_REQUEST['up_login'], $_REQUEST['up_pass']);
		mf_apireq('user/destroy_action_token', array('action_token' => $getAToken['action_token']));
	}

	// Pool Upload
	echo "<div id='T8_div' width='100%' align='center'>Checking Finished Upload : Try <span id='T8_try'>0</span><br /><span id='T8_status'></span></div>\n";

	$x = 1;
	do {
		echo "<script type='text/javascript'>document.getElementById('T8_try').innerHTML = '$x';</script>\n";

		sleep($x + 5);
		$poll_upload = mf_apireq('upload/poll_upload', array('key' => $ulResult['doupload']['key']));
		mf_checkErrors($poll_upload, 'Error Saving File');

		echo "<script type='text/javascript'>document.getElementById('T8_status').innerHTML += '" . htmlspecialchars($poll_upload['doupload']['description'], ENT_QUOTES) . "<br />';</script>\n";

		if (!empty($poll_upload['doupload']['fileerror'])) {
			$err = "Uploaded File Error: [{$poll_upload['doupload']['error']}]";
			switch ($poll_upload['doupload']['error']) {
				default: $err .= ($poll_upload['doupload']['description'] ? $poll_upload['doupload']['description'] : '*No description for this error*');break;
				case 1: $err .= 'File is larger than the maximum filesize allowed';break;
				case 2: $err .= 'File size cannot be 0';break;
				case 3: case 4:
				case 9: $err .= 'Found a bad RAR file';break;
				case 5: $err .= 'Virus found';break;
				case 6: case 8:
				case 10: $err .= 'Unknown internal error';break;
				case 7: $err .= 'File hash or size mismatch';break;
				case 12: $err .= 'Failed to insert data into database';break;
				case 13: $err .= 'File name already exists in the same parent folder, skipping';break;
				case 14: $err .= 'Destination folder does not exist';break;
				case 15: $err .= 'Account storage limit is reached';break;
				case 16: $err .= 'There was a file update revision conflict';break;
				case 17: $err .= 'Error patching delta file';break;
				case 18: $err .= 'Account is blocked';break;
				case 19: $err .= 'Failure to create path';break;
			}
			html_error("$err.");
		}
	} while ($x++ < 20 && $poll_upload['doupload']['status'] != '99');

	if (empty($poll_upload['doupload']['quickkey'])) html_error('Upload: quickkey not found.');
	$download_link = "$referer?" . $poll_upload['doupload']['quickkey'];
}

function Login($user, $pass) {
	$post = array();
	$post['email'] = $user;
	$post['password'] = $pass;
	$post['application_id'] = $GLOBALS['app']['id'];
	$post['signature'] = sha1($user . $pass . $GLOBALS['app']['id']);
	$post['token_version'] = 1;

	$login = mf_apireq('user/get_session_token', $post);
	mf_checkErrors($login, 'Login Error');
	if (empty($login['session_token'])) html_error('Session Token not Found.');
	$GLOBALS['app']['session_token'] = $login['session_token'];

	if (!empty($login['current_api_version']) && $login['current_api_version'] != $GLOBALS['app']['api_version']) $GLOBALS['app']['new_api_version'] = $login['current_api_version'];

	return true;
}

function Get_Reply($content) {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in PHP.');
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error('JSON start braces not found.');
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error('No JSON content.');
	$rply = json_decode($content, true);
	if ($rply === null) html_error('Error reading JSON.');
	return $rply;
}

function mf_checkErrors($reply, $prefix = 'Error') {
	if (strtolower($reply['result']) != 'error' || (!empty($reply['doupload']['result']) && is_numeric($reply['doupload']['result']) && $reply['doupload']['result'] >= 0)) return;
	if (!empty($reply['error'])) {
		$err = "$prefix: [{$reply['error']}]: ";
		switch ($reply['error']) {
			default: $err .= ($reply['message'] ? $reply['message'] : '*No message for this error*');break;
			case 101:
			case 900: $err .= 'API temporarily not available, please try again later';break;
			case 107: $err .= 'Email/Password incorrect';break;
			case 108: $err .= 'Invalid User/Email';break;
			// HTTP Errors
			case 500: $err .= 'Server error while processing your request, please try again later';break;
			case 503: $err .= 'API temporarily not available, please try again later';break;
		}
	} else {
		$err = "$prefix: [{$reply['doupload']['error']}]: ";
		switch ($reply['doupload']['error']) {
			default: $err .= ($reply['doupload']['description'] ? $reply['doupload']['description'] : '*No description for this error*');break;
			case -20: $err .= 'Invalid Upload Key';break;
			case -80: $err .= 'Upload Key not Found';break;
			case -701:
			case -881: $err .= 'Maximum file size for free users exceeded';break;
			case -700:
			case -882: $err .= 'Maximum file size exceeded';break;
		}
	}
	if (!empty($GLOBALS['app']['new_api_version'])) echo "\n<span>Current API Used: " . htmlspecialchars($GLOBALS['app']['api_version']) . "<br />Lastest API Available: " . htmlspecialchars($GLOBALS['app']['new_api_version']) . "</span>\n";
	html_error("$err.");
}

function mf_apireq($action, $post = array()) {
	if (!function_exists('json_encode')) html_error('Error: Please enable JSON in PHP.');
	if (!is_array($post)) html_error('mf_apireq: Parameter 2 must be passed as an array.');

	$post['response_format'] = 'json'; // Get API replies in json
	if (in_array($action, array('user/get_session_token', 'upload/poll_upload'))) unset($post['session_token']);
	else if (empty($post['session_token']) && !empty($GLOBALS['app']['session_token'])) $post['session_token'] = $GLOBALS['app']['session_token'];
	$post = array_map('urlencode', array_filter($post));

	$path = "api/{$GLOBALS['app']['api_version']}/$action.php";
	if ($GLOBALS['cURL']) $page = cURL($GLOBALS['referer'] . $path, 0, $post, $GLOBALS['referer']);
	else {
		$page = geturl($GLOBALS['domain'], 443, "/$path", $GLOBALS['referer'], 0, $post, 0, $_GET['proxy'], $GLOBALS['pauth'], 0, 'https');
		is_page($page);
	}

	$status = intval(substr($page, 9, 3));
	if ($status >= 500) return array('result' => 'Error', 'error' => $status, 'message' => "mf_apireq: HTTP Error $status.");

	$json = Get_Reply($page);
	if (count($json) == 1 && !empty($json['response'])) $json = $json['response'];
	return $json;
}

function strtolower_nr($str) {
	return (is_string($str) ? strtolower($str) : $str);
}

//[18-2-2015]  Written by Th3-822.
//[30-12-2017] Updated API to 1.5 & small fixes. - Th3-822
//[24-1-2018] Fixed upload token expiring issues & small fixes. - Th3-822
//[03-6-2018] Switched to www. domain & use cURL for upload (Requires PHP 5.4 for Progress Bar to Work, iirc) & spamming GH with issues won't make this fixed early. - Th3-822
//[08-6-2018] Fixed filenames on upload. - Th3-822
<?php
$upload_services[] = 'mediafree.co';
$max_file_size['mediafree.co'] = 2000;
$page_upload['mediafree.co'] = 'mediafree.co.php';
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 3); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'mediafree.co'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 1; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [22-1-2014]

?>
<?php
$upload_services[] = 'mega.co.nz_member';
$max_file_size['mega.co.nz_member'] = false;
$page_upload['mega.co.nz_member'] = 'mega.co.nz_member.php';
?>
<?php
######## Account Info ########
/* Warning: Login uses a lot of CPU, make sure to upload at least 1 file in your account with this plugin for saving account data before adding it here.*/
$upload_acc['mega_co_nz']['user'] = ''; //Set your email
$upload_acc['mega_co_nz']['pass'] = ''; //Set your password
########################

$chunk_UL = false; // Set to true to upload only 1 encrypted chunk per request to mega. (Switch to true when you are getting many Data sending errors)
$calcMacEachChunk = true; // Set to false for get the file's cbc-mac after upload. (Sv will read the file 2 times & too high cpu usage in short time)

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$T8 = array('seqno' => mt_rand(), 'sid' => '');

echo "<center>Mega.co.nz plugin by <b>Th3-822</b></center><br />\n"; // Please, do not remove or change this line contents. - Th3-822
if (!extension_loaded('mcrypt') || !in_array('rijndael-128', mcrypt_list_algorithms(), true)) html_error("Mcrypt module isn't installed or it doesn't have support for the needed encryption.");

// OpenSSL is Much Faster (Only Works Since 5.4)
if (version_compare(PHP_VERSION, '5.4.0', '>=') && extension_loaded('openssl') && in_array('aes-128-cbc', openssl_get_cipher_methods(), true)) {
	function aes_cbc_encrypt($data, $key) {
		$data = str_pad($data, 16 * ceil(strlen($data) / 16), "\0"); // OpenSSL needs this padded.
		return openssl_encrypt($data, 'aes-128-cbc', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
	}
	function aes_cbc_decrypt($data, $key) {
		$data = str_pad($data, 16 * ceil(strlen($data) / 16), "\0"); // OpenSSL needs this padded.
		return openssl_decrypt($data, 'aes-128-cbc', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
	}
} else {
	function aes_cbc_encrypt($data, $key) {
		return mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
	}
	function aes_cbc_decrypt($data, $key) {
		return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_CBC, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
	}
}

if (!empty($upload_acc['mega_co_nz']['user']) && !empty($upload_acc['mega_co_nz']['pass'])) {
	$default_acc = true;
	$_REQUEST['T8']['up_login'] = $upload_acc['mega_co_nz']['user'];
	$_REQUEST['T8']['up_pass'] = $upload_acc['mega_co_nz']['pass'];
	$_REQUEST['action'] = 'Th3-822';
	echo "<center><b>Using Default Login.</b></center><br />\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'Th3-822') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='Th3-822' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='T8[up_login]' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='T8[up_pass]' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
	echo "<p style='text-align:center'>Login step may last <b>1 minute or more with high CPU usage</b>, longer passwords will increase that time.<br /><small>After a correct login, session will be stored for skip the login step.</small></p>";
	echo "<script type='text/javascript'>self.resizeTo(700,350);</script>\n"; //Resize upload window
} else {
	$login = $not_done = false;
	$domain = 'mega.co.nz';

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	if (!empty($_REQUEST['T8']['up_login']) && !empty($_REQUEST['T8']['up_pass'])) SavedLogin($_REQUEST['T8']['up_login'], $_REQUEST['T8']['up_pass']);
	else html_error('Login Error: Email or Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload url</div>\n";

	$ul_url = apiReq(array('a' => 'u', 's' => $fsize));
	if (is_numeric($ul_url[0])) check_errors($ul_url[0], 'Error getting upload url');
	$up_url = $ul_url[0]['p'];

	$ul_key = array();
	for ($i = 0; $i < 6; $i++) $ul_key[] = get_rand(3);

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$mac_str = '';
	$upfiles = T8_mega_upload($up_url, $ul_key, $lfile, $lname, $mac_str);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if ($calcMacEachChunk) {
		$file_mac = str_to_a32($mac_str);
		mcrypt_generic_deinit($m_td1);
		mcrypt_module_close($m_td1);
		mcrypt_generic_deinit($m_td2);
		mcrypt_module_close($m_td2);
	} else $file_mac = FileMac($lfile, $fsize, a32_to_str(array_slice($ul_key, 0, 4)), a32_to_str(array($ul_key[4], $ul_key[5], $ul_key[4], $ul_key[5])));

	$body = substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4);
	if (is_numeric($body)) check_errors($body, 'Upload Error');

	$meta_mac = array($file_mac[0] ^ $file_mac[1], $file_mac[2] ^ $file_mac[3]);
	$attributes = array('n' => basename($lname));
	$enc_attributes = enc_attr($attributes, array_slice($ul_key, 0, 4));
	$key = array($ul_key[0] ^ $ul_key[4], $ul_key[1] ^ $ul_key[5], $ul_key[2] ^ $meta_mac[0], $ul_key[3] ^ $meta_mac[1], $ul_key[4], $ul_key[5], $meta_mac[0], $meta_mac[1]);

	$file = apiReq(array('a' => 'p', 't' => $T8['root_id'], 'n' => array(array('h' => $body, 't' => 0, 'a' => base64url_encode($enc_attributes), 'k' => a32_to_base64(encrypt_key($key, $T8['master_key']))))));
	if (is_numeric($file[0])) check_errors($file[0], 'Save file error');

	$public_handle = apiReq(array('a' => 'l', 'n' => $file[0]['f'][0]['h']));
	if (is_numeric($public_handle[0])) check_errors($public_handle[0], 'Error getting public fileid');
	$key = substr($file[0]['f'][0]['k'], strpos($file[0]['f'][0]['k'], ':'));
	$decrypted_key = a32_to_base64(decrypt_key(base64_to_a32($key), $T8['master_key']));

	$download_link = "https://$domain/#!{$public_handle[0]}!$decrypted_key";
}

// secure_rand() function from: http://www.zimuel.it/en/strong-cryptography-in-php/
function secure_rand($length) {
	if (function_exists('openssl_random_pseudo_bytes')) {
		$rnd = openssl_random_pseudo_bytes($length, $strong);
		if ($strong === TRUE) return $rnd;
	}
	$sha = $rnd = '';
	if (file_exists('/dev/urandom')) {
		$fp = fopen('/dev/urandom', 'rb');
		if ($fp) {
			if (function_exists('stream_set_read_buffer')) stream_set_read_buffer($fp, 0);
			$sha = fread($fp, $length);
			fclose($fp);
		}
	}
	for ($i=0; $i<$length; $i++) {
		$sha = hash('sha256',$sha.mt_rand());
		$char = mt_rand(0,62);
		$rnd .= chr(hexdec($sha[$char].$sha[$char+1]));
	}
	return $rnd;
}

function get_rand($bytes) {
	return hexdec(bin2hex(secure_rand($bytes)));
}
function Get_Reply($content) {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = substr($content, $pos + 4);
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error('Json start braces not found.');
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error('No json content.');
	$rply = json_decode($content, true);
	if (!$rply || count($rply) == 0) html_error('Error reading json.');
	return $rply;
}
function apiReq($atrr) {
	$try = 0;
	do {
		if ($try > 0) sleep(mt_rand(2,3));
		$ret = doApiReq($atrr);
		$try++;
	} while ($try < 6 && $ret[0] == -3);
	return $ret;
}
function doApiReq($atrr) {
	global $T8;
	$domain = 'g.api.mega.co.nz';//$domain = 'eu.api.mega.co.nz';
	if (!function_exists('json_encode')) html_error('Error: Please enable JSON in php.');
	$cURL = $GLOBALS['options']['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
	$chttps = false;
	if ($cURL) {
		$cV = curl_version();
		if (in_array('https', $cV['protocols'], true)) $chttps = true;
	}
	if (!extension_loaded('openssl') && !$chttps) html_error('You need to install/enable PHP\'s OpenSSL extension to support HTTPS connections.');
	elseif (!$chttps) $cURL = false;

	$sid = (!empty($T8['sid']) ? '&sid=' . $T8['sid'] : '');
	$post = json_encode($atrr);
	$referer = "https://mega.co.nz/\r\nContent-Type: application/json";
	if ($cURL) $page = cURL("https://$domain/cs?id=" . ($T8['seqno']++) . $sid, 0, "[$post]", $referer);
	else {
		global $pauth;
		$page = geturl($domain, 443, '/cs?id=' . ($T8['seqno']++) . $sid, $referer, 0, "[$post]", 0, 0, 0, 0, 'https');
		is_page($page);
	}
	list ($header, $page) = array_map('trim', explode("\r\n\r\n", $page, 2));
	if (is_numeric($page)) return array(intval($page));
	if (in_array(intval(substr($header, 9, 3)), array(500, 503))) return array(-3); //  500 Server Too Busy
	return Get_Reply($page);
}
function check_errors($err, $prefix = 'Error') {
	$isLogin = (stripos($prefix, 'login') !== false);
	switch ($err) {
		default: $msg = '*No message for this error*';break;
		case -1: $msg = 'An internal error has occurred';break;
		case -2: $msg = 'You have passed invalid arguments to this command, your rapidleech is outdated?';break;
		case -3: $msg = 'A temporary congestion or server malfunction prevented your request from being processed';break;
		case -4: $msg = 'You have exceeded your command weight per time quota. Please wait a few seconds, then try again';break;
		case -5: $msg = 'The upload has failed';break;
		case -6: $msg = 'Too many concurrent IP addresses are accessing this upload target URL';break;
		case -7: $msg = 'The upload file packet is out of range or not starting and ending on a chunk boundary';break;
		case -8: $msg = 'The upload target URL you are trying to access has expired. Please request a fresh one';break;
		case -9: $msg = ($isLogin ? 'Email/Password incorrect' : 'Resource not found or deleted');break;
		case -11: $msg = 'Access violation';break;
		case -13: $msg = ($isLogin ? 'Account not Activated yet' : 'Trying to access an incomplete file');break;
		case -14: $msg = 'A decryption operation failed';break;
		case -15: $msg = 'Invalid or expired user session, please relogin';break;
		case -16: $msg = 'User blocked';break;
		case -17: $msg = 'Request over quota';break;
		case -18: $msg = 'Resource temporarily not available, please try again later';break;
	}
	html_error("$prefix: [$err] $msg.");
}

// Using some functions from: http://julien-marchand.fr/blog/using-the-mega-api-with-php-examples/
function base64url_encode($data) {
	return strtr(rtrim(base64_encode($data), '='), '+/', '-_');//return strtr(base64_encode($data), '+/=', '-_,');
}
function base64url_decode($data) {
	if (($s = (2 - strlen($data) * 3) % 4) < 2) $data .= substr(',,', $s);
	return base64_decode(strtr($data, '-_,', '+/='));
}
function a32_to_str($hex) {
	return call_user_func_array('pack', array_merge(array('N*'), $hex));
}
function a32_to_base64($a) {
	return base64url_encode(a32_to_str($a));
}
function str_to_a32($b) {
	// Add padding, we need a string with a length multiple of 4
	$b = str_pad($b, 4 * ceil(strlen($b) / 4), "\0");
	return array_values(unpack('N*', $b));
}
function base64_to_a32($s) {
	return str_to_a32(base64url_decode($s));
}
function aes_cbc_encrypt_a32($data, $key) {
	return str_to_a32(aes_cbc_encrypt(a32_to_str($data), a32_to_str($key)));
}
function aes_cbc_decrypt_a32($data, $key) {
	return str_to_a32(aes_cbc_decrypt(a32_to_str($data), a32_to_str($key)));
}
function enc_attr($attr, $key) {
	$attr = 'MEGA' . json_encode($attr);
	return aes_cbc_encrypt($attr, a32_to_str($key));
}
function stringhash($s, $aeskey) {
	$s32 = str_to_a32($s);
	$h32 = array(0, 0, 0, 0);
	for ($i = 0; $i < count($s32); $i++) $h32[$i % 4] ^= $s32[$i];
	for ($i = 0; $i < 0x4000; $i++) $h32 = aes_cbc_encrypt_a32($h32, $aeskey);
	return a32_to_base64(array($h32[0], $h32[2]));
}
function prepare_key($a) {
	$pkey = array(0x93C467E3, 0x7DB0C7A4, 0xD1BE3F81, 0x0152CB56);
	$count_a = count($a);
	for ($r = 0; $r < 0x10000; $r++) {
		for ($j = 0; $j < $count_a; $j += 4) {
			$key = array(0, 0, 0, 0);
			for ($i = 0; $i < 4; $i++) if ($i + $j < $count_a) $key[$i] = $a[$i + $j];
			$pkey = aes_cbc_encrypt_a32($pkey, $key);
		}
	}
	return $pkey;
}
function encrypt_key($a, $key) {
	$x = array();
	for ($i = 0; $i < count($a); $i += 4) $x = array_merge($x, aes_cbc_encrypt_a32(array_slice($a, $i, 4), $key));
	return $x;
}
function decrypt_key($a, $key) {
	$x = array();
	for ($i = 0; $i < count($a); $i += 4) $x = array_merge($x, aes_cbc_decrypt_a32(array_slice($a, $i, 4), $key));
	return $x;
}
function mpi2bc($s) {
	$s = bin2hex(substr($s, 2));
	$len = strlen($s);
	$n = 0;
	for ($i = 0; $i < $len; $i++) $n = bcadd($n, bcmul(hexdec($s[$i]), bcpow(16, $len - $i - 1)));
	return $n;
}
function bin2int($str) {
	$result = 0;
	$n = strlen($str);
	do {
		$result = bcadd(bcmul($result, 256), ord($str[--$n]));
	} while ($n > 0);
	return $result;
}
function int2bin($num) {
	$result = '';
	do {
		$result .= chr(bcmod($num, 256));
		$num = bcdiv($num, 256);
	} while (bccomp($num, 0));
	return $result;
}
function bitOr($num1, $num2, $start_pos) {
	$start_byte = intval($start_pos / 8);
	$start_bit = $start_pos % 8;
	$tmp1 = int2bin($num1);
	$num2 = bcmul($num2, 1 << $start_bit);
	$tmp2 = int2bin($num2);
	if ($start_byte < strlen($tmp1)) {
		$tmp2 |= substr($tmp1, $start_byte);
		$tmp1 = substr($tmp1, 0, $start_byte) . $tmp2;
	} else $tmp1 = str_pad($tmp1, $start_byte, "\0") . $tmp2;
	return bin2int($tmp1);
}
function bitLen($num) {
	$tmp = int2bin($num);
	$bit_len = strlen($tmp) * 8;
	$tmp = ord($tmp[strlen($tmp) - 1]);
	if (!$tmp) $bit_len -= 8;
	else while (!($tmp & 0x80)) {
		$bit_len--;
		$tmp <<= 1;
	}
	return $bit_len;
}
function rsa_decrypt($enc_data, $p, $q, $d) {
	$enc_data = int2bin($enc_data);
	$exp = $d;
	$modulus = bcmul($p, $q);
	$data_len = strlen($enc_data);
	$chunk_len = bitLen($modulus) - 1;
	$block_len = intval(ceil($chunk_len / 8));
	$curr_pos = 0;
	$bit_pos = 0;
	$plain_data = 0;
	while ($curr_pos < $data_len) {
		$tmp = bin2int(substr($enc_data, $curr_pos, $block_len));
		$tmp = bcpowmod($tmp, $exp, $modulus);
		$plain_data = bitOr($plain_data, $tmp, $bit_pos);
		$bit_pos += $chunk_len;
		$curr_pos += $block_len;
	}
	return int2bin($plain_data);
}

function getRootNode($files = 0) {
	global $T8;
	if (empty($files) || !is_array($files) || count($files) < 1) $files = apiReq(array('a' => 'f', 'c' => 1));
	if (is_numeric($files[0])) check_errors($files[0], 'Cannot get Root folder ID');
	foreach ($files[0]['f'] as $file) if ($file['t'] == 2) {
		$T8['root_id'] = $file['h'];
		break;
	}
	if (empty($T8['root_id'])) html_error('Root folder ID not found.');
}

function getNextChunkLength($len) {
	if ($len < 131072) return 131072;
	elseif ($len < 262144) return 262144;
	elseif ($len < 393216) return 393216;
	elseif ($len < 524288) return 524288;
	elseif ($len < 655360) return 655360;
	elseif ($len < 786432) return 786432;
	elseif ($len < 917504) return 917504;
	else return 1048576;
}

function calcChunkMac($data, $key, $iv) {
	global $m_td1, $m_td2;
	$size = strlen($data);
	if ($size % 16 > 0) {
		$data .= str_repeat("\0", (16 - $size % 16));
		$size = strlen($data);
	}

	$init = mcrypt_generic_init($m_td2, $key, $iv);
	if ($init === false || $init < 0) html_error('Cannot init mcrypt');

	$size -= 16;
	if ($size > 0) mcrypt_generic($m_td2, substr($data, 0, $size));
	return mcrypt_generic($m_td1, mcrypt_generic($m_td2, substr($data, $size)));
}

function FileMac($file, $fsize, $key, $iv) {
	$fs = fopen($file, 'rb');
	$csize = 131072;
	$_data = '';
	$readed = 0;
	$m_td1 = mcrypt_module_open('rijndael-128', '', 'cbc', '');
	$m_td2 = mcrypt_module_open('rijndael-128', '', 'cbc', '');
	$init = mcrypt_generic_init($m_td1, $key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
	if ($init === false || $init < 0) html_error('Cannot init mcrypt');
	echo "\n<script type='text/javascript'>document.getElementById('T8').innerHTML = 'CBC-MAC File: 0 %';document.getElementById('T8').style.display = 'block';</script>";
	while (!feof($fs)) {
		$data = fread($fs, $csize);
		if ($data === false) {
			fclose($fs);
			html_error(lang(112));
		}
		if ($_data !== '') {
			$data = $_data . $data;
			$_data = '';
		}
		if (strlen($data) < $csize && !feof($fs)) {
			$_data .= $data;
			continue;
		}
		if (strlen($data) > $csize) {
			$_data .= substr($data, $csize);
			$data = substr($data, 0, $csize);
		}

		$readed += $size = strlen($data);
		if ($size % 16 > 0) {
			$data .= str_repeat("\0", (16 - $size % 16));
			$size = strlen($data);
		}

		$init = mcrypt_generic_init($m_td2, $key, $iv);
		if ($init === false || $init < 0) html_error('Cannot init mcrypt');

		$size -= 16;
		if ($size > 0) mcrypt_generic($m_td2, substr($data, 0, $size));
		$mac_str = mcrypt_generic($m_td1, mcrypt_generic($m_td2, substr($data, $size)));

		if ($csize < 1048576) $csize = getNextChunkLength($csize);
		echo "\n<script type='text/javascript'>document.getElementById('T8').innerHTML = 'CBC-MAC File: ".($readed < $fsize ? round($readed / $fsize * 100, 2) : '100')." %';</script>";
		flush();
	}
	echo "\n<script type='text/javascript'>document.getElementById('T8').innerHTML = 'CBC-MAC File: 100 %';document.getElementById('T8').style.display = 'none';</script>";
	mcrypt_generic_deinit($m_td1);
	mcrypt_module_close($m_td1);
	mcrypt_generic_deinit($m_td2);
	mcrypt_module_close($m_td2);
	fclose($fs);
	return str_to_a32($mac_str);
}

function Login($user, $pass) {
	global $T8;
	if (!extension_loaded('bcmath')) html_error('This plugin needs BCMath extension for login.');
	$password_aes = prepare_key(str_to_a32($pass));
	$T8['user_handle'] = stringhash($user, $password_aes);
	$res = apiReq(array('a' => 'us', 'user' => $user, 'uh' => $T8['user_handle']));
	if (is_numeric($res[0])) check_errors($res[0], 'Cannot login');
	$T8['master_key'] = decrypt_key(base64_to_a32($res[0]['k']), $password_aes);
	$privk = a32_to_str(decrypt_key(base64_to_a32($res[0]['privk']), $T8['master_key']));
	$rsa_priv_key = array(0, 0, 0, 0);
	for ($i = 0; $i < 4; $i++) {
		$l = ((ord($privk[0]) * 256 + ord($privk[1]) + 7) / 8) + 2;
		$rsa_priv_key[$i] = mpi2bc(substr($privk, 0, $l));
		$privk = substr($privk, $l);
	}
	$T8['sid'] = rsa_decrypt(mpi2bc(base64url_decode($res[0]['csid'])), $rsa_priv_key[0], $rsa_priv_key[1], $rsa_priv_key[2]);
	$T8['sid'] = base64url_encode(substr(strrev($T8['sid']), 0, 43));
	getRootNode();
	t8ArrToCookieArr($rsa_priv_key);

	$quota = apiReq(array('a' => 'uq', 'strg' => 1));
	if (!is_array($quota[0])) check_errors($quota[0], 'Cannot get disk quota');
	SaveCookies($user, $pass); // Update cookies file.
	$cookie = '';
	if (($quota[0]['mstrg'] - $quota[0]['cstrg']) < $GLOBALS['fsize']) html_error('Insufficient Free Space in Account for Upload this File.');
}

function IWillNameItLater($cookie, $decrypt=true) {
	if (!is_array($cookie)) {
		if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
		return '';
	}
	if (count($cookie) < 1) return $cookie;
	$keys = array_keys($cookie);
	$values = array_values($cookie);
	$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
	$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
	return array_combine($keys, $values);
}

function SavedLogin($user, $pass) {
	global $T8, $cookie, $secretkey;
	if (!defined('DOWNLOAD_DIR')) {
		global $options;
		if (substr($options['download_dir'], -1) != '/') $options['download_dir'] .= '/';
		define('DOWNLOAD_DIR', (substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']));
	}

	$user = strtolower($user);
	$filename = DOWNLOAD_DIR.basename('mega_ul.php');
	if (!file_exists($filename) || filesize($filename) <= 6) return Login($user, $pass);

	$file = file($filename);
	$savedcookies = unserialize($file[1]);
	unset($file);

	$hash = hash('crc32b', $user.':'.$pass);
	if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$cookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
		$secretkey = $_secretkey;
		if ((is_array($cookie) && count($cookie) < 1) || empty($cookie)) return Login($user, $pass);

		$T8['sid'] = $cookie['sid'];
		$T8['user_handle'] = $cookie['user_handle'];
		$T8['master_key'] = base64_to_a32($cookie['master_key']);
		$T8['root_id'] = $cookie['root_id'];
		$rsa_priv_key = explode('/T8\\', $cookie['rsa_priv_key']);

		$quota = apiReq(array('a' => 'uq', 'strg' => 1)); // I'm using the 'User quota details' request for validating the session id.
		if (is_numeric($quota[0]) && $quota[0] < 0) {
			if ($quota[0] == -15) { // Session code expired... We need to get a newer one.
				if (!extension_loaded('bcmath')) html_error('This plugin needs BCMath extension for login.');
				$T8['sid'] = false; // Do not send old sid or it will get '-15' error.
				$res = apiReq(array('a' => 'us', 'user' => $user, 'uh' => $T8['user_handle']));
				if (is_numeric($res[0])) check_errors($res[0], 'Cannot re-login');
				$T8['sid'] = rsa_decrypt(mpi2bc(base64url_decode($res[0]['csid'])), $rsa_priv_key[0], $rsa_priv_key[1], $rsa_priv_key[2]);
				$T8['sid'] = base64url_encode(substr(strrev($T8['sid']), 0, 43));
				t8ArrToCookieArr();
			} else check_errors($quota[0], 'Cannot validate saved-login');
		}
		SaveCookies($user, $pass); // Update last used time.
		$cookie = '';
		if (($quota[0]['mstrg'] - $quota[0]['cstrg']) < $GLOBALS['fsize']) html_error('Insufficient Free Space in Account for Upload this File');
		return;
	}
	return Login($user, $pass);
}

function t8ArrToCookieArr($rsa_priv_key = 0) {
	global $cookie, $T8;
	if (empty($cookie) || !is_array($cookie)) $cookie = array();
	$cookie['sid'] = $T8['sid'];
	$cookie['user_handle'] = $T8['user_handle'];
	$cookie['master_key'] = a32_to_base64($T8['master_key']);
	$cookie['root_id'] = $T8['root_id'];
	if (!empty($rsa_priv_key) && is_array($rsa_priv_key) && count($rsa_priv_key) > 2) $cookie['rsa_priv_key'] = implode('/T8\\', array_slice($rsa_priv_key, 0, 3)); // For decrypt the SID we need only the first 3 elements of the priv key, so we will only save those 3 elements.
}

function SaveCookies($user, $pass) {
	global $cookie, $secretkey;
	$maxdays = 30; // Max days to keep cookies for more than 1 user.
	$filename = DOWNLOAD_DIR.basename('mega_ul.php');
	if (file_exists($filename) && filesize($filename) > 6) {
		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		// Remove old cookies
		if (is_array($savedcookies)) {
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
	} else $savedcookies = array();
	$hash = hash('crc32b', $user.':'.$pass);
	$_secretkey = $secretkey;
	$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
	$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($cookie, false));
	$secretkey = $_secretkey;

	write_file($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies));
}

function chunk_ul($scheme, $host, $port, $url, $onlyOpen = false) {
	global $nn, $pauth, $fp, $errno, $errstr, $fsize, $pbChunkSize, $data, $zapros;
	if ($scheme == 'https://') {
		$scheme = 'tls://';
		$port = 443;
	}

	if (!empty($_GET['proxy'])) {
		$proxy = true;
		list($proxyHost, $proxyPort) = explode(':', $_GET['proxy'], 2);
		$host = $host . ($port != 80 && ($scheme != 'tls://' || $port != 443) ? ':' . $port : '');
		$url = $scheme . $host . $url;
	} else $proxy = false;

	if ($scheme != 'tls://') $scheme = '';
	$request = array();
	$request[] = 'POST ' . str_replace(' ', '%20', $url) . ' HTTP/1.0';
	$request[] = "Host: $host";
	$request[] = 'User-Agent: '. (defined('rl_UserAgent') ? rl_UserAgent : 'Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.17');
	$request[] = 'Accept: */*';
	$request[] = 'Accept-Language: en-US;q=0.7,en;q=0.3';
	$request[] = 'Accept-Charset: utf-8,windows-1251;q=0.7,*;q=0.7';
	$request[] = 'Content-Type: application/octet-stream';
	$request[] = "Content-Length: ".($onlyOpen ? $fsize : strlen($data));
	if ($proxy && !empty($pauth)) $request[] = "Proxy-Authorization: Basic $pauth\r\n";
	$request[] = 'Connection: Close';

	$zapros = implode("\r\n", $request) . "\r\n\r\n";
	$errno = 0; $errstr = '';
	$posturl = (!empty($proxyHost) ? $scheme . $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
	$fp = @stream_socket_client($posturl, $errno, $errstr, 120, STREAM_CLIENT_CONNECT);

	if (!$fp) {
		$dis_host = $proxy ? $proxyHost : $host;
		$dis_port = $proxy ? $proxyPort : $port;
		html_error(sprintf(lang(88), $dis_host, $dis_port));
	} elseif ($errno || $errstr) html_error($errstr);

	if (!@fputs($fp, $zapros)) html_error('Cannot send request headers.');
	fflush($fp);

	require_once(TEMPLATE_DIR . '/uploadui.php');
	echo "\n<script type='text/javascript'>document.getElementById('ul_con').innerHTML ='".($proxy ? (sprintf(lang(89), $proxyHost, $proxyPort) . "<br />'UPLOAD: <b>$url</b>...<br />") : sprintf(lang(90), $host, $port))."';document.getElementById('ul_fname').style.display = 'block';</script>";
	flush();

	if ($onlyOpen) return;
	global $timeStart, $totalsend, $time, $lastChunkTime;
	$dlen = strlen($data);
	$sended = 0;
	for ($s = 0; $s < ($dlen - 1); $s += $pbChunkSize) {
		$chunk = ($pbChunkSize >= ($dlen - $s)) ? substr($data, $s) : substr($data, $s, $pbChunkSize);
		$sendbyte = @fputs($fp, $chunk);
		fflush($fp);

		if ($sendbyte === false || strlen($chunk) > $sendbyte) {
			fclose($fp);
			html_error(lang(113));
		}

		$totalsend += $sendbyte;
		$sended += $sendbyte;

		$time = getmicrotime() - $timeStart;
		$chunkTime = $time - $lastChunkTime;
		if (($s + $sendbyte) <= ($dlen - 1) && $chunkTime < 1) continue;
		$chunkTime = (!($chunkTime < 0) && $chunkTime > 0) ? $chunkTime : 1;
		$lastChunkTime = $time;
		$speed = round($sended / 1024 / $chunkTime, 2);
		$percent = round($totalsend / $fsize * 100, 2);
		echo "<script type='text/javascript'>pr('$percent', '" . bytesToKbOrMbOrGb($totalsend) . "', '$speed');</script>\n";
		flush();
		$sended = 0;
	}
	if ($errno || $errstr) html_error($errstr);
	fflush($fp);

	$page = '';
	while (!feof($fp)) {
		$data = fgets($fp, 16384);
		if ($data === false) break;
		$page .= $data;
	}

	fclose($fp);
	$body = substr($page, strpos($page, "\r\n\r\n") + 4);
	if (is_numeric($body) && $body < 0) check_errors($body, 'Error while uploading chunk');
	return $page;
}

function T8_mega_upload($link, $ul_key, $file, $filename, &$mac_str = '') {
	global $nn, $fp, $fs, $errno, $errstr, $fsize, $pbChunkSize, $T8, $chunk_UL, $calcMacEachChunk, $zapros;
	$pbChunkSize = GetChunkSize($fsize);
	$_link = parse_url($link);
	$scheme = $_link['scheme'] . '://';
	$host = $_link['host'];
	$port = defport($_link);
	$url = $_link['path']. (!empty($_link['query']) ? '?'.$_link['query'] : '');
	unset($_link);
	$key = a32_to_str(array_slice($ul_key, 0, 4));

	$_td = mcrypt_module_open('rijndael-128', '', 'ctr', '');
	$init = mcrypt_generic_init($_td, $key, a32_to_str(array($ul_key[4], $ul_key[5], 0, 0)));
	if ($init === false || $init < 0) html_error('Cannot init mcrypt');

	if (!is_readable($file)) html_error(sprintf(lang(65), $file));

	echo "\n<p id='ul_con'></p>\n<p id='ul_fname' style='display:none'>" . lang(104) . " <b>$filename</b>, " . lang(56) . ' <b>' . bytesToKbOrMbOrGb($fsize) . "</b>...<br /></p><p id='T8' style='display:none'></p>\n";
	flush();

	if ($chunk_UL) global $chunkSize, $timeStart, $data, $totalsend, $time, $lastChunkTime;
	else chunk_ul($scheme, $host, $port, $url, true);

	$fs = fopen($file, 'rb');
	$chunkSize = 131072;
	$totalsend = $time = $lastChunkTime = 0;
	$_data = '';
	if ($calcMacEachChunk) {
		global $m_td1, $m_td2;
		$m_td1 = mcrypt_module_open('rijndael-128', '', 'cbc', '');
		$m_td2 = mcrypt_module_open('rijndael-128', '', 'cbc', '');
		$init = mcrypt_generic_init($m_td1, $key, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0");
		if ($init === false || $init < 0) html_error('Cannot init mcrypt');
		$c_mac = a32_to_str(array($ul_key[4], $ul_key[5], $ul_key[4], $ul_key[5]));
	}

	$timeStart = microtime(true);

	while (!feof($fs) && !$errno && !$errstr) {
		$data = fread($fs, $chunkSize);
		if ($data === false) {
			fclose($fs);
			if (!$chunk_UL) fclose($fp);
			html_error(lang(112));
		}
		if ($_data !== '') {
			$data = $_data . $data;
			$_data = '';
		}
		if (strlen($data) < $chunkSize && !feof($fs)) {
			$_data .= $data;
			continue;
		}
		if (strlen($data) > $chunkSize) {
			$_data .= substr($data, $chunkSize);
			$data = substr($data, 0, $chunkSize);
		}
		if ($calcMacEachChunk) $mac_str = calcChunkMac($data, $key, $c_mac);
		if ($chunkSize < 1048576) $chunkSize = getNextChunkLength($chunkSize);

		$data = mcrypt_generic($_td, $data);
		if ($chunk_UL) $page = chunk_ul($scheme, $host, $port, "$url/$totalsend-" . (($totalsend + strlen($data)) - 1));
		else {
			$dlen = strlen($data);
			$sended = 0;
			for ($s = 0; $s < ($dlen - 1); $s += $pbChunkSize) {
				$chunk = ($pbChunkSize >= ($dlen - $s)) ? substr($data, $s) : substr($data, $s, $pbChunkSize);
				$sendbyte = @fputs($fp, $chunk);
				fflush($fp);

				if ($sendbyte === false || strlen($chunk) > $sendbyte) {
					fclose($fs);
					fclose($fp);
					html_error(lang(113));
				}

				$totalsend += $sendbyte;
				$sended += $sendbyte;

				$time = getmicrotime() - $timeStart;
				$chunkTime = $time - $lastChunkTime;
				if (($s + $sendbyte) <= ($dlen - 1) && $chunkTime < 1) continue;
				$chunkTime = (!($chunkTime < 0) && $chunkTime > 0) ? $chunkTime : 1;
				$lastChunkTime = $time;
				$speed = round($sended / 1024 / $chunkTime, 2);
				$percent = round($totalsend / $fsize * 100, 2);
				echo "<script type='text/javascript'>pr('$percent', '" . bytesToKbOrMbOrGb($totalsend) . "', '$speed');</script>\n";
				flush();
				$sended = 0;
			}
		}
	}
	mcrypt_generic_deinit($_td);
	mcrypt_module_close($_td);
	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}

	if (!$chunk_UL) {
		fflush($fp);
		$page = '';
		while (!feof($fp)) {
			$data = fgets($fp, 16384);
			if ($data === false) break;
			$page .= $data;
		}
		fclose($fp);
	}
	fclose($fs);
	return $page;
}

//[23-7-2013] Written by Th3-822.
//[30-1-2014] Ephemeral account support removed, mega is not allowing anon users to generate public links. - Th3-822
//[15-4-2014] Fixed re-login error. - Th3-822
//[19-5-2016] Using OpenSSL where is possible for better login speed & Added free space check. - Th3-822

?>
<?php
$upload_services[]="megashare.vnn.vn";
$max_file_size["megashare.vnn.vn"]=300;
$page_upload["megashare.vnn.vn"] = "megashare.vnn.vn.php";
?>
<?php

####### Account Info. ###########
$megasharevnn_login = "xxxxx"; //Set your megasharevnntory email id (login)
$megasharevnn_pass = "xxxxx"; //Set your megasharevnntory password
##############################

$not_done=true;
$continue_up=false;
if ($megasharevnn_login && $megasharevnn_pass){
	$_REQUEST['my_login'] = $megasharevnn_login;
	$_REQUEST['my_pass'] = $megasharevnn_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["megashare.vnn.vn"]; ?></b></small></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to megashare.vnn.vn</div>
<?php
                        $page = geturl("megashare.vnn.vn", 80, "/", 0,0, 0, 0, $_GET["proxy"], $pauth);
	                is_page($page);
	                $cookie1 = GetCookies($page); 
	                $post = array();
	                $post['act'] = 'login';
	                $post['user'] = trim($_REQUEST['my_login']);
	                $post['login'] = 'Login';
	                $post['pass'] = trim($_REQUEST['my_pass']);
	                $page = geturl("megashare.vnn.vn", 80, "/login.php", 0, $cookie1, $post, 0, $_GET["proxy"], $pauth);
	                is_page($page);
	                $cookie2 = GetCookies($page);
	                is_notpresent($cookie2, 'vdc2_logined=1', 'Error logging in - are your logins correct?');
	                if (!preg_match('%(vdc2_passhash=.+)%', $cookie2, $lcookie)) html_error('Error getting login-cookie');
	                $lcook = cut_str($cookie2,'; vdc2_passhash=','; vdc2_last_click=');
	                $cookie = 'PHPSESSID='.cut_str($cookie1,'PHPSESSID=','; vdc2_logined=0;').'; vdc2_logined=1;'.cut_str($cookie2,'; vdc2_logined=1;',' vdc2_passhash=').cut_str($cookie2,$lcook.';',' vdc2_autologin=deleted').' vdc2_passhash='.$lcook;
	                $page = geturl("megashare.vnn.vn", 80, "/", 0,$cookie, 0, 0, $_GET["proxy"], $pauth);
	                is_page($page);
?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php 		
                        preg_match('%<form name="uploadform" action="(.*)" method="post" target="uploadframe" enctype="multipart/form-data">%',$page, $match);
                        $upload_form = trim($match[1]);
                        $url = parse_url($upload_form);
?>

<?php 	
                        $sessionid = cut_str($page, '<input type="hidden" name="sessionid" value="','" />');
                        $UploadSession = cut_str($page, '<input type="hidden" name="UploadSession" value="','" />');
                        $phpuploadscript = cut_str($page,'<input type="hidden" name="phpuploadscript" value="','" />');
                        $maxfilesize = cut_str($page,'<input type="hidden" name="maxfilesize" value="','" />');
                        $returnurl = cut_str($page,'<input type="hidden" name="returnurl" value="','" />');
                        $AccessKey = cut_str($page, '<input type="hidden" name="AccessKey" value="', '"');
			$fpost = array();
			$fpost["sessionid"] = $sessionid;
			$fpost["UploadSession"] = $UploadSession;
			$fpost["AccessKey"] = $AccessKey;
			$fpost["maxfilesize"] = $maxfilesize;
			$fpost["phpuploadscript"] = $phpuploadscript;
			$fpost["returnurl"] = $returnurl;
			$fpost["uploadmode"] = '1';
			$fpost["file_descr[0]"] = 'LeechViet';
			$fpost["file_password[0]"] = '';
			$fpost["file_publish[0]"] = '1';		
			$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), "http://megashare.vnn.vn/", 0, $fpost, $lfile, $lname, "uploadfile_0");
?>

<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
			$ref = cut_str($upfiles,'<p>The document has moved <a href="','">here</a>');
			if (!$ref) html_error('Error getting return url');
			$ref = str_replace('&amp;','&',$ref);
			$Url=parse_url($ref);
			$page = geturl($Url["host"], $url["port"] ? $url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://megashare.vnn.vn/", $cookie, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
			$linkmoi = cut_str($page, '<meta HTTP-EQUIV=Refresh CONTENT="1; URL=','">');
			$Url=parse_url($linkmoi);
			$page = geturl($Url["host"], $url["port"] ? $url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://megashare.vnn.vn/", $cookie, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
			$epost = array();
			$epost["UploadSession"] = $UploadSession;
			$epost["AccessKey"] = str_replace("=","%3D",$AccessKey);
			$epost["uploadmode"] = '1';
			$epost["submitnums"] = '0';
			$epost["fromemail"] ='';
			$epost["toemail"] = '';	
			$Url=parse_url("http://megashare.vnn.vn/emaillinks.php");
			$page = geturl($Url["host"], $url["port"] ? $url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://megashare.vnn.vn", $cookie, $epost, 0, $_GET["proxy"], $pauth);
			is_page($page);
			$download_link = cut_str($page, '<A id=downloadhref href="', '" target=_blank>');
                        $delete_link  = cut_str($page, '<A id=filedelhref href="', '" target=_blank>');
	}
//szal14-Jun-09
//Fix 28.10.2010_VinhNhaTrang
?>
<?php
$upload_services[] = "megashares.com_member";
$max_file_size["megashares.com_member"] = 2000; // Max 10000
$page_upload["megashares.com_member"] = "megashares.com_member.php";
?>
<?php
######## Account Info ########
$upload_acc['megashares_com']['user'] = ''; //Set your username
$upload_acc['megashares_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$ftypes = array('doc'=>'Document', 'video'=>'Video / Movie', 'application'=>'Application', 'music'=>'Music', 'image'=>'Image / Photo');

// Check https support for requests.
$use_curl = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$chttps = false;
$use_https = true;
if ($use_curl) {
	$cV = curl_version();
	if (in_array('https', $cV['protocols'], true)) $chttps = true;
}
if (!extension_loaded('openssl') && !$chttps) $use_https = false;
else if (!$chttps) $use_curl = false;

if ($upload_acc['megashares_com']['user'] && $upload_acc['megashares_com']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['megashares_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['megashares_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	// Change settings here: (With default login enabled)
	$_REQUEST['up_description'] = 'Uploaded with Rapidleech.'; // File Description.
	$_REQUEST['up_category'] = 'doc'; // File Category. You can use 'doc', 'video', 'application', 'music' or 'image'
	$_REQUEST['up_lpassword'] = ''; // Link password.
	$_REQUEST['up_searchable'] = 'yes'; // Make link searchable.
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br />Upload options*<br /><br /></td></tr>
	<tr><td style='white-space:nowrap;'>File Description:</td><td>&nbsp;<input type='text' name='up_description' value='Uploaded with Rapidleech.' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>Upload Category:</td><td>&nbsp;<select name='up_category' style='width:160px;height:20px;'>\n";
	foreach($ftypes as $n => $v) echo "\t<option value='$n'>$v</option>\n";
	echo "\t</select></td></tr>
	<tr><td style='white-space:nowrap;'>Link password:</td><td>&nbsp;<input type='text' name='up_lpassword' value='' style='width:160px;' /></td></tr>
	<tr><td colspan='2' align='center'><input type='checkbox' name='up_searchable' value='yes' checked='checked' />&nbsp; Make link searchable/public</td>";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
	echo "<script type='text/javascript'>self.resizeTo(700,420);</script>\n"; //Resize upload window
} else {
	$login = $not_done = false;
	$domain = 'www.megashares.com';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('orgrfr' => $referer);
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post['httpref'] = '';
		$post['mymslogin_name'] = urlencode($_REQUEST['up_login']);
		$post['mymspassword'] = urlencode($_REQUEST['up_pass']);
		$post['myms_login'] = 'Login';

		$loginUrl = 'https://d01.megashares.com/myms_login.php';
		$page = ul_GetPage($loginUrl, $cookie, $post, $referer);

		//is_present($page, "Error during login - Invalid Username.", "Login Failed: The username you have entered is incorrect.");
		//is_present($page, "Password does not match Username.", "Login Failed: The password you have entered is incorrect.");
		is_present($page, 'Error during login - Login failed for user', 'Login Failed: The username/password is incorrect.');
		is_present($page, 'You have not verified your account yet.', 'Login Failed: Account not verified.');
		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['myms'])) html_error("Login Failed.");

		$login = true;
	} else {
		html_error('Login Failed: Login/Password empty.');
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = ul_GetPage($referer, $cookie, 0, $loginUrl);

	$post = array();
	$post['Filename'] = $lname;

	//<Pl guid>
	$guid = base_convert(jstime(), 10, 32);
	for ($i = 0; $i < 5; $i++) $guid .= base_convert(rand(0, 65534), 10, 32);
	$guid = 'p'.$guid.base_convert(rand(0, 31), 10, 32);
	// <Pl guid/>
	$post['name'] = $guid.strrchr($lname, '.');

	$post['passProtectUpload'] = (!empty($_REQUEST['up_lpassword'])) ? $_REQUEST['up_lpassword'] : '';
	$post['searchable'] = (!empty($_REQUEST['up_searchable']) && $_REQUEST['up_searchable'] == 'yes') ? 'yes' : 'no';
	$post['uploadFileDescription'] = (!empty($_REQUEST['up_description']) ? $_REQUEST['up_description'] : 'Uploaded with Rapidleech.');
	$post['uploadFileCategory'] = (!empty($_REQUEST['up_category']) && array_key_exists($_REQUEST['up_category'], $ftypes) ? $_REQUEST['up_category'] : 'doc');

	//$post['checkTOS'] = '';
	//$post['Upload'] = 'Submit Query';

	// Pre-Upload Check
	$plData = array();
	$plData['uploading_files%5B0%5D%5Bid%5D'] = $guid;
	$plData['uploading_files%5B0%5D%5Bname%5D'] = urlencode($lname);
	$plData['uploading_files%5B0%5D%5Bsize%5D'] = $fsize;
	$plData['uploading_files%5B0%5D%5Bpercent%5D'] = $plData['uploading_files%5B0%5D%5Bloaded%5D'] = 0;
	$plData['uploading_files%5B0%5D%5Bstatus%5D'] = 1;
	$check = array_map('trim', explode("\r\n\r\n", ul_GetPage($referer . 'pre_upload.php', $cookie, $plData, $referer), 2));
	if (!empty($check[1]) && $check[1] != 'success') html_error('Pre-Upload Check Error: Page Says: ' . htmlspecialchars($check[1]));

	if (!preg_match('@https?://(?:[\w\-]+\.)*megashares\.com/[^\'\"<>\s]+\.php\?tmp_sid=\w+&ups_sid=\w+&uld=\d+&uloc=\d+@i', $page, $ud)) html_error('Upload URL not found.');
	$up_loc = $ud[0];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$url = parse_url($up_loc);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), '', 0, $post, $lfile, $lname, 'file', '', $_GET['proxy'], $pauth, 'Shockwave Flash');

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);
	is_present($upfiles, 'fupaup=1', 'The filename you have provided is against our AUP and may not be uploaded.');

	$body = trim(substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4));

	if (!preg_match('@^\d+@i', $body, $fid)) html_error("Post-ul fileid not found.");
	$page = ul_GetPage($referer . 'upostproc.php?fid=' . $fid[0], $cookie, 0, $referer);

	if (!preg_match('@https?://(?:[\w\-]+\.)*megashares\.com/dl/\w+/[^\t\r\n\'\"<>]+@i', $page, $dl)) html_error('Download link not found.');
	$download_link = $dl[0];
	if (preg_match('@https?://(?:[\w\-]+\.)*megashares\.com/\?dl=\w+@i', $page, $dlt)) $delete_link = $dlt[0];
}

function ul_GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0) {
	if (!$referer && !empty($GLOBALS['Referer'])) {
		$referer = $GLOBALS['Referer'];
	}

	if ($GLOBALS['use_curl']) {
		if ($XMLRequest) $referer .= "\r\nX-Requested-With: XMLHttpRequest";
		$page = cURL($link, $cookie, $post, $referer, $auth);
	} else {
		global $pauth;
		$Url = parse_url($link);
		$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
		is_page($page);
	}
	return $page;
}

//[25-6-2011]  Written by Th3-822.
//[07-2-2012]  Regexp for $up_loc fixed, added redirect for getting download link. - Th3-822
//[26-5-2012]  Fixed. - Th3-822
//[21-11-2015]  Updated. - Th3-822

?>
<?php
$upload_services[] = 'minhateca.com.br';
$max_file_size['minhateca.com.br'] = 0;
$page_upload['minhateca.com.br'] = 'minhateca.com.br.php';
?>
<?php

####### Free Account Info. ###########
$minhateca_login = ""; //set your id (login)
$minhateca_pass = ""; //set your  password

##############################

$host="minhateca.com.br";

$not_done=true;
$continue_up=false;
if ($minhateca_login && $minhateca_pass){
        $_REQUEST['my_login'] = $minhateca_login;
        $_REQUEST['my_pass'] = $minhateca_pass;
        $_REQUEST['action'] = "FORM";
        echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["minhateca.com.br"]; ?></b></small></tr>
</table>
</form>
<?php
        }
if ($continue_up)
        {
                $not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to <?php echo $host; ?></div>
<?php 
                        $page = geturl($host, 80, "/", "http://".$host."/", 0, 0, 0, $_GET["uproxy"], $pauth);
                        is_page($page);
						$cookie = GetCookies($page);
						
						preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
						
						$csrf_token = str_replace('__RequestVerificationToken_Lw__=', '', $cookie);
						
						$csrf_token = str_replace('+', '%2B', $csrf_token);
						$csrf_token = str_replace('/', '%2F', $csrf_token);
						
						$post['FileId'] = "0";						
						$post['Login'] = $_REQUEST['my_login'];
                        $post['Password'] = $_REQUEST['my_pass'];
                        $post['RememberMe'] = "false";
                        $post['redirect'] = "true";
                        $post['redirectUrl'] = "";
						
                        $post['__RequestVerificationToken'] = $csrf_token;
                        						
						$page = geturl($host, 80, "/action/Login/login", "http://".$host."/", $cookie, $post, 0, $_GET["uproxy"], $pauth);
												
                        is_notpresent($page, 'HTTP/1.1 302', 'Error logging in - are your logins correct!');
						
						$cookie = GetCookies($page);
                        $page = geturl($host, 80, "/". $_REQUEST['my_login'], "http://".$host."/", $cookie, 0, 0, $_GET["uproxy"], $pauth);
						
						is_page($page);
						
						$pos = strpos($page, '<!DOCTYPE');
						if($pos == false)
						{
							html_error ('Login error');
						}
						$page = substr($page, $pos);
						
						$dom = new DOMDocument();
						@$dom->loadHTML($page);
						
						$accNoTag = $dom->getElementById('__accno');
						if($accNoTag == NULL)
						{
							html_error('Error logging in - are your logins correct!');
						}
						$accountId = $accNoTag->getAttribute('value');
												
                        is_page($page);
        ?>
<!--<script>document.getElementById('login').style.display='none';</script>-->
<div id=info width=100% align=center>Retrive upload ID</div>
<script>document.getElementById('info').style.display='none';</script>
<?php 
						$path = "/ChomikUploadingFile.aspx?id=" . $accountId. "&sid=0";
						$page = geturl($host, 80, $path, "http://".$host."/", $cookie, 0, 0, $_GET["uproxy"], $pauth);
						
						is_page($page);
						
						$redir = getRedirector($page);
												
						$uploadUrl = parse_url($redir);
						
						$uploadPath = str_replace("UploadingFileProgress", "UploadingFile", $uploadUrl["path"]);
						
						$page = geturl($uploadUrl["host"],$uploadUrl["port"] ? $uploadUrl["port"] : 80, $uploadPath.($uploadUrl["query"] ? "?".$uploadUrl["query"] : ""), "http://".$host."/", $cookie, 0, 0, $_GET["uproxy"], $pauth);
						
						is_page($page);
						
						$pos = strpos($page, '<!DOCTYPE');
						if($pos == false)
						{
							html_error ('Upload error');
						}
						$page = substr($page, $pos);
						
						$dom = new DOMDocument();
						@$dom->loadHTML($page);
						
						$viewStateTag = $dom->getElementById('__VIEWSTATE');
						$viewState = $viewStateTag->getAttribute('value');

						$uploadPost = array();
						$uploadPost['__EVENTTARGET'] = 'UploadButton';
						$uploadPost['__EVENTARGUMENT'] = '';
						$uploadPost['RegulationsOwner'] = 'on';
						$uploadPost['FileSampleDescription'] = '';
						$uploadPost['__VIEWSTATE'] = $viewState;
						$uploadPost['APC_UPLOAD_PROGRESS'] = $progress_key;
                        $uploadPost['APC_UPLOAD_USERGROUP'] = $usergroup_key;
                        $uploadPost['UPLOAD_IDENTIFIER'] = $progress_key;
						
						$uploadPath = str_replace("UploadingFileProgress", "UploadingFile", $uploadUrl["path"]);
												
                        $upfiles = upfile($uploadUrl["host"],$uploadUrl["port"] ? $uploadUrl["port"] : 80, $uploadPath.($uploadUrl["query"] ? "?".$uploadUrl["query"] : ""), "http://".$host."/", $cookie, $uploadPost, $lfile, $lname, "File1", "", $_GET["uproxy"]);
						
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php   
						is_page($upfiles);
												
						is_notpresent($upfiles, 'HTTP/1.1 200', 'Upload error');
						
						$pos = strpos($upfiles, '<!DOCTYPE');
						if($pos == false)
						{
							html_error ('Upload error');
						}
						$upfiles = substr($upfiles, $pos);
						
						$dom = new DOMDocument();
						@$dom->loadHTML($upfiles);
						
						$uploadConfirmTag = $dom->getElementById('UploadedConfirm');
						if($uploadConfirmTag == NULL)
						{
							html_error ('Upload error');
						}
        }

  
 function getRedirector($page) {
    preg_match('/Location: ([^\r|\n]+)/i', $page, $redir);
    return $redir[1];

}
// written by VinhNhaTrang 04/11/2010
?>
<?php
$upload_services[] = 'minhateca.com.br_box';
$max_file_size['minhateca.com.br_box'] = 0;
$page_upload['minhateca.com.br_box'] = 'minhateca.com.br_box.php';
?>
<?php

####### Free Account Info. ###########
$minhateca_login = ""; //set your id (login)
$minhateca_pass = ""; //set your  password

##############################

$host="box.minhateca.com.br";

$not_done=true;
$continue_up=false;
if ($minhateca_login && $minhateca_pass){
		$_REQUEST['my_login'] = $minhateca_login;
		$_REQUEST['my_pass'] = $minhateca_pass;
		$_REQUEST['action'] = "FORM";
		echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
	$continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["minhateca.com.br_box"]; ?></b></small></tr>
</table>
</form>
<?php
		}
if ($continue_up)
		{
				$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to <?php echo $host; ?></div>
<?php 
						$post = 
							'<?xml version="1.0" encoding="UTF-8"?>' .
							'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' .
							  '<s:Body>' .
							    '<Auth xmlns="http://chomikuj.pl/">' .
							      '<name>' . $_REQUEST['my_login'] . '</name>' .
							      '<passHash>' . strtolower(md5($_REQUEST['my_pass'])) . '</passHash>' .
							      '<ver>4</ver>' .
							      '<client>' .
							        '<name>chomikbox</name>' .
							        '<version>2.0.8.1</version>' .
							      '</client>' .
							    '</Auth>' .
							  '</s:Body>' .
							'</s:Envelope>';
						
						$page = geturl($host, 80, "/services/ChomikBoxService.svc", "http://".$host."/\r\nSOAPAction: http://chomikuj.pl/IChomikBoxService/Auth\r\nContent-Type: text/xml;charset=utf-8\r\nUser-Agent: Mozilla/5.0", 0, $post, 0, $_GET["uproxy"], $pauth);
						is_page($page);
						
						
						preg_match('/\<a:token\>(.*?)\<\/a:token\>/', $page, $temp);
						if($temp)
						{
							$auth_token = $temp[1];
						} else {
							html_error ('Login error');
						}
						
						preg_match('/\<a:hamsterId\>(.*?)\<\/a:hamsterId\>/', $page, $temp);
						if($temp)
						{
							$chomik_id = $temp[1];
						} else {
							html_error ('Login error');
						}

		?>
<!--<script>document.getElementById('login').style.display='none';</script>-->
<div id=info width=100% align=center>Retrive upload ID</div>
<script>document.getElementById('info').style.display='none';</script>
<?php 
						$post = 
							'<?xml version="1.0" encoding="UTF-8"?>' .
							'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' . 
							  '<s:Body>' .
							    '<UploadToken xmlns="http://chomikuj.pl/">' .
							      '<token>' . $auth_token . '</token>' .
							      '<folderId>0</folderId>' .
							      '<fileName>' . $lname . '</fileName>' .
							    '</UploadToken>' .
							  '</s:Body>' .
							'</s:Envelope>';

						$page = geturl($host, 80, "/services/ChomikBoxService.svc", "http://".$host."/\r\nSOAPAction: http://chomikuj.pl/IChomikBoxService/UploadToken\r\nContent-Type: text/xml;charset=utf-8\r\nUser-Agent: Mozilla/5.0", 0, $post, 0, $_GET["uproxy"], $pauth);
						is_page($page);

						preg_match('/\<a:key\>(.*?)\<\/a:key\>/', $page, $temp);
						if($temp)
						{
							$upload_key = $temp[1];
						} else {
							html_error ('Error fetching upload page');
						}
						
						preg_match('/\<a:stamp\>(.*?)\<\/a:stamp\>/', $page, $temp);
						if($temp)
						{
							$upload_time = $temp[1];
						} else {
							html_error ('Error fetching upload page');
						}
						
						preg_match('/\<a:server\>(.*?)\<\/a:server\>/', $page, $temp);
						if($temp)
						{
							$upload_server = $temp[1];
							$upload_host = explode(":", $upload_server)[0];
							$upload_port = explode(":", $upload_server)[1];
						} else {
							html_error ('Error fetching upload page');
						}

						$upfiles = MT_upfile($upload_host, $upload_port, $upload_time, $chomik_id, $upload_key, $lfile, $lname, $_GET["uproxy"], $pauth)
						
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php   
						is_page($upfiles);					
						is_notpresent($upfiles, 'HTTP/1.1 200', 'Upload error');
						
						$pos = strpos($upfiles, '<resp res="1" fileid=');
						if($pos == false)
						{
							html_error ('Upload error');
						}
						
						preg_match('/fileid\="(.*?)"/', $upfiles, $temp);
						if($temp)
						{
							$fileid = $temp[1];
						} else {
							html_error ('Fileid not found');
						}
						
						$post = 
							'<?xml version="1.0" encoding="UTF-8"?>' .
							'<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' .
								'<s:Body>' .
									'<Download xmlns="http://chomikuj.pl/">' .
										'<token>' . $auth_token . '</token>' .
										'<sequence>' .
											'<stamp>' . rand(0,25000) . '</stamp>' .
											'<part>0</part>' .
											'<count>1</count>' .
										'</sequence>' .
										'<disposition>download</disposition>' .
										'<list>' .
											'<DownloadReqEntry>' .
												'<id>' . $fileid . '</id>' .
											'</DownloadReqEntry>' .
										'</list>' .
									'</Download>' .
								'</s:Body>' .
							'</s:Envelope>';
						
						$page = geturl($host, 80, "/services/ChomikBoxService.svc", "http://".$host."/\r\nSOAPAction: http://chomikuj.pl/IChomikBoxService/Download\r\nContent-Type: text/xml;charset=utf-8\r\nUser-Agent: Mozilla/5.0", 0, $post, 0, $_GET["uproxy"], $pauth);
						is_page($page);
						
						$dl = array();
						preg_match('/\<globalId\>(.*?)\<\/globalId\>/', $page, $temp);
						if($temp)
						{
							$dl['globalId'] = $temp[1];
						} else {
							html_error ('Error retrive download link!');
						}
						
						preg_match_all('/\<name\>(.*?)\<\/name\>/', $page, $temp);
						if($temp)
						{
							$dl['name'] = $temp[1][1];
							$dl['filename'] = pathinfo($dl['name'], PATHINFO_FILENAME);
							$dl['extension'] = pathinfo($dl['name'], PATHINFO_EXTENSION);
						} else {
							html_error ('Error retrive download link!');
						}
						
						$download_link = 'http://minhateca.com.br'.$dl['globalId'].'/'.$dl['filename'].','.$fileid.'.'.$dl['extension'];
						
		}


function MT_upfile($host, $port, $time, $chomik_id, $key, $file, $filename, $proxy = 0, $pauth = 0) {
	global $nn, $lastError, $fp, $fs;
	
	if (!isset($nn)) $nn = "\r\n";
	
	$scheme = 'http://';
	$url = '/file/';
	
	$upagent = 'Mozilla/5.0';
	$bound = "!CHB$time";
	$saveToFile = 0;
	$postdata = '';
	
	//chomik_id
	$postdata .= '--' . $bound . $nn;
	$postdata .= "name=\"chomik_id\"$nn";
	$postdata .= "Content-Type: text/plain$nn$nn";
	$postdata .= "$chomik_id$nn";
	
	//folder_id
	$postdata .= '--' . $bound . $nn;
	$postdata .= "name=\"folder_id\"$nn";
	$postdata .= "Content-Type: text/plain$nn$nn";
	$postdata .= "0$nn";
	
	//key
	$postdata .= '--' . $bound . $nn;
	$postdata .= "name=\"key\"$nn";
	$postdata .= "Content-Type: text/plain$nn$nn";
	$postdata .= "$key$nn";
	
	//time
	$postdata .= '--' . $bound . $nn;
	$postdata .= "name=\"time\"$nn";
	$postdata .= "Content-Type: text/plain$nn$nn";
	$postdata .= "$time$nn";
	
	//client
	$postdata .= '--' . $bound . $nn;
	$postdata .= "name=\"client\"$nn";
	$postdata .= "Content-Type: text/plain$nn$nn";
	$postdata .= "MinhaBox.br-2.0.8.1$nn";
	
	//locale
	$postdata .= '--' . $bound . $nn;
	$postdata .= "name=\"locale\"$nn";
	$postdata .= "Content-Type: text/plain$nn$nn";
	$postdata .= "BR$nn";

	$fieldname = 'file';
	if (!is_readable($file)) {
		$lastError = sprintf(lang(65), $file);
		return FALSE;
	}
	$fileSize = getSize($file);

	$postdata .= '--' . $bound . $nn;
	$postdata .= "name=\"$fieldname\"; filename=\"$filename\"$nn$nn";
	if (!empty($cookie)) {
		if (is_array($cookie)) $cookies = (count($cookie) > 0) ? CookiesToStr($cookie) : 0;
		else $cookies = trim($cookie);
	}
	if ($scheme == 'https://') {
		if (!extension_loaded('openssl')) return html_error('You need to install/enable PHP\'s OpenSSL extension to support uploading via HTTPS.');
		$scheme = 'tls://';
		if ($port == 0 || $port == 80) $port = 443;
	} else if ($port == 0) $port = 80;
	if (!empty($referer) && ($pos = strpos("\r\n", $referer)) !== 0) {
		$origin = parse_url($pos ? substr($referer, 0, $pos) : $referer);
		$origin = strtolower($origin['scheme']) . '://' . strtolower($origin['host']) . (!empty($origin['port']) && $origin['port'] != defport(array('scheme' => $origin['scheme'])) ? ':' . $origin['port'] : '');
	} else $origin = ($scheme == 'tls://' ? 'https://' : $scheme) . $host . ($port != 80 && ($scheme != 'tls://' || $port != 443) ? ':' . $port : '');
	if ($proxy) {
		list($proxyHost, $proxyPort) = explode(':', $proxy, 2);
		if ($scheme != 'tls://') {
			$host = $host . ($port != 80 && $port != 443 ? ":$port" : '');
			$url = "$scheme$host$url";
		}
	}
	if ($scheme != 'tls://') $scheme = '';
	$cHeaders = readCustomHeaders($referer);
	$request = array();
	$request[''] = 'POST ' . str_replace(' ', '%20', $url) . ' HTTP/1.1';
	
	$request['Content-Type'] = "multipart/mixed; boundary=$bound";
	$request['User-Agent'] = $upagent;
	$request['Pragma'] = 'no-cache';
	$request['Cache-Control'] = 'no-cache';
	$request['Host'] = $host.':'.$port;

	if (!empty($pauth) && !$scheme) $request['proxy-authorization'] = "Basic $pauth";
	$request['content-length'] = (strlen($postdata) + strlen($nn . "--" . $bound . "--" . $nn) + $fileSize);
	$request = headers2request(array_merge($request, $cHeaders), $postdata);
	$errno = 0;
	$errstr = '';
	if ($scheme == 'tls://') {
		$hosts = (!empty($proxyHost) ? $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
		if ($proxy) $url = "https://$host$url"; // For the 'connected to' message
	} else $hosts = (!empty($proxyHost) ? $scheme . $proxyHost : $scheme . $host) . ':' . (!empty($proxyPort) ? $proxyPort : $port);
	$fp = @stream_socket_client($hosts, $errno, $errstr, 120, STREAM_CLIENT_CONNECT);
	if (!$fp) {
		if (!function_exists('stream_socket_client')) return html_error('[ERROR] stream_socket_client() is disabled.');
		$dis_host = !empty($proxyHost) ? $proxyHost : $host;
		$dis_port = !empty($proxyPort) ? $proxyPort : $port;
		return html_error(sprintf(lang(88), $dis_host, $dis_port));
	}
	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}
	if ($proxy) echo '<p>' . sprintf(lang(89), $proxyHost, $proxyPort) . '<br />UPLOAD: <b>' . htmlspecialchars($url) . "</b>...<br />\n";
	else echo '<p>'.sprintf(lang(90), $host, $port).'</p>';
	if ($scheme == 'tls://' && $proxy) {
		$connRequest = array();
		$connRequest[''] = "CONNECT $host:$port HTTP/1.1";
		if (!empty($pauth)) $connRequest['proxy-authorization'] = "Basic $pauth";
		$connRequest['proxy-connection'] = 'Close';
		$connRequest = headers2request($connRequest);
		fwrite($fp, $connRequest);
		fflush($fp);
		$llen = 0;
		$header = '';
		do {
			$header .= fgets($fp, 16384);
			$len = strlen($header);
			if (!$header || $len == $llen) {
				$lastError = 'No response from proxy after CONNECT.';
				stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
				fclose($fp);
				return false;
			}
			$llen = $len;
		} while (strpos($header, $nn . $nn) === false);
		$status = intval(substr($header, 9, 3));
		if ($status != 200) {
			return html_error("Proxy returned $status after CONNECT.");
		}
		// Start TLS.
		if (!stream_socket_enable_crypto($fp, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) return html_error('TLS Startup Error.');
	}
	echo(lang(104) . ' <b>' . htmlspecialchars($filename) . '</b>, ' . lang(56) . ' <b>' . bytesToKbOrMbOrGb($fileSize) . '</b>...<br />');
	$GLOBALS['id'] = md5(time() * rand(0, 10));
	require (TEMPLATE_DIR . '/uploadui.php');
	flush();
	fwrite($fp, $request);
	fflush($fp);
	$timeStart = microtime(true);
	$chunkSize = GetChunkSize($fileSize);
	$fs = fopen($file, 'r');
	$totalsend = $time = $lastChunkTime = 0;
	while (!feof($fs) && !$errno && !$errstr) {
		$data = fread($fs, $chunkSize);
		if ($data === false) {
			fclose($fs);
			fclose($fp);
			return html_error(lang(112));
		}
		$sendbyte = @fwrite($fp, $data);
		fflush($fp);
		if ($sendbyte === false || strlen($data) > $sendbyte) {
			fclose($fs);
			fclose($fp);
			return html_error(lang(113));
		}
		$totalsend += $sendbyte;
		$time = microtime(true) - $timeStart;
		$chunkTime = $time - $lastChunkTime;
		$chunkTime = $chunkTime ? $chunkTime : 1;
		$chunkTime = ($chunkTime > 0) ? $chunkTime : 1;
		$lastChunkTime = $time;
		$speed = round($sendbyte / 1024 / $chunkTime, 2);
		$percent = round($totalsend / $fileSize * 100, 2);
		echo "<script type='text/javascript'>pr('$percent', '" . bytesToKbOrMbOrGb($totalsend) . "', '$speed');</script>\n";
		flush();
	}
	if ($errno || $errstr) {
		$lastError = $errstr;
		return false;
	}
	fclose($fs);
	fwrite($fp, $nn . "--" . $bound . "--" . $nn);
	fflush($fp);
	$llen = 0;
	$header = '';
	do {
		$header .= fgets($fp, 16384);
		$len = strlen($header);
		if (!$header || $len == $llen) {
			$lastError = lang(91);
			stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
			fclose($fp);
			return false;
		}
		$llen = $len;
	} while (strpos($header, $nn . $nn) === false);
	// Array for active stream filters
	$sFilters = array();
	if (stripos($header, "\nTransfer-Encoding: chunked") !== false && in_array('dechunk', stream_get_filters())) $sFilters['dechunk'] = stream_filter_append($fp, 'dechunk', STREAM_FILTER_READ); // Add built-in dechunk filter
	$length = trim(cut_str($header, "\nContent-Length: ", "\n"));
	if (!$length || !is_numeric($length)) $length = -1;
	$page = stream_get_contents($fp, $length);
	stream_socket_shutdown($fp, STREAM_SHUT_RDWR);
	fclose($fp);
	if (empty($sFilters['dechunk']) && stripos($header, "\nTransfer-Encoding: chunked") !== false && function_exists('http_chunked_decode')) {
		$dechunked = http_chunked_decode($page);
		if ($dechunked !== false) $page = $dechunked;
		unset($dechunked);
	}
	if (stripos($header, "\nContent-Encoding: gzip") !== false) {
		$decompressed = gzinflate(substr($page, 10));
		if ($decompressed !== false) $page = $decompressed;
		unset($decompressed);
	} else if (stripos($header, "\nContent-Encoding: deflate") !== false) {
		$decompressed = gzinflate(in_array(substr($page, 0, 2), array("x\x01", "x\x9C", "x\xDA")) ? substr($page, 2) : $page);
		if ($decompressed !== false) $page = $decompressed;
		unset($decompressed);
	}
	$page = $header.$page;
	return $page;
}		
		

// tech - Written in 26/11/2016
?>
<?php
$upload_services[]="mirrorcreator.com";
$max_file_size["mirrorcreator.com"]=200;
$page_upload["mirrorcreator.com"] = "mirrorcreator.com.php";  
?>
<?php
####### Default Free File Storage Provider. ###########
$Default = "0"; //Set this variable to "1" to enable the autoupload compatibility
#######################################

$not_done=true;
$continue_up=false;
if ($Default === "1"){

// To select Default Storage Providers uncomment the providers you want to be selected
// by default - you must have a MAXIMUM of 14 providers selected.

$_REQUEST['filesonic'] = "on";
$_REQUEST['depositfiles'] = "on";
$_REQUEST['wupload'] = "on";
$_REQUEST['easyshare'] = "on";
$_REQUEST['fileserve'] = "on";
//$_REQUEST['enterupload'] = "on";
$_REQUEST['megaupload'] = "on";
$_REQUEST['hotfile'] = "on";
$_REQUEST['rapidshare'] = "on";
//$_REQUEST['freakshare'] = "on";
//$_REQUEST['zshare'] = "on";
//$_REQUEST['turbobit'] = "on";
//$_REQUEST['uploadstation'] = "on";
$_REQUEST['ziddu'] = "on";
$_REQUEST['mediafire'] = "on";
//$_REQUEST['extabit'] = "on";
//$_REQUEST['bitshare'] = "on";
//$_REQUEST['filefactory'] = "on";
//$_REQUEST['megashare'] = "on";
$_REQUEST['x7_dot_to'] = "on";
$_REQUEST['ifileit'] = "on";
//$_REQUEST['gamefront'] = "on";
//$_REQUEST['badongo'] = "on";
$_REQUEST['uploadedto'] = "on";
//$_REQUEST['uploadbox'] = "on";
//$_REQUEST['ugotfile'] = "on";
//$_REQUEST['eyvx'] = "on";
//$_REQUEST['loadto'] = "on";
//$_REQUEST['oron'] = "on";
//$_REQUEST['twoshared'] = "on";
//$_REQUEST['filekeen'] = "on";
//$_REQUEST['gaiafile'] = "on";
//$_REQUEST['filehook'] = "on";
	
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default File Storage Provider.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<script type="text/javascript">
function maxMirrors(box)
{
    var elements = document.getElementsByTagName("input");
    var count = 0;
    for( i = 0; i < elements.length; i++ )
    {
	
        if( elements[i].type == "checkbox" )
        {
            if( elements[i].checked )
                count++;
        }
    }
    
    if( count > 14 )    
    {
        alert("Select 14 mirrors maximum!");
        box.checked = false;
	FancyForm.update(box.getParent());
        

    }
}
</script>
<table border=0 style="width:380px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />

<tr><td><label onclick="maxMirrors(this);" for="filesonic">FileSonic<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="filesonic" id="filesonic" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="depositfiles">DepositFiles<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="depositfiles" id="depositfiles" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="wupload">Wupload<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="wupload" id="wupload" checked="checked"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="easyshare">EasyShare<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="easyshare" id="easyshare" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="fileserve">FileServe<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="fileserve" id="fileserve" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="enterupload">EnterUpload<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="enterupload" id="enterupload"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="megaupload">MegaUpload<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="megaupload" id="megaupload" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="hotfile">HotFile<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="hotfile" id="hotfile" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="rapidshare">RapidShare<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="rapidshare" id="rapidshare" checked="checked"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="freakshare">FreakShare<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="freakshare" id="freakshare"></td>
<td><label onclick="maxMirrors(this);" for="zshare">ZShare<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="zshare" id="zshare"></td>
<td><label onclick="maxMirrors(this);" for="turbobit">TurboBit<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="turbobit" id="turbobit"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="uploadstation">UploadStation<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="uploadstation" id="uploadstation"></td>
<td><label onclick="maxMirrors(this);" for="ziddu">Ziddu<br/><span id="maxsize">Max. 200 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="ziddu" id="ziddu" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="mediafire">MediaFire<br/><span id="maxsize">Max. 200 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="mediafire" id="mediafire" checked="checked"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="extabit">ExtaBit<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="extabit" id="extabit"></td>
<td><label onclick="maxMirrors(this);" for="bitshare">BitShare<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="bitshare" id="bitshare"></td>
<td><label onclick="maxMirrors(this);" for="filefactory">FileFactory<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="filefactory" id="filefactory"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="megashare">MegaShare<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="megashare" id="megashare"></td>
<td><label onclick="maxMirrors(this);" for="x7_dot_to">x7.to<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="x7_dot_to" id="x7_dot_to" checked="checked"></td>
<td><label onclick="maxMirrors(this);" for="ifileit">iFileIt<br/><span id="maxsize">Max. 300 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="ifileit" id="ifileit" checked="checked"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="gamefront">GameFront<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="gamefront" id="gamefront"></td>
<td><label onclick="maxMirrors(this);" for="badongo">Badongo<br/><span id="maxsize">Max. 200 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="badongo" id="badongo"></td>
<td><label onclick="maxMirrors(this);" for="uploadedto">UploadedTo<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="uploadedto" id="uploadedto" checked="checked"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="uploadbox">UploadBox<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="uploadbox" id="uploadbox"></td>
<td><label onclick="maxMirrors(this);" for="ugotfile">uGotFile<br/><span id="maxsize">Max. 300 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="ugotfile" id="ugotfile"></td>
<td><label onclick="maxMirrors(this);" for="eyvx">Eyvx<br/><span id="maxsize">Max. 200 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="eyvx" id="eyvx"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="loadto">Loadto<br/><span id="maxsize">Max. 300 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="loadto" id="loadto"></td>
<td><label onclick="maxMirrors(this);" for="oron">Oron<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="oron" id="oron"></td>
<td><label onclick="maxMirrors(this);" for="twoshared">TwoShared<br/><span id="maxsize">Max. 100 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="twoshared" id="twoshared"></td></tr>
<tr><td><label onclick="maxMirrors(this);" for="filekeen">FileKeen<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="filekeen" id="filekeen"></td>
<td><label onclick="maxMirrors(this);" for="gaiafile">GaiaFile<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="gaiafile" id="gaiafile"></td>
<td><label onclick="maxMirrors(this);" for="filehook">FileHook<br/><span id="maxsize">Max. 400 MB</span></label><input onclick="maxMirrors(this);" type="checkbox" name="filehook" id="filehook"></td></tr>
<tr><td colspan=3 align=center><input type=submit value='Upload' /></tr>
</table>
</form>
<?php
}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
        $rnd = time().rndNum(3);
	$page = geturl("www.mirrorcreator.com", 80, "/uber/ubr_link_upload.php", "", 0, 0, 0, "");
	
	preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
	$cookie = $temp[1];
	$cookies = implode(';',$cookie);
	
	$page = geturl("www.mirrorcreator.com", 80, "/uber/ubr_link_upload.php?_=".round(microtime(true))."000", "http://www.mirrorcreator.com/", $cookies, 0, 0, "");
	is_page($page);
	$upid = "upload_id=".cut_str($page,'Upload("','"');
	$post['mail']= "";
	if(!empty($_REQUEST['filesonic'])) {$post['filesonic'] = 'on';}
	if(!empty($_REQUEST['depositfiles'])) {$post['depositfiles'] = 'on';}
	if(!empty($_REQUEST['wupload'])) {$post['wupload'] = 'on';}
	if(!empty($_REQUEST['easyshare'])) {$post['easyshare'] = 'on';}
	if(!empty($_REQUEST['fileserve'])) {$post['fileserve'] = 'on';}
	if(!empty($_REQUEST['enterupload'])) {$post['enterupload'] = 'on';}
	if(!empty($_REQUEST['megaupload'])) {$post['megaupload'] = 'on';}
	if(!empty($_REQUEST['hotfile'])) {$post['hotfile'] = 'on';}
	if(!empty($_REQUEST['rapidshare'])) {$post['rapidshare'] = 'on';}
	if(!empty($_REQUEST['freakshare'])) {$post['freakshare'] = 'on';}
	if(!empty($_REQUEST['zshare'])) {$post['zshare'] = 'on';}
	if(!empty($_REQUEST['turbobit'])) {$post['turbobit'] = 'on';}
	if(!empty($_REQUEST['uploadstation'])) {$post['uploadstation'] = 'on';}
	if(!empty($_REQUEST['ziddu'])) {$post['ziddu'] = 'on';}
	if(!empty($_REQUEST['mediafire'])) {$post['mediafire'] = 'on';}
	if(!empty($_REQUEST['extabit'])) {$post['extabit'] = 'on';}
	if(!empty($_REQUEST['bitshare'])) {$post['bitshare'] = 'on';}
	if(!empty($_REQUEST['filefactory'])) {$post['filefactory'] = 'on';}
	if(!empty($_REQUEST['megashare'])) {$post['megashare'] = 'on';}
	if(!empty($_REQUEST['x7_dot_to'])) {$post['x7_dot_to'] = 'on';}
	if(!empty($_REQUEST['ifileit'])) {$post['ifileit'] = 'on';}
	if(!empty($_REQUEST['gamefront'])) {$post['gamefront'] = 'on';}
	if(!empty($_REQUEST['badongo'])) {$post['badongo'] = 'on';}
	if(!empty($_REQUEST['uploadedto'])) {$post['uploadedto'] = 'on';}
	if(!empty($_REQUEST['uploadbox'])) {$post['uploadbox'] = 'on';}
	if(!empty($_REQUEST['ugotfile'])) {$post['ugotfile'] = 'on';}
	if(!empty($_REQUEST['eyvx'])) {$post['eyvx'] = 'on';}
	if(!empty($_REQUEST['loadto'])) {$post['loadto'] = 'on';}
	if(!empty($_REQUEST['oron'])) {$post['oron'] = 'on';}
	if(!empty($_REQUEST['twoshared'])) {$post['twoshared'] = 'on';}
	if(!empty($_REQUEST['filekeen'])) {$post['filekeen'] = 'on';}
	if(!empty($_REQUEST['gaiafile'])) {$post['gaiafile'] = 'on';}
	if(!empty($_REQUEST['filehook'])) {$post['filehook'] = 'on';}

	$url=parse_url('http://www.mirrorcreator.com/cgi-bin/ubr_upload.pl?'.$upid);	
?>
<script>document.getElementById('info').style.display='none';</script>
<?php

	$upfiles=upfile($url["host"],defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""),'http://www.mirrorcreator.com/', $cookies, $post, $lfile, $lname, "upfile_$rnd");
		
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
	$page = geturl("www.mirrorcreator.com", 80, "/process.php?$upid", "http://www.mirrorcreator.com/process.php?$upid", $cookies, 0, 0, "");
        preg_match('%<a href="(.*)" target="_blank">%',$page,$match);
        $download_link= trim($match[1]);
}
function rndNum($lg){
$str="0123456789"; 
for ($i=1;$i<=$lg;$i++){
$st=rand(1,9);
$pnt.=substr($str,$st,1);
}
return $pnt;
}	
// Made by Baking 07/02/2010 00:02
//Fix by VinhNhaTrang 15/12/2010
// Updated by CountVirgo, fixed issues, added new providers - 13/09/2011
?>
<?php
$upload_services[] = 'multiup.org';
$max_file_size['multiup.org'] = 5120;
$page_upload['multiup.org'] = 'multiup.org.php';  
?>
<?php
######## Account Info ########
$upload_acc['multiup_org']['user'] = ''; //Set your login
$upload_acc['multiup_org']['pass'] = ''; //Set your password
#######################

$DontUlTo = array();
#Plugin Settings#
	# Uncheck/Disable Upload Sites: (Note: It'll upload to sites non listed here if checked at login page).

		$DontUlTo['sitename.tld'] = true; // This will uncheck by default the checkbox for upload to 'sitename.tld' at login form and it won't upload to that host at auul.

	# MultiUP have added a new site and you want to uncheck/disable it from uploading?: Copy the name showed in Upload to these hosts* and add it in a new line (Lowercase name).
###########

// Don't edit from here unless you know what are you doing.
$not_done = true;
$domain = 'www.multiup.org';
$referer = "http://$domain/";

$page = geturl($domain, 80, '/api/get-list-hosts', $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
$page = Get_Reply($page);
if (empty($page['hosts'])) {
	if (empty($page['error']) || strtolower($page['error']) == 'success') html_error('Failed to get hosts list.');
	html_error('Failed to get hosts list: ' . htmlentities($page['error']) . '.');
}
$sites = array_combine(array_map('strtolower', array_keys($page['hosts'])), array_values($page['hosts']));
unset($page);

if (!empty($upload_acc['multiup_org']['user']) && !empty($upload_acc['multiup_org']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['multiup_org']['user'];
	$_REQUEST['up_pass'] = $upload_acc['multiup_org']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br />Upload to these hosts*<br /><br /></td></tr>\n";
	foreach ($sites as $site => $data) echo "\t<tr><td style='white-space:nowrap;' align='left'><input type='checkbox' name='UpT8[" . htmlentities($site, ENT_QUOTES) . "]' value='1'" . (($fsize > ($data['size'] * 1048576)) ? " title='This file is too heavy for the max size allowed for this hoster.'" : (!empty($DontUlTo[$site]) ? " title='Unchecked by default for \$DontUlTo setting.'" : " checked='checked'")) . " /></td><td style='white-space:nowrap;' align='right'>&nbsp;".htmlentities($site)."&nbsp; ({$data['size']} MB)</td>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' onclick='javascript:return checkh();' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>" . basename(__FILE__) . "</b></small></td></tr>\n";
	echo "</form>\n</table>\n";
	echo "<script type='text/javascript'>/*<![CDATA[*/\nself.resizeTo(700,600);function checkh() {if ($(':checkbox').filter(':checked').length < 1) {alert('You mush select at least one filehoster for upload.'); return false;} return true;\n}\n/*]]>*/</script>\n"; //Resize upload window && Form Check
} else {
	$login = $not_done = false;

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('user_lang' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array('username' => urlencode($_REQUEST['up_login']), 'password' => urlencode($_REQUEST['up_pass']));

		$page = geturl($domain, 80, '/api/login', $referer, 0, $post, 0, $_GET['proxy'], $pauth);is_page($page);
		$json = Get_Reply($page);
		if (empty($json['user'])) {
			if (empty($json['error']) || strtolower($json['error']) == 'success') html_error('Login error: UserID value not found.');
			html_error('Login error: ' . htmlentities($json['error']) . '.');
		}
		$user = $json['user'];

		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl($domain, 80, '/api/get-fastest-server', $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	$json = Get_Reply($page);
	if (empty($json['server'])) {
		if (empty($json['error']) || strtolower($json['error']) == 'success') html_error('Cannot get upload url.');
		html_error('Cannot get upload url: ' . htmlentities($json['error']) . '.');
	}

	$post = array();
	if ($login) $post['user'] = $user;
	$i = 1;
	foreach (array_keys($sites) as $site) if ((!empty($_POST['UpT8']) && !empty($_POST['UpT8'][$site])) || (empty($_POST['UpT8']) && empty($DontUlTo[$site]))) $post['host' . $i++] = $site;

	$up_url = $json['server'];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, 0, $post, $lfile, $lname, 'files[]', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$json = Get_Reply($upfiles);
	if (empty($json['url'])) {
		if (empty($json['error']) || strtolower($json['error']) == 'success') html_error('Upload error.');
		html_error('Upload error: ' . htmlentities($json['error']) . '.');
	}

	$download_link = $json['url'];
}

function Get_Reply($page) {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	$body = substr($page, strpos($page, "\r\n\r\n") + 4);
	if (empty($body)) html_error('Error reading json (Empty page).');
	$body = substr($body, strpos($body, '{'));$body = substr($body, 0, strrpos($body, '}') + 1);
	$json = json_decode($body, true);
	if (empty($json)) html_error('Error reading json.');
	return $json;
}

//[25-1-2013] Written by Th3-822.
//[14-12-2015] Fixed. - Th3-822
//[19-7-2016] Added referer to requests to fix small bug. - Th3-822

?>
<?php 
$upload_services[] = "netload.in";
$max_file_size["netload.in"] = 400;
$page_upload["netload.in"] = "netload.in.php";
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
     // addon debug 
     /*
define('RAPIDLEECH', 'yes');
require_once("http.php");
require_once("other.php");
$nn = "\r\n";
*/
// end addon
			$page = geturl("netload.in", 80, "/", "", 0, 0, 0, "");
			is_page($page);
			preg_match('/http:\/\/.+netload\.in\/upload\.php\?id=\w+/i', $page, $uplink);
			$action_url = $uplink[0];
			$url = parse_url($action_url);
			$post['remote_file'] = 'http://';
?>
<script>document.getElementById('info').style.display='none';</script>

<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php 
            $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),'http://netload.in/', 0, $post, $lfile, $lname, "file");
			is_page($upfiles);
			preg_match("/http:\/\/.+?\}/i",$upfiles,$arr);
            $location = parse_url($arr[0]);
			$pars2 = $location['scheme']."://".$location['host'].$location['path']."?".$location['query'];
			$page = geturl("netload.in", 80, $pars2, "", 0, 0, 0, "");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 

			preg_match('/http:\/\/netload\.in\/\w+/i', $page, $dllink);
			preg_match('/http:\/\/netload\.in\/index\.php\?id=\d{1,4}/i', $page, $dlink1);
			preg_match_all('/\w{32}/i', $page, $dlink2);
			$download_link = $dllink[0].".html";
			$delete_link = $dlink1[0]."&file_id=".$dlink2[0][1];

		// 030\03\2009  update by kaox ;	
?>
<?php 
$upload_services[] = "netload.in_premium";
$max_file_size["netload.in_premium"] = 500;
$page_upload["netload.in_premium"] = "netload.in_premium.php";
?>
<?php
##########################################
$mega_login = ""; // login
$mega_pass = ""; // password
##########################################
$not_done = true;
$continue_up = false;
$cook = "";
if ($mega_login & $mega_pass) {
	$_REQUEST ['my_login'] = $mega_login;
	$_REQUEST ['my_pass'] = $mega_pass;
	$_REQUEST ['action'] = "FORM";
	echo "<b><center>Use Default Netload.in login/pass.</center></b>\n";
}

if ($_REQUEST ['action'] == "FORM")
	$continue_up = true; else {
	?>
<table border=1 style="width: 540px;" cellspacing=0 align=center>
	<form method=post><input type=hidden name=action value='FORM' />
	
	<tr >
	  <td colspan=4 align=center height=25px ><b>Enter Premium Account</b> </td>
	</tr>
	<tr>
		<td nowrap>&nbsp;Login		
		<td>&nbsp;<input name=my_login value='' style="width: 160px;" />&nbsp;		
		<td nowrap>&nbsp;Password		
		<td>&nbsp;<input type=password name=my_pass value='' style="width: 160px;" />&nbsp;	
	</tr>	
	<tr>
		<td nowrap colspan=0>&nbsp;Description		
		<td colspan=3>&nbsp;<input name=message value='<?php print $mega_desc; ?>' style="width: 428px;" />&nbsp;			
	</tr>
	<tr><td colspan=4 align=center><input type=submit value='Upload' /></tr>	
</table>
</form>
<?php
}

if ($continue_up) {
	$lang = "l=en"; // îïðåäåëÿåì ÿçûê    
	$not_done = false;
	if (empty ( $_REQUEST ['my_login'] ) || empty ( $_REQUEST ['my_pass'] )) {
		echo "<b><center>Empty login/pass Netload.in.</center></b>\n";
		$mem = false;
	} else {
		?>
<div id=login width=100% align=center>Login to Netload.in</div>
<?php
		$mem = true;
		$Url = parse_url("http://netload.in/index.php");
		$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, "/index.php", "http://netload.in/index.php", 0, 0, 0, $_GET["proxy"],$pauth);
		preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
			$cookie = $temp[1];
			$cook = implode(';',$cookie);
		$post = array();
  $post["txtuser"] = $_REQUEST ['my_login'] ? $_REQUEST ['my_login'] : $premium_acc["netload"]["user"];
  $post["txtpass"] = $_REQUEST ['my_pass'] ? $_REQUEST ['my_pass'] : $premium_acc["netload"]["pass"];
  $post["txtcheck"] = "login";
  $post['txtlogin'] = '';
  $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, "/index.php", "http://netload.in/index.php", $cook, $post, 0, $_GET["proxy"],$pauth);
		is_page ( $page );
		//print_r($page);
		if (strpos ( $page, "we couldnt find user" )) {
			echo "<b><center>Error login to Netload.in.</center></b>\n";
		} else {
			preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
			$cookie = $temp[1];
			$cook = implode(';',$cookie);
			//$cook .= "; " . $lang;
		}
	}
	?>
<script>document.getElementById('login').style.display='none';</script>


<table width=600 align=center>
	</td>
	</tr>
	<tr>
		<td align=center>

		<div id=info width=100% align=center>Retrieve upload ID</div>
<?php
	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, "/index.php?id=1", 0, $cook, 0, 0, $_GET["proxy"],$pauth);
	?>
	<script>document.getElementById('info').style.innerHTML='Connected to netload, retrieving form...';</script>
<?php
	is_page ( $page );
	unset ( $post );
	$url_action = cut_str($page,'<form method="post" action="','"');
	$post['upload_hash'] = cut_str($page,'name="upload_hash" value="','"');
	$post['remote_file'] = 'http://';
	$post['directory_name'] = '';
	$url = parse_url ( $url_action );
	$cooks = explode(';',$cook);
	foreach ($cooks as $temp) {
		if (stristr($temp,'cookie_user')) {
			$cooks = $temp;
			break;
		}
	}
?>
	<script>document.getElementById('info').style.innerHTML='Uploading...';</script>
<?php
	$upfiles = upfile ( $url ["host"], $url ["port"] ? $url ["port"] : 80, $url ["path"] . ($url ["query"] ? "?" . $url ["query"] : ""), "http://netload.in/index.php?id=1", $cooks, $post, $lfile, $lname, "file" );
	
	?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
	is_page ( $upfiles );
	$loc = "";
	preg_match('/ocation: (.*)/',$upfiles,$loc);
	$location = $loc[1];
	$Url = parse_url($location);
	$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url['path'].'?'.$Url['query'], "http://netload.in/index.php?id=1", $cook, 0, 0, $_GET["proxy"],$pauth);
	
	is_present( $page, "Upload failed or the file doesn't meet our TOS.");
	//is_notpresent ( $upfiles, "downloadurl = '", "File not upload" );
	//preg_match ( '/\'(http:.*)\'/' ,$upfiles, $temp);
	//$download_link = $temp[1];
	$download_link = cut_str($page,'<input type="text" id="txtField" value="','"');
	$delete_link = cut_str($page,'<input type="text" id="txtField2" value="','"');
	
	
	//$download_link = cut_str ( $upfiles, "downloadurl = '", "'" );
    }
?>
<?php
$upload_services[]="nippyshare.com";
$max_file_size["nippyshare.com"]=100;
$page_upload["nippyshare.com"] = "nippyshare.com.php";  
?>
<?php
	
	echo "<center>Nippyshare.com plugin by <b>The Devil</b></center><br />\n";
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$domain = 'nippyshare.com';
	$TD = geturl($domain,0,'/', 'https://nippyshare.com', 0, 0, 0, 0, 0, 0, 'https');
	$block = cut_str($TD,'id="browse"','</form>');
	preg_match('@[^\r\n\s\t]..nippyshare.com/[^\r\n\s\t<>\'\"]+@',$block,$uplocs);
	$req = 'https://'.$uplocs[0];
	$url = parse_url($req);
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$post = array();
	$post['upload'] = 'Upload';
	$upfiles = upfile($url['host'],0,$url['path'],'https://nippyshare.com',0,$post,$lfile,$lname,'file[]','',0,0,0,$url['scheme']);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	$download_link = cut_str($upfiles,"href='","'"); //Lazy
	
//Written by The Devil

?>
<?php 
$upload_services[]="novafile.com_member";
$max_file_size["novafile.com_member"]=2000;
$page_upload["novafile.com_member"] = "novafile.com_member.php";
?>
<?php
######## Account Info ########
$upload_acc['novafile_com']['user'] = ''; //Set your login
$upload_acc['novafile_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if (!empty($upload_acc['novafile_com']['user']) && !empty($upload_acc['novafile_com']['pass'])) {
	$_REQUEST['up_login'] = $upload_acc['novafile_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['novafile_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
}

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$not_done = false;
	$domain = 'novafile.com';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to ".str_replace('www.', '', $domain)."</div>\n";

	$cookie = array('lang' => 'english');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post['op'] = 'login';
		$post['redirect'] = '';
		$post['login'] = urlencode($_REQUEST['up_login']);
		$post['password'] = urlencode($_REQUEST['up_pass']);

		$page = geturl($domain, 80, '/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
		$header = substr($page, 0, strpos($page, "\r\n\r\n"));
		if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.');
		is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
		is_notpresent($header, 'Set-Cookie: xfss=', 'Error: Cannot find session cookie.');
		$cookie = GetCookiesArr($header);
		$cookie['lang'] = 'english';
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl($domain, 80, '/?op=upload', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);

	if (!preg_match('@action="((https?://[^/\"]+)?/upload/\d+)/?\"@i',$page, $up)) html_error('Error: Cannot find upload server.');
	$up[1] = (empty($up[2])) ? "http://$domain".$up[1] : $up[1];

	$uid = '';for ($i = 0; $i < 13; $i++) $uid .= rand(0,9);

	$post = array();
	$post['upload_type'] = 'file';
	$post['srv_id'] = cut_str($page, 'name="srv_id" value="', '"');
	$post['sess_id'] = cut_str($page, 'name="sess_id" value="', '"');
	$post['utype'] = cut_str($page, 'name="utype" value="', '"');
	$post['srv_tmp_url'] = cut_str($page, 'name="srv_tmp_url" value="', '"');
	$post['file_0_descr'] = 'Uploaded by Rapidleech.';
	$post['tos'] = 1;
	$post['submit_btn'] = 'Upload';

	$up_url = $up[1]."/?X-Progress-ID=$uid";

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'file_0', '', $_GET['proxy'], $pauth);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$post = array();
	$post['op'] = 'upload_result';
	if (!preg_match('@name=[\'\"]fn[\'\"](?:(?:[\s\t]*>)|(?:[\s\t]*value=[\'\"]))([^\'\"<>]+)@i', $upfiles, $fn)) html_error('Error: fn value not found.');
	$post['fn'] = trim($fn[1]);
	$post['st'] = 'OK';

	$page = geturl($domain, 80, '/', $up_url, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);

	if (preg_match('@(https?://(?:www\.)?'.preg_quote($domain, '@').'/\w{12}(?:/[^\?/<>\"\'\r\n]+)?(?:\.html?)?)\?killcode=\w+@i', $page, $lnk)) {
		$download_link = $lnk[1];
		$delete_link = $lnk[0];
	} else html_error('Download link not found.');
}

//[17-11-2012] Written by Th3-822.

?>
<?
$upload_services[]="novamov.com";
$max_file_size["novamov.com"]=1024;
$page_upload["novamov.com"] = "novamov.com.php";
?>
<?php
####### Account Info. ###########
$novamov_login = "";
$novamov_pass = "";
$novaup_cat = "3"; // 0 = Unknown; 1 = Software; 3 = Documents; 4 = Videos; 6 Games
##############################

$not_done=true;
$continue_up=false;
if ($novamov_login & $novamov_pass){
	$_REQUEST['bin_login'] = $novamov_login;
	$_REQUEST['bin_pass'] = $novamov_pass;
	$_REQUEST['cat'] = $novaup_cat;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Let it empty for free user</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=1 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM'><input type=hidden value=uploaded value'<?php $_REQUEST[uploaded]?>'>
<input type=hidden name=filename value='<?php echo base64_encode($_REQUEST[filename]); ?>'>
<tr><td nowrap>&nbsp;Login<td>&nbsp;<input name=bin_login value='' style="width:160px;">&nbsp;</tr>
<tr><td nowrap>&nbsp;Password<td>&nbsp;<input name=bin_pass value='' style="width:160px;">&nbsp;</tr>
<tr><td nowrap>&nbsp;Categories<td>&nbsp;<select name="cat" id="cat">
  <option value="0">Unknown</option>
  <option value="1">Software</option>
  <option value="3">Documents</option>
  <option value="4">Videos</option>
  <option value="6">Games</option>
</select></tr>
<tr><td colspan=2 align=center>Let it empty for free user</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload'></tr>
</table>
</form>
<?
}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center> 
</td></tr> 
<tr><td align=center> 
<div id=login width=100% align=center></div> 
<?php
			$Url=parse_url('http://www.novamov.com/login.php?return=');
			if ($_REQUEST['action'] == "FORM")
			{
				$post["user"]=$_REQUEST['bin_login'];
				$post["pass"]=$_REQUEST['bin_pass'];
				$post["Login.x"]=rand(1,99);
				$post["Login.y"]=rand(1,99);
			
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), "http://www.novamov.com/login.php", 0, $post, 0, $_GET["proxy"], $pauth);
			$cookies=GetCookies($page);
			
			}	
?>
<script>document.getElementById('info').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div> 
<?php
			$Url=parse_url('http://www.novamov.com/panel.php?q=3');
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), 0, $cookies, 0, 0, $_GET["proxy"], $pauth);
			$uquery = cut_str($page,'<iframe src="','"');
			$userid = cut_str($uquery,'u=','&key');
			$cookie = "user=".$userid."";
			$ref='http://k.novaup.com:8080/upload/ubr_file_'.$uquery.'';
			$Url2 = 'http://k.novaup.com:8080/upload/ubr_link_upload.php?rnd_id='.time().'';
			$Url=parse_url($Url2);
			$page = geturl($Url["host"], 8080, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), $ref, $cookie, 0, 0, $_GET["proxy"], $pauth);
			
			$upload_id = cut_str($page,'startUpload("','"');
			$post["title"]= $lname;
			$post["desc"]= "Description";
			$post["ui"]= $userid;
			$post["cat"]= $_REQUEST['cat'];	
			$url2 ='http://k.novaup.com:8080/cgi-bin/ubr_upload.pl?upload_id='.$upload_id.'';
			$url = parse_url($url2);		
			$upfiles=upfile($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), $ref, 0, $post, $lfile, $lname, "upfile_0");
			$ufinished = cut_str($upfiles,'<p>The document has moved <a href="','"');
			$Url=parse_url($ufinished);
			$page = geturl($Url["host"], 8080, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), $ref, $cookie, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 
			preg_match('#(http:\/\/www\.novaup\.com\/download\/([a-z0-9]+))\&d=(http:\/\/www\.novaup\.com\/delete\/([a-z0-9]+)\/([a-z0-9]+))#', $page, $temp);
			$download_link= $temp[1];
			$delete_link= $temp[3];
}       
?>
<?php
$upload_services[]="openload.co";
$max_file_size["openload.co"]=1024; //I don't know it
$page_upload["openload.co"] = "openload.co.php";  
?>
<?php

//////////ACCOUNT INFO//////////////////////////////////////////////////////
$upload_acc['openload_co']['user'] = ""; //Set your API Key Here
$upload_acc['openload_co']['pass'] = ""; //Set your API Password Here
////////////////////////////////////////////////////////////////////////////

//Do Not Edit Below//
////////////////////////////////////////////////////////////////////////////
if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
$not_done = true;
if (!empty($upload_acc['openload_co']['user']) && !empty($upload_acc['openload_co']['pass'])) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['openload_co']['user'];
	$_REQUEST['up_pass'] = $upload_acc['openload_co']['pass'];
	$_REQUEST['action'] = '_TD_';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != '_TD_') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='_TD_' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;API Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;API Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'>**Leave Login Details Empty for Anon Upload**</td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'>**NOTE: API Password is Different to Your Usual Password**</td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	
	$login = $not_done = false;
	$base = 'https://api.openload.co/1';
	$domain = 'openload.co';
	echo "<center>Openload.co plugin by <b>The Devil</b></center><br />\n";
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])){
		$login = true;
	} else echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	if($login){
		$resp = cURL($base.'/file/ul?login='.$_REQUEST['up_login'].'&key='.$_REQUEST['up_pass']);
	} else	$resp = cURL($base.'/file/ul');
	
	$devil = strpbrk($resp,'{');
	if(empty($devil)){
		html_error('[0]Error: Bad API Response');
	}
	$devil = json_decode($devil,true);
	if(!($devil['status']=='200')){
		html_error($devil['status'].' '.$devil['msg'].': Bad API Response!');
	}
	if(empty($devil['result']['url'])){
		html_error('[50x1]Error: Plugin Update Required');
	}
	$uploc = $devil['result']['url'];
	$url = parse_url($uploc);
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfiles = upfile($url['host'], 0, $url['path'], 0, 0, 0, $lfile, $lname, 'file','', 0, 0, 0, $url['scheme']);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	$dfin = strpbrk($upfiles,'{');
	if(empty($dfin)){
		html_error('[1]Error: Bad API Response');
	}
	$devil = json_decode($dfin,true);
	if(!($devil['status']=='200')){
		html_error($devil['status'].' '.$devil['msg'].': Bad API Response!');
	}
	$download_link = $devil['result']['url'];
	}

// Written by The Devil
	
?>

<?php
$upload_services[] = 'ourupload.com';
$max_file_size['ourupload.com'] = 5000; // Filesize limit (MB)
$page_upload['ourupload.com'] = 'ourupload.com.php';
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'ourupload.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 10; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822

?>
<?php

$upload_services[] = 'rapidgator.net_member';
$max_file_size['rapidgator.net_member'] = 5120;
$page_upload['rapidgator.net_member'] = 'rapidgator.net_member.php';

?>
<?php
######### Account Info #########
$upload_acc['rapidgator_net']['user'] = ''; //Set your user
$upload_acc['rapidgator_net']['pass'] = ''; //Set your password
##########################

$_GET['proxy'] = !empty($proxy) ? $proxy : (!empty($_GET['proxy']) ? $_GET['proxy'] : '');
$not_done = true;

// This Plugin Requires cURL + HTTPs support
$use_curl = extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
if ($use_curl) {
	$cV = curl_version();
	if (!in_array('https', $cV['protocols'], true)) html_error('This plugin requires cURL + HTTPs support. (Lacks HTTPs support)');
} else html_error('This plugin requires cURL + HTTPs support. (cURL is disabled)');

if ($upload_acc['rapidgator_net']['user'] && $upload_acc['rapidgator_net']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['rapidgator_net']['user'];
	$_REQUEST['up_pass'] = $upload_acc['rapidgator_net']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$not_done = $login = false;
	$domain = 'rapidgator.net';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('lang' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		// Decrypt login if it was encrypted
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$post = array();
		$post['LoginForm%5Bemail%5D'] = urlencode($_REQUEST['up_login']);
		$post['LoginForm%5Bpassword%5D'] = urlencode($_REQUEST['up_pass']);
		$post['LoginForm%5BrememberMe%5D'] = 1;
		if (!empty($_POST['step']) && $_POST['step'] == '1') {
			$_POST['step'] = false;
			if (empty($_POST['captcha'])) html_error('You didn\'t enter the image verification code.');
			$cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
			$post['LoginForm%5BverifyCode%5D'] = urlencode($_POST['captcha']);
		}

		//Redirects
		$rdc = 0;
		$page = false; // False value for starting the loop.
		$redir = "https://$domain/auth/login";
		if (!empty($_POST['referer'])) $referer = $_POST['referer'];
		while (($redir = ChkRGRedirs($page, $redir, '(?:/auth/login|/site/ChangeLocation/key/)', $default_acc)) && $rdc < 15) {
			$page = cURL($redir, $cookie, $post, $referer);
			$cookie = GetCookiesArr($page, $cookie);
			$referer = $redir;
			$rdc++;
		}

		is_present($page, 'Wrong e-mail or password.', 'Login Failed: Invalid Email or Password.');
		is_present($page, 'E-mail is not a valid email address.', 'Login Failed: Login isn\'t an email address.');
		is_present($page, 'We discovered that you try to access your account from unusual location.', 'Login Failed: Login Blocked By IP, Check Account Email And Follow The Steps To Add IP to Whitelist.');
		if (stripos($page, 'The code from a picture does not coincide') !== false) {
			if (!empty($post['LoginForm%5BverifyCode%5D'])) html_error('Login Failed: Incorrect CAPTCHA response.');
			if (!preg_match('@(https?://(?:[^\./\r\n\'\"\t\:]+\.)?rapidgator\.net(?:\:\d+)?)?/auth/captcha/\w+/\w+@i', $page, $imgurl)) html_error('Error: CAPTCHA not found.');
			$imgurl = (empty($imgurl[1])) ? 'https://rapidgator.net'.$imgurl[0] : $imgurl[0];
			//Download captcha img.
			$captcha = explode("\r\n\r\n", cURL($imgurl, $this->cookie), 2);
			if (substr($captcha[0], 9, 3) != '200') html_error('Error downloading captcha img.');
			$mimetype = (preg_match('@image/[\w+]+@', $captcha[0], $mimetype) ? $mimetype[0] : 'image/png');

			$data = array();
			$data['step'] = '1';
			$data['cookie'] = urlencode(encrypt(CookiesToStr($cookie)));
			$data['action'] = 'FORM'; // I should add 'premium_acc' to DefaultParamArr()
			if (!$default_acc) {
				$data['A_encrypted'] = 'true';
				$data['up_login'] = urlencode(encrypt($_REQUEST['up_login'])); // encrypt() will keep this safe.
				$data['up_pass'] = urlencode(encrypt($_REQUEST['up_pass'])); // And this too.
			}
			EnterCaptcha("data:$mimetype;base64,".base64_encode($captcha[1]), $data, 5, 'Login');
			exit;
		}
		//is_present($page, 'The code from a picture does not coincide', 'Login Failed: Captcha... (T8: I will add it later)');
		is_present($page, 'The code from a picture does not coincide', 'Login Failed: Captcha... (T8: I will add it later)');

		if (empty($cookie['user__'])) html_error("Login Error: Cannot find 'user__' cookie.");
		$cookie['lang'] = 'en';
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	//Redirects
	$rdc = 0;
	$page = false; // False value for starting the loop.
	$redir = "https://$domain/";
	while (($redir = ChkRGRedirs($page, $redir)) && $rdc < 15) {
		$page = cURL($redir, $cookie, 0, $referer);
		$cookie = GetCookiesArr($page, $cookie);
		$referer = $redir;
		$rdc++;
	}

	if (!preg_match('@var\s+form_url\s*=\s*setProtocol\("(https?:\/\/[^/|\"]+\/[^\"]+)"\)\s*;@i', $page, $form_url) || !preg_match('@var\s+progress_url_web\s*=\s*setProtocol\("(https?:\/\/[^/|\"]+\/[^\"]+)"\)\s*;@i', $page, $prog_url)) {
		is_present($page, 'Your storage space is full. Delete some files or upgrade to the new', 'Your storage space is full');
		html_error('Error: Cannot find upload url.');
	}

	$starttime = time();
	$uuid = '';
	$hexchars = str_split('0123456789abcdef');
	for ($i = 0; $i < 32; $i++) $uuid .= $hexchars[array_rand($hexchars)];

	$up_url = $form_url[1]."$uuid&folder_id=0";

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, array(), $lfile, $lname, 'file', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";

	is_page($upfiles);

	// Pool Upload
	echo "<div id='T8_div' width='100%' align='center'>Checking Finished Upload : Try <span id='T8_try'>0</span><br /><span id='T8_status'></span></div>\n";
	$x = 1;
	do {
		echo "<script type='text/javascript'>document.getElementById('T8_try').innerHTML = '$x';</script>\n";
		sleep($x + 5); // A little wait

		//Redirects
		$rdc = 0;
		$page = false; // False value for starting the loop.
		$redir = $prog_url[1]."&data%5B0%5D%5Buuid%5D=$uuid&data%5B0%5D%5Bstart_time%5D=$starttime";
		while (($redir = ChkRGRedirs($page, $redir)) && $rdc < 15) {
			$page = cURL($redir, $cookie, 0, $referer);
			$cookie = GetCookiesArr($page, $cookie);
			$referer = $redir;
			$rdc++;
		}

		$resp = json2array($page, "Cannot get upload status $x");
	} while ($x++ < 5 && $resp[0]['state'] == 'processing');

	if (!empty($resp[0]['download_url'])) {
		$download_link = $resp[0]['download_url'];
		if (!empty($resp[0]['remove_url'])) $delete_link = $resp[0]['remove_url'];
	} else html_error("Download link not found ({$resp[0]['state']}).");
}

function json2array($content, $errorPrefix = 'Error') {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (empty($content)) return NULL;
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error("[$errorPrefix]: JSON start braces not found.");
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error("[$errorPrefix]: No JSON content.");
	$rply = json_decode($content, true);
	if ($rply === NULL) html_error("[$errorPrefix]: Error reading JSON.");
	return $rply;
}

// Edited For upload.php usage.
function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5', $sname = 'Enter Captcha', $iname = 'captcha') {
	echo "\n<form name='captcha' method='POST'>\n";
	foreach ($inputs as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
	echo "\t<h4>" . lang(301) . " <img alt='CAPTCHA Image' src='$captchaImg' /> " . lang(302) . ": <input id='captcha' type='text' name='$iname' size='$captchaSize' />&nbsp;&nbsp;\n\t\t<input type='submit' onclick='return check();' value='$sname' />\n\t</h4>\n\t<script type='text/javascript'>/* <![CDATA[ */\n\t\tfunction check() {\n\t\t\tvar captcha=document.getElementById('captcha').value;\n\t\t\tif (captcha == '') {\n\t\t\t\twindow.alert('You didn\'t enter the image verification code');\n\t\t\t\treturn false;\n\t\t\t} else return true;\n\t\t}\n\t/* ]]> */</script>\n</form>\n</body></html>";
}

function ChkRGRedirs($page, $lasturl, $rgpath = '/', $default_login = false) { // Edited for upload plugin usage.
	if (!is_array($lasturl)) $lasturl = parse_url($lasturl);
	if ($page === false) return rebuild_url($lasturl);
	$hpos = strpos($page, "\r\n\r\n");
	$headers = empty($hpos) ? $page : substr($page, 0, $hpos);

	if (stripos($headers, "\nLocation: ") === false && stripos($headers, "\nSet-Cookie: ") === false && stripos($headers, '<script') !== false && !(cut_str($page, '<title>', '</title>'))) {
		if (empty($_REQUEST['rgredir'])) {
			if (!($body = cut_str($page, '<body>', '</body>'))) $body = $page;
			if (stripos($body, '<script') !== strripos($body, '<script')) html_error('Unknown error while getting redirect code.');
			$data = array('action' => 'FORM', 'referer' => rebuild_url($lasturl), 'rgredir' => '');
			if (!$default_login) {
				$data['A_encrypted'] = 'true';
				$data['up_login'] = urlencode(encrypt($_REQUEST['up_login']));
				$data['up_pass'] = urlencode(encrypt($_REQUEST['up_pass']));
			}
			if (!($js = cut_str($body, '<script language="JavaScript">', '</script>')) && !($js = cut_str($body, '<script type="text/javascript">', '</script>'))) html_error('Cannot get the redirect code.');
			$js = str_ireplace(array('window.location.href','document.location.href'), 'document.getElementById("rgredir").value', $js);
			if (strpos($js, 'document.body.onmousemove') !== false) { // New redirect code
				$js = preg_replace('@^[\s\t]*\w+\([^\;]+;@i', '', $js);
				$js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*function[\s\t]*\(\)[\s\t]*\{@i', '', $js);
				$js = preg_replace('@document\.body\.onmousemove[\s\t]*=[\s\t]*\'\';?\};[\s\t]*window\.setTimeout\([\s\t]*((\"[^\"]+\")|(\'[^\']+\'))[^\;]+;[\s\t\r\n]*$@i', '', $js);
			} elseif (($funcPos = stripos($js, 'function WriteA(')) !== false) { // JS + aaaaaaaaaaaaaaaaaaaaaaaaa
				$links = array();
				if (preg_match_all('@<a\s*[^>]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"[^>]*\sid="([A-Za-z][\w\.\-]*)"@i', $body, $a)) $links = array_merge($links, array_combine($a[2], $a[1]));
				if (preg_match_all('@<a\s*[^>]*\sid="([A-Za-z][\w\.\-]*)"[^>]*\shref="((?:https?://(?:www\.)?rapidgator\.net)?/[^\"]+)"@i', $body, $a)) $links = array_merge($links, array_combine($a[1], $a[2]));
				if (empty($links)) html_error('Cannot get the redirect fields');
				unset($a);

				$jsLinks = '';
				foreach ($links as $key => $link) {
					if (strpos($link, '://') === false) $link = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net' . $link;
					$jsLinks .= "$key: '".addslashes($link)."', ";
				}
				unset($links, $key, $link);
				$jsLinks = '{' . substr($jsLinks, 0, -2) . '}';
				$func = substr($js, $funcPos);
				if (!preg_match('@\.getElementById\(([\$_A-Za-z][\$\w]*)\)@i', $func, $linkVar)) html_error('Cannot edit redirect JS');
				$linkVar = $linkVar[1];
				unset($func);
				$js = substr($js, 0, $funcPos)."\nvar T8RGLinks = $jsLinks;\nif ($linkVar in T8RGLinks) document.getElementById('rgredir').value = T8RGLinks[$linkVar];";
				unset($jsLinks, $funcPos, $linkVar);
			}
			echo "\n<form name='rg_redir' method='POST'><br />\n";
			foreach ($data as $name => $input) echo "<input type='hidden' name='$name' id='$name' value='" . htmlspecialchars($input, ENT_QUOTES) . "' />\n";
			echo "</form>\n<span id='T8_emsg' class='htmlerror' style='text-align:center;display:none;'></span>\n<noscript><span class='htmlerror'><b>Sorry, this code needs JavaScript enabled to work.</b></span></noscript>\n<script type='text/javascript'>/* <![CDATA[ Th3-822 */\n\tvar T8 = true;\n\ttry {{$js}\n\t} catch(e) {\n\t\t$('#T8_emsg').html('<b>Cannot decode challenge: ['+e.name+'] '+e.message+'</b>').show();\n\t\tT8 = false;\n\t}\n\tif (T8) window.setTimeout(\"$('form[name=rg_redir]').submit();\", 300); // 300 Âµs to make sure that the value was decoded and added.\n/* ]]> */</script>\n\n</body>\n</html>";
			exit;
		} else {
			$_REQUEST['rgredir'] = rawurldecode($_REQUEST['rgredir']);
			if (strpos($_REQUEST['rgredir'], '://')) $_REQUEST['rgredir'] = parse_url($_REQUEST['rgredir'], PHP_URL_PATH);
			if (empty($_REQUEST['rgredir']) || substr($_REQUEST['rgredir'], 0, 1) != '/') html_error('Invalid redirect value.');
			$redir = (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net'.$_REQUEST['rgredir'];
			unset($_REQUEST['rgredir']);
		}
	} elseif (preg_match('@Location: ((https?://(?:[^/\r\n]+\.)?rapidgator\.net)?'.$rgpath.'[^\r\n]*)@i', $headers, $redir)) $redir = (empty($redir[2])) ? (!empty($lasturl['scheme']) && strtolower($lasturl['scheme']) == 'https' ? 'https' : 'http').'://rapidgator.net'.$redir[1] : $redir[1];

	return (empty($redir) ? false : $redir);
}

// [09-9-2012] Written by Th3-822.
// [02-10-2012] Fixed for new weird redirect code. - Th3-822
// [31-10-2012] Fixed for https on login/redirects. - Th3-822
// [28-1-2013] Added Login captcha support. - Th3-822
// [14-6-2013] Removed https from first login try, for avoid block. - Th3-822
// [10-8-2013] Fixed redirects (again). - Th3-822
// [05-10-2013] Removed anon user support. - Th3-822
// [25-11-2013] Fixed redirects function (aagain :D ). - Th3-822
// [16-12-2015][WIP] Fixing Blocks, Redirect Handling & Forcing Plugin To Use cURL. - Th3-822
// [27-11-2016] Added wait and retries to get download_link. - Th3-822
// [28-08-2017] Switched to HTTPS. - Th3-822
<?php
$upload_services[]="rapidshare.ru";
$max_file_size["rapidshare.ru"]=1500;
$page_upload["rapidshare.ru"] = "rapidshare.ru.php";  

$rapidshareru_login=""; // <- Ëîãèí/Login
$rapidshareru_pass=""; // <- Ïàðîëü/Password
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
	
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
			$ref="http://www.rapidshare.ru/";
			if (isset($rapidshareru_login) && isset($rapidshareru_pass))
			{
				$post['page']='page=www.rapidshare.ru%2F';
				$post['userEmail']=str_replace("@","%40",$rapidshareru_login);
				$post['userPass']=$rapidshareru_pass;
				$url=parse_url($ref."login.php");
				$page = geturl($url["host"],defport($url),$url['path'].($url["query"] ? "?".$url["query"] : ""),$ref,0,$post,0,0,0);
				is_page($page);
				$cookies = GetCookies($page);
				if (strpos($page,"userID"))
				{echo"<br><b>Login OK. Use member upload</b><br>";}
				else{
					echo"<br><b>Error Login. Use no member upload</b><br>";
					}
			}
            $page = geturl("www.rapidshare.ru", 80, "/", "", 0, 0, 0, "");
			is_page($page);
			$tmp = cut_str($page,'id=actionurl','/>');
			$action_url = cut_str($tmp,'value="','"');
			if (!$action_url) html_error("Error retrive upload id <br>".$page);

			$url=parse_url($action_url);

?>
<script>document.getElementById('info').style.display='none';</script>
<?php

			@$upfiles=upfile($url["host"],defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""),$ref, $cookies, 0, $lfile, $lname, "fl1");

?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php		
			is_page($upfiles);
//			is_notpresent($upfiles,"ok","Error Upload File!".$upfiles);
            $location = trim(cut_str($upfiles,"Location: ","\n"));
			if (!$location) html_error("Error upload file <br>".$page);
            $url=parse_url($location);
            $page = geturl($url["host"],defport($url),$url['path'].($url["query"] ? "?".$url["query"] : ""),$ref,$cookies,0,0,0,0);
            is_page($page);
            is_notpresent($page,"$lname","Error Upload file <br>".$page);
            
            $download_link = cut_str($page,'[URL]','[/URL]');

// sert 22.06.2008
?>
<?php
$upload_services[]="rghost.ru";
$max_file_size["rghost.ru"]=2000;
$page_upload["rghost.ru"] = "rghost.ru.php";
?>
<?php

//Input your <site> username and password
$site_login = '';
$site_pass = '';



/////////////////////////////////////////////////
$not_done=true;
$continue_up=false;
if ($site_login & $site_pass)
{
$_REQUEST['my_login'] = $site_login;
$_REQUEST['my_pass'] = $site_pass;
$_REQUEST['action'] = "FORM";
echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
{
$continue_up=true;
}
else
{
?>
<table border=0 style="width:350px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Username*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload'></tr>
</table>
</form>
<?php
}

if ($continue_up)
{
$not_done = false;

?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to Site</div>
<?php
if ( !isset($_REQUEST['my_login']) || !isset($_REQUEST['my_pass']) ) html_error('No user and pass given');

$Url = parse_url('http://rghost.ru/');
$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"], $pauth);
is_page($page);
$cookies = GetCookies($page);
preg_match('%name="authenticity_token" type="hidden" value="(.+)" />%U', $page, $auth_token);
$authenticity_token = $auth_token[1];
$post = array();
$post['email'] = urlencode(trim($_REQUEST['my_login']));
$post['password'] = trim($_REQUEST['my_pass']);
$post['authenticity_token'] = $authenticity_token;
$post['remember_me'] = '0';
$post['return_to'] = urlencode('http://rghost.ru/');
$post['commit'] = 'Sign+in';
$Url = parse_url('http://rghost.ru/profile/login');
$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookies, $post, 0, $_GET["proxy"], $pauth);
is_page($page);
$cookies = GetCookies($page);
$Url = parse_url('http://rghost.ru/');
$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookies, 0, 0, $_GET["proxy"], $pauth);
is_page($page);
if (!preg_match('%var seed=\'(\d+)\';%U', $page, $pid)) html_error('Progress-ID not found');
?>

<!-- now get rid of the login div -->
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php

$uploadpage = 'http://phonon.rghost.ru/files?X-Progress-Id=' . $pid[1];
$url = parse_url($uploadpage);
?>
<script>document.getElementById('info').style.display='none';</script>
<?php

$post = array();
$post['authenticity_token'] = $authenticity_token;
$post['commit'] = 'Upload';

$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), 'http://rghost.ru/', $cookies, $post, $lfile, $lname, "file");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
is_page($upfiles);
if (!preg_match('%(http://rghost.ru/\d+)\'%U', $upfiles, $infos)) html_error('Download Link not found - please check your account.');
$download_link = $infos[1];
}
//szal 03jul2009
?>
<?php
$upload_services[] = 'rioupload.com';
$max_file_size['rioupload.com'] = 2000;
$page_upload['rioupload.com'] = 'rioupload.com.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 7); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'rioupload.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 1024; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php
$upload_services[] = 'rodfile.com';
$max_file_size['rodfile.com'] = 2024;
$page_upload['rodfile.com'] = 'rodfile.com.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 7); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'rodfile.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 1024; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php
$upload_services[] = 'sendmyway.com';
$max_file_size['sendmyway.com'] = 1000;
$page_upload['sendmyway.com'] = 'sendmyway.com.php';
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 4); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'www.sendmyway.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 500; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [15-5-2015]

?>
<?php 
$upload_services[]="sendspace.com";
$max_file_size["sendspace.com"]=300;
$page_upload["sendspace.com"] = "sendspace.com.php";
$sendspace_login=""; // Ëîãèí
$sendspace_pass=""; // Ïàðîëü
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
    
<div id=info width=100% align=center>Retrive upload ID</div>
<?php 
//************************ Login *******************
$sendspace_login="";
$sendspace_pass="";
//**************************************************

$not_done = true;
$continue_up = false;

if ($sendspace_login & $sendspace_pass) {
	$_REQUEST ['my_login'] = $sendspace_login;
	$_REQUEST ['my_pass'] = $sendspace_pass;
	$_REQUEST ['action'] = "FORM";
	echo "<b><center>Use Default Sendspace.com login/pass.</center></b>\n";
}

if ($_REQUEST ['action'] == "FORM")
	$continue_up = true; else {
	?>
<table border=1 style="width: 540px;" cellspacing=0 align=center>
	<form method=post><input type=hidden name=action value='FORM' />
	
	<tr >
	  <td colspan=4 align=center height=25px ><b>	Enter Free or Premium Account</b> </td>
	</tr>
	<tr>
		<td nowrap>&nbsp;Login		
		<td>&nbsp;<input name=my_login value='' style="width: 160px;" />&nbsp;		
		<td nowrap>&nbsp;Password		
		<td>&nbsp;<input type=password name=my_pass value='' style="width: 160px;" />&nbsp;	
	</tr>	
	<tr>
		<td nowrap colspan=0>&nbsp;Note		
		<td colspan=3>&nbsp;<b>If you have no sendspace account then, kindly press upload button to upload</b>&nbsp;			
	</tr>
	<tr>
		<td colspan=4 align=center><input type=submit value='Upload' />
	</tr>	
</table>
</form>
<?php
}

if ($continue_up) {

            $page = geturl("www.sendspace.com", 80, "/", "", 0, 0, 0, "");
?>
    <script>document.getElementById('info').style.display='none';</script>
<?php 
function biscotti($content) {
        is_page($content);
        preg_match_all("/Set-Cookie: (.*)\n/",$content,$matches);
        foreach ($matches[0] as $coll) {
        $bis.=cut_str($coll,"Set-Cookie: ","; ")."; ";	
        }return $bis;}
        
			$sendspace_login = $_REQUEST ['my_login'];
			$sendspace_pass = $_REQUEST ['my_pass'];
			
            $cook=biscotti($page);
     		if ($sendspace_login && $sendspace_pass){
			$post["action"]="login";
			$post["username"]=$sendspace_login;
			$post["password"]=$sendspace_pass;
            $post["remember"]="1";
			$post["submit"]="login";
			$post["openid_url"]="";
			$post["action_type"]="login";
			$page=geturl("www.sendspace.com", 80, "/login.html", "http://www.sendspace.com/login.html", $cook, $post, 0, $_GET["proxy"]);
			$cook=$cook." ".biscotti($page);
			is_present($cook,"ssal=deleted","Login incorrect retype your username or password correctly");
			$page=geturl("www.sendspace.com", 80, "/", "http://www.sendspace.com/", $cook, 0, 0, $_GET["proxy"]);
			unset($post);
			}else{
				echo("<br> <b>No enter login & pass</b> to sendspace.com <br><br>");
			}

            $tmp = cut_str($page,'DESTINATION','>');            
            $DESTINATION_DIR=cut_str($tmp,'value="','"');
            
            $url_action=cut_str($page,'post" action="','"');
            $UPLOAD_IDENTIFIER=cut_str($page,'name=UPLOAD_IDENTIFIER value="','"');
            $UPLOAD_IDENTIFIER=$UPLOAD_IDENTIFIER ? $UPLOAD_IDENTIFIER : cut_str($page,'name="UPLOAD_IDENTIFIER" value="','"');
			$signature=cut_str($page,'signature" value="','"');
            
            if (empty($url_action) || empty($UPLOAD_IDENTIFIER) || empty($DESTINATION_DIR))
                {    
                    html_error("Error retrive upload id".$page);
                }
            
			$post["MAX_FILE_SIZE"]="314572800";
			$post["UPLOAD_IDENTIFIER"]=$UPLOAD_IDENTIFIER;
            $post["DESTINATION_DIR"]=$DESTINATION_DIR;
            $post["js_enabled"]="1";
			$post["signature"]=$signature;
//            $post["terms"]="1";
			$post["recpemail"]="";
            if ($sendspace_login && $sendspace_pass) $post["userid"]=cut_str($page,'userid" value="','"');
            $post["desc0"]=$descript;
//			$post["btnupload"]="Upload File";
            
            $url=parse_url($url_action);
            $upfiles=upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),"http://www.sendspace.com/", $cook, $post, $lfile, $lname, "file_0");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php        
			is_page($upfiles);
			is_present($upfiles,"uploadprocerr.html","Error Upload file! / Îøèáêà çàãðóçêè ôàéëà!");

            //$page = geturl($url["host"],defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""),$url_action, $cook, 0, 0, "");
            //is_page($page);
            $tmp = cut_str($upfiles,'Download Link in HTML',"'>");
            $download_link=cut_str($tmp,"href='",'"');
            $tmp = cut_str($upfiles,'File Delete Link','/>');
            $delete_link=cut_str($tmp,'value="','"');

}
// Fixed by kaox 07/05/09
// Added GUI for asking username and password by Raj Malhotra
// Fixed "Error retrive upload idHTTP/1.1 301 " by Raj Malhotra
?>
<?php
$upload_services[]="share-online.biz_member";
$max_file_size["share-online.biz_member"]=2048;
$page_upload["share-online.biz_member"] = "share-online.biz_member.php";
?>
<?php
####### Account Info. ###########
$so_login = "";
$so_pass = "";
##############################

$not_done=true;
$continue_up=false;
if ($so_login & $so_pass){
	$_REQUEST['bin_login'] = $so_login;
	$_REQUEST['bin_pass'] = $so_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Let it empty for free user</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=1 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM'><input type=hidden value=uploaded value'<?php $_REQUEST[uploaded]?>'>
<input type=hidden name=filename value='<?php echo base64_encode($_REQUEST[filename]); ?>'>
<tr><td nowrap>&nbsp;Login<td>&nbsp;<input name=bin_login value='' style="width:160px;">&nbsp;</tr>
<tr><td nowrap>&nbsp;Password<td>&nbsp;<input name=bin_pass value='' style="width:160px;">&nbsp;</tr>
<tr><td colspan=2 align=center>Let it empty for free user</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload'></tr>
</table>
</form>
<?php
}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center> 
</td></tr> 
<tr><td align=center> 
<div id=login width=100% align=center></div> 
<?php
			$Url=parse_url('http://www.share-online.biz/upv3_session.php');
			if ($_REQUEST['action'] == "FORM")
			{
				$post["username"]=trim($_REQUEST['bin_login']);
				$post["password"]=trim($_REQUEST['bin_pass']);
			
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"] . ($Url["query"] ? "?" . $Url["query"] : ""), 0, 0, $post, 0, $_GET["proxy"], $pauth);
			is_present($page, 'EXCEPTION username or password invalid', 'Your login details are wrong!');
			preg_match('#([a-zA-Z0-9]+);(dlw([0-9]+)-[0-9]\.share-online\.biz\/upload)#', $page,$session);
			}	
?>
<script>document.getElementById('info').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div> 
<?php
			$url=parse_url("http://".$session[2]."");
            $post["username"] = trim($_REQUEST['bin_login']);
            $post["password"] = trim($_REQUEST['bin_pass']);
            $post["upload_session"] = $session[1]; 
            $post["chunk_no"]= 1; 
			$post["chunk_number"]= 1; 
			$post["filesize"]= filesize($lfile);
			$post["finalize"]= 1;
			
			$upfiles = upfile($url["host"], $url["port"] ? $url["port"] : 80, $url["path"] . ($url["query"] ? "?" . $url["query"] : ""), 0, 0, $post, $lfile, $lname, "fn");
			preg_match('#(http:\/\/www\.share-online\.biz\/dl\/.+);.+;#', $upfiles,$dllink);
			if (!empty($dllink[1]))
			$download_link = $dllink[1];
			else
			html_error ('Didn\'t find downloadlink!');
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
}       
?>
<?
$upload_services[]="share.megaplus.vn_member";
$max_file_size["share.megaplus.vn_member"]= 2000;
$page_upload["share.megaplus.vn_member"] = "share.megaplus.vn_member.php";
?>
<?php
####### Account Info. ###########
$share_megaplus_vn_login = "xxxxxx"; //Set your user id (login)
$share_megaplus_vn_pass = "xxxxxx"; //Set your password
##############################

$not_done=true;
$continue_up=false;
if ($share_megaplus_vn_login && $share_megaplus_vn_pass){
	$_REQUEST['my_login'] = $share_megaplus_vn_login;
	$_REQUEST['my_pass'] = $share_megaplus_vn_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["share.megaplus.vn"];exit; ?></b></small></tr>
</table>
</form>

<?php
	}
$continue_up=true;
if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to Share.megaplus.vn</div>
<?php 
			$page = geturl("share.megaplus.vn", 80, "/", "http://share.megaplus.vn/index.php", 0, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
                        $cookie = GetCookies($page);
                        $page = geturl("share.megaplus.vn", 80, "/megavnnplus.php?service=login", 'http://share.megaplus.vn/', $cookie, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
                        preg_match('%ocation: (.+)\r\n%', $page, $redir);
		        $geturl = rtrim($redir["1"]);
                        $geturl = "$geturl&locale=en";
                        $page = ssl_curl($geturl, 0, $cookie);
	                $cookies = GetCookies($page);
                        $post_path = cut_str($page,'<form id="fm1" class="fm-v clearfix" action="','" method="post">');
                        $post_url = "https://id.megaplus.vn";
                        $post_url = "$post_url$post_path";     
                        $post = array();
			$post['username'] = trim($_REQUEST['my_login']);
			$post['password'] = trim($_REQUEST['my_pass']);			
			$post['lt'] = cut_str($page,'<input type="hidden" name="lt" value="','" />');
			$post['_eventId'] = 'submit';
			$post['submit'] = 'LOGIN';
                        $page = ssl_curl($post_url, $post, $cookies);
                        $cookies = GetCookies($page);
                        preg_match('%ocation: (.+)\r\n%', $page, $redir);
                        $geturl = rtrim($redir["1"]);
                        if(!$geturl){
                        is_notpresent($page, 'ticket=', 'Error logging in - are your logins correct!');
                        }
                        $Url = parse_url($geturl);
                        $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookies, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
                        $cookie = GetCookies($page);
                        $cookies = substr($cookie,37) ;
                        $Url = parse_url("http://share.megaplus.vn/index.php");
                        $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://share.megaplus.vn/", $cookies, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
                        $PHPSESSID =  str_replace('PHPSESSID=','',$cookies);       
	?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive test</div>
<script>document.getElementById('info').style.display='none';</script>
<?php 
			$url = parse_url('http://share.megaplus.vn/upload.php');
                        $upagent = 'Shockwave Flash';
			$fpost = array();
			$fpost['Filename'] = $lname;
                        $fpost['description'] = 'LeechViet Premium Link';
			$fpost['secCode'] = 'abc';
			$fpost['public'] = 'true';
                        $fpost['PHPSESSID'] = $PHPSESSID;
			$fpost['Upload'] = 'Submit Query';
		        $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), "http://share.megaplus.vn/", $cookies, $fpost, $lfile, $lname, "Filedata",$upagent);
                        
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
			if(!preg_match("%http://share.megaplus.vn/dl.php/(.*)%", $upfiles, $preg)) html_error("Error get direct link");
			$download_link=$preg[0];
			
	}
function ssl_curl($link, $post = 0, $cookie = 0, $refer = 0)
{
	$mm = !empty($post) ? 1 : 0;
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $link);
	curl_setopt($ch, CURLOPT_HEADER, 1);
	curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U;Windows NT 5.1; de;rv:1.8.0.1)\r\nGecko/20060111\r\nFirefox/1.5.0.1');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	if ($mm == 1)
	{
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, formpostdata($post));
	}
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
	curl_setopt($ch, CURLOPT_REFERER, $refer);
	curl_setopt($ch, CURLOPT_COOKIE, $cookie) ;
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
	curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
	$contents .= curl_exec($ch);
	curl_close($ch);
	return $contents;
}
/*************************\  
written by VinhNhaTrang 31/10/2010
\*************************/
?>
<?php
$upload_services[] = 'shared.com_member';
$max_file_size['shared.com_member'] = 2000;
$page_upload['shared.com_member'] = 'shared.com_member.php';
?>
<?php
######## Account Info ########
$upload_acc['shared_com']['user'] = ''; //Set your login
$upload_acc['shared_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;

if ($upload_acc['shared_com']['user'] && $upload_acc['shared_com']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['shared_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['shared_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM') {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Login*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
} else {
	$login = $not_done = false;
	$domain = 'shared.com';
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}

		$page = geturl($domain, 80, '/login', $referer.'login', $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);

		$post = array();
		$post['utf8'] = urlencode(html_entity_decode(cut_str($page, 'name="utf8" type="hidden" value="', '"'), ENT_QUOTES, 'UTF-8'));
		$post['authenticity_token'] = cut_str($page, 'name="authenticity_token" type="hidden" value="', '"');
		if (empty($post['authenticity_token'])) html_error('CSRF token not found.');
		$post['user%5Bemail%5D'] = urlencode($_REQUEST['up_login']);
		$post['user%5Bpassword%5D'] = urlencode($_REQUEST['up_pass']);
		$post['submit'] = 'Log+In';

		$page = geturl($domain, 80, '/login', $referer.'login', $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);

		is_present($page, 'Login incorrect', 'Login Failed: Email/Password incorrect.');
		if (!preg_match('@\nLocation: (?:https?://shared.com)?/u/([^\r\n]+)@i', $page, $uname)) html_error('Login Error: Login redirect not found.');
		$login = true;
	} else html_error('Login failed: User/Password empty.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrieving upload ID</div>\n";

	$page = geturl($domain, 80, '/u/'.$uname[1], $referer.'login', $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	$cookie = GetCookiesArr($page, $cookie);

	if (!preg_match('@action="((https?://(?:\w+\.)*shared\.com)?(/)?[^\s\'\"<>]+)"\s+class="no-files-selected"@i', $page, $up)) html_error('Error: Upload url not found.');

	$csrf = trim(cut_str($page, 'name="authenticity_token" type="hidden" value="', '"'));
	if (empty($csrf)) html_error('Error: Upload CSRF token not found.');

	$post = array();
	$post['status'] = '1';

	$ref = $referer.'u/'.$uname[1]."\r\nX-CSRF-Token: $csrf";

	$up_url = (empty($up[2]) ? "http://$domain".(empty($up[3]) ? '/' : '').$up[1] : $up[1]);

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $ref, $cookie, $post, $lfile, $lname, 'files[]', '', 0, 0, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (!preg_match('@"slug"\s*:\s*"([^"]+)",@i', $upfiles, $lnk)) html_error('Download link not found.');
	$download_link = 'http://shared.com/'.$lnk[1];
}

//[09-3-2014]  Written by Th3-822.
//[15-3-2014]  Fixed login redirect. - Th3-822
//[26-5-2014]  Removed https, site is forcing http connections now. - Th3-822

?>
<?php 
$upload_services[] = "shareflare.net";
$max_file_size["shareflare.net"] = 200;
$page_upload["shareflare.net"] = "shareflare.net.php";  
?>
<?php
$continue_up=true;
if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to Shareflare.net</div>
<?php 
			$page = geturl("shareflare.net", 80, "/", 0, 0, 0, 0, $_GET["proxy"], $pauth);
			is_page($page);
                        preg_match("%var ACUPL_UPLOAD_SERVER = '(.*)';%i", $page, $acup);
                        $ACUPL_UPLOAD_SERVER = $acup[1];
                        $MAX_FILE_SIZE = cut_str($page, '<input type="hidden" name="MAX_FILE_SIZE" value="','">');		
	?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive test</div>
<script>document.getElementById('info').style.display='none';</script>
<?php 
                        $url_up = $ACUPL_UPLOAD_SERVER;
                        $acupl_UID = GRC_0();
                        $acupl_UID1 = GRC();
                        $fpost = array(
			'MAX_FILE_SIZE' => $MAX_FILE_SIZE,
			'owner'         => '',
			'pin'           => '',
                        'base'          => 'shareflare',
                        'host'          => 'shareflare.net');
			$url=parse_url($url_up.'/marker='.$acupl_UID.'_'.$acupl_UID1.'');
		        $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),"http://shareflare.net/index.php", 0, $fpost, $lfile, $lname, "file0");                        
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
                        $Url = parse_url('http://shareflare.net/acupl_proxy.php?srv='.$url_up.'&uid='.$acupl_UID.'_'.$acupl_UID1.'');
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://shareflare.net/index.php", 0, 0, 0, $_GET["proxy"],$pauth);
			preg_match('%post_result": "(.*)", "now_time"%', $page, $result);
	                $link_result = $result[1];
                        $Url = parse_url($link_result);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://shareflare.net/index.php", 0, 0, 0, $_GET["proxy"],$pauth);
                        preg_match("%http://shareflare.net/download/(.*)%",$page, $dllink);
                        if (!$dllink[1]) html_error('Error getting return url');
                        preg_match("%http://shareflare.net/download/delete(.*)%",$page, $delink);
                        $download_link=$dllink[0];
                        $delete_link= $delink[0];                              		
	}
function GRC($length = 40, $letters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz')
  {
      $s = '';
      $lettersLength = strlen($letters)-1;
      for($i = 0 ; $i < $length ; $i++)
      {
      $s .= $letters[rand(0,$lettersLength)];
      }
      return $s;
  } 
function GRC_0($length = 11, $letters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ')
  {
      $s = '';
      $lettersLength = strlen($letters)-1;
      for($i = 0 ; $i < $length ; $i++)
      {
      $s .= $letters[rand(0,$lettersLength)];
      }
      return $s;
  } 
// written by VinhNhaTrang 09/11/2010
?>
<?php 
$upload_services[]="solidfiles.com";
$max_file_size["solidfiles.com"]=500; 
$page_upload["solidfiles.com"] = "solidfiles.com.php";
?>
<?php
	
	$domain = 'solidfiles.com';
	$url = 'https://www.solidfiles.com';
	echo "<center>Solidfiles.com plugin by <b>The Devil</b></center><br />\n";
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrieve Upload ID</div>\n";
	$page = cURL($url);
	$cookie = GetCookiesArr($page);
	$prep['name'] = $lname;
	$pay = json_encode($prep);
	$heads = array('X-Upload-Content-Length: '.getSize($lfile),
		'Content-Length: '.strlen($pay),
		'Content-Type: application/json');
	$opts[CURLOPT_HTTPHEADER] = $heads;
	$page = cURL('https://www.solidfiles.com/api/upload/nodes',$cookie,$pay,'https://www.solidfiles.com/',0,$opts);
	$devil = preg_match('@https?://www.solidfiles.com/[\d\w/?_=]+@',$page,$uplocs);
	if(!$devil==1){
		html_error('[1]Error: Unable to Retrieve Upload ID');
	}
	$url = parse_url($uplocs[0]);
	$srang = getSize($lfile);
	$gg = $srang-1;
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$pfile = putfile($url['host'],0,$url['path'].($url["query"] ? "?" . $url["query"] : ""),"https://www.solidfiles.com/\r\nContent-Range: bytes 0-$gg/$srang\r\nContent-Type: application/octet-stream",$cookie,$lfile,$lname,0,0,0,$url['scheme']);is_page($pfile);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>";
	$devil = jsonreply($pfile);
	(empty($devil['view_url'])) ? html_error('[1]Error: Cannot Find Download Link') : $download_link = $devil['view_url'];

	function jsonreply($resp){
		$tmp = stristr($resp,"{");
		(empty($tmp)) ? html_error('[0]Error: Cannot Find API Response') : '';
		$devil = json_decode($tmp,true);
		return $devil;
	}

// Written by The Devil	

?>
<?php
$upload_services[] = 'turbobit.net';
$max_file_size['turbobit.net'] = 2048;
$page_upload['turbobit.net'] = 'turbobit.net.php';  
?>
<?php
######## Account Info ########
$upload_acc['turbobit_net']['apikey'] = ''; //Set your apikey
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$continue_up = false;

if (!empty($upload_acc['turbobit_net']['apikey'])) {
	$default_acc = true;
	$_REQUEST['up_apikey'] = $upload_acc['turbobit_net']['apikey'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default ApiKey.</center></b>\n";
} else $default_acc = false;

if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up = true;
else {
	echo "<table border='0' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;API Key*</td><td>&nbsp;<input type='text' name='up_apikey' placeholder='Get it @ https://turbobit.net/user/settings' value='' style='width:250px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
}

if ($continue_up) {
	$login = $not_done = false;
	$domain = 'turbobit.net';
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('user_lang' => 'en');
	if (!empty($_REQUEST['up_apikey'])) {
		$page = geturl($domain, 443, '/v001/upload/http/server', 0, 0, array('api_key' => urlencode(trim($_REQUEST['up_apikey']))), 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
		$json = json2array($page, 'Login Error');

		if (empty($json['result'])) {
			if (!empty($json['message'])) html_error('[Login Error] ' . htmlspecialchars($json['message']));
			html_error('[Login Error] Unexpected Reply.');
		}

		$login = true;
	} else {
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		if ($fsize > 209715200) html_error('File is too big for anon upload (> 200 MiB)'); // 200 MiB
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	if ($login) {
		if (empty($json['url'])) html_error('Error: API Upload URL not found.');
		if (empty($json['params']) || !is_array($json['params'])) html_error('Error: API Upload params not found.');

		$up_url = $json['url'];
		$post = $json['params'];
	} else {
		$page = geturl($domain, 443, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);

		if (!preg_match('@https?://s\d+\.turbobit\.net/uploadfile@i', $page, $up_url)) html_error('Error: Upload URL not found.');

		$post = array();
		$post['Filename'] = $lname;
		$post['apptype'] = cut_str($page, 'name="apptype" value="', '"');
		$up_url = $up_url[0];
	}

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$json = json2array($upfiles);
	if ((empty($json['result']) || $json['result'] != 'true') || empty($json['id'])) html_error('Upload error: "'.htmlspecialchars($json['message']).'"');
	$id = is_array($json['id']) ? $json['id']['fid'] : $json['id'];

	if (!$login) {
		$page = geturl($domain, 443, '/newfile/gridFile/'.$id, $referer."newfile/edit/\r\nX-Requested-With: XMLHttpRequest", $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
		$json = json2array($page);
		$info = reset($json['rows']);
		if (!empty($info['cell'][7])) $delete_link = sprintf('%sdelete/file/%s/%s', $referer, $id, $info['cell'][7]);
	}

	$download_link = "$referer$id.html";
}

function json2array($content, $errorPrefix = 'Error') {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	if (empty($content)) html_error("[$errorPrefix]: No content.");
	$content = ltrim($content);
	if (($pos = strpos($content, "\r\n\r\n")) > 0) $content = trim(substr($content, $pos + 4));
	$cb_pos = strpos($content, '{');
	$sb_pos = strpos($content, '[');
	if ($cb_pos === false && $sb_pos === false) html_error("[$errorPrefix]: JSON start braces not found.");
	$sb = ($cb_pos === false || $sb_pos < $cb_pos) ? true : false;
	$content = substr($content, strpos($content, ($sb ? '[' : '{')));$content = substr($content, 0, strrpos($content, ($sb ? ']' : '}')) + 1);
	if (empty($content)) html_error("[$errorPrefix]: No JSON content.");
	$rply = json_decode($content, true);
	if ($rply === NULL) html_error("[$errorPrefix]: Error reading JSON.");
	return $rply;
}

//[11-1-2013] Written by Th3-822.
//[07-6-2013] Added login recaptcha support. - Th3-822
//[22-8-2013] Fixed for changes at upload page. - Th3-822
//[06-9-2013] Fixed get fileid. - Th3-822
//[12-2-2017] Removed CAPTCHA (Unsupported ATM) and Fixed Login (There were Huges Typos on It). - Th3-822
//[06-12-2020] Switched to API Upload instead of login. - Th3-822
<?php
$upload_services[] = 'tusfiles.net';
$max_file_size['tusfiles.net'] = false;
$page_upload['tusfiles.net'] = 'tusfiles.net.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 7); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'tusfiles.net'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 443; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php
$upload_services[] = 'tusfiles.net_member';
$max_file_size['tusfiles.net_member'] = 2048;
$page_upload['tusfiles.net_member'] = 'tusfiles.net_member.php';
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 3); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'www.tusfiles.net'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = true; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [22-1-2014]

?>
<?php 
$upload_services[] = "u.115.com";
$max_file_size["u.115.com"] = 1024;
$page_upload["u.115.com"] = "u.115.com.php";  
?>
<?php

####### Account Info. ###########
$u_115_login = ""; //Set you username
$u_115_pass = ""; //Set your password
##############################

$not_done=true;
$continue_up=false;
if ($u_115_login & $u_115_pass)
    {
        $_REQUEST['my_login'] = $u_115_login;
        $_REQUEST['my_pass'] = $u_115_pass;
        $_REQUEST['action'] = "FORM";
        echo "<b><center>Use Default login/pass.</center></b>\n";
    }

if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["u.115.com"]; ?></b></small></tr>
</table>
</form>
<?php
    }

if ($continue_up)
    {
        $not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id="login" width=100% align=center>Login to U.115.com</div>
<?php 
        $post['login[account]'] = $_REQUEST['my_login'];
        $post['login[passwd]'] = $_REQUEST['my_pass'];
        $post['back'] = "http://www.115.com";
        $post['goto'] = "http%3A%2F%2F115.com";

        $page = geturl("passport.115.com", 80, "/?action=login", 0, 0, $post);            
        is_page($page);
        $cookie1 = GetCookies($page);
        
      //  echo (" <div> Page : $page </div>");
        
        $errorcode =cut_str ($page , "name='error_code' value='","'");
      //  echo (" <div> errorcode : $errorcode </div>");
      
        if($errorcode)
        {
             html_error("Error logging in - are your logins correct!");
        } 
      
      //  $linkaction =cut_str ($page ,' Location: ','');
      //  echo (" <div> linkaction : $linkaction </div>");
      //  
      //  if(!$linkaction)
      //  {
      //       html_error("Error logging in - are your logins correct!");
      //  } 
      //  $Url = parse_url($linkaction);
      //  $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie1, 0, 0, $_GET["proxy"],$pauth);    
      //  is_page($page);
      //  $cookie = GetCookies($page);
?>
<script>document.getElementById('login').style.display='none';</script>
<div id="info" width=100% align="center">Retrive upload ID</div>

<?php 
        $Url = parse_url("http://115.com/");
        $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""),"http://www.115.com/", $cookie1, 0, 0, $_GET["proxy"],$pauth);    
        
        $cookie = GetCookies($page);
        
        $Upload_url=cut_str ($page ,'"aid":1,"upload_url":"','",');
        $Upload_url=str_replace('\/','/',$Upload_url);
        
       // echo (" <div> Upload_url : $Upload_url </div>");
        
        $cookie_up =cut_str ($page ,"var USER_COOKIE = '","';");
        
        if(!$Upload_url)
        {
            html_error($Upload_url);
        }
?>
<script>document.getElementById('info').style.display='none';</script>
<?php 
        $url = parse_url ($Upload_url); 
        //$url= parse_url("http://up.u.115.com/upload");
        $fpost = array();
        $fpost['Filename'] = $lname;
        $fpost['cookie'] = $cookie_up;
        $fpost['aid'] = '1';
        $agent='Shockwave Flash';
        $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),"http://u.115.com/?ct=index&ac=my", $cookie, $fpost, $lfile, $lname, "Filedata" );
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
        //,"pick_code":"e65lenbo","ico":"
        $pickcode =cut_str ($upfiles ,'"pick_code":"','","ico"');
        //echo (" <div> pickcode : $pickcode </div>");
        //echo (" <div> upfiles : $upfiles  </div>");
        if(!$pickcode)
        {
             html_error("Finished, Go to your account to see Download-URL.");
        }
        else
        {
            echo (" <div> Note: You required login before you can see it. </div>");
            $download_link = "http://u.115.com/file/$pickcode";
        }
        // echo (" <div> Mark </div>");
    }
?>
<?php
$upload_services[]="uafile.com";
$max_file_size["uafile.com"]=750;
$page_upload["uafile.com"] = "uafile.com.php";  
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php
      
      $post['name']=$lname;
      $post['submit']="Upload!";
      
      $upfiles=upfile("www.uafile.com",80, "/upload.php" ,"http://uafile.com/index.php", 0, $post, $lfile, $lname, "upfile");
   
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
		$tmp = cut_str($upfiles,'</center> <p><center> <a href="','"');
		$tmp2 =  cut_str($upfiles,'del=','"');
		if (empty($tmp)){
			print_r($upfiles);
			html_error("Error retrive download link!");
		}
	     $download_link=$tmp;
	     $delete_link = $tmp.'&amp;del='.$tmp2;
?>
<?php
$upload_services[] = 'up-4ever.com';
$max_file_size['up-4ever.com'] = 0; // Filesize limit (MB)
$page_upload['up-4ever.com'] = 'up-4ever.com.php';
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'www.up-4ever.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 443; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822

?>
<?php
$upload_services[] = 'upfile.mobi';
$max_file_size['upfile.mobi'] = 2048; // Filesize limit (MB)
$page_upload['upfile.mobi'] = 'upfile.mobi.php';
?>
<?php
######## Account Info ########
$upload_acc['upfile_mobi']['user'] = ''; //Set your username
$upload_acc['upfile_mobi']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$continue_up = false;

if ($upload_acc['upfile_mobi']['user'] && $upload_acc['upfile_mobi']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['upfile_mobi']['user'];
	$_REQUEST['up_pass'] = $upload_acc['upfile_mobi']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
	// Upload settings
	$_REQUEST['T8']['passw'] = '';
	$_REQUEST['T8']['descr'] = '';
} else $default_acc = false;

if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up = true;
else {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br />Upload options<br /><br /></td></tr>
	<tr><td style='white-space:nowrap;'>File Password:</td><td>&nbsp;<input type='text' name='T8[passw]' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>Description:</td><td>&nbsp;<input type='text' name='T8[descr]' value='Uploaded with Rapidleech.' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
}

if ($continue_up) {
	$not_done = false;
	$domain = 'upfile.mobi';
	$referer = "http://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to $domain</div>\n";

	$cookie = array('lang' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post['u'] = urlencode($_REQUEST['up_login']);
		$post['p'] = urlencode($_REQUEST['up_pass']);

		$page = geturl($domain, 80, '/index.php?page=login&start', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
		is_present($page, 'username or password is incorrect', 'Login Failed: User/Password incorrect.');
		$cookie = GetCookiesArr($page);
		if (empty($cookie['secret_code'])) html_error('Login Failed: Session cookie not found.');
		$cookie['lang'] = 'en';
		$login = true;
	} else {
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		$login = false;

		//if (!preg_match('@\.(png|jpe?g|gif|bmp|t(iff?|ga|cx)|avi|mp[2-4]|m4a|mk(a|v)|divx|wm(a|v)|mov|3gp|flv|rmvb|web(m|p)|ts|h264|aac|flac|ogg|wav|aiff?|amr)$@i', $lname)) html_error('Non members can only upload video, audio and pictures.');
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl($domain, 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	$cookie = GetCookiesArr($page, $cookie);

	if (!preg_match('@action="(https?://(?:[\w-]+\.)*upfile\.mobi(?::\d+)?/upload[^\'\"\s]+)"@i', $page, $upUrl)) html_error('Upload URL not found.');

	$_REQUEST['T8'] = array_map('trim', $_REQUEST['T8']);
	$post = array();
	$post['folder_id'] = 0;
	if (!empty($_REQUEST['T8']['passw'])) $post['pass'] = $_REQUEST['T8']['passw'];
	$post['info'] = !empty($_REQUEST['T8']['descr']) ? $_REQUEST['T8']['descr'] : 'Uploaded with Rapidleech.';
	$post['agree'] = 'yes';

	$up_url = $upUrl[1];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'file', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (preg_match('@\?page=upload_error&n=(\d+)@i', $upfiles, $err)) {
		switch ($err[1]) {
			case 2:
				$err = 'Filename is too long.';
				break;
			case 3:
				$err = '"Upload is temporarily disabled due to technical works"';
				break;
			case 7:
				$err = '"You need a verified account to upload archive"';
				break;
			case 8:
				$err = '"As a guest you can only upload video, audio and pictures"';
				break;
			default:
				$err = "*Unknown error: {$err[1]}*";
				break;
		}
		html_error('Upload Error: ' . htmlspecialchars($err));
	}

	if (!preg_match('@[\?&]id=([\w\-]+)@i', $upfiles, $fid)) html_error('Download link not Found.');
	$download_link = $referer.$fid[1];
	if (preg_match('@[\?&]password=([\dA-Fa-f]{32})@i', $upfiles, $fpsw)) $access_pass = $download_link.'.'.$fpsw[1]; // Testing this var.
	if (preg_match('@[\?&]code=(\w+)@i', $upfiles, $fdel)) $delete_link = $referer."?page=delete&f={$fid[1]}&s=".$fdel[1];
}

//[05-7-2013] Written by Th3-822.
//[26-1-2015] Fixed. - Th3-822
//[22-8-2016] Fixed Link Regexp. - Th3-822

?>
<?php
$upload_services[]="upload.com.ua";
$max_file_size["upload.com.ua"]=2000;
$page_upload["upload.com.ua"] = "upload.com.ua.php";  
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php            
            $page = geturl("upload.com.ua", 80, "/", "", 0, 0, 0, "");
            is_page($page);
            $cookie = GetCookies($page);
            $action_url = cut_str($page,'form-data" action="','"');
            if (empty($action_url)) html_error("Error retrive action url!");
            $url = parse_url($action_url);
            $post['UPLOAD_IDENTIFIER'] = cut_str($page,'DENTIFIER" type="hidden" value="','"');
            $post['description'] = $descript;
            $post['agreed'] = 1;
            $post['ispublic'] = 0;  // ôàéë â ïàáëèê, åñëè ïðèâàò - çàêîìåíòèðîâàòü
?>
<script>document.getElementById('info').style.display='none';</script>
    
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php         
        
        $upfiles=upfile($url['host'],defport($url),$url['path']."?".$url["query"], "http://upload.com.ua", $cookie, $post, $lfile, $lname, "file2upload0");

?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
		$download_link = trim(cut_str($upfiles,"ocation:","\n"));
		if (empty($download_link)){
			print_r($upfiles);
			html_error("Error retrive download link!");
		}
?>
<?php
$upload_services[] = 'uploaded.net_member';
$max_file_size['uploaded.net_member'] = 2000;
$page_upload['uploaded.net_member'] = 'uploaded.net_member.php';
?>
<?php
######## Account Info ########
$upload_acc['uploaded_net']['user'] = ''; //Set your userid/alias
$upload_acc['uploaded_net']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$continue_up = false;

if ($upload_acc['uploaded_net']['user'] && $upload_acc['uploaded_net']['pass']) {
	$_REQUEST['up_login'] = $upload_acc['uploaded_net']['user'];
	$_REQUEST['up_pass'] = $upload_acc['uploaded_net']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
}

if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up = true;
else {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;User*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
}

if ($continue_up) {
	$not_done = false;
	$referer = 'http://uploaded.net/';

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to uploaded.net</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) CookieLogin(urlencode($_REQUEST['up_login']), urlencode($_REQUEST['up_pass']));
	else html_error('Login Failed: Email or Password are empty. Please check login data.');

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl('uploaded.net', 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	$js = geturl('uploaded.net', 80, '/js/script.js', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($js);

	if (!preg_match('@uploadServer = [\'|\"](https?://([^\|\'|\"|\r|\n|\s|\t]+\.)uploaded\.net/)[\'|\"]@i', $js, $up)) {
		is_present($js, "uploadServer = '';" ,'Due to high load our capacities are currently in full usage. Please try again in a few minutes.');
		html_error('Error: Cannot find upload server.');
	}

	if (!preg_match('@id="user_id" value="(\d+)"@i', $page, $uid)) html_error('Error: UserID not found.');
	if (!preg_match('@id="user_pw" value="(\w+)"@i', $page, $spass)) html_error('Error: Password hash not found.'); // $spass = array(1 => sha1($_REQUEST['up_pass']));
	$adm_link = generate();

	$post = array();
	$post['Filename'] = $lname;
	$post['Upload'] = 'Submit Query';

	$up_url = $up[1]."upload?admincode=$adm_link&id={$uid[1]}&pw={$spass[1]}&folder=0";

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], 80, $url['path'].($url['query'] ? '?'.$url['query'] : ''), 0, 0, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 'Shockwave Flash');

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$content = substr($upfiles, strpos($upfiles, "\r\n\r\n") + 4);

	if (stripos($content, 'forbidden') === 0) html_error('File Forbidden (Blacklisted)');

	if (preg_match('@^(\w+)\,\d@i', $content, $fid)) {
		$download_link = 'http://uploaded.net/file/'.$fid[1]; // $download_link = 'http://ul.to/'.$fid[1];
	} else html_error('Download link not found.');

}

function generate($len = 6) {
	$pwd = '';
	$con = array('b','c','d','f','g','h','j','k','l','m','n','p','r','s','t','v','w','x','y','z');
	$voc = array('a','e','i','o','u');

	for($i = 0; $i < $len/2; $i++) {
		$c = mt_rand(0, 1000) % 20;
		$v = mt_rand(0, 1000) % 5;
		$pwd .= $con[$c] . $voc[$v];
	}

	return $pwd;
}

function Login($user, $pass) {
	global $cookie, $referer, $pauth;
	$post = array_map('urlencode', array('id' => $user, 'pw' => $pass));

	$x = 0;
	do {
		$page = geturl('uploaded.net', 80, '/io/login', $referer.($x > 0 ? 'io/login' : '')."\r\nX-Requested-With: XMLHttpRequest", $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);
		$x++;
	} while ($x < 6 && substr($page, 9, 3) == '302' && stripos($page, "\nLocation: /io/login") !== false);

	$body = trim(substr($page, strpos($page, "\r\n\r\n") + 4));
	is_present($body, 'No connection to database', 'Login failed: "No connection to database".');
	if (preg_match('@\{\"err\":\"([^\"]+)\"@i', $body, $err)) html_error('Login Error: "'.html_entity_decode(stripslashes($err[1])).'".');
	if (empty($cookie['login'])) {
		if ($body == '') html_error('The host didn\'t replied the login request, wait 15-30 seconds and try again.');
		html_error('Login Error: Cannot find "login" cookie.');
	}

	SaveCookies($user, $pass); // Update cookies file
}

function IWillNameItLater($cookie, $decrypt=true) {
	if (!is_array($cookie)) {
		if (!empty($cookie)) return $decrypt ? decrypt(urldecode($cookie)) : urlencode(encrypt($cookie));
		return '';
	}
	if (count($cookie) < 1) return $cookie;
	$keys = array_keys($cookie);
	$values = array_values($cookie);
	$keys = $decrypt ? array_map('decrypt', array_map('urldecode', $keys)) : array_map('urlencode', array_map('encrypt', $keys));
	$values = $decrypt ? array_map('decrypt', array_map('urldecode', $values)) : array_map('urlencode', array_map('encrypt', $values));
	return array_combine($keys, $values);
}

function CookieLogin($user, $pass) {
	global $secretkey, $cookie, $referer, $pauth;
	if (empty($user) || empty($pass)) html_error('Login Failed: User or Password is empty.');
	$user = strtolower($user);

	if (!defined('DOWNLOAD_DIR')) {
		global $options;
		if (substr($options['download_dir'], -1) != '/') $options['download_dir'] .= '/';
		define('DOWNLOAD_DIR', (substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']));
	}
	$filename = DOWNLOAD_DIR . basename('uploaded_ul.php');
	if (!file_exists($filename) || filesize($filename) <= 6) return Login($user, $pass);

	$file = file($filename);
	$savedcookies = unserialize($file[1]);
	unset($file);

	$hash = hash('crc32b', $user.':'.$pass);
	if (is_array($savedcookies) && array_key_exists($hash, $savedcookies)) {
		$_secretkey = $secretkey;
		$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
		$testCookie = (decrypt(urldecode($savedcookies[$hash]['enc'])) == 'OK') ? IWillNameItLater($savedcookies[$hash]['cookie']) : '';
		$secretkey = $_secretkey;
		if (empty($testCookie) || (is_array($testCookie) && count($testCookie) < 1)) return Login($user, $pass);

		$x = 0;
		do {
			$page = geturl('uploaded.net', 80, '/me', $referer.($x > 0 ? 'me' : ''), $testCookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
			$testCookie = GetCookiesArr($page, $testCookie);
			$x++;
		} while ($x < 6 && substr($page, 9, 3) == '302' && stripos($page, "\nLocation: /me") !== false);

		if (substr($page, 9, 3) != '200') return Login($user, $pass);
		$cookie = $testCookie; // Update cookies
		SaveCookies($user, $pass); // Update cookies file
		return;
	}
	return Login($user, $pass);
}

function SaveCookies($user, $pass) {
	global $secretkey, $cookie;
	$maxdays = 30; // Max days to keep cookies for more than 1 user.
	$filename = DOWNLOAD_DIR . basename('uploaded_ul.php');
	if (file_exists($filename) && filesize($filename) > 6) {
		$file = file($filename);
		$savedcookies = unserialize($file[1]);
		unset($file);

		// Remove old cookies
		if (is_array($savedcookies)) {
			foreach ($savedcookies as $k => $v) if (time() - $v['time'] >= ($maxdays * 24 * 60 * 60)) unset($savedcookies[$k]);
		} else $savedcookies = array();
	} else $savedcookies = array();
	$hash = hash('crc32b', $user.':'.$pass);
	$_secretkey = $secretkey;
	$secretkey = hash('crc32b', $pass).sha1($user.':'.$pass).hash('crc32b', $user); // A 56 char key should be safer. :D
	$savedcookies[$hash] = array('time' => time(), 'enc' => urlencode(encrypt('OK')), 'cookie' => IWillNameItLater($cookie, false));
	$secretkey = $_secretkey;

	file_put_contents($filename, "<?php exit(); ?>\r\n" . serialize($savedcookies), LOCK_EX);
}

//[26-8-2012] Written by Th3-822.
//[02-10-2012] Fixed link regexp. - Th3-822
//[13-5-2013] Added "CookieLogin" for saving user cookies. (ul.to is blocking login requests after 5-6 logins) - Th3-822
//[06-12-2015] Added support for redirects blocking site access. #6DCambiemosVzla - Th3-822

?>
<?php
$upload_services[] = 'uploading.com_member';
$max_file_size['uploading.com_member'] = 2000;
$page_upload['uploading.com_member'] = 'uploading.com_member.php';
?>
<?php
######## Account Info ########
$upload_acc['uploading_com']['user'] = ''; //Set your email
$upload_acc['uploading_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$continue_up = false;

if ($upload_acc['uploading_com']['user'] && $upload_acc['uploading_com']['pass']) {
	$default_acc = true;
	$_REQUEST['up_login'] = $upload_acc['uploading_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['uploading_com']['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
} else $default_acc = false;

if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up = true;
else {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;Email*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</table>\n</form>\n";
}

if ($continue_up) {
	$not_done = false;
	$referer = 'http://uploading.com/';
	$captcha = (isset($_REQUEST['step']) && $_REQUEST['step'] == 'captcha') ? true : false;

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to uploading.com</div>\n";

	$cookie = array();
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		if (!empty($_REQUEST['A_encrypted'])) {
			$_REQUEST['up_login'] = decrypt(urldecode($_REQUEST['up_login']));
			$_REQUEST['up_pass'] = decrypt(urldecode($_REQUEST['up_pass']));
			unset($_REQUEST['A_encrypted']);
		}
		if ($captcha && empty($_POST['recaptcha_response_field'])) html_error("You didn't enter the image verification code.");
		$page = geturl('uploading.com', 80, '/', '', $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['SID'])) html_error('Login Error: SID cookie not found.');

		$post = array();
		$post['email'] = urlencode($_REQUEST['up_login']);
		$post['password'] = urlencode($_REQUEST['up_pass']);
		$post['remember'] = 'on';
		if ($captcha) {
			$post['recaptcha_challenge_field'] = $_POST['recaptcha_challenge_field'];
			$post['recaptcha_response_field'] = $_POST['recaptcha_response_field'];
		}
		//$post['back_url'] = 'http://uploading.com/';

		$ajax_req = geturl('uploading.com', 80, '/general/login_form/?ajax', $referer."\r\nX-Requested-With: XMLHttpRequest", $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($ajax_req);
		$json = Get_Reply($ajax_req);
		if (!empty($json['error'])) html_error('Login Error... MSG: ' . $json['error']);
		if (!empty($json['answer']) && isset($json['answer']['captcha']) && $json['answer']['captcha'] == true) {
			if (!preg_match('@build_recaptcha\s*\([^,|\)]+,\s*[\'|\"](\w+)[\'|\"]\s*\)@i', $page, $pid)) html_error('Error: Login captcha data not found.');
			$data = array('action' => 'FORM', 'step' => 'captcha');
			if (!$default_acc) {
				$data['A_encrypted'] = 'true';
				$data['up_login'] = urlencode(encrypt($user)); // encrypt() will keep this safe.
				$data['up_pass'] = urlencode(encrypt($pass)); // And this too.
			}
			reCAPTCHA($pid[1], $data);
			exit;
		}
		$cookie = GetCookiesArr($ajax_req, $cookie);
		// if (empty($cookie['SID'])) html_error('Login Error: SID cookie not found.');
		if (empty($cookie['u']) || empty($cookie['remembered_user'])) html_error('Login Error: Login cookies not found.'); // Yes.... u=1 is needed. :D
	} else html_error("Login Failed: Email or Password are empty. Please check login data.");

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl('uploading.com', 80, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	if (!preg_match('@upload_url[\s|\t]*:[\s|\t|\r|\n]*[\'|\"](https?://([^\|\'|\"|\r|\n|\s|\t]+\.)?uploading\.com/[^\'|\"|\r|\n|\s|\t]+)@i', $page, $up)) html_error('Error: Cannot find upload server.');

	$post = array('name' => urlencode($lname), 'size' => getSize($lfile));
	$page = geturl('uploading.com', 80, '/files/generate/?ajax', $referer."\r\nX-Requested-With: XMLHttpRequest", $cookie, $post, 0, $_GET['proxy'], $pauth);is_page($page);
	$json = Get_Reply($page);
	if (empty($json['file']['file_id'])) html_error('Upload id not found.');
	if (empty($json['file']['link'])) html_error('Download link not found. Upload aborted.');

	$post = array();
	$post['Filename'] = $lname;
	$post['folder_id'] = 0;
	$post['file'] = $json['file']['file_id'];
	$post['SID'] = $cookie['SID'];
	$post['Upload'] = 'Submit Query';

	$up_url = $up[1];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], 80, $url['path'].($url['query'] ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'file', '', $_GET['proxy'], $pauth, 'Shockwave Flash');

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	$download_link = $json['file']['link'];
}

function Get_Reply($page) {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	$json = substr($page, strpos($page, "\r\n\r\n") + 4);
	$json = substr($json, strpos($json, '{'));$json = substr($json, 0, strrpos($json, '}') + 1);
	$rply = json_decode($json, true);
	if (!$rply || (is_array($rply) && count($rply) == 0)) html_error('Error getting json data.');
	return $rply;
}

// Edited For upload.php usage.
function EnterCaptcha($captchaImg, $inputs, $captchaSize = '5', $sname = 'Enter Captcha', $iname = 'captcha') {
	echo "\n<form name='captcha' method='POST'>\n";
	foreach ($inputs as $name => $input) echo "\t<input type='hidden' name='$name' id='$name' value='$input' />\n";
	echo "\t<h4>" . lang(301) . " <img alt='CAPTCHA Image' src='$captchaImg' /> " . lang(302) . ": <input type='text' id='captcha' name='$iname' size='$captchaSize' />&nbsp;&nbsp;\n\t\t<input type='submit' onclick='return check();' value='$sname' />\n\t</h4>\n\t<script type='text/javascript'>/* <![CDATA[ */\n\t\tfunction check() {\n\t\t\tvar captcha=document.getElementById('captcha').value;\n\t\t\tif (captcha == '') {\n\t\t\t\twindow.alert('You didn\'t enter the image verification code');\n\t\t\t\treturn false;\n\t\t\t} else return true;\n\t\t}\n\t/* ]]> */</script>\n</form>\n</body>\n</html>";
}

// Edited For upload.php usage.
function reCAPTCHA($publicKey, $inputs, $sname = 'Upload File') {
	global $cookie, $domain, $referer, $pauth;
	if (empty($publicKey) || preg_match('/[^\w\.\-]/', $publicKey)) html_error('Invalid reCAPTCHA public key.');
	if (!is_array($inputs)) html_error('Error parsing captcha post data.');
	// Check for a global recaptcha key
	$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, 'http://fakedomain.tld/fakepath', 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
	if (substr($page, 9, 3) != '200') html_error('Invalid or deleted reCAPTCHA public key.');

	if (strpos($page, 'Invalid referer') === false) {
		// Embed captcha
		echo "<script language='JavaScript'>var RecaptchaOptions = {theme:'red', lang:'en'};</script>\n\n<center><form name='recaptcha' method='POST'><br />\n";
		foreach ($inputs as $name => $input) echo "<input type='hidden' name='$name' id='C_$name' value='$input' />\n";
		echo "<script type='text/javascript' src='//www.google.com/recaptcha/api/challenge?k=$publicKey'></script><noscript><iframe src='//www.google.com/recaptcha/api/noscript?k=$publicKey' height='300' width='500' frameborder='0'></iframe><br /><textarea name='recaptcha_challenge_field' rows='3' cols='40'></textarea><input type='hidden' name='recaptcha_response_field' value='manual_challenge' /></noscript><br /><input type='submit' name='submit' onclick='javascript:return checkc();' value='$sname' />\n<script type='text/javascript'>/*<![CDATA[*/\nfunction checkc(){\nvar capt=document.getElementById('recaptcha_response_field');\nif (capt.value == '') { window.alert('You didn\'t enter the image verification code.'); return false; }\nelse { return true; }\n}\n/*]]>*/</script>\n</form></center>\n</body>\n</html>";
	} else {
		// Download captcha
		$page = geturl('www.google.com', 0, '/recaptcha/api/challenge?k=' . $publicKey, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($page);
		if (!preg_match('@[\{,\s]challenge\s*:\s*[\'\"]([\w\-]+)[\'\"]@', $page, $challenge)) html_error('Error getting reCAPTCHA challenge.');
		$inputs['recaptcha_challenge_field'] = $challenge = $challenge[1];

		$imgReq = geturl('www.google.com', 0, '/recaptcha/api/image?c=' . $challenge, $referer, 0, 0, 0, $_GET['proxy'], $pauth);is_page($imgReq);
		list($headers, $imgBody) = explode("\r\n\r\n", $imgReq, 2);
		unset($imgReq);
		if (substr($headers, 9, 3) != '200') html_error('Error downloading captcha img.');
		$mimetype = (preg_match('@image/[\w+]+@', $headers, $mimetype) ? $mimetype[0] : 'image/jpeg');

		EnterCaptcha("data:$mimetype;base64,".base64_encode($imgBody), $inputs, 20, $sname, 'recaptcha_response_field');
	}
	exit;
}

//[14-7-2012] Written by Th3-822.

?>
<?php
$upload_services[]="uploadjockey.com";
$max_file_size["uploadjockey.com"]=1000;
$page_upload["uploadjockey.com"] = "uploadjockey.com.php";  
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
	
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
			$ref='http://uploadjockey.com/';
			$rand = mt_rand(1000000000000, 1999999999999);
			$page = geturl("www.uploadjockey.com", 80, "/", "", 0, 0, 0, "");
			preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
			$cookie = $temp[1];
			$cookies = implode(';',$cookie);

			$page2 = geturl("uploadjockey.com", 80, "/uj_link_upload.php?_=$rand", "", 0, 0, 0, "");
			$uid=cut_str($page2,'UberUpload.startUpload("','"');

			$url = parse_url("http://uploadjockey.com/cgi-bin/uj_upload.pl?upload_id=$uid");


?>
<script>document.getElementById('info').style.display='none';</script>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php

			$post["megaupload"]="on";
			$post["uploading"]="on";
			$post["depositfiles"]="on";
			$post["terms"]="1";
			$upfiles = upfile($url["host"], defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""), $ref, $cookies, $post, $lfile, $lname, "upfile_".microtime(true));

?>
<script>document.getElementById('progressblock').style.display='none';</script>
<div id=final width=100% align=center>Get final code</div>
<?php		

			is_page($upfiles);
			$locat=trim(cut_str($upfiles,'Location:',"\n"));
			$LOCAT="http://".cut_str($locat,'http://','&');
			
			$Url = parse_url($LOCAT);
			$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $ref, $cookies, 0, 0, $_GET["proxy"],$pauth);

			$ddl=cut_str($page,'http://www.uploadjockey.com/download/','"');
						
			$download_link="http://www.uploadjockey.com/download/".$ddl;
			

// Made by Baking 13/09/2009 23:39
?>
<?php
$upload_services[] = 'uploadkadeh.com_member';
$max_file_size['uploadkadeh.com_member'] = 2048;
$page_upload['uploadkadeh.com_member'] = 'uploadkadeh.com_member.php';
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'uploadkadeh.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 443; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822
<?php
$upload_services[] = 'uploadocean.com';
$max_file_size['uploadocean.com'] = 4096;
$page_upload['uploadocean.com'] = 'uploadocean.com.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'uploadocean.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 4096; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 443; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = true; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

//[22-03-2017] Written by The Devil

?>
<?php
$upload_services[] = 'uploadrocket.net';
$max_file_size['uploadrocket.net'] = 6144; // Filesize limit (MB)
$page_upload['uploadrocket.net'] = 'uploadrocket.net.php';
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'uploadrocket.net'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 2000; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php 
$upload_services[] = "uploadstube.de";
$max_file_size["uploadstube.de"] = 250;
$page_upload["uploadstube.de"] = "uploadstube.de.php";
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php 
			/*$page = geturl("netload.in", 80, "/", "", 0, 0, 0, "");
			is_page($page);
			preg_match('/form.*(index\.php\?id=.*?")/i', $page, $uplink);*/
			$action_url = 'http://www.uploadstube.de/upload.php';
			$url = parse_url($action_url);
			$post['typ'] = 'file';
?>
<script>document.getElementById('info').style.display='none';</script>

<table width=600 align=center>
</td></tr>
<tr><td align=center>
<?php 
            $upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),'http://www.uploadstube.de/', 0, $post, $lfile, $lname, "upfile[]");
			is_page($upfiles);
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php 
			preg_match('%http://www\.uploadstube\.de/download\.php\?file=\d+%i', $upfiles, $dllink);
			preg_match('%http://www\.uploadstube\.de/download\.php\?file=\d+&del=\d+%', $upfiles, $dlink);
			$download_link = $dllink[0];
			$delete_link = $dlink[0];	
?>
<?php
$upload_services[] = 'uplod.it';
$max_file_size['uplod.it'] = false;
$page_upload['uplod.it'] = 'uplod.it.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 7); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'uplod.it'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 443; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php 
$upload_services[] = 'uptobox.com';
$max_file_size['uptobox.com'] = 51200;
$page_upload['uptobox.com'] = 'uptobox.com.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'uptobox.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 1024; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 443; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)
	$_T8['fw_sendLogin'] = 'SendLogin'; // Callable function

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

function SendLogin($post) {
	global $_T8, $cookie, $pauth;
	$page = geturl('uptobox.com', 443, '/?op=login&referer=homepage', 'https://uptobox.com/?op=login&referer=homepage', $cookie, $post, 0, 0, 0, 0, 'https'); // geturl doesn't support https proxy
	is_page($page);
	is_present($page, 'You are trying to log in from a different country', 'Login Failed: Login Blocked By IP, Check Account Email And Follow The Steps To Add IP to Whitelist.');
	return $page;
}

//if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
//require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Quick and dirty modified GenericXFSHost for quick upload fix:
/* # Default Settings # */
$default = array();
$default['port'] = 80; // Server's port, default: 80 | 443 = https.
$default['path'] = '/'; // URL path to XFS script, default: '/'
$default['xfsFree'] = false; // Change to true if the host is using XFS free.
$default['sslLogin'] = false; // Force https on login.
$default['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
$default['anonUploadDisable'] = false; // Disallow non registered users upload. (XFS Pro)
$default['anonUploadLimit'] = 0; // File-size limit for non registered users (MB) - 0 = Plugin's limit | (XFS Pro)
$default['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$_T8 = array_merge($default, array_filter($_T8)); // Merge default settings with loader's settings

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$pauth = !empty($pauth) ? $pauth : false;
$not_done = true;

if (!$_T8['xfsFree'] && !empty($upload_acc[$acc_key_name]['user']) && !empty($upload_acc[$acc_key_name]['pass'])) {
	$_REQUEST['up_login'] = $upload_acc[$acc_key_name]['user'];
	$_REQUEST['up_pass'] = $upload_acc[$acc_key_name]['pass'];
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
}

if (!$_T8['xfsFree'] && (empty($_REQUEST['action']) || $_REQUEST['action'] != 'FORM')) {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>\n<form method='POST'>\n\t<input type='hidden' name='action' value='FORM' />\n\t<tr><td style='white-space:nowrap;'>&nbsp;Username*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>\n\t<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "\t<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".$page_upload[$_REQUEST['uploaded']]."</b></small></td></tr>\n";
	echo "</form>\n</table>\n";
} else {
	$not_done = false;
	if (substr($_T8['path'], 0, 1) != '/') $_T8['path'] = '/'.$_T8['path'];
	if (substr($_T8['path'], -1) != '/') $_T8['path'] .= '/';
	$_T8['port'] = (!empty($_T8['port']) && $_T8['port'] > 0 && $_T8['port'] < 65536) ? (int)$_T8['port'] : 80;
	$scheme = ($_T8['port'] == 443) ? 'https' : 'http';
	$referer = $scheme.'://'.$_T8['domain'].$_T8['path'];

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to ".str_ireplace('www.', '', $_T8['domain'])."</div>\n";

	$cookie = (!empty($cookie)) ? (is_array($cookie) ? $cookie : StrToCookies($cookie)) : array();
	$cookie['lang'] = 'english';
	if ($_T8['xfsFree']) $login = false;
	elseif (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post['op'] = 'login';
		$post['redirect'] = '';
		$post['login'] = urlencode($_REQUEST['up_login']);
		$post['password'] = urlencode($_REQUEST['up_pass']);

		if (empty($_T8['fw_sendLogin']) || !is_callable($_T8['fw_sendLogin'])) {
			$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op=login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, ($_T8['sslLogin'] ? 'https' : $scheme));is_page($page);
		} else $page = call_user_func($_T8['fw_sendLogin'], $post);
		$header = substr($page, 0, strpos($page, "\r\n\r\n"));
		if (stripos($header, "\nLocation: ") !== false && preg_match('@\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($_T8['domain']) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$_T8['domain'] to 'www.{$_T8['domain']}'.");
		if (preg_match('@Incorrect ((Username)|(Login)) or Password@i', $page)) html_error('Login failed: User/Password incorrect.');
		is_present($page, 'op=resend_activation', 'Login failed: Your account isn\'t confirmed yet.');
		is_present($page, 'Please%20enter%20your%20e-mail', "Login failed: Missing account's email, login at site and set the email.");
		$cookie = GetCookiesArr($header, $cookie);
		if (empty($cookie['xfss']) && empty($cookie['login'])) html_error('Error: Login cookies not found.');
		$cookie['lang'] = 'english';
		$login = true;
	} else {
		if ($_T8['anonUploadDisable']) html_error('Login failed: User/Password empty.');
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		if ($_T8['anonUploadLimit'] > 0 && $fsize > $_T8['anonUploadLimit']*1024*1024) html_error('File is too big for anon upload');
		$login = false;
	}

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'].'?op='.(empty($_T8['opUploadName']) ? 'upload' : $_T8['opUploadName']), $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
	if (substr($page, 9, 3) != '200') {
		$page = geturl($_T8['domain'], $_T8['port'], $_T8['path'], $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, $scheme);is_page($page);
	}
	$header = substr($page, 0, strpos($page, "\r\n\r\n"));
	if (!$login && stripos($header, "\nLocation: ") !== false && preg_match('@\nLocation: (https?://[^\r\n]+)@i', $header, $redir) && 'www.' . strtolower($_T8['domain']) == strtolower(parse_url($redir[1], PHP_URL_HOST))) html_error("Please set \$_T8['domain'] to 'www.{$_T8['domain']}'.");

	if (!preg_match('@action=["\'](https?://www\d+\.uptobox\.com/upload\?(?:\w+=\w+&)*sess_id=)@i', $page, $up_url)) html_error('Upload Server Not Found.');
	$up_url = $up_url[1];
	if ($login) $up_url .= $cookie['xfss'];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), 0, $cookie, array(), $lfile, $lname,
	'files[]', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (($pos = strpos($upfiles, "\r\n\r\n")) > 0) $reply = trim(substr($upfiles, $pos + 4));
	$reply = json_decode(trim($reply), true);

	if (empty($reply['files'][0]['url'])) html_error('Download Link Not Found.');
	$download_link = $reply['files'][0]['url'];
	if (!empty($reply['files'][0]['deleteUrl'])) $delete_link = $reply['files'][0]['deleteUrl'];
}

// Written by Th3-822
<?php
$upload_services[]="uptotal.com";
$max_file_size["uptotal.com"]=1500;
$page_upload["uptotal.com"] = "uptotal.com.php";  
?>
<?php
$ref='http://uptotal.com';
$rand = mt_rand(1000000000000, 1999999999999);
$page = geturl("uptotal.com", 80, "/", "", 0, 0, 0, "");

$upload_form = cut_str($page, 'enctype="multipart/form-data" action="', '"');
$uploaded = cut_str($page, 'enctype="multipart/form-data" action="http://uptotal.com/enviar.php', '"');
echo $upload_form;
if (!$url = parse_url($upload_form)) html_error('Error getting upload url');
$fpost["loadto"] = "on";
$fpost["megaupload"] = "on";
$fpost["easyshare"] = "on";
$fpost["depositfiles"] = "on";
$fpost["zshare"] = "on";
$fpost["hotfile"] = "on";
$fpost["fileserve"] = "on";
$fpost["sendspace"] = "on";
$fpost["filesonic"] = "on";
$fpost["uploaded"] = "on";
$fpost["uploading"] = "on";
$fpost["mediafire"] = "on";
$fpost["freakshare"] = "on";
$fpost["2shared"] = "on";
$fpost["turbobit"] = "on";
$fpost["bitshare"] = "on";
$fpost['x7to'] = "on";
$fpost["upload_button"] = "Upload";

$url=parse_url($ref.'/enviar.php');
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<script>document.getElementById('info').style.display='none';</script>
<?php	

		$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), $ref, 0, $fpost, $lfile, $lname, "file");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
		//$uploaded = cut_str($upfiles, 'moved <a href="', '"');
		//$uploaded2 = cut_str($upfiles, 'moved <a href="http://www.multi-load.com/process.php?', '"');
		//preg_match('/Location:http://www.multi-load.com/process.php (.*)\r\n/i', $page, $infos);
		//$dlink = $infos[1];
		$page = $upfiles;
		//echo $uploaded2;
		//echo $upfiles;

		$endlink = cut_str($page,'Seu Link de Download: <a href="','">');
		$download_link = $ref."/".$endlink;
// Made by Baking 14/05/2009
?>
<?php
$upload_services[]="uptotal.com_member";
$max_file_size["uptotal.com_member"]=999;
$page_upload["uptotal.com_member"] = "uptotal.com_member.php";  
?>
<?php

$uptotal_login = "";
$uptotal_pass = "";

$not_done=true;
$continue_up=false;
if ($uptotal_login & $uptotal_pass){
	$_REQUEST['my_login'] = $uptotal_login;
	$_REQUEST['my_pass'] = $uptotal_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Login*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["uptotal.com"]; ?></b></small></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;

$Url=parse_url('http://uptotal.com/login.php?do=logar');

$post["submit_login"]="1";
$post["user_login"]=$_REQUEST['my_login'];
$post["user_pass"]=$_REQUEST['my_pass'];
$post["wp-submit"]="1";


$page = geturl("uptotal.com", 80, "/login.php?do=logar", 0, 0, $post, 0, $_GET["proxy"], $pauth);
$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), "http://uptotal.com/", 0, $post, 0, $_GET["proxy"],$pauth);

$cook = GetCookies($page,true);

			


if (!empty($cook))
{
$ref='http://uptotal.com';
$rand = mt_rand(1000000000000, 1999999999999);
$page = geturl("uptotal.com", 80, "/", "", 0, 0, 0, "");

$upload_form = cut_str($page, 'enctype="multipart/form-data" action="', '"');
$uploaded = cut_str($page, 'enctype="multipart/form-data" action="http://uptotal.com/enviar.php', '"');
echo $upload_form;
if (!$url = parse_url($upload_form)) html_error('Error getting upload url');
			$fpost["turbobit"] = "on";
			$fpost["megaupload"] = "on";
			$fpost["depositfiles"] = "on";
			$fpost["2shared"] = "on";
			$fpost["filesonic"] = "on";
			$fpost["hotfile"] = "on";
			$fpost["loadto"] = "on";
			$fpost["duckload"] = "on";
						
			$fpost["badongo"] = "on";
			$fpost["easyshare"] = "on";
			$fpost["zshare"] = "on";
			$fpost["putlocker"] = "on";
			$fpost["sendspace"] = "on";
			$fpost["filebeam"] = "on";
			$fpost["uploadedto"] = "on";
			$fpost["bitshare"] = "on";
			$fpost["uploadstation"] = "on";				
			$fpost["hostingbulk"] = "on";
			$fpost["fileserve"] = "on";
			$fpost["x7to"] = "on";
			$fpost["uploadbox"] = "on";
			$fpost["freakshare"] = "on";
			$fpost["mediafire"] = "on";
			$fpost["extabit"] = "on";
			$fpost["rapidleech"] = "on";
$fpost["upload_button"] = "Upload";

$url=parse_url($ref.'/enviar.php');
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<script>document.getElementById('info').style.display='none';</script>
<?php	

		$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), $ref, $cook, $fpost, $lfile, $lname, "file");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
		//$uploaded = cut_str($upfiles, 'moved <a href="', '"');
		//$uploaded2 = cut_str($upfiles, 'moved <a href="http://www.com/process.php?', '"');
		//preg_match('/Location:http://www.com/process.php (.*)\r\n/i', $page, $infos);
		//$dlink = $infos[1];
		$page = $upfiles;
		//echo $uploaded2;
		//echo $upfiles;

		$endlink = cut_str($page,'Seu Link de Download: <a href="','">');
		$download_link = $ref."/".$endlink;
// Made by Rudny 11/05/2011
} else { echo "erro no sistema"; }}
?>
<?php
$upload_services[] = 'upvast.com';
$max_file_size['upvast.com'] = 5072;
$page_upload['upvast.com'] = 'upvast.com.php';  
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 9); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'upvast.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 200; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://rapidleech.com/forum/viewtopic.php?f=17&t=80 or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [29-10-2015]

?>
<?php
$upload_services[] = 'userscloud.com';
$max_file_size['userscloud.com'] = 2048;
$page_upload['userscloud.com'] = 'userscloud.com.php';
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 3); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'userscloud.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [22-1-2014]

?>
<?php
$upload_services[] = 'usersfiles.com';
$max_file_size['usersfiles.com'] = 2048;
$page_upload['usersfiles.com'] = 'usersfiles.com.php';
?>
<?php

if (!defined('RAPIDLEECH')) exit;
$_T8 = array('v' => 3); // Version of this config file. (Do Not Edit)

/* # Plugin's Settings # */
$_T8['domain'] = 'usersfiles.com'; // May require the www. (Check first if the site adds the www.).
$_T8['anonUploadDisable'] = false; // Disallow non-registered users upload. (XFS Pro)
$_T8['anonUploadLimit'] = 0; // File-size limit for non-registered users (MB) | 0 = Plugin's limit | (XFS Pro)

// Advanced Settings (Don't edit it unless you know what are you doing)
	$_T8['port'] = 80; // Server's port, default: 80 | 443 = https.
	$_T8['xfsFree'] = false; // Change to true if the host is using XFS free.
	$_T8['path'] = '/'; // URL path to XFS script, default: '/'
	$_T8['sslLogin'] = false; // Force https on login.
	$_T8['opUploadName'] = 'upload'; // Custom ?op=value for checking upload page, default: 'upload'
	$_T8['flashUpload'] = false; // Forces the use of flash upload method... Also filename for .cgi if it's a non empty string. (XFS Pro)

$acc_key_name = str_ireplace(array('www.', '.'), array('', '_'), $_T8['domain']); // (Do Not Edit)

/* # Account Info # */
$upload_acc[$acc_key_name]['user'] = ''; //Set your login
$upload_acc[$acc_key_name]['pass'] = ''; //Set your password

if (!file_exists(HOST_DIR . 'upload/GenericXFSHost.inc.php')) html_error('Cannot load "'.htmlentities(HOST_DIR).'upload/GenericXFSHost.inc.php" (File doesn\'t exists), please install lastest version from: http://www.rapidleech.com/index.php/topic/14014-upload-plugin-for-sites-with-xfs-pro/ or http://pastebin.com/E0z7qMU1 ');
require(HOST_DIR . 'upload/GenericXFSHost.inc.php');

// Written by Th3-822 - Last Update: [22-1-2014]

?>
<?php
$upload_services[] = 'vid.me';
$max_file_size['vid.me'] = 1024; //No idea what the limit is
$page_upload['vid.me'] = 'vid.me.php';
?>
<?php
	
	echo "<center>Vid.me plugin by <b>The Devil</b></center><br />\n";
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";
	$domain = 'vid.me';
	$post['title'] = $lname;
	$post['description'] =  'Uploaded with Rapidleech';
	$post['PLATFORM'] = 'web';
	$post['source'] = 'computer';
	$post['mode'] = 'chunked';
	$post['filename'] = $lname;
	$post['size'] = getSize($lfile);
	$post['public'] = '0';
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
	$upfile = upfile($domain,0,'/api/video/request',0,0,$post,$lfile,$lname,'filedata','',0,0,0,'https');is_page($upfile);
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";
	$block = strstr($upfile,'{');
	$devil = json_decode($block,true);
	$download_link = $devil['url'];


	//Written by The Devil
?>
<?php 
$upload_services[]="videobb.com";
$max_file_size["videobb.com"]=2048;
$page_upload["videobb.com"] = "videobb.com.php";  
?>
<?php
####### Account Info. ###########
$videobb_login = '';
$videobb_pass = '';
##############################

				$not_done=true;
				$continue_up=false;
				if ($videobb_login && $videobb_pass){
					$_REQUEST['my_login'] = $videobb_login;
					$_REQUEST['my_pass'] = $videobb_pass;
					$_REQUEST['action'] = "FORM";
					echo "<b><center>Use Default login/pass.</center></b>\n";
				}
				if ($_REQUEST['action'] == "FORM")
					$continue_up=true;
				else{
?>
					<script>document.getElementById('info').style.display='none';</script>
            <div id='info' width='100%' align='center' style="font-weight:bold; font-size:16px">LOGIN</div>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;User*<td>&nbsp;<input type=text name=my_login style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
						<script>document.getElementById('info').style.display='none';</script>
						<div id=login width=100% align=center>Login to Videobb.com</div>
<?php 
				$ext = extensao($lname);
				if (!empty($_REQUEST['my_login']) && !empty($_REQUEST['my_pass'])) {
				if($ext == 'avi' || $ext == 'divx' || $ext == '3gp' || $ext == 'mov' ||  $ext == 'mpeg' ||  $ext == 'mpg' ||  $ext == 'xvid' ||  $ext == 'flv' ||  $ext == 'asf' ||  $ext == 'dat' ||  $ext == 'mp4' ||  $ext == 'mkv' || $ext == 'f4v' || $ext == 'm4v' || $ext == 'rm' || $ext == 'wmv'){
                $rnd = time().rndNum(3);
                $page = geturl("videobb.com", 80, "/index.php","http://videobb.com/upload.php",0, 0, 0);
		        is_page($page);
                $cookie = GetCookies($page);
				$split = split ('[; ]', $cookie);
				$cookie = $split[0].'; '.$split[18];
                $post = array();
		        $post['login_username'] = trim($_REQUEST['my_login']);
		        $post['login_password'] = trim($_REQUEST['my_pass']);
				$post['rem_me'] = '';
				$page = geturl("videobb.com", 80, "/login.php","http://videobb.com/index.php",$cookie, $post, 0);
		        is_page($page);
                preg_match('/^HTTP\/1\.0|1 ([0-9]+) .*/',$page,$status);
				if ($status[1] == 200) {html_error("Error, check username and password");}
                $cookie .= "; ".GetCookies($page);
				$split = split ('[; ]', $cookie);
				$cookie = $split[0].'; '.$split[2].'; '.$split[16].'; '.$split[18];
				if($split[0] == '' || $split[2] == '' || $split[16] == '' || $split[18] == ''){
					html_error('Error in uploading, needs to be updated!');
					}
					}else{
				html_error('This video is not allowed to Videobb.com. Video allowed: avi, divx, 3gp, mov, mpeg, mpg, xvid, flv, asf, dat, mp4, mkv, wmv, rm, m4v, f4v');}
				}else{
					html_error('User or password is empty, check and try again');
				}
?>
					<script>document.getElementById('login').style.display='none';</script>
					<div id=info width=100% align=center>Retrive upload ID</div>
<?php
            $page = geturl("videobb.com", 80, "/ajax/upload_track.php?cat_sel=1&f=$lname","http://videobb.com/upload.php\r\nX-Requested-With: XMLHttpRequest",$cookie, 0, 0);
		    is_page($page);
            $sessionId=urlencode(cut_str ( $page ,'sessionId":"' ,'",'));
            $sid=cut_str ( $page ,'sid":"' ,'",');
            $sd=cut_str ( $page ,'sd":"' ,'",');
            $ip=cut_str ( $page ,'ip":"' ,'",');
            $cc=cut_str ( $page ,'cc":"' ,'",');
			$vc=cut_str ( $page ,'vc":"' ,'"');
			$enc = cut_str($page ,'enc":"' ,'",');
            $progressURL=urldecode(cut_str ( $page ,'progressURL":"' ,'",'));
            $submitURL=urldecode(cut_str ( $page ,'submitURL":"' ,'",'));
            $URL = htmlspecialchars_decode($progressURL);
           	$URL=str_replace("\\","",$URL);
            $upurl=htmlspecialchars_decode($submitURL);
			$upurl=str_replace("\\","",$upurl);
			                                                    
?>
					<script>document.getElementById('info').style.display='none';</script>
					<div id=info width=100% align=center>Connecting Upload</div> 
<?php 
			$page = geturl("videobb.com", 80, "/upload.php","http://videobb.com/upload.php",$cookie, 0, 0);
		    is_page($page);  
            $upurl = $upurl."?X-Progress-ID=$sessionId";
			$url=parse_url($upurl);
            unset($post);
			$post=array();
            $post["uploadSessionId"] = $sessionId;
			$post["APC_UPLOAD_PROGRESS"] = $sessionId;
            $post["ud"]=$ud;
			$post["un"]=$un;
			$post["enc"]=$enc;
            $post["broadcast"]="0";
           	$post["allow_comments"]= "0";
			$post["allow_rating"]="0";
            $post["search_by_user"]= "0";
			$post["title"]="Upload Video, thanks simplesdescarga";
            $post["description"]="Upload by simplesdescarga";
            $post["tags"] = "";
			$post["category"] = "1";
            $post["cat_sel"]="1";
			$post["sip"]=$sip;
			$post["ps"]="1";
            $post["cc"]=$cc;
         	$post["bsid"]= "7";
			$post["sid"]=$sid;
            $post["ip"]= $ip;
			$post["vc"]=$vc;
            $post["slip"]=$slip;
            $post["sd"]="WU";
			$upfiles = upfile($url["host"], defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""), 0, $cookie, $post, $lfile, $lname, "file");
			is_page($upfiles);
?>
							<script>document.getElementById('progressblock').style.display='none';</script>
<?php 	
			is_page($upfiles);
            $upurl = $URL."/progress?X-Progress-ID=$sessionId&callback=jsonp$rnd";
            $Url=parse_url($upurl);
            $page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""),"http://videobb.com/upload.php", $cookie, 0, 0, $_GET["proxy"],$pauth);
            is_page($page);
            $state=cut_str ( $page ,'state" : "' ,'"');
            if($state == "starting"){
            $download_link= "http://www.videobb.com/video/$vc";
           	}else {
           	html_error ('Error upload file');}
	}
?>

<?php		
				//FunÃ§Ã£o que verifica a extensÃ£o
				function extensao($file){
				$tam = strlen($file);
				if( $file[($tam)-4] == '.' ){
				$extensao = substr($file,-3);}
				elseif( $file[($tam)-5] == '.' ){
				$extensao = substr($file,-4);}
				elseif( $file[($tam)-3] == '.' ){
				$exe = substr($file,-2);
				}else{
				$exe = NULL;}
				return $extensao;}
				
				function rndNum($lg){
				$str="0123456789"; 
				for ($i=1;$i<=$lg;$i++){
				$st=rand(1,9);
				$pnt.=substr($str,$st,1);}
				return $pnt;}
				
							//VinhNhaTrang 17/12/2010
							//hackinho 06/07/2011
							//fixados os cookies by simplesdescarga 13/01/2012
							//adiconado suporte a extenÃ§Ã£o de arquivos by simplesdescarga 13/01/2012
							//fixados erros no login by simplesdescarga 13/01/2012
							//100% funcionando o upload by simplesdescarga 13/01/2012
?>
<?php
$upload_services[] = 'vk.com';
$max_file_size['vk.com'] = 2000;
$page_upload['vk.com'] = 'vk.com.php';
?>
<?php

// ** VK (ÐÐÐ¾Ð½ÑÐ°ÐºÑÐµ) Upload Plugin by Th3-822 **
// Create a Application at http://vk.com/editapp?act=create
// Select "Web Site" and add your rapidleech url and the base domain.
// After creating the app, copy the Application ID and the Secret key. and add them at $app.

######## Plugin's Info ########
$app = array();
$app['id'] = ''; //Application ID
$app['secret'] = ''; //Application SecretKey
$upload_audio_as_video = false; // Upload Audio files to "My Videos"...
$upload_video_as_doc = false; // Upload original Video file as Doc (Limit 200 MB)...
########################
if (empty($app['id']) || empty($app['secret'])) html_error('Application ID or SecretKey Empty. Please create a VK\'s app and add them at '.HOST_DIR.'upload/'.basename(__FILE__));

$not_done = true;
$_GET['proxy'] = isset($proxy) ? $proxy : (isset($_GET['proxy']) ? $_GET['proxy'] : '');

$return_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '?uploaded='.urlencode($_REQUEST['uploaded']).'&filename='.urlencode(base64_encode($lname));
if (!empty($_GET['proxy'])) $return_url .= '&useuproxy=on&uproxy='.urlencode($_GET['proxy']);
if (!empty($_REQUEST['pauth'])) $return_url .= '&upauth='.urlencode($pauth);
if (!empty($_GET['save_style'])) $return_url .= '&save_style='.urlencode($_GET['save_style']);
if (isset($_GET['auul'])) $return_url .= '&auul='.urlencode($_GET['auul']);

$fileExts = array(
	'video' => array('avi', 'mp4', '3gp', 'mpg', 'mpeg', 'mov', 'flv', 'wmv'),
	'audio' => array('mp3'),
	'block' => array('exe', 'scr', 'msi', 'com', 'cmd', 'bat', 'reg', 'pif', 'vbs', 'js', 'hta') /* Block non allowed fileExts (List May Be Incomplete) */
);
// File Ext Check
$fExt = (strpos($lname, '.') !== false) ? strtolower(substr(strrchr($lname, '.'), 1)) : '';
$type = 'doc';
foreach ($fileExts as $t => $exts) {
	if (in_array($fExt, $exts)) {
		$type = $t;
		break;
	}
}

// Convert Upload Types
if ($type == 'audio' && $upload_audio_as_video) $type = 'video';
elseif ($type == 'video' && $upload_video_as_doc) $type = 'doc';

// Check Type Limits
switch ($type) {
	case 'block': html_error("This file ext. ($fExt) isn't allowed by VK.");
	case 'audio':
	case 'doc':
		if ($fsize > 200*1024*1024) html_error("You only can upload '$type' files up to 200 MB.");
}

// Check https support for login.
$usecurl = $options['use_curl'] && extension_loaded('curl') && function_exists('curl_init') && function_exists('curl_exec') ? true : false;
$chttps = false;
if ($usecurl) {
	$cV = curl_version();
	if (in_array('https', $cV['protocols'], true)) $chttps = true;
}
if (!extension_loaded('openssl') && !$chttps) html_error('You need to install/enable PHP\'s OpenSSL extension to support HTTPS connections.');
elseif (!$chttps) $usecurl = false;

$auth_url = 'https://oauth.vk.com/authorize?client_id='.urlencode($app['id']).'&display=popup&scope=audio,video,docs,offline&response_type=code&redirect_uri='.urlencode($return_url);

if (empty($_REQUEST['code'])) {
	echo "\n<script type='text/javascript'>document.location = '$auth_url';</script>\n<h1 style='text-align:center'>You are being redirected to VK's oauth dialog...</h1><div style='text-align:center'>It doesn't redirect?, Click <a href='$auth_url'>here</a>.</div>\n";
	exit("</body>\n</html>");
} else {
	$not_done = false;

	// Auth
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Authenticating</div>\n";

	$page = vk_GetPage('https://oauth.vk.com/access_token?client_id='.urlencode($app['id']).'&client_secret='.urlencode($app['secret']).'&code='.urlencode($_REQUEST['code']).'&redirect_uri='.urlencode($return_url));
	$json = Get_Reply($page);
	if (!empty($json['error']) && stripos($json['error'], 'REDIRECT_URI') === false) html_error("Auth Error: [{$json['error']}] ".(!empty($json['error_description'])?$json['error_description']:''));

	// Retrive upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Preparing Upload</div>\n";

	sleep(1); // They have a limit of 3 Request/Second... Let's wait a second :D

	$data = array();
	switch ($type) {
		case 'video':
			$data['method'] = 'video.save';
			$data['name'] = $lname;
			$data['description'] = 'Uploaded with Rapidleech';
			// $data['is_private'] = '1'; // Uncomment for upload videos as private. (Not Sure Yet How It Does Work)
			// $data['group_id'] = 1234567890; // ID of the community. (Positive Number)
			break;
		case 'audio':
			$data['method'] = 'audio.getUploadServer';
			break;
		case 'doc':
			$data['method'] = 'docs.getUploadServer';
			// $data['group_id'] = 1234567890; // ID of the community. (Positive Number)
			break;
	}

	$upsrv = vk_doApiReq($data);
	if (!empty($upsrv['error'])) {
		if ($upsrv['error'] == '204') html_error('Your account is banned for uploading.');
		html_error("{$data['method']} Error: [{$upsrv['error']['error_code']}] {$upsrv['error']['error_msg']}");
	}

	$post = array();
	$up_url = $upsrv['response']['upload_url'];

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].($url['query'] ? '?'.$url['query'] : ''), '', '', $post, $lfile, $lname, ($type == 'video' ? 'video_file' : 'file'), '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);
	$upres = Get_Reply($upfiles);
	if (!empty($upres['error'])) {
		if (is_array($upres['error'])) html_error("Upload $type Error: [{$upres['error']['error_code']}] " . $upres['error']['error_msg']);
		else if ($type == 'doc' && $upres['error'] == 'unknown error' && in_array($fExt, array('zip', 'zipx', 'rar', 'rar5', 'tar', 'gz', '7z', 'cab'))) html_error("Upload $type Error: Possible Forbidden File Type Inside Compressed File.");
		else html_error("Upload $type Error: " . $upres['error']);
	}

	if ($type != 'video') {
		sleep(1); // Let's wait another second :D

		$data = array();
		switch ($type) {
			case 'audio':
				$data['method'] = 'audio.save';
				$data['audio'] = $upres['audio'];
				$data['server'] = $upres['server'];
				$data['hash'] = $upres['hash'];
				break;
			case 'doc':
				$data['method'] = 'docs.save';
				$data['file'] = $upres['file'];
				$data['tags'] = 'Rapidleech';
				break;
		}
		$rply = vk_doApiReq($data);

		if (!empty($rply['error'])) {
			if (is_array($rply['error'])) html_error($data['method'] . " Error: [{$rply['error']['error_code']}] " . $rply['error']['error_msg']);
			else html_error($data['method'] . ' Error: ' . $rply['error']);
		}
	}

	if ($type == 'video') {
		if (!empty($upsrv['response']['vid'])) $download_link = 'https://vk.com/video' . $json['user_id'] . '_' . $upsrv['response']['vid'];
		else html_error('Your video will appear in your VK account after a while.');
	}
	elseif ($type == 'doc' && !empty($rply['response'][0]['did'])) $download_link = 'https://vk.com/doc' . $rply['response'][0]['owner_id'] . '_' . $rply['response'][0]['did'];
	else html_error('Check your VK account for see your new uploaded file.');
}

function vk_doApiReq($data) {
	global $app;
	$data['api_id'] = $app['id'];
	$data['format'] = 'json';
	$data['v'] = '3.0';
	$sig = '';
	ksort($data);
	foreach ($data as $k => $v) $sig .= "$k=$v";
	$sig = md5($sig.$app['secret']);
	$baseLink = 'https://api.vk.com/method/'.$data['method'].'?';
	unset($k, $v, $data['method']);
	return Get_Reply(vk_GetPage($baseLink . http_build_query($data) . "&sig=$sig&access_token=".$GLOBALS['json']['access_token']));
}

function Get_Reply($page) {
	if (!function_exists('json_decode')) html_error('Error: Please enable JSON in php.');
	$json = substr($page, strpos($page, "\r\n\r\n") + 4);
	$json = substr($json, strpos($json, '{'));$json = substr($json, 0, strrpos($json, '}') + 1);
	$rply = json_decode($json, true);
	if (!$rply || (is_array($rply) && count($rply) == 0)) html_error('Error getting json data.');
	return $rply;
}

function vk_GetPage($link, $cookie = 0, $post = 0, $referer = 0, $auth = 0, $XMLRequest = 0) {
	if (!$referer && !empty($GLOBALS['Referer'])) {
		$referer = $GLOBALS['Referer'];
	}

	if ($GLOBALS['usecurl']) {
		if ($XMLRequest) $referer .= "\r\nX-Requested-With: XMLHttpRequest";
		$page = cURL($link, $cookie, $post, $referer, $auth);
	} else {
		global $pauth;
		$Url = parse_url($link);
		$page = geturl($Url['host'], defport($Url), $Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''), $referer, $cookie, $post, 0, !empty($_GET['proxy']) ? $_GET['proxy'] : '', $pauth, $auth, $Url['scheme'], 0, $XMLRequest);
		is_page($page);
	}
	return $page;
}

//[30-8-2012] Written by Th3-822.
//[28-10-2012] Small fixes that i don't remember. - Th3-822
//[24-11-2012] Now it shows video url & Fixed auul for this plugin. - Th3-822
//[22-9-2013] Fixed mp3 upload & Other issues. - Th3-822
//[15-12-2014] Fixed uploading (Now it requires support for HTTPS uploads). - Th3-822
//[23-8-2015] Added Docs upload support. - Th3-822

?>
<?php
$upload_services[]="wat.tv_member";
$max_file_size["wat.tv_member"]=200;
$page_upload["wat.tv_member"] = "wat.tv_member.php";
?>
<?php
//addon
function BiscottiDiKaox($content)
{
preg_match_all("/Set-Cookie: (.*)\n/",$content,$matches);
foreach ($matches[1] as $coll) {
$bis0=split(";",$coll);
$bis1=$bis0[0]."; ";
$bis2=split("=",$bis1);
if (substr_count($bis,$bis2[0])>0)
{$patrn=$bis2[0]."[^ ]+";
$bis=preg_replace("/$patrn/",$bis1,$bis);
} else{$bis.=$bis1 ; }}
$bis=str_replace(" "," ",$bis);
return rtrim($bis);}
// end addon

####### Free Account Info. ###########
$wat_login = "";
$wat_pass = "";
##############################

$not_done=true;
$continue_up=false;
if ($wat_login & $wat_pass){
	$_REQUEST['username'] = $wat_login;
	$_REQUEST['password'] = $wat_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Login*<td>&nbsp;<input type=text name=username value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=password value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["wat.tv"]; ?></b></small></tr>
</table>
</form>
<?php
}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to WAT.TV</div>
<?php
			$post['username'] = $_REQUEST['username'];
			$post['password'] = $_REQUEST['password'];
			$page = geturl("www.wat.tv", 80, "/login", 0, 0, $post, 0, $_GET["proxy"], $pauth);
			is_page($page);
			is_notpresent($page, 'wat_auth', 'Error logging in - are your logins correct?');
			$cookie=BiscottiDiKaox($page);
			$page = geturl("www.wat.tv", 80, "/upload", 0, $cookie, 0, 0, "");
			is_page($page);
			is_notpresent($page, 'HTTP/1.1 200 OK', 'Error logging in - are your logins correct?');
?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php

			$upload_form = cut_str($page, 'enctype="multipart/form-data" action="', '"');
			$uploaded = cut_str($page, 'enctype="multipart/form-data" action="http://upload.wat.tv', '"');
			if (!$url = parse_url($upload_form)) html_error('Error getting upload url');
			$fpost = array();
			$fpost['send'] = "Envoyer";
?>
<script>document.getElementById('info').style.display='none';</script>
<?php	

			$cookie2 = "wousdat_profil=1"."; $cookie";
			$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""), $upload_form, 0, $fpost, $lfile, $lname, "file");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php

			$page = geturl("www.wat.tv", 80, "$uploaded.&token=&title=&tags=&genre=&description=&country=&city=&public=&rubid=&chaineid=", 0, $cookie2, 0, 0, "");
			is_page($page);
			preg_match('/Location: (.*)\r\n/i', $page, $infos);
			$download_link = 'http://www.wat.tv'.$infos[1];
	}		
// Made by Baking 08/05/2008
// Thank to Kaox for his help ^^
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php

	$ref='http://www.wikifortio.com/';
	$Url=parse_url($ref);
	$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
	
	$upost['MAX_FILE_SIZE'] = cut_str($page,'"hidden" name="MAX_FILE_SIZE" value="' ,'"');
	$upost['_sourcePage'] = cut_str($page,'"hidden" name="_sourcePage" value="' ,'"');

	preg_match_all('/Set-Cookie: (.*);/U',$page,$temp);
	$cookie = $temp[1];
	$cookies = implode(';',$cookie);
	
		for ($i=0; $i < strlen($lname); $i++) {
				$Bconv = "\\u00".(bin2hex($lname[$i]));
				$Aconv .= $Bconv;
		}	
		
	$post['getUplAddrAndFileId'] = '1';
	$post['fileName'] = $Aconv;
	$post['stamp'] = time()."000";
	
	$page = geturl("www.wikifortio.com", 80, "/upload/dispatch.php", $ref, $cookies, $post, 0, $_GET["proxy"], $pauth);
	is_page($page);	
	is_notpresent($page, 'details.php?saveDetails=1', 'Error - unable to retrive the first upload link.');
	
	$upfrom = "http://".cut_str($page,'http://' ,';');
		$refup = "http://".cut_str($upform,'http://' ,'/')."/";
	$fid = cut_str($page,'http://www.wikifortio.com/' ,'/');	
		
	$upost['fid'] = $fid;
	$upost['fileName'] = $Aconv;
	$upost['__fp'] = '';
	
	$dpost['saveDetails'] = "1";
	$dpost['storagePeriod'] = "90";
	$dpost['fid'] = $fid;
	$dpost['node'] = cut_str($refup,'http://' ,'/');
	$page = geturl("www.wikifortio.com", 80, "/upload/details.php", $refup, $cookies, $dpost, 0, $_GET["proxy"], $pauth);
	is_page($page);	
	is_notpresent($page, 'details.php?detailsDialog', 'Error - unable to retrive the second upload link.');
	
	$admin = cut_str($page,"document.location.href='" ,"'");	

	$url=parse_url($upfrom);
?>
<script>document.getElementById('info').style.display='none';</script>
<?
	$upfiles = upfile($url["host"], defport($url), $url["path"].($url["query"] ? "?".$url["query"] : ""), $refup, 0, $upost, $lfile, $lname, "uploadFormFile");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?
	$Url=parse_url($admin);
	$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, 0, 0, 0, $_GET["proxy"],$pauth);
	is_notpresent($page, $fid, 'Error - unable to retrive the download link.');
		
	$download_link=	cut_str($page,'downloadlink"><strong><a href="' ,'"');	
	$adm_link= $admin;
	
// Made by Baking 24/12/2009 21:54
?>
<?php
$upload_services[]="wikifortio.com";
$max_file_size["wikifortio.com"]=100;
$page_upload["wikifortio.com"] = "wikifortio.com.php";  
?>
<?php
$upload_services[]="wikiupload.com";
$max_file_size["wikiupload.com"]=5000;
$page_upload["wikiupload.com"] = "wikiupload.com.php";
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
				$ref="http://www.wikiupload.com/";
				$page = geturl("www.wikiupload.com", 80, "/", "", 0, 0, 0, "");
				is_page($page);
				$page=cut_str($page,'<form','</form>');
				$action_url=str_replace("./","/","http://www.wikiupload.com".cut_str($page,'action="','"'));
				$post['sessionid']=cut_str($action_url,'sid=','"');
				if (!$post['sessionid']) html_error ('Error get session id');
				$post['returnPath']='index.php';
				$post['action']='upload_file';
				$post['description']='';
				$post['tags']='';
				$post['agree']='on';
				$post['x']='96';
				$post['y']='11';
	
				$url=parse_url($action_url);
		
				$upfiles=upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : "") ,$ref, 0, $post, $lfile, $lname, "userfile");

?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php		
				is_notpresent($upfiles,"Location","File not uploaded");
				$newlink=trim(cut_str($upfiles,"Location:","\n"));
				$Url=parse_url($newlink);
				$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $ref, 0, 0, 0, $_GET["proxy"],$pauth);
				is_page($page);
				$location=$ref."middle_page.php?id=".cut_str($page,'middle_page.php?id=',"'");
				if (!$location) html_error ('Error get location');
				$Url=parse_url($location);
				$page = geturl($Url["host"], defport($Url), $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), $newlink, 0, 0, 0, $_GET["proxy"],$pauth);
				is_page($page);
				$download_link=$ref."download_page.php?id=".cut_str($page,"download_page.php?id=","'");

// sert 27.06.2008
?>
<?php
$upload_services[] = "wrzuta.pl";
$max_file_size["wrzuta.pl"] = 500;
$page_upload["wrzuta.pl"] = "wrzuta.pl.php";
?>
<?php
####### Account Info. ###########
$upload_acc['wrzuta_pl']['user'] = ""; //Set your username
$upload_acc['wrzuta_pl']['pass'] = ""; //Set your password
##############################

$not_done = true;
$continue_up = false;

$fname = substr($lname, 0, strrpos($lname, '.'));
$categories = array(1 => "Other (pozostale)", 2 => "Adult (erotyka)", 3 => "Sport", 4 => "Funny (smieszne)", 5 => "Music (muzyka)", 6 => "Advertising (reklamy)", 8 => "Films and TV (filmy i tv)", 9 => "Games (gry)", 10 => "Animals (zwierzeta)", 11 => "Graphics (grafika)", 12 => "For children (dla dzieci)", 13 => "Fashion and beauty (moda i uroda)", 14 => "Science and Technology (nauka i technika)", 15 => "Stars and Showbiz (gwiazdy i showbiznes)");

if ($upload_acc['wrzuta_pl']['user'] && $upload_acc['wrzuta_pl']['pass']){
	$_REQUEST['login'] = $upload_acc['wrzuta_pl']['user'];
	$_REQUEST['password'] = $upload_acc['wrzuta_pl']['pass'];
	$_REQUEST['action'] = "FORM";
	// Set options for uploading with default login:
	$_REQUEST['up_title'] = "$fname";
	$_REQUEST['up_tags'] = "$fname";
	$_REQUEST['up_description'] = 'Uploaded with Rapidleech';
	$_REQUEST['up_category'] = 1; // Check $categories
	$_REQUEST['up_adult'] = 'no';
	$_REQUEST['up_private'] = 'no';
	$_REQUEST['up_comments'] = 'yes';
	echo "<b><center>Using Default Settings</center></b>\n";
}

if ($_REQUEST['action'] == "FORM")
	$continue_up = true;
else{
?>
<table border="0" style="width:270px;margin:auto;" cellspacing="0">
<form method="POST">
<input type="hidden" name="action" value="FORM" />
<tr><td style="white-space:nowrap;">&nbsp;Username*<td>&nbsp;<input type="text" name="login" value="" style="width:160px;" />&nbsp;</tr>
<tr><td style="white-space:nowrap;">&nbsp;Password*<td>&nbsp;<input type="password" name="password" value="" style="width:160px;" />&nbsp;</tr>
<tr><td colspan='2' align='center'><br />Upload options*<br /><br /></td></tr>
<tr><td style='white-space:nowrap;'>Title:</td><td>&nbsp;<input type='text' name='up_title' value="<?php echo $fname ?>" style='width:160px;' /></td></tr>
<tr><td style='white-space:nowrap;'>Tags:</td><td>&nbsp;<input type='text' name='up_tags' value="<?php echo $fname; ?>" style='width:160px;' /></td></tr>
<tr><td style='white-space:nowrap;'>Description:</td><td>&nbsp;<input type='text' name='up_description' value='Uploaded with Rapidleech' style='width:160px;' /></td></tr>
<tr><td style='white-space:nowrap;'>Category:</td><td>&nbsp;<select name='up_category' style='width:160px;height:20px;'>
<?php foreach($categories as $v => $n) echo "<option value='$v'>$n</option>\n"; ?>
</select></td></tr>
<tr><td colspan='2' align='center'>Content type:<input type='radio' name='up_adult' value='no' checked='checked'>&nbsp;Safe&nbsp;&nbsp;<input type='radio' name='up_adult' value='yes'>&nbsp;<b style="color:red;">Unsafe</b></td></tr>
<tr><td style='white-space:nowrap;'><input type='checkbox' name='up_private' value='yes' />&nbsp; Set as private</td><td style='white-space:nowrap;' align='right'><input type='checkbox' name='up_comments' value='yes' checked='checked' />&nbsp; Allow Comments</td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Upload" /></td></tr>
<tr><td colspan="2" align="center"><small>*You can set it as default in <b><?php echo $page_upload["wrzuta.pl"]; ?></b></small></td></tr>
</form>
</table>
<script type='text/javascript'>self.resizeTo(700,500);</script>
<?php
}

if ($continue_up)
	{
		$not_done=false;
?>
<table style="width:600px;margin:auto;">
</td></tr>
<tr><td align="center">
<div id="info" style="width:100%;text-align:center;">Login to wrzuta.pl</div>
<?php
	$page = geturl("www.wrzuta.pl", 80, "/ajax/csrf/pobierz/", 'http://www.wrzuta.pl/', 0, 0, 0, $_GET["proxy"], $pauth);is_page($page);
	$cookie = GetCookiesArr($page);
	if (!empty($_REQUEST['login']) && !empty($_REQUEST['password'])) {
		$post = array();
		$post['login_form_login'] = $_REQUEST['login'];
		$post['login_form_password'] = sha1(sha1($_REQUEST['password']).strtolower($_REQUEST['login']));
		$post['login_form_remember'] = 0;
		$post['csrf'] = $cookie['csrf'];

		$page = geturl("www.wrzuta.pl", 80, "/ajax/uzytkownik/zaloguj", 'http://www.wrzuta.pl/', $cookie, $post, 0, $_GET["proxy"], $pauth);is_page($page);
		is_present($page, 'B\u0142\u0119dny login lub has\u0142o', "Login failed: User/Password incorrect.");
		is_present($page, 'Autoryzacja nie powiod\u0142a si\u0119', "Login failed: Auth Failed.");
		is_notpresent($page, '"status":"ok"', 'Login Error?');
		is_notpresent($page, 'Set-Cookie: SID=', 'Error: Cannot find session cookie.');
		$cookie = array_merge($cookie, GetCookiesArr($page));
		$login = true;
	} else {
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		$login = false;
	}
?>
<script type="text/javascript">document.getElementById('info').innerHTML='Uploading...';</script>
<?php
	$post = array();
	$post['Filename'] = $lname;
	$post['Upload'] = 'Submit Query';

	$upfiles = upfile('www.wrzuta.pl', 80, '/ajax/pliki/dodaj', '', 0, $post, $lfile, $lname, "file", '', $_GET["proxy"], $pauth, 'Shockwave Flash');
	is_page($upfiles);
	is_notpresent($page, '"status":"ok"', 'Upload failed?');
	if (!preg_match('@"token":"([^\"]+)"@i', $upfiles, $token)) html_error("Error: File token not found!.");
	$token = $token[1];
?>
<script type="text/javascript">document.getElementById('progressblock').style.display='none';document.getElementById('info').innerHTML='Saving file...';</script>
<?php
	$post = array();
	$post['token0'] = $token;
	$post['files_qnt'] = 1;

	$page = geturl('www.wrzuta.pl', 80, "/ajax/pliki/statusuploadu", 'http://www.wrzuta.pl/', $cookie, $post, 0, $_GET["proxy"], $pauth);is_page($page);
	is_notpresent($page, '"uploaded_cnt":1', 'Cannot check uploaded file');

	$page = geturl('www.wrzuta.pl', 80, "/pliki/edytuj", 'http://www.wrzuta.pl/', $cookie, $post, 0, $_GET["proxy"], $pauth);is_page($page);

	$post = array();
	$post['files_qnt'] = 1;
	$post['files_idxs'] = cut_str($page, 'name="files_idxs" value="', '"');
	$post['sess_id'] = cut_str($page, 'name="MAX_FILE_SIZE" value="', '"');
	$post['csrf'] = cut_str($page, 'name="csrf" value="', '"');
	$post['token0'] = $token;
	$post['key_0'] = cut_str($page, 'name="key_0" value="', '"');
	$post['upload_file_name_0'] = !empty($_REQUEST['up_title']) ? urlencode($_REQUEST['up_title']) : urlencode($fname);
	$post['upload_file_tags_0'] = !empty($_REQUEST['up_tags']) ? urlencode($_REQUEST['up_tags']) : urlencode($fname);
	$post['upload_file_dir_key_0'] = 0;
	$post['upload_file_desc_0'] = !empty($_REQUEST['up_description']) ? urlencode($_REQUEST['up_description']) : 'Uploaded+with+rapidleech';
	$post['id_subcategory_0'] = $post['id_category_0'] = (array_key_exists($_REQUEST['up_category'], $categories)) ? $_REQUEST['up_category'] : 1;
	$post['upload_file_adults_0'] = ($_REQUEST['up_adult'] == 'yes') ? 1 : 0;
	if ($login) $post['upload_file_private_0'] = ($_REQUEST['up_private'] == 'yes') ? 1 : 0;
	$post['upload_file_comments_0'] = ($_REQUEST['up_comments'] == 'yes') ? 1 : 0;
	$post['accept_rules'] = 'on';

	$page = geturl("www.wrzuta.pl", 80, "/pliki/zapisz", 'http://www.wrzuta.pl/pliki/edytuj', $cookie, $post, 0, $_GET["proxy"], $pauth);is_page($page);
?>
<script type="text/javascript">document.getElementById('info').innerHTML='Getting download link...';</script>
<?php
	is_notpresent($page, 'Location: ', 'Redirect not found');
	if (preg_match('@Location: (https?://[^/]+wrzuta.pl/[^\r|\n]+)@i', $page, $lnk)) {
		$download_link = $lnk[1];
	} else {
		html_error("Error: Download link not found.");
	}
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";
}

//[06-1-2012] Written by Th3-822.

?>
<?php 
$upload_services[] = "ziddu.com";
$max_file_size["ziddu.com"] = 200;
$page_upload["ziddu.com"] = "ziddu.com.php";  
?>
<?php

####### Account Info. ###########
$ziddu_login = ""; //Set your Email Id
$ziddu_pass = ""; //Set your password
##############################

$not_done=true;
$continue_up=false;
if ($ziddu_login & $ziddu_pass){
	$_REQUEST['my_login'] = $ziddu_login;
	$_REQUEST['my_pass'] = $ziddu_pass;
	$_REQUEST['action'] = "FORM";
	echo "<b><center>Use Default login/pass.</center></b>\n";
}
if ($_REQUEST['action'] == "FORM")
    $continue_up=true;
else{
?>
<table border=0 style="width:270px;" cellspacing=0 align=center>
<form method=post>
<input type=hidden name=action value='FORM' />
<tr><td nowrap>&nbsp;Email Id*<td>&nbsp;<input type=text name=my_login value='' style="width:160px;" />&nbsp;</tr>
<tr><td nowrap>&nbsp;Password*<td>&nbsp;<input type=password name=my_pass value='' style="width:160px;" />&nbsp;</tr>
<tr><td colspan=2 align=center><input type=submit value='Upload' /></tr>
<tr><td colspan=2 align=center><small>*You can set it as default in <b><?php echo $page_upload["ziddu.com_member"]; ?></b></small></tr>
</table>
</form>

<?php
	}

if ($continue_up)
	{
		$not_done=false;
?>
<table width=600 align=center>
</td></tr>
<tr><td align=center>
<div id=login width=100% align=center>Login to Ziddu</div>
<?php
			if (!$_REQUEST['my_login'] || !$_REQUEST['my_pass']) html_error('You didn\'t enter any account login details!');
			$page = geturl("www.ziddu.com", 80, "/login.php", 0, 0, 0);
			$cookie = GetCookies($page);
			$post['email'] = $_REQUEST['my_login'];
            $post['password'] = $_REQUEST['my_pass'];
            $post['Submit'] = "&nbsp;Login&nbsp;";
			$post['action'] = "LOGIN";
			$post['cookie'] = "";
			$post['uid'] = "";
            $page = geturl("www.ziddu.com", 80, "/login.php", 0, $cookie, $post);
			is_page($page);
			is_present($page, 'Either Email or Password is Incorrect', 'Error Logging In - Check your login details');
			is_present($page, 'Your Account has been unsubscribed by your self', 'Error Logging In - Check your login details');
?>
<script>document.getElementById('login').style.display='none';</script>
<div id=info width=100% align=center>Retrive upload ID</div>
<?php
			$upload_form0 = "http://www.ziddu.com/upload.php";
			$Url = parse_url($upload_form0);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, 0, 0, $_GET["proxy"],$pauth);
			is_page($page);
			preg_match('/name="mmemid".*value="(.*?)"/i', $page, $mmemid);
			preg_match('/name="mname".*value="(.*?)"/i', $page, $mname);
			$memail = cut_str ( $page ,'memail" value="' ,'"' );
			$post = array();
			$post['mmemid'] = $mmemid[1];
			$post['mname'] = $mname[1];
			$post["memail"]=$memail;
			$post['lang'] = 'english';


			$upload_form = 'http://uploads.ziddu.com/upload.php';
			$Url = parse_url($upload_form);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, $post, 0, $_GET["proxy"],$pauth);
			is_page($page);
			// $cookie2 = GetCookies($page);
			preg_match('%action="(cgi-bin/.*?)"%i', $page, $act);
			preg_match('/name="memail".*value="(.*?)"/i', $page, $memail);
			$url_action = 'http://uploads.ziddu.com/'.$act[1];
			$fpost = array();
			$fpost['memail'] = $memail[1];
?>
<script>document.getElementById('info').style.display='none';</script>
<?php
			$url = parse_url($url_action);
			$upfiles = upfile($url["host"],$url["port"] ? $url["port"] : 80, $url["path"].($url["query"] ? "?".$url["query"] : ""),$upload_form, $cookie, $fpost, $lfile, $lname, "upfile_0", "");
?>
<script>document.getElementById('progressblock').style.display='none';</script>
<?php
			is_page($upfiles);
			preg_match('%ocation:\s(.+)\r\n%', $upfiles, $fredir);
			$Url = parse_url($fredir[1]);
			$page = geturl($Url["host"], $Url["port"] ? $Url["port"] : 80, $Url["path"].($Url["query"] ? "?".$Url["query"] : ""), 0, $cookie, $post, 0, $_GET["proxy"],$pauth);
			preg_match('%<a href="(http://www.ziddu.com/download/\d+/.+\.html)"\s+%i', $page, $flink);
			$download_link = $flink[1];
	}
	// szal 20-03-09
	// FIXED by kaox 26-sep-09
	// Fixed by Crashblack 24 April 2011 (http://crash-black.blogspot.com)
?>
<?php
$upload_services[] = 'zippyshare.com';
$max_file_size['zippyshare.com'] = 500;
$page_upload['zippyshare.com'] = 'zippyshare.com.php';
<?php
######## Account Info ########
$upload_acc['zippyshare_com']['user'] = ''; //Set your userid/alias
$upload_acc['zippyshare_com']['pass'] = ''; //Set your password
########################

$_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';
$not_done = true;
$continue_up = false;

if ($upload_acc['zippyshare_com']['user'] && $upload_acc['zippyshare_com']['pass']) {
	$_REQUEST['up_login'] = $upload_acc['zippyshare_com']['user'];
	$_REQUEST['up_pass'] = $upload_acc['zippyshare_com']['pass'];
	$_REQUEST['up_private'] = false;
	$_REQUEST['action'] = 'FORM';
	echo "<b><center>Using Default Login.</center></b>\n";
}

if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'FORM') $continue_up = true;
else {
	echo "<table border='0' style='width:270px;' cellspacing='0' align='center'>
	<form method='POST'>
	<input type='hidden' name='action' value='FORM' />
	<tr><td style='white-space:nowrap;'>&nbsp;User*</td><td>&nbsp;<input type='text' name='up_login' value='' style='width:160px;' /></td></tr>
	<tr><td style='white-space:nowrap;'>&nbsp;Password*</td><td>&nbsp;<input type='password' name='up_pass' value='' style='width:160px;' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><br />Upload options *<br /></td></tr>\r\n<tr><td colspan='2' align='center'><input type='checkbox' name='up_private' value='true' />&nbsp; Set as Private Upload</td></tr>";
	echo "<tr><td colspan='2' align='center'><br /><input type='submit' value='Upload' /></td></tr>\n";
	echo "<tr><td colspan='2' align='center'><small>*You can set it as default in <b>".basename(__FILE__)."</b></small></td></tr>\n";
	echo "</form>\n</table>\n";
}

if ($continue_up) {
	$not_done = false;
	$domain = 'zippyshare.com';
	$referer = "https://$domain/";

	// Login
	echo "<table style='width:600px;margin:auto;'>\n<tr><td align='center'>\n<div id='login' width='100%' align='center'>Login to zippyshare.com</div>\n";

	$cookie = array('ziplocale' => 'en');
	if (!empty($_REQUEST['up_login']) && !empty($_REQUEST['up_pass'])) {
		$post = array();
		$post['login'] = $_REQUEST['up_login'];
		$post['pass'] = $_REQUEST['up_pass'];
		$post['remember'] = 'on';

		$page = geturl($domain, 443, '/services/login', $referer, $cookie, $post, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);
		is_present($page, '?invalid=1', 'Login failed: User/Password incorrect.');
		$cookie = GetCookiesArr($page, $cookie);
		if (empty($cookie['zipname']) && empty($cookie['ziphash'])) html_error('Error: Login cookies not found.');
		$login = true;
	} else {
		echo "<b><center>Login not found or empty, using non member upload.</center></b>\n";
		$login = false;
	}

	// Retrieve upload ID
	echo "<script type='text/javascript'>document.getElementById('login').style.display='none';</script>\n<div id='info' width='100%' align='center'>Retrive upload ID</div>\n";

	$page = geturl($domain, 443, '/', $referer, $cookie, 0, 0, $_GET['proxy'], $pauth, 0, 'https');is_page($page);

	if (!preg_match('@(?<=//|\')www\d+(?=\.zippyshare\.com/upload|\';)@i', $page, $up)) html_error('Error: Cannot find upload server.');

	$post = array();
	$post['name'] = $lname;
	if ($login) {
		$post['zipname'] = $cookie['zipname'];
		$post['ziphash'] = $cookie['ziphash'];
	}
	$post['embPlayerValues'] = (!empty($cookie['embed-player-values']) ? $cookie['embed-player-values'] : 'false');
	if (!empty($_REQUEST['up_private'])) $post['private'] = 'true';
	else $post['notprivate'] = 'true';

	$up_url = sprintf('https://%s.zippyshare.com/upload', $up[0]);

	// Uploading
	echo "<script type='text/javascript'>document.getElementById('info').style.display='none';</script>\n";

	$url = parse_url($up_url);
	$upfiles = upfile($url['host'], defport($url), $url['path'].(!empty($url['query']) ? '?'.$url['query'] : ''), $referer, $cookie, $post, $lfile, $lname, 'Filedata', '', $_GET['proxy'], $pauth, 0, $url['scheme']);

	// Upload Finished
	echo "<script type='text/javascript'>document.getElementById('progressblock').style.display='none';</script>\n";

	is_page($upfiles);

	if (preg_match('@https?://www\d*\.zippyshare\.com/v/\w+/file\.html@i', $upfiles, $link)) $download_link = $link[0];
	else html_error('Download link not found.');

}

//[17-5-2013] Written by Th3-822.
//[28-9-2014] Added private upload option. - Th3-822
//[11-1-2015] Fixed upload & Link regexp. (Happy new year) - Th3-822
//[24-6-2018] Switched to https & small changes. - Th3-822
<?php

require_once('rl_init.php');
ignore_user_abort(true);
login_check();

// If configs/files.lst is not writable, give a warning
if (!is__writable(CONFIG_DIR . 'files.lst')) html_error(lang(304));

// If the download path is not writable, show error
if (!is__writable(DOWNLOAD_DIR)) html_error(DOWNLOAD_DIR . lang(305));

purge_files($options['delete_delay']);
register_shutdown_function('pause_download');

$_REQUEST = $_GET = array_merge($_GET, $_POST);
$_REQUEST['premium_acc'] = $_POST['premium_acc'] = $_GET['premium_acc'] = isset($_REQUEST['premium_acc']) && $_REQUEST['premium_acc'] == 'on' ? 'on' : false;
$_REQUEST['cookieuse'] = $_POST['cookieuse'] = $_GET['cookieuse'] = isset($_REQUEST['cookieuse']) && $_REQUEST['cookieuse'] == 'on' ? 'on' : false;

require_once(CLASS_DIR . 'cookie.php');

if (!@file_exists(HOST_DIR . 'download/hosts.php')) html_error(lang(127));

// require "hosts.php";
require_once(HOST_DIR . 'download/hosts.php');

if (!empty($_GET['image'])) {
	require_once(CLASS_DIR . 'http.php');
	require_once(CLASS_DIR . 'image.php');
	exit();
}

$_GET['proxy'] = !empty($_GET['proxy']) ? trim(urldecode($_GET['proxy'])) : '';
if (!empty($_GET['useproxy']) && (empty($_GET['proxy']) || strpos($_GET['proxy'], ':') === false)) html_error(lang(324));
$pauth = (!empty($_GET['proxyuser']) && !empty($_GET['proxypass'])) ? base64_encode($_GET['proxyuser'] . ':' . $_GET['proxypass']) : (!empty($_GET['pauth']) ? decrypt(urldecode(trim($_GET['pauth']))) : '');

if (empty($_GET['path']) || $options['download_dir_is_changeable'] == false) {
	if (empty($_GET['host'])) $_GET['path'] = (substr($options['download_dir'], 0, 6) != 'ftp://') ? realpath(DOWNLOAD_DIR) : $options['download_dir'];
	else $_GET['saveto'] = (substr($options['download_dir'], 0, 6) != 'ftp://') ? realpath(DOWNLOAD_DIR) : $options['download_dir'];
}

if (empty($_GET['filename']) || empty($_GET['host']) || empty($_GET['path'])) {
	$LINK = !empty($_GET['link']) ? trim($_GET['link']) : false;
	if (!$LINK) {
		require_once(CLASS_DIR . 'main.php');
		exit();
	}

	if ($options['ref_check']) check_referer();

	// Detect if it doesn't have a protocol assigned
	if (stripos($LINK, '://') === false || (strtolower(substr($LINK, 0, 7)) != 'http://' && strtolower(substr($LINK, 0, 6)) != 'ftp://' && strtolower(substr($LINK, 0, 6)) != 'ssl://' && strtolower(substr($LINK, 0, 8)) != 'https://')) {
		// Automatically assign http://
		$LINK = 'http://' . $LINK;
	}

	if (!empty($_GET['saveto']) && empty($_GET['path'])) html_error(lang(6));

	if (!empty($_GET['domail']) && !checkmail($_GET['email'])) {
		html_error(lang(3));
		if (!empty($_GET['split']) && !is_numeric($_GET['partSize'])) html_error(lang(4)); // T-8: Check this.
	}

	$Url = parse_url($LINK);
	$Url['scheme'] = strtolower($Url['scheme']);
	$Url['host'] = strtolower($Url['host']);

	$Url['path'] = (empty($Url['path'])) ? '/' : str_replace('%7C', '|', $Url['path']);
	$LINK = rebuild_url($Url);

	if (empty($_GET['referer'])) {
		$Referer = $Url;
		$Referer['scheme'] = strtolower($Referer['scheme']);
		// Remove login from Referer
		unset($Referer['user'], $Referer['pass']);
		$Referer = rebuild_url($Referer);
	} else $Referer = trim(rawurldecode($_GET['referer']));

	if (!in_array($Url['scheme'], array('http', 'https', 'ftp'))) html_error(lang(5));

	if (empty($Url['user']) xor empty($Url['pass'])) {
		unset($Url['user'], $Url['pass']);
		$LINK = rebuild_url($Url);
	}

	if (isset($_GET['user_pass']) && $_GET['user_pass'] == 'on' && !empty($_GET['iuser']) && !empty($_GET['ipass'])) {
		$Url['user'] = $_GET['iuser'];
		$Url['pass'] = $_GET['ipass'];
		// Rebuild url
		$LINK = rebuild_url($Url);
	}

	// If Url has user & pass, use them as premium login for plugins and set $auth for direct download.
	if (!empty($Url['user']) && !empty($Url['pass'])) {
		if (empty($_REQUEST['premium_acc'])) $_GET['premium_acc'] = $_POST['premium_acc'] = $_REQUEST['premium_acc'] = 'on';
		$_GET['premium_user'] = $_POST['premium_user'] = $_REQUEST['premium_user'] = $Url['user'];
		$_GET['premium_pass'] = $_POST['premium_pass'] = $_REQUEST['premium_pass'] = $Url['pass'];

		$auth = urlencode(encrypt(base64_encode(rawurlencode($Url['user']) . ':' . rawurlencode($Url['pass']))));

		// Lets delete User and Pass from link because isn't needed now.
		unset($Url['user'], $Url['pass']);
		$LINK = rebuild_url($Url);
	} else $auth = '';

	include(TEMPLATE_DIR . '/header.php');

	if (empty($_GET['dis_plug']) || $_GET['dis_plug'] != 'on') {
		// check Domain-Host
		foreach ($host as $site => $file) {
			if (host_matches($site, $Url['host'])) {
				error_reporting(E_ERROR | E_PARSE | error_reporting()); // Make sure to show any critical error while loading the plugin.
				require_once(CLASS_DIR . 'http.php');
				require_once(HOST_DIR . 'DownloadClass.php');
				$class = substr($file, 0, -4);
				if (empty($auth) && !empty($_GET['premium_acc'])) {
					if (!empty($premium_acc["$class"]['proxy'])) {
						if ($premium_acc["$class"]['proxy'] != -1) {
							// Load Server-Side Proxy for this host.
							$_GET['useproxy'] = 'on';
							$_GET['proxy'] = $premium_acc["$class"]['proxy'];
							$pauth = (!empty($premium_acc["$class"]['pauth']) ? base64_encode($premium_acc["$class"]['pauth']) : false);
						}
					} else if (!empty($premium_acc["$class"])) {
						// Disable User-Proxy Support for Server-Side accounts.
						$_GET['useproxy'] = $_GET['proxy'] = $pauth = false;
					}
				}
				require_once(HOST_DIR . "download/$file");
				$firstchar = substr($file, 0, 1);
				if (ctype_digit($firstchar)) $class = "d$class";
				if (class_exists($class)) {
					$hostClass = new $class();
					$hostClass->Download($LINK);
				}
				exit();
			}
		}
	}

	$mydomain = strtolower(($pos = strpos($_SERVER['HTTP_HOST'], ':')) !== false ? substr($_SERVER['HTTP_HOST'], 0, $pos) : $_SERVER['HTTP_HOST']);
	if ($options['bw_save'] && !empty($_SERVER['SERVER_ADDR']) && ($Url['host'] == $_SERVER['SERVER_ADDR'] || host_matches($mydomain, $Url['host']))) html_error(sprintf(lang(7), $mydomain, $_SERVER['SERVER_ADDR']));
	if (empty($auth) && !empty($_GET['premium_acc'])) {
		if (!empty($premium_acc[$Url['host']]['proxy'])) {
			$proxy = $premium_acc[$Url['host']]['proxy'];
			if ($proxy != -1) {
				$_GET['useproxy'] = ($proxy != -1 ? 'on' : false);
				$_GET['proxy'] = ($proxy != -1 ? $proxy : false);
				$pauth = (!empty($premium_acc[$Url['host']]['pauth']) ? base64_encode($premium_acc[$Url['host']]['pauth']) : false);
			}
		} else $proxy = false;

		if (!empty($premium_acc[$Url['host']]['user']) && !empty($premium_acc[$Url['host']]['pass'])) $auth = '2';
		else if (empty($_GET['cookie']) && !empty($premium_acc[$Url['host']]['cookie'])) $auth = '3';
		else if (!filter_var($Url['host'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
			foreach (array_keys($premium_acc) as $site) if (host_matches($site, $Url['host'])) {
				if (empty($proxy) && !empty($premium_acc["$site"]['proxy'])) {
					$proxy = $premium_acc["$site"]['proxy'];
					if ($proxy != -1) {
						// Load Server-Side Proxy for this host.
						$_GET['useproxy'] = 'on';
						$_GET['proxy'] = $proxy;
						$pauth = (!empty($premium_acc["$site"]['pauth']) ? base64_encode($premium_acc["$site"]['pauth']) : false);
					}
				} else if (!empty($premium_acc["$site"])) {
					// Disable User-Proxy Support for Server-Side accounts.
					$_GET['useproxy'] = $_GET['proxy'] = $pauth = false;
				}
				if (!empty($premium_acc["$site"]['user']) && !empty($premium_acc["$site"]['pass'])) {
					$auth = '2';
					break;
				} else if (empty($_GET['cookie']) && !empty($premium_acc["$site"]['cookie'])) {
					$auth = '3';
					break;
				}
			}
		}
	}

	$redir = GetDefaultParams();
	$redir['dis_plug'] = 'on';
	$redir['filename'] = urlencode((isset($Url['path']) && basename($Url['path'])) ? urldecode(basename($Url['path'])) : 'index.html');
	$redir['host'] = urlencode($Url['host']);
	if (!empty($Url['port'])) $redir['port'] = urlencode($Url['port']);
	$redir['path'] = urlencode($Url['path'] . (!empty($Url['query']) ? '?' . $Url['query'] : ''));
	if (!empty($Referer)) $redir['referer'] = urlencode($Referer);
	$redir['link'] = urlencode($LINK);
	if (!empty($_GET['cookie'])) $redir['cookie'] = urlencode(encrypt($_GET['cookie']));
	if (!empty($auth)) $redir['auth'] = $auth;

	insert_location($redir);
} else {
	require_once(TEMPLATE_DIR . 'functions.php');
	include(TEMPLATE_DIR . '/header.php');
	if ($options['ref_check']) check_referer();
	echo('<div align="center">');

	$_GET['saveto'] = urldecode(trim($_GET['saveto']));
	do {
		$_GET['filename'] = urldecode(trim($_GET['filename']));
		if (strpos($_GET['filename'], '?') !== false) $_GET['filename'] = substr($_GET['filename'], 0, strpos($_GET['filename'], '?'));
		$_GET['host'] = strtolower(urldecode(trim($_GET['host'])));
		$_GET['path'] = urldecode(trim($_GET['path']));
		$_GET['port'] = !empty($_GET['port']) ? urldecode(trim($_GET['port'])) : 0;
		$_GET['referer'] = !empty($_GET['referer']) ? urldecode(trim($_GET['referer'])) : 0;
		$_GET['link'] = urldecode(trim($_GET['link']));

		$_GET['post'] = !empty($_GET['post']) ? unserialize(decrypt(urldecode(trim($_GET['post'])))) : 0;
		$_GET['cookie'] = !empty($_GET['cookie']) ? decrypt(urldecode(trim($_GET['cookie']))) : '';
		// $resume_from = $_GET["resume"] ? intval(urldecode(trim($_GET["resume"]))) : 0;
		// if ($_GET["resume"]) {unset($_GET["resume"]);}
		$redirectto = '';

		if ($options['bw_save']) {
			$mydomain = ($pos = strpos($_SERVER['HTTP_HOST'], ':')) !== false ? substr($_SERVER['HTTP_HOST'], 0, $pos) : $_SERVER['HTTP_HOST'];
			if (($_GET['host'] == $_SERVER['SERVER_ADDR'] || host_matches($mydomain, $_GET['host']))) html_error(sprintf(lang(7), $mydomain, $_SERVER['SERVER_ADDR']));
			unset($mydomain);
		}

		$AUTH = array();
		$_GET['auth'] = !empty($_GET['auth']) ? trim($_GET['auth']) : '';
		if ($_GET['auth'] == '1') {
			if (!preg_match('|^(?:.+\.)?(.+\..+)$|i', $_GET['host'], $hostmatch)) html_error('No valid hostname found for authorisation!');
			$hostmatch = str_replace('.', '_', $hostmatch[1]);
			if (isset($premium_acc["$hostmatch"]) && is_array($premium_acc["$hostmatch"]) && !empty($premium_acc["$hostmatch"]['user']) && !empty($premium_acc["$hostmatch"]['pass'])) {
				$AUTH['user'] = $premium_acc["$hostmatch"]['user'];
				$AUTH['pass'] = $premium_acc["$hostmatch"]['pass'];
				$auth = base64_encode($AUTH['user'] . ':' . $AUTH['pass']);
			} else html_error('No usable premium account found for this download - please set one in accounts.php');
		} elseif ($_GET['auth'] == '2') {
			if (!empty($premium_acc[$_GET['host']]['user']) && !empty($premium_acc[$_GET['host']]['pass'])) {
				$AUTH['user'] = $premium_acc[$_GET['host']]['user'];
				$AUTH['pass'] = $premium_acc[$_GET['host']]['pass'];
				$auth = base64_encode($AUTH['user'] . ':' . $AUTH['pass']);
			} else if (!filter_var($_GET['host'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
				foreach (array_keys($premium_acc) as $site) {
					if (host_matches($site, $_GET['host']) && !empty($premium_acc["$site"]['user']) && !empty($premium_acc["$site"]['pass'])) {
						$AUTH['user'] = $premium_acc["$site"]['user'];
						$AUTH['pass'] = $premium_acc["$site"]['pass'];
						$auth = base64_encode($AUTH['user'] . ':' . $AUTH['pass']);
						break;
					}
				}
			}
		} elseif ($_GET['auth'] == '3') {
			$auth = false;
			if (!empty($premium_acc[$_GET['host']]['cookie'])) {
				$_GET['cookie'] = trim($premium_acc[$_GET['host']]['cookie']);
			} else if (!filter_var($_GET['host'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_IPV6)) {
				foreach (array_keys($premium_acc) as $site) {
					if (host_matches($site, $_GET['host']) && !empty($premium_acc["$site"]['cookie'])) {
						$_GET['cookie'] = trim($premium_acc["$site"]['cookie']);
						break;
					}
				}
			}
		} elseif (!empty($_GET['auth'])) {
			$auth = decrypt(urldecode($_GET['auth']));
			list($AUTH['user'], $AUTH['pass']) = array_map('rawurldecode', explode(':', base64_decode($auth), 2));
		} else $auth = false;

		$pathWithName = $_GET['saveto'] . PATH_SPLITTER . basename($_GET['filename']);
		while (strpos($pathWithName, "\\\\") !== false) $pathWithName = str_replace("\\\\", "\\", $pathWithName);
		if (strpos($pathWithName, '?') !== false) $pathWithName = substr($pathWithName, 0, strpos($pathWithName, '?'));

		$url = parse_url($_GET['link']);
		if (empty($url['port'])) $url['port'] = $_GET['port'];
		if (isset($url['scheme']) && $url['scheme'] == 'ftp' && empty($_GET['proxy'])) {
			require_once(CLASS_DIR . 'ftp.php');
			$file = getftpurl($_GET['host'], defport($url), urldecode($_GET['path']), $pathWithName);
		} else {
			require_once(CLASS_DIR . 'http.php');
			!empty($_GET['force_name']) ? $force_name = urldecode($_GET['force_name']) : '';
			$file = geturl($_GET['host'], defport($url), $_GET['path'], $_GET['referer'], $_GET['cookie'], $_GET['post'], $pathWithName, $_GET['proxy'], $pauth, $auth, $url['scheme']);
		}

		if ($options['redir'] && $lastError && strpos($lastError, substr(lang(95), 0, strpos(lang(95), '%1$s'))) !== false) {
			$redirectto = substr($lastError, strpos(lang(95), '%1$s'));
			$redirectto = trim(substr($redirectto, 0, strrpos($redirectto, ']')));
			print lang(8) . ' <b>' . htmlspecialchars($redirectto) . "</b> ... <br />$nn";
			$_GET['referer'] = urlencode($_GET['link']);
			if (!preg_match('@^(?:https?|ftp)\://@i', $redirectto)) { // If redirect doesn't have the host
				$ref = parse_url($_GET['link']);
				unset($ref['user'], $ref['pass'], $ref['query'], $ref['fragment']);
				if (substr($redirectto, 0, 1) != '/') $redirectto = "/$redirectto";
				$purl = array_merge($ref, parse_url($redirectto));
			} else $purl = parse_url($redirectto);
			$_GET['link'] = urlencode(rebuild_url($purl));
			if (basename($purl['path'])) $_GET['filename'] = basename($purl['path']);
			else $_GET['filename'] = 'index.html';
			$_GET['host'] = urlencode($purl['host']);
			$_GET['path'] = urlencode($purl['path'] . (!empty($purl['query']) ? '?' . $purl['query'] : ''));
			$_GET['port'] = !empty($purl['port']) ? $purl['port'] : 0;
			$_GET['cookie'] = !empty($_GET['cookie']) ? urlencode(encrypt($_GET['cookie'])) : '';
			if (is_array($_GET['post'])) $_GET['post'] = false;//$_GET['post'] = urlencode(encrypt(serialize($_GET['post'])));
			$lastError = $_GET['auth'] = '';
			unset($ref, $purl);
		}
	} while ($redirectto && !$lastError);

	if ($lastError) html_error(htmlspecialchars($lastError));
	elseif ($file['bytesReceived'] == $file['bytesTotal'] || $file['size'] == 'Unknown') {
		echo '<script type="text/javascript">' . "pr(100, '" . $file['size'] . "', '" . $file['speed'] . "')</script>\r\n";
		echo sprintf(lang(10), link_for_file($file['file']), $file['size'], $file['time'], $file['speed']);
		$file['date'] = time();

		if (!write_file(CONFIG_DIR . 'files.lst', serialize(array('name' => $file['file'], 'size' => $file['size'], 'date' => $file['date'], 'link' => $_GET['link'], 'comment' => (!empty($_GET['comment']) ? str_replace(array("\r", "\n"), array('\r', '\n'), $_GET['comment']) : ''))) . "\r\n", 0)) echo lang(9) . '<br />';

		if (!empty($_GET['email']) && !$options['disable_email']) {
			require_once(CLASS_DIR . 'mail.php');
			$_GET['partSize'] = (isset($_GET['partSize']) && is_numeric($_GET['partSize']) ? $_GET['partSize'] * 1024 * 1024 : false);
			if (xmail($fromaddr, $_GET['email'], 'File ' . $file['name'], 'File: ' . $file['name'] . "\r\n" . 'Link: ' . $_GET['link'] . (!empty($_GET['comment']) ? "\r\n" . 'Comments: ' . str_replace (array('\r', '\n'), array("\r", "\n"), $_GET['comment']) : ''), $pathWithName, $_GET['partSize'], ($_GET['partSize'] && !empty($_GET['method']) ? $_GET['method'] : ''))) {
				printf(lang(11), $_GET['email'], $file['name']);
			} else echo lang(12) . '<br />';
		}
		echo "\n<form method='POST' name='flist' action='{$_SERVER['SCRIPT_NAME']}'>\n";
		echo "\t<input type='hidden' name='files[]' value='{$file['date']}' /><br />\n";
		echo "\t<div style='text-align:center;'>\n";
		echo renderActions();
		echo "\t</div>\n";
		echo "</form>\n";
		if ($options['new_window']) echo '<br /><a href="javascript:window.close();">' . lang(378) . '</a>';
		else echo "<br /><a href='{$_SERVER['SCRIPT_NAME']}'>" . lang(13) . "</a>";

		if (!empty($_GET['audl'])) echo $nn . '<script type="text/javascript">parent.nextlink();</script>';
	} else {
		unlink($pathWithName);
		print lang(14) . '<br /><a href="javascript:location.reload();">' . lang(15) . '</a>';
		if (!empty($_GET['audl'])) {
			echo $nn . '<script type="text/javascript">parent.nextlink();</script>';
		}
		//echo '<script type="text/javascript">location.reload();</script>';
	}
	echo "\n</div>\n</body>\n</html>";
}
order deny,allow
deny from all
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// The Arabic language file
// You should always use this file as a template for translating

$lang[1] = 'Ø±ÙØ¶ Ø§ÙÙØµÙÙ';
$lang[2] = 'Ø§ÙØ®Ø§Ø¯Ù Ø±ÙØ¶Øª ØªÙØ¨ÙØ© Ø·ÙØ¨Ù';
$lang[3] = 'Ø§ÙØª ÙÙ ØªØ¯Ø®Ù Ø¹ÙÙØ§Ù Ø¨Ø±ÙØ¯ Ø¥ÙÙØªØ±ÙÙÙ ØµØ§ÙØ­';
$lang[4] = 'Ø§ÙØ­Ø¬Ù ÙÙ Ø§ÙØ£Ø¬Ø²Ø§Ø¡ ÙÙØ³Øª Ø§ÙØ±ÙÙÙØ©';
$lang[5] = 'Ø±Ø§Ø¨Ø· ÙÙ ÙÙØ¹ ØºÙØ± ÙØ¹Ø±ÙÙ, <span class="font-black">ÙÙØ· Ø§Ø³ØªØ®Ø¯Ø§Ù <span class="font-blue">http</span> Ø§Ù <span class="font-blue">https</span> Ø§Ù <span class="font-blue">ftp</span> Ø¨Ø±ÙØªÙÙÙÙ</span>';
$lang[6] = 'ÙÙ ÙØªÙ ØªØ­Ø¯ÙØ¯ ÙØ³Ø§Ø± ÙØ­ÙØ¸ ÙØ°Ø§ Ø§ÙÙÙÙ';
$lang[7] = 'ØºÙØ± ÙØ³ÙÙØ­ ÙÙ <span class="font-black">%1$s (%2$s)</span>'; // %1$s = Ø§Ø³Ù Ø§ÙÙØ¶ÙÙ %2$s = Ø§Ù Ø¨Ù Ø§ÙÙØ¶ÙÙ
$lang[8] = 'Ø¥Ø¹Ø§Ø¯Ø© Ø§ÙØªÙØ¬ÙÙ Ø¥ÙÙ:';
$lang[9] = 'ØªØ¹Ø°Ø± ØªØ­Ø¯ÙØ« ÙØ§Ø¦ÙØ© Ø§ÙÙÙÙØ§Øª';
$lang[10] = 'ÙÙÙ <b>%1$s</b> (<b>%2$s</b>) Ø§ÙÙØ­ÙÙØ¸Ø©!<br />Ø§ÙÙÙØª: <b>%3$s</b><br />ÙØªÙØ³Ø· Ø§ÙØ³Ø±Ø¹Ø©: <b>%4$s KB/s</b><br />'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ %2$s = Ø­Ø¬Ù Ø§ÙÙÙÙ %3$s = ÙÙØª Ø§ÙØªØ­ÙÙÙ %4$s = Ø§ÙØ³Ø±Ø¹Ø©
$lang[11] = '<script>Ø§ÙØ¨Ø±ÙØ¯("Ø§ÙÙÙÙ ØªÙ Ø¥Ø±Ø³Ø§ÙÙ Ø¥ÙÙ ÙØ°Ø§ Ø§ÙØ¹ÙÙØ§Ù<b>%1$s</b>.", "%2$s");</script>'; // %1$s = Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ§ÙÙØªØ±ÙÙÙ %2$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[12] = 'Ø®Ø·Ø£ ÙÙ Ø§Ø±Ø³Ø§Ù Ø§ÙÙÙÙ!';
$lang[13] = 'Ø§ÙØ¹ÙØ¯Ø© Ø¥ÙÙ Ø§ÙØ±Ø¦ÙØ³ÙØ©';
$lang[14] = 'ÙÙØ¯Øª Ø§ÙØ§ØªØµØ§Ù Ø Ø­Ø°Ù Ø§ÙÙÙÙ.';
$lang[15] = 'ØªØ­Ø¯ÙØ«';
$lang[16] = 'Ø§ÙØ±Ø¬Ø§Ø¡ ØªØºÙÙØ± Ø§ÙÙØ¶Ø¹ Ø§ÙÙ <b>1</b>';
$lang[17] = 'Ø§ÙØ­Ø¯ Ø§ÙØ§ÙØµÙ (%1$s) ÙÙ Ø§ÙÙØµÙØ§Øª ØªÙ Ø§ÙØªÙØµÙ Ø¥ÙÙÙØ§.'; // %1$s = Ø§ÙØ­Ø¯ Ø§ÙØ£ÙØµÙ ÙØ¹Ø¯Ø¯ ÙÙ Ø§ÙØ±ÙØ§Ø¨Ø·
$lang[18] = '%1$s Ø±Ø§Ø¨Ø·%2$s Ø¯ÙÙØª ÙÙ %3$s Ø«Ø§ÙÙØ©. (Method: <b>%4$s</b>)'; // %1$s = Ø¹Ø¯Ø¯ ÙÙ Ø§ÙØ±ÙØ§Ø¨Ø· %2$s = ØªØ¹Ø¯Ø¯ Ø´ÙÙ %3$s = Ø«Ø§ÙÙØ© %4$s = Ø·Ø±ÙÙØ© ÙÙØ­Øµ Ø§ÙØ±ÙØ§Ø¨Ø·
$lang[19] = 's'; // ÙÙØ§ÙØ© ØµÙØºØ© Ø§ÙØ¬ÙØ¹
$lang[20] = 'Ø¹ÙÙØ§Ù Ø§ÙÙÙÙÙ Ø§ÙÙÙÙÙ';
$lang[21] = 'Ø±Ø§Ø¨Ø·';
$lang[22] = 'ÙØ¶Ø¹';
$lang[23] = 'Ø§ÙØªØ¸Ø§Ø±';
$lang[24] = 'Ø®Ø·Ø£ ÙÙ Ø§ÙØ¹ÙÙØ§Ù';
$lang[25] = 'Ø¥Ø¹Ø¯Ø§Ø¯';
$lang[26] = 'Ø§ÙØ¨Ø¯Ø¡';
$lang[27] = 'ÙÙØ¯Øª Ø§ÙØ§ØªØµØ§Ù';
$lang[28] = 'Ø§ÙØªÙÙ';
$lang[29] = 'Ø¨Ø¯Ø¡ ØªØ­ÙÙÙ Ø§ÙØ±ÙØ§Ø¨Ø· Ø§ÙÙØ«ÙØ±Ø© Ø¯ÙØ¹Ø© ÙØ§Ø­Ø¯Ø©';
$lang[30] = 'Ø¥Ø·Ø§Ø±Ø§Øª ØºÙØ± ÙØ¹ØªÙØ¯Ø© Ø ÙØªØ­Ø¯ÙØ« Ø§ÙÙØªØµÙØ­ Ø§ÙØ®Ø§Øµ Ø¨Ù';
$lang[31] = 'Ø§Ø¶Ø§ÙØ© Ø±ÙØ§Ø¨Ø·';
$lang[32] = 'Ø§ÙØ±ÙØ§Ø¨Ø·';
$lang[33] = 'Ø®ÙØ§Ø±Ø§Øª';
$lang[34] = 'ÙÙÙØ§Øª Ø§ÙÙØ³Ø­ÙØ¨Ø© ÙÙ Ø§ÙØ³ÙØ±ÙØ±Ø§Øª Ø§ÙØ§Ø®Ø±Ù';
$lang[35] = 'Ø§Ø³ØªØ®Ø¯Ù Ø¥Ø¹Ø¯Ø§Ø¯Ø§Øª Ø§ÙØ¨Ø±ÙÙØ³Ù';
$lang[36] = 'Ø¨Ø±ÙÙØ³Ù';
$lang[37] = 'Ø§Ø³Ù Ø§ÙÙØ³ØªØ®Ø¯Ù';
$lang[38] = 'ÙÙÙØ© Ø§ÙÙØ±ÙØ±';
$lang[39] = 'Ø§Ø³ØªØ®Ø¯Ù Ø­Ø³Ø§Ø¨Ù ÙÙ [imageshack]';
$lang[40] = 'Ø­ÙØ¸ Ø§ÙÙ';
$lang[41] = 'Ø§ÙÙØ³Ø§Ø±';
$lang[42] = 'Ø§Ø³ØªØ®Ø¯Ù Ø­Ø³Ø§Ø¨ Ø§ÙÙÙØª Ø¨Ø±ÙÙÙÙ';
$lang[43] = 'ØªØ´ØºÙÙ Ø§ÙØ³ÙØ±ÙØ± Ø¬Ø§Ø°Ø¨ÙØ©';
$lang[44] = 'ØªØ£Ø®ÙØ± Ø§ÙÙÙØª';
$lang[45] = 'ØªØ£Ø®ÙØ± (Ø«Ø§ÙÙØ©)';
$lang[46] = 'ÙÙ ÙØªÙ ØªØ­Ø¯ÙØ¯ Ø£Ù ÙÙÙ ÙÙØ±ÙØ¹';
$lang[47] = 'Ø§Ø®ØªØ± ÙÙÙ ÙÙØ±ÙØ¹';
$lang[48] = 'Ø§ÙØ³ÙØ±ÙØ± ÙØ§ ÙØ¯Ø¹Ù Ø±ÙØ¹ Ø§ÙÙÙÙØ§Øª!';
$lang[49] = 'ØªØ­ÙÙÙ ÙÙØ§ÙØ°';
$lang[50] = 'ØªÙØ³ÙÙ Ø­ÙØ¸ Ø§ÙØ±Ø§Ø¨Ø·';
$lang[51] = 'Ø§ÙÙØºØ©';
$lang[52] = 'ØªØ­Ø¯ÙØ¯ Ø§ÙØ¬ÙÙØ¹';
$lang[53] = 'Ø§ÙØºØ§Ø¡ ØªØ­Ø¯ÙØ¯ Ø§ÙØ¬ÙÙØ¹';
$lang[54] = 'Ø¹ÙØ³ Ø§ÙØªØ­Ø¯ÙØ¯';
$lang[55] = 'Ø§ÙØ§Ø³Ù';
$lang[56] = 'Ø§ÙØ­Ø¬Ù';
$lang[57] = 'ÙÙ ÙØªÙ Ø§ÙØ¹Ø«ÙØ± Ø¹ÙÙ ÙÙÙØ§Øª';
$lang[58] = 'Legend for link saving format: (case sensitive)';
$lang[59] = 'Ø±Ø§Ø¨Ø· ÙÙØªØ­ÙÙÙ';
$lang[60] = 'Ø§Ø³Ù Ø§ÙÙÙÙ';
$lang[61] = 'Ø±Ø¨Ø· Ø§ÙÙÙØ· Ø§ÙØ§ÙØªØ±Ø§Ø¶Ù';
$lang[62] = 'Ø£Ù Ø´ÙØ¡ Ø¨Ø§ÙØ¥Ø¶Ø§ÙØ© Ø¥ÙÙ ØªÙÙ Ø§ÙÙØ°ÙÙØ±Ø© Ø£Ø¹ÙØ§Ù Ø³ÙÙ ØªØ¹Ø§ÙÙ Ø¹ÙÙ Ø£ÙÙØ§ Ø§ÙØ³ÙØ³ÙØ© Ø ÙÙÙØª ØºÙØ± ÙØ§Ø¯Ø± Ø¹ÙÙ Ø§ÙÙÙØ§Ù ÙØªØ¹Ø¯Ø¯Ø© ØªÙØ³ÙÙ Ø³Ø·Ø± Ø§ÙØ¢Ù Ø Ø³ÙØªÙ Ø¥Ø¯Ø±Ø§Ø¬ Ø³Ø·Ø± Ø¬Ø¯ÙØ¯ ÙÙÙÙ ÙÙÙ ÙØµÙØ©.';
$lang[63] = 'Ø±ÙØ¹ Ø§ÙÙÙÙ %1$s to %2$s'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ %2$s = Ø§Ø³Ù Ø§ÙÙÙÙ Ø§ÙÙØ¶ÙÙ
$lang[64] = 'Ø§ÙÙÙÙ %1$s ÙØ§ ÙØ¬ÙØ¯ ÙÙ.'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[65] = 'Ø§ÙÙÙÙ %1$s ØºÙØ± ÙØ§Ø¨Ù ÙÙÙØ±Ø§Ø¡Ø© ÙÙ ÙØ¨Ù Ø§ÙØ¨Ø±ÙØ§ÙØ¬ Ø§ÙÙØµÙ.'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[66] = 'ÙØ§ ÙÙÙÙ Ø§ÙØªØ­ÙÙÙ Ø ÙØ£Ù Ø­Ø¬Ù Ø§ÙÙÙÙ ÙØ¨ÙØ± Ø¬Ø¯Ø§.';
$lang[67] = 'Ø®Ø¯ÙØ© Ø§ÙØªØ­ÙÙÙ ØºÙØ± ÙØ³ÙÙØ­Ø©';
$lang[68] = 'Ø±Ø§Ø¨Ø· Ø§ÙØªØ­ÙÙÙ';
$lang[69] = 'Ø±Ø§Ø¨Ø· Ø§ÙØ­Ø°Ù';
$lang[70] = 'Ø±Ø§Ø¨Ø· Ø§ÙØ³ØªØ§Øª';
$lang[71] = 'Ø±Ø§Ø¨Ø· Ø§ÙÙØ¯ÙØ±';
$lang[72] = 'Ø§Ø³Ù Ø§ÙÙØ³ØªØ®Ø¯Ù';
$lang[73] = 'FTP Ø±ÙØ¹';
$lang[74] = 'ÙÙÙØ© Ø§ÙÙØ±ÙØ±';
$lang[75] = 'Ø±Ø§ÙØ¨Ø¯ ÙÙØ´ - Ø±ÙØ§Ø¨Ø· Ø§ÙØ±ÙØ¹';
$lang[76] = '<div class="linktitle">Ø§ÙØ±ÙØ§Ø¨Ø· Ø§ÙÙØ±ÙÙØ¹Ø© ÙÙ <strong>%1$s</strong> - <span class="bluefont">Ø§ÙØ­Ø¬Ù: <strong>%2$s</strong></span></div>'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ %2$s = Ø­Ø¬Ù Ø§ÙÙÙÙ
$lang[77] = 'Ø§ØºÙØ§Ù';
$lang[78] = 'Ø±Ø¬ÙØ¹';
$lang[79] = 'ØªØ¹Ø°Ø± ØªØ£Ø³ÙØ³ Ø§ØªØµØ§Ù ÙØ¹ Ø§ÙØ³ÙØ±ÙØ± %1$s.'; // %1$s = Ø§Ø³Ù Ø®Ø§Ø¯Ù FTP
$lang[80] = 'Ø§Ø³Ù Ø§ÙÙØ³ØªØ®Ø¯Ù ØºÙØ± ØµØ­ÙØ­Ø© Ù / Ø£Ù ÙÙÙØ© Ø§ÙØ³Ø±.';
$lang[81] = 'ÙØªØµÙØ©: <b>%1$s</b>...'; // %1$s = Ø§Ø³Ù Ø®Ø§Ø¯Ù FTP
$lang[82] = 'ÙÙØ¹ Ø§ÙÙÙÙ %1$s ÙØ­Ø±Ù ÙÙØªÙ ØªØ­ÙÙÙÙØ§'; // %1$s = ÙÙØ¹ Ø§ÙÙÙÙ
$lang[83] = 'Ø§ÙÙÙÙ <b>%1$s</b>, Ø§ÙØ­Ø¬Ù <b>%2$s</b>...'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ %2$s = Ø­Ø¬Ù Ø§ÙÙÙÙ
$lang[84] = 'Ø®Ø·Ø£ ÙÙ Ø§Ø¹Ø§Ø¯Ø© ØªÙØ¬ÙÙ Ø§ÙØ±Ø§Ø¨Ø·';
$lang[85] = 'ÙØµ ÙØ±Øª ÙÙØ§ ÙÙ ÙÙØ§Ø¬ÙØ© Ø³ÙØ³ÙØ©!';
$lang[86] = 'Ø®Ø·Ø£ : Ø§ÙØ±Ø¬Ø§Ø¡ ØªÙÙÙÙ Ø¬Ø§ÙØ§ Ø³ÙØ±ÙØ¨Øª.';
$lang[87] = 'Ø§ÙØ±Ø¬Ø§Ø¡ Ø§ÙØ§ÙØªØ¸Ø§Ø± <b>%1$s</b> Ø«Ø§ÙÙØ©...'; // %1$s = number of seconds
$lang[88] = 'ØªØ¹Ø°Ø± Ø§ÙØ§ØªØµØ§Ù Ø¨Ù %1$s ÙÙ Ø§ÙÙÙÙØ° %2$s'; // %1$s = Ø§Ø³Ù Ø§ÙÙØ¶ÙÙ %2$s = Ø§ÙÙÙÙØ°
$lang[89] = 'ÙØªØµÙ Ø§ÙÙ Ø§ÙØ¨Ø±ÙÙØ³Ù: <b>%1$s</b> ÙÙ Ø§ÙÙÙÙØ° <b>%2$s</b>...'; // %1$s = Ø¨Ø±ÙÙØ³Ù Ø§ÙÙØ¶ÙÙ %2$s = ÙÙÙØ° Ø§ÙØ¨Ø±ÙÙØ³Ù
$lang[90] = 'ÙØªØµÙØ© : <b>%1$s</b> ÙÙ Ø§ÙÙÙÙØ° <b>%2$s</b>...'; // %1$s = Ø§ÙÙØ¶ÙÙ %2$s = Ø§ÙÙÙÙØ°
$lang[91] = 'ÙØ§ ÙÙØ¬Ø¯ Ø±Ø£Ø³ ØªÙÙØª';
$lang[92] = 'Ø§ÙØª ÙÙÙÙØ¹ ÙÙ Ø§ÙÙØµÙÙ Ø¥ÙÙ ÙØ°Ù Ø§ÙØµÙØ­Ø©!';
$lang[93] = 'ÙÙ ÙØªÙ Ø§ÙØ¹Ø«ÙØ± Ø¹ÙÙ ÙØ°Ù Ø§ÙØµÙØ­Ø©!';
$lang[94] = 'Ø§ÙØµÙØ­Ø© ØºÙØ± ÙÙØ¬ÙØ¯Ø© Ø£Ù Ø£ÙÙØ§ ÙÙÙÙØ¹Ø© ÙÙ Ø§ÙÙØµÙÙ Ø§ÙÙÙØ§!';
$lang[95] = 'Ø®Ø·Ø£! ÙÙ Ø§Ø¹Ø§Ø¯Ø© Ø§ÙØªÙØ¬ÙÙ Ø§ÙÙ [%1$s]'; // %1$s = ØªÙØ¬ÙÙ Ø¹ÙÙØ§Ù
$lang[96] = 'ÙØ°Ø§ Ø§ÙÙÙÙØ¹ ÙØªØ·ÙØ¨ Ø¥Ø°ÙØ§. ÙÙØ¥Ø´Ø§Ø±Ø© Ø§ÙÙØ³ØªØ®Ø¯Ù ÙÙÙÙØ© Ø§ÙØ³Ø± ÙÙÙØµÙÙ ÙÙÙ Ø§ÙØ¶Ø±ÙØ±Ù Ø§Ø³ØªØ®Ø¯Ø§Ù Ø±Ø§Ø¨Ø· ÙÙØ§Ø«ÙØ©:<br />http://<b>Ø¯Ø®ÙÙ:ÙÙÙØ© Ø§ÙÙØ±ÙØ±</b>www.site.com/file.exe';
$lang[97] = 'ØªÙ ØªØ¬Ø§ÙØ² Ø§ÙØ­Ø¯ Ø§ÙÙØ³ÙÙØ­';
$lang[98] = 'ÙØ°Ø§ Ø§ÙØ®Ø§Ø¯Ù ÙØ§ ÙØ¯Ø¹Ù Ø§ÙØ§Ø³ØªØ¦ÙØ§Ù';
$lang[99] = 'ØªØ­ÙÙÙ';
$lang[100] = 'ÙØ°Ø§ Ø§ÙØ­Ø³Ø§Ø¨ ÙØ³ØªØ®Ø¯Ù Ø¢Ù Ø¨Ù Ø£Ø®Ø±.';
$lang[101] = 'Ø§ÙÙÙÙ %1$s ÙØ§ ÙÙÙÙ Ø­ÙØ¸ÙØ§ ÙÙ Ø§ÙÙØ¬ÙØ¯ %2$s'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ %2$s = Ø§Ø³Ù Ø§ÙÙØ¬ÙØ¯
$lang[102] = 'Ø­Ø§ÙÙ ØªØ¹Ø·Ù ØªØµØ±ÙØ­ 777 ÙÙÙØ¬ÙØ¯.';
$lang[103] = 'Ø­Ø§ÙÙ ÙØ±Ø© Ø§Ø®Ø±Ù';
$lang[104] = 'ÙÙÙ';
$lang[105] = 'ÙÙØ³ ÙÙ Ø§ÙÙÙÙÙ Ø§ÙÙÙØ§Ù Ø±ÙÙØ§ ÙÙØ§Ø³ÙØ§ ÙÙ Ø§ÙÙÙÙ %1$s'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[106] = 'Ø®Ø·Ø£ ÙÙ Ø§ÙØ¹ÙÙØ§Ù Ø Ø£Ù Ø®Ø·Ø£ ØºÙØ± ÙØ¹Ø±ÙÙ';
$lang[107] = 'ÙÙØ¯ ÙØµÙØª Ø§ÙÙ Ø§ÙØ­Ø¯ Ø§ÙÙØ³ÙÙØ­ Ø§ÙÙØ¬Ø§ÙÙ ÙÙÙØ³ØªØ®Ø¯ÙÙÙ.';
$lang[108] = 'Ø§ÙØªÙØª ÙØ¯Ø© Ø§ÙØªØ­ÙÙÙ';
$lang[109] = 'Ø®Ø·Ø£ Ø±ÙØ² Ø§ÙÙØµÙÙ.';
$lang[110] = 'ÙÙØ¯ Ø¯Ø®ÙØª Ø±ÙØ² Ø§ÙØ®Ø·Ø£ ÙØ±Ø§Øª Ø¹Ø¯ÙØ¯Ø© Ø¬Ø¯Ø§';
$lang[111] = 'ÙÙØ¯ ØªØ­ÙÙÙ ØªØ¬Ø§ÙØ²Øª Ø§ÙØ­Ø¯ Ø§ÙÙØ³ÙÙØ­ ÙÙ Ø§ÙØ¨Ø§ÙØ¯ÙÙØ«';
$lang[112] = 'Ø®Ø·Ø£ ÙÙ ÙØ±Ø§Ø¡Ø© Ø§ÙØ¨ÙØ§ÙØ§Øª';
$lang[113] = 'Ø®Ø·Ø£ ÙÙ Ø¥Ø±Ø³Ø§Ù Ø§ÙØ¨ÙØ§ÙØ§Øª';
$lang[114] = 'Ø¬Ø§Ø±ÙØ©';
$lang[115] = 'ØºÙØ± ÙØªØ§Ø­';
$lang[116] = 'ÙÙØª';
$lang[117] = 'Ø£ÙØª ÙÙ Ø­Ø§Ø¬Ø© ÙØªØ­ÙÙÙ / ØªÙØ¹ÙÙ cURL extension (http://www.php.net/cURL) Ø£Ù ÙÙÙÙÙ ØªØ¹ÙÙÙ \'fgc\' => 1 ÙÙ config.php.';
$lang[118] = 'ÙÙØ¹ÙØ© cURL ÙÙØ²Ø©';
$lang[119] = 'Ø§Ø³ØªØ®Ø¯Ø§Ù PHP5  Ø§ÙØ¶Ù ÙÙÙÙ ÙØ³Øª ÙÙØ²ÙØ§';
$lang[120] = 'ØªØ­ÙÙ ÙÙØ§ Ø¥Ø°Ø§ ÙØ§Ù ÙØ¯ÙÙ Ø·Ø±ÙÙØ© Ø¢ÙÙØ© ÙØªÙÙÙ Ø¹ÙÙ Ø§ÙØ³ÙÙØ§Ø±ÙÙ ÙØ§ ÙÙÙÙ Ø£Ù ØªØ¹ÙÙ ÙØ¹ Ø§ÙÙØ¶Ø¹ Ø§ÙØ¢ÙÙ Ø¹ÙÙ';
$lang[121] = 'Ø§Ø±Ø³Ø§Ù ÙÙÙ <b>%1$s</b>'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[122] = 'Ø¨Ø¯ÙÙ ØªÙØ³ÙÙ Ø§ÙÙÙÙ, Ø§Ø±Ø³Ø§Ù Ø§ÙÙ Ø¨Ø±ÙØ¯ Ø§ÙÙØªØ±ÙÙÙ ÙØ§Ø­Ø¯';
$lang[123] = 'ØªÙØ³ÙÙ Ø§ÙÙ %1$s Ø¬Ø²Ø¡ Ø­Ø¬Ù'; // %1$s = Ø¬Ø²Ø¡ Ø­Ø¬Ù
$lang[124] = 'Ø§ÙØ§Ø³ÙÙØ¨';
$lang[125] = 'Ø§Ø±Ø³Ø§Ù Ø¬Ø²Ø¡ <b>%1$s</b>'; //%1$s = part number
$lang[126] = 'ÙØ§ Ø­Ø§Ø¬Ø© ÙÙØªÙØ³ÙÙ, Ø§Ø±Ø³Ø§Ù Ø§ÙÙ Ø¨Ø±ÙØ¯ Ø§ÙÙØªØ±ÙÙÙ';
$lang[127] = 'ÙØ§ ÙÙÙÙ ÙÙÙØ¶ÙÙ Ø§ÙØ­ØµÙÙ Ø¹ÙÙ Ø§ÙÙÙÙ';
$lang[128] = 'ÙØ§ ÙÙÙÙ Ø§ÙØ´Ø§Ø¡ ÙÙÙ';
$lang[129] = 'Ø³Ø§Ø¹Ø§Øª'; // ØªØ¹Ø¯Ø¯
$lang[130] = 'Ø³Ø§Ø¹Ø©';
$lang[131] = 'Ø¯ÙØ§Ø¦Ù'; // ØªØ¹Ø¯Ø¯
$lang[132] = 'Ø¯ÙÙÙØ©';
$lang[133] = 'Ø«ÙØ§ÙÙ'; // ØªØ¹Ø¯Ø¯
$lang[134] = 'Ø«Ø§ÙÙØ©';
$lang[135] = 'ÙØ§ ÙÙÙÙ Ø§ÙÙØµÙÙ Ø§ÙÙ Ø§ÙØ°Ø§ÙØ±Ø© ÙØ£Ù Ø§ÙÙØ³Ø§Ø± Ø®Ø§Ø·Ø¦ Ø§Ù ÙÙØ§Ù ÙÙÙ Ø®Ø§Ø·Ø¦';
$lang[136] = 'Ø§ÙØ°Ø§ÙØ±Ø©';
$lang[137] = 'Ø®Ø·Ø£ ÙØ§ Ø­Ø¯Ø«';
$lang[138] = 'Ø§Ø®ØªØ± ÙÙÙ ÙØ§Ø­Ø¯ Ø¹ÙÙ Ø§ÙØ£ÙÙ.';
$lang[139] = 'Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ§ÙÙØªØ±ÙÙÙ';
$lang[140] = 'Ø§Ø±Ø³Ø§Ù';
$lang[141] = 'ØªÙ Ø§ÙØ­Ø°Ù Ø¨ÙØ¬Ø§Ø­';
$lang[142] = 'ÙØ³Ù Ø¨Ø£Ø¬Ø²Ø§Ø¡';
$lang[143] = 'Ø­Ø¬Ù Ø§ÙØ§Ø¬Ø²Ø§Ø¡';
$lang[144] = '<b>%1$s</b> - Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ§ÙÙØªØ±ÙÙÙ ØºÙØ± ØµØ§ÙØ­.'; // %1$s = Ø¹ÙÙØ§Ù Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ¥ÙÙØªØ±ÙÙÙ
$lang[145] = 'Ø§ÙÙÙÙ <b>%1$s</b> ÙÙ ÙØªÙ Ø§ÙØ¹Ø«ÙØ±!'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[146] = 'ÙØ§ ÙÙÙÙ ØªØ­Ø¯ÙØ« ÙØ§Ø¦ÙØ© Ø§ÙÙÙÙØ§Øª!';
$lang[147] = 'Ø­Ø°Ù ÙÙÙ ÙØ¹Ø·Ù';
$lang[148] = 'Ø­Ø°Ù Ø§ÙÙÙÙØ§Øª';
$lang[149] = 'ÙØ¹Ù';
$lang[150] = 'ÙØ§';
$lang[151] = 'Ø§ÙÙÙÙ <b>%1$s</b> ÙØ­Ø°ÙÙ'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[152] = 'Ø®Ø·Ø£ ÙÙ Ø­Ø°Ù Ø§ÙÙÙÙ <b>%1$s</b>!'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[153] = 'Ø§ÙÙØ¶ÙÙ';
$lang[154] = 'Ø§ÙÙÙÙØ°';
$lang[155] = 'Ø§ÙÙØ¬ÙØ¯';
$lang[156] = 'Ø­Ø°Ù Ø§ÙÙÙÙ Ø¨Ø¹Ø¯ Ø§ÙØ±ÙØ¹ Ø¨ÙØ¬Ø§Ø­';
$lang[157] = 'Ø­ÙØ¸ Ø¨ÙØ§ÙØ§Øª FTP';
$lang[158] = 'Ø­Ø°Ù Ø¨ÙØ§ÙØ§Øª FTP';
$lang[159] = 'ÙØ§ ÙÙÙÙ ØªØ­Ø¯ÙØ¯ ÙÙÙØ¹ Ø§ÙÙØ¬ÙØ¯ <b>%1$s</b>'; // %1$s = directory name
$lang[160] = 'Ø§ÙÙÙÙ %1$s ØªÙ Ø§ÙØ±ÙØ¹ Ø¨ÙØ¬Ø§Ø­!'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[161] = 'Ø§ÙÙÙØª';
$lang[162] = 'ÙØªÙØ³Ø· Ø§ÙØ³Ø±Ø¹Ø©';
$lang[163] = 'ØªØ¹Ø°Ø± Ø±ÙØ¹ Ø§ÙÙÙÙ <b>%1$s</b>!'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[164] = 'Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ§ÙÙØªØ±ÙÙÙ';
$lang[165] = 'ØªÙ Ø§ÙØ­Ø°Ù Ø¨ÙØ¬Ø§Ø­';
$lang[166] = 'Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ¥ÙÙØªØ±ÙÙÙ ØºÙØ± ØµØ§ÙØ­';
$lang[167] = 'Ø§ÙØ±Ø¬Ø§Ø¡ Ø­Ø¯Ø¯ ÙÙØ· .crc Ø§Ù .001 file!';
$lang[168] = 'Ø§ÙØ±Ø¬Ø§Ø¡ Ø­Ø¯Ø¯ Ø§ÙÙÙÙ .crc file!';
$lang[169] = 'Ø±Ø¬Ø§Ø¡ Ø§Ø®ØªØ± .crc Ø§Ù .001 file!';
$lang[170] = 'Perform a CRC check? (ÙØ³ØªØ­Ø³Ù)';
$lang[171] = 'CRC32 check mode';
$lang[172] = 'Ø§Ø³ØªØ®Ø¯Ø§Ù hash_file (ÙØ³ØªØ­Ø³Ù)';
$lang[173] = 'ÙØ±Ø§Ø¡Ø© Ø§ÙÙÙÙ Ø¥ÙÙ Ø§ÙØ°Ø§ÙØ±Ø©';
$lang[174] = 'Fake crc';
$lang[175] = 'Ø­Ø°Ù Ø§ÙÙÙÙ Ø¨Ø¹Ø¯ Ø§ÙØ¯ÙØ¬ Ø¨ÙØ¬Ø§Ø­';
$lang[176] = 'ÙÙØ§Ø­Ø¸Ø©';
$lang[177] = 'Ø­Ø¬Ù Ø§ÙÙÙÙ Ù crc32 ÙÙ ÙÙÙÙ Ø§ÙØ§Ø®ØªÙØ§Ø±';
$lang[178] = 'ÙØ§ ÙÙÙÙ ÙØ±Ø§Ø¡Ø© Ø§ÙÙÙÙ .crc file!';
$lang[179] = 'Ø®Ø·Ø£ Ø Ø¥Ø®Ø±Ø§Ø¬ Ø§ÙÙÙÙ ÙÙØ¬ÙØ¯ ÙØ³Ø¨ÙØ§ <b>%1$s</b>'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[180] = 'Ø®Ø·Ø£ Ø Ø£Ø¬Ø²Ø§Ø¡ ÙÙÙÙØ¯Ø© Ø£Ù ØºÙØ± ÙÙØªÙÙØ©';
$lang[181] = 'Ø®Ø·Ø£ Ø ÙÙÙØ¹ Ø§ÙÙÙÙ %1$s ÙÙÙÙØ¹'; // ÙÙØ¹ Ø§ÙÙÙÙ
$lang[182] = 'ÙÙÙØ³ ÙÙ Ø§ÙÙÙÙÙ ÙÙØªØ­ Ø§ÙÙÙÙ Ø§ÙÙØ¬ÙØ© <b>%1$s</b>'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[183] = 'Ø®Ø·Ø£ ÙÙ ÙØªØ§Ø¨Ø© Ø§ÙÙÙÙ <b>%1$s</b>!'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[184] = 'CRC32 Ø§ÙØ§Ø®ØªØ¨Ø§Ø±Ù ÙØ§ ÙØ·Ø§Ø¨Ù!';
$lang[185] = 'Ø§ÙÙÙÙ <b>%1$s</b> ØªÙ Ø¯ÙØ¬Ù Ø¨ÙØ¬Ø§Ø­'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[186] = 'Ø­Ø°Ù';
$lang[187] = 'ÙÙ ÙØªÙ Ø­Ø°Ù';
$lang[188] = 'Ø¥Ø¶Ø§ÙØ© ÙÙØ­Ù';
$lang[189] = 'Ø¨Ø¯ÙÙ';
$lang[190] = 'Ø§ÙÙ';
$lang[191] = 'Ø§Ø¹Ø§Ø¯Ø© ØªØ³ÙÙØ©?';
$lang[192] = 'Ø§ÙØºØ§Ø¡';
$lang[193] = 'Ø®Ø·Ø£ ØªØ³ÙÙØ© Ø§ÙÙÙÙ <b>%1$s</b>'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[194] = 'Ø§ÙÙÙÙ <b>%1$s</b> ØªÙØª Ø§Ø¹Ø§Ø¯Ø© ØªØ³ÙÙØªÙ Ø§ÙÙ <b>%2$s</b>'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ Ø§ÙØ£ØµÙÙ %2$s = Ø¥Ø¹Ø§Ø¯Ø© ØªØ³ÙÙØ© Ø§Ø³Ù Ø§ÙÙÙÙ 
$lang[195] = 'Ø§Ø³Ù Ø§ÙØ§Ø±Ø´ÙÙ';
$lang[196] = 'Ø§ÙØ±Ø¬Ø§Ø¡ Ø¥Ø¯Ø®Ø§Ù Ø§Ø³Ù Ø§ÙØ§Ø±Ø´ÙÙ!';
$lang[197] = 'Ø®Ø·Ø£ ÙÙ Ø§ÙØ£Ø±Ø´ÙÙ ÙÙ ÙØªÙ Ø¥ÙØ´Ø§Ø¡ Ø§ÙØ§Ø±Ø´ÙÙ.';
$lang[198] = 'Ø§ÙÙÙÙ %1$s ÙØ§ÙØª ÙØ¹Ø¨Ø£Ø©'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[199] = 'Ø§ÙÙØ¹Ø¨Ø£ ÙÙ Ø§ÙØ§Ø±Ø´ÙÙ <b>%1$s</b>'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[200] = 'Ø®Ø·Ø£ Ø Ø§ÙØ§Ø±Ø´ÙÙ ÙØ§Ø±Øº.';
$lang[201] = 'Ø§Ø³Ù Ø¬Ø¯ÙØ¯';
$lang[202] = 'ØªØ¹Ø°Ø± Ø¥Ø¹Ø§Ø¯Ø© ØªØ³ÙÙØ© Ø§ÙÙÙÙ <b>%1$s</b>!'; // %1$s = Ø§Ø³Ù Ø§ÙÙÙÙ
$lang[203] = 'Ø­Ø°Ù Ø§ÙÙÙÙ Ø¨Ø¹Ø¯ Ø§ÙØªÙØ³ÙÙ Ø¨ÙØ¬Ø§Ø­';
$lang[204] = 'Ø§ÙÙÙÙØ§Øª ÙØ§ÙÙØ¬ÙØ¯Ø§Øª';
$lang[205] = 'ÙÙ Ø¶ØºØ· zip';
$lang[206] = 'Ø§Ø®ØªØ± ØµÙØºØ© Ø§ÙÙÙØ¯ÙÙ Ø§ÙØªÙ ØªØ±ÙØ¯ ØªØ­ÙÙÙÙØ§ ÙÙ Ø§ÙÙÙØªÙÙØ¨';
$lang[207] = 'Ø§ÙØ±Ø§Ø¨Ø· Ø§ÙØ°Ù ØªØ±ÙØ¯ Ø³Ø­Ø¨Ù';
$lang[208] = 'Ø§ÙØ±ÙÙØ±ÙØ±';
$lang[209] = 'Ø³Ø­Ø¨ Ø§ÙÙÙÙ';
$lang[210] = 'Ø§Ø³ØªØ®Ø¯Ù &amp; Ø§ÙØ¨Ø±ÙØªÙÙÙÙ (HTTP/FTP)';
$lang[211] = 'ÙØ³ØªØ®Ø¯Ù';
$lang[212] = 'ÙÙÙØ© Ø³Ø±';
$lang[213] = 'Ø¥Ø¶Ø§ÙØ© ØªØ¹ÙÙÙØ§Øª';
$lang[214] = 'Ø§ÙØ®ÙØ§Ø±Ø§Øª Ø§ÙØ§Ø¶Ø§ÙÙØ©';
$lang[215] = 'ØªØ¹Ø·ÙÙ Ø¬ÙÙØ¹ Ø§ÙØ¥Ø¶Ø§ÙØ§Øª';
$lang[216] = 'Ø§Ø®ØªØ± ØµÙØºØ© Ø§ÙÙÙØ¯ÙÙ Ø§ÙØªÙ ØªØ±ÙØ¯ ØªØ­ÙÙÙÙØ§ ÙÙ Ø§ÙÙÙØªÙÙØ¨';
$lang[217] = 'Ø§ÙØ±Ø§Ø¨Ø· Ø§ÙÙØ¨Ø§Ø´Ø±';
$lang[218] = 'Ø§Ø®ØªØ± Ø§ÙØµÙØºØ©';
$lang[219] = 'ÙÙØ­ØµÙÙ Ø¹ÙÙ Ø§Ø¹ÙÙ Ø¬ÙØ¯Ø©';
$lang[220] = '17 [ÙÙØ¯ÙÙ: 3GP 176x144 | ØµÙØª: AAC 2ch 44.10kHz]';
$lang[221] = '5 [ÙÙØ¯ÙÙ: FLV 400x240 | ØµÙØª: MP3 1ch 22.05kHz]';
$lang[222] = '34 [ÙÙØ¯ÙÙ: FLV 640x360 | ØµÙØª: AAC 2ch 44.10kHz]';
$lang[223] = '35 [ÙÙØ¯ÙÙ: FLV 854x480 | ØµÙØª: AAC 2ch 44.10kHz]';
$lang[224] = '43 [ÙÙØ¯ÙÙ: WebM 640x360 | ØµÙØª: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [ÙÙØ¯ÙÙ: WebM 1280x720 | ØµÙØª: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [ÙÙØ¯ÙÙ: MP4 480x360 | ØµÙØª: AAC 2ch 44.10kHz]';
$lang[227] = '22 [ÙÙØ¯ÙÙ: MP4 1280x720 | ØµÙØª: AAC 2ch 44.10kHz]';
$lang[228] = '37 [ÙÙØ¯ÙÙ: MP4 1920x1080 | ØµÙØª: AAC 2ch 44.10kHz]';
$lang[229] = 'ÙØªØ­ÙÙÙ Ø§ÙØªÙØ±ÙØª ÙÙ ImageShack';
$lang[230] = 'Ø§Ø³Ù Ø§ÙÙØ³ØªØ®Ø¯Ù';
$lang[231] = 'ÙÙÙØ© Ø§ÙÙØ±ÙØ±';
$lang[232] = 'Ø§Ø³ØªØ®Ø¯Ù ÙÙÙÙØ² Megaupload.com ÙÙØªØ­ÙÙÙ';
$lang[233] = 'ÙØ³ØªØ®Ø¯Ù';
$lang[234] = 'Ø§Ø³ØªØ®Ø¯Ø§Ù Ø§Ø¶Ø§ÙØ© Ø§ÙÙÙØªØ¯ÙØ§Øª';
$lang[235] = 'ÙØ¶Ø¹ ÙÙÙÙØ² Ø§Ø¶Ø§ÙÙ';
$lang[236] = 'ÙÙØªØ§Ø­=Ø§ÙÙÙÙØ©';
$lang[237] = 'Ø¥Ø±Ø³Ø§Ù ÙÙÙ Ø¥ÙÙ Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ¥ÙÙØªØ±ÙÙÙ';
$lang[238] = 'Ø§ÙØ¨Ø±ÙØ¯ Ø§ÙØ§ÙÙØªØ±ÙÙÙ';
$lang[239] = 'ØªÙØ³ÙÙ Ø§ÙÙÙÙØ§Øª';
$lang[240] = 'Ø§ÙØ§Ø³ÙÙØ¨';
$lang[241] = 'Ø§ÙØ­Ø¬Ù Ø§ÙÙÙÙ';
$lang[242] = 'RFC 2046';
$lang[243] = 'Ø­Ø¬Ù Ø§ÙØ§Ø¬Ø²Ø§Ø¡';
$lang[244] = 'ÙÙØºØ§ Ø¨Ø§ÙØª';
$lang[245] = 'Ø§Ø³ØªØ®Ø¯Ù Ø§Ø¹Ø¯Ø§Ø¯Ø§Øª Ø§ÙØ¨Ø±ÙÙØ³Ù';
$lang[246] = 'Ø§ÙØ¨Ø±ÙÙØ³Ù';
$lang[247] = 'Ø§Ø³Ù Ø§ÙÙØ³ØªØ®Ø¯Ù';
$lang[248] = 'ÙÙÙØ© Ø§ÙÙØ±ÙØ±';
$lang[249] = 'Ø§Ø³ØªØ®Ø¯Ù Ø­Ø³Ø§Ø¨ Ø§ÙÙÙØª Ø¨Ø±ÙÙÙÙ';
$lang[250] = 'Ø§Ø³Ù Ø§ÙÙØ³ØªØ®Ø¯Ù';
$lang[251] = 'ÙÙÙØ© Ø§ÙÙØ±ÙØ±';
$lang[252] = 'Ø­ÙØ¸ Ø§ÙÙ';
$lang[253] = 'Ø§ÙÙÙØ§Ù';
$lang[254] = 'Ø­ÙØ¸ Ø§ÙØ§Ø¹Ø¯Ø§Ø¯Ø§Øª';
$lang[255] = 'ÙØ³Ø­ Ø§ÙØ§Ø¹Ø¯Ø§Ø¯Ø§Øª Ø§ÙØ­Ø§ÙÙØ©';
$lang[256] = 'ØªØ­Ø¯ÙØ¯ Ø§ÙØ¬ÙÙØ¹';
$lang[257] = 'Ø§ÙØºØ§Ø¡ ØªØ­Ø¯ÙØ¯ Ø§ÙØ¬ÙÙØ¹';
$lang[258] = 'Ø¹ÙØ³ Ø§ÙØªØ­Ø¯ÙØ¯';
$lang[259] = 'Ø¹Ø±Ø¶';
$lang[260] = 'Ø§ÙØªØ­ÙÙÙ';
$lang[261] = 'ÙÙ Ø´ÙØ¡';
$lang[262] = 'Ø§ÙØ§Ø³Ù';
$lang[263] = 'Ø§ÙØ­Ø¬Ù';
$lang[264] = 'Ø§ÙØªØ¹ÙÙÙØ§Øª';
$lang[265] = 'Ø§ÙØªØ§Ø±ÙØ®';
$lang[266] = 'ÙØ§ ØªÙØ¬Ø¯ ÙÙÙØ§Øª';
$lang[267] = 'ÙØ¹ÙÙ ÙØ¹';
$lang[268] = 'ÙÙØªÙ';
$lang[269] = 'ØªØµØ­ÙØ­ Ø§ÙÙØ¶Ø¹';
$lang[270] = 'Ø¹Ø±Ø¶ Ø§ÙØ±ÙØ§Ø¨Ø· ÙÙØ·';
$lang[271] = 'Ø§ÙØªÙ Ø§ÙØ±ÙØ§Ø¨Ø· ÙÙØ·';
$lang[272] = 'Ø§ÙØªØ­ÙÙ ÙÙ Ø§ÙØ±ÙØ§Ø¨Ø·';
$lang[273] = 'Ø§ÙØªØ¸Ø§Ø±...';
$lang[274] = 'ÙØ¬ÙØ², Ø§ÙØ±Ø¬Ø§Ø¡ Ø§ÙØ§ÙØªØ¸Ø§Ø±...';
$lang[275] = 'Ø§ÙØ®Ø§Ø¯Ù';
$lang[276] = 'Ø§ÙÙØ³Ø§Ø­Ø© Ø§ÙÙØ³ØªØ®Ø¯ÙØ©';
$lang[277] = 'Ø§ÙÙØ³Ø§Ø­Ø© Ø§ÙÙØ§Ø±ØºØ©';
$lang[278] = 'ÙØ³Ø§Ø­Ø© Ø§ÙØ³ÙØ±ÙØ±';
$lang[279] = 'Ø§ÙØ°Ø§ÙØ±Ø©';
$lang[280] = 'Ø§ÙÙÙØª ÙÙ Ø§ÙØ®Ø§Ø¯Ù';
$lang[281] = 'Ø§ÙØªÙÙÙØª Ø§ÙÙØ­ÙÙ';
$lang[282] = 'Ø§ÙØ­Ø°Ù Ø§ÙØªÙÙØ§Ø¦Ù';
$lang[283] = 'Ø¨Ø¹Ø¯ Ø³Ø§Ø¹Ø§Øª ÙÙ Ø§ÙØªØ­ÙÙÙ';
$lang[284] = 'Ø¨Ø¹Ø¯ Ø¯ÙØ§Ø¦Ù ÙÙ Ø§ÙØªØ­ÙÙÙ';
$lang[285] = 'Ø§ÙØ¹ÙÙ';
$lang[286] = 'Ø§ÙØ±ÙØ¹';
$lang[287] = 'Ø§ÙØ±ÙØ¹ Ø¨Ø§ÙØ§Ù ØªÙ Ø¨Ù';
$lang[288] = 'Ø§Ø±Ø³Ø§Ù Ø§ÙÙ Ø¨Ø±ÙØ¯ ÙØ§Ø­Ø¯';
$lang[289] = 'Ø§Ø±Ø³Ø§Ù ÙÙØ¬ÙÙØ¹Ø© ÙÙ Ø§ÙØ¨Ø±ÙØ¯Ø§Øª';
$lang[290] = 'ØªÙØ³ÙÙ Ø§ÙÙÙÙØ§Øª';
$lang[291] = 'Ø¯ÙØ¬ Ø§ÙÙÙÙØ§Øª';
$lang[292] = 'Ø¹Ø±Ø¶ Ø§ÙØ¨ØµÙØ© Ø§ÙØ±ÙÙÙØ© ÙÙÙÙÙ';
$lang[293] = 'Ø¶ØºØ· Ø§ÙÙÙÙØ§Øª';
$lang[294] = 'Ø¶ØºØ· Ø§ÙÙÙÙØ§Øª Ø¨ØµÙØºØ© ZIP';
$lang[295] = 'ÙÙ Ø¶ØºØ· Ø§ÙÙÙÙØ§Øª Ø¨ØµÙØºØ© ZIP';
$lang[296] = 'Ø§Ø¹Ø§Ø¯Ø© ØªØ³ÙÙØ©';
$lang[297] = 'ÙØ¶Ø¹ ÙÙÙØ© Ø¨Ø¹Ø¯ ØµÙØºØ© Ø§ÙÙÙÙ';
$lang[298] = 'Ø§ÙØ­Ø°Ù';
$lang[299] = 'ÙØ§Ø¦ÙØ© Ø§ÙØ±ÙØ§Ø¨Ø·';
$lang[300] = 'Ø§Ø³ØªØ±Ø¯Ø§Ø¯ ØµÙØ­Ø© Ø§ÙØªØ­ÙÙÙ';
$lang[301] = 'Ø§Ø¯Ø®Ù';
$lang[302] = 'ÙÙØ§';
$lang[303] = 'ØªØ­ÙÙÙ ÙÙÙ';
$lang[304] = 'ÙØ§ ÙÙÙÙ ÙØªØ­ Ø§ÙØ³ÙØ±Ø¨Øª Ø­ØªÙ ØªØ¹Ø·Ù ØªØµØ±ÙØ­ 777 ÙÙÙÙÙ Ø§ÙØªØ§ÙÙ configs/files.lst';
$lang[305] = '&nbsp;ÙØ§ ÙÙÙÙ ÙØªØ­ Ø§ÙØ³ÙØ±Ø¨Øª Ø­ØªÙ ØªØ¹Ø·Ù ØªØµØ±ÙØ­ 777 ÙÙÙÙÙ files';
$lang[306] = 'Ø¯ÙØ¬ ÙÙÙ';
$lang[307] = 'Ø§ÙØªØ¸Ø§Ø±';
$lang[308] = 'ÙØ¬Ø§Ø­';
$lang[309] = 'ÙØ´Ù';
$lang[310] = 'ÙØ¯ ØªØ±Ù ÙØ°Ù Ø§ÙØªØ­Ø°ÙØ±Ø§Øª Ø¯ÙÙ ØªØ´ØºÙÙ';
$lang[311] = 'ÙØ¯ ÙØ§ ÙÙÙÙ ÙØ§Ø¯Ø±Ø§ Ø¹ÙÙ ØªØ´ØºÙÙ Ø®Ø§Ø¯Ù ÙØ¹ÙÙÙØ§Øª';
$lang[312] = 'Ø§ÙØ®Ø§Ø¯Ù ØºÙØ± ÙØ§Ø¯Ø± Ø¹ÙÙ ØªØ­ÙÙÙ ÙÙÙØ§Øª ÙÙÙ 2 ØºÙØºØ§ Ø¨Ø§ÙØª';
$lang[313] = 'Ø±Ø§ÙØ¨Ø¯ ÙÙØ´ ÙØ¯ÙÙ Ø§ÙØ³ÙØ±Ø¨Øª';
$lang[314] = 'ÙØªØ­ Ø¬Ø¬Ø¬';
$lang[315] = 'Ø­Ø¯ Ø§ÙØ°Ø§ÙØ±Ø©';
$lang[316] = 'Ø§ÙÙØ¶Ø¹ Ø§ÙØ§ÙÙ';
$lang[317] = 'cURL';
$lang[318] = 'Ø§ÙØ³ÙØ§Ø­ Ø¨ÙØªØ­ Ø§ÙØ±Ø§Ø¨Ø·';
$lang[319] = 'Ø§ØµØ¯Ø§Ø± PHP - ';
$lang[320] = 'ÙØ³ÙØ­ Ø§ÙÙÙØª ÙØ¯Ø¹Ù ØªÙØ±ÙØ± ÙØ±Ø¬Ø¹ÙØ©';
$lang[321] = 'passthru';
$lang[322] = 'ÙØ³Ø§Ø­Ø© Ø§ÙÙØ±Øµ';
$lang[323] = 'Ø§ØµØ¯Ø§Ø± Ø§ÙØ§Ø¨Ø§ØªØ´Ù - ';
$lang[324] = 'Ø§Ø¯Ø®ÙØª Ø¹ÙÙØ§Ù Ø¨Ø±ÙÙØ³Ù Ø®Ø§Ø·Ø¦';
$lang[325] = 'ØªÙ Ø­ÙØ¸ Ø§ÙÙÙÙ Ø¨ÙØ¬Ø§Ø­!';
$lang[326] = 'Ø­ÙØ¸ Ø§ÙÙÙØ§Ø­Ø¸Ø§Øª';
$lang[327] = 'ÙÙØ§Ø­Ø¸Ø§Øª';
$lang[328] = 'Ø§ÙØ§Ø¬Ø±Ø§Ø¡Ø§Øª ÙØ¹Ø·ÙØ©';
$lang[329] = 'Ø§ÙÙØ§ÙØ°Ø© Ø§ÙØ±Ø¦ÙØ³ÙØ©';
$lang[330] = 'Ø§ÙØ§Ø¹Ø¯Ø§Ø¯Ø§Øª';
$lang[331] = 'Ø§ÙÙÙÙØ§Øª';
$lang[332] = 'ÙØ¯ÙÙ Ø§ÙØ±ÙØ§Ø¨Ø·';
$lang[333] = 'Ø§ÙØ§Ø¶Ø§ÙØ§Øª';
$lang[334] = 'Ø§ÙØªÙØ²ÙÙ Ø§ÙØªÙÙØ§Ø¦Ù';
$lang[335] = 'Ø§ÙØ±ÙØ¹ Ø§ÙØªÙÙØ§Ø¦Ù';
$lang[336] = 'Ø­Ø¬Ù Ø§ÙÙÙÙ ÙÙØªØµØ± Ø¹ÙÙ ';
$lang[337] = 'Ø­Ø¯ Ø­Ø¬Ù Ø§ÙÙÙÙ: ';
$lang[338] = 'Rar Files';
$lang[339] = 'Unrar Files';
$lang[340] = 'Error detected';
$lang[341] = 'click here to expand';
$lang[342] = 'You can drag window from here';
$lang[343] = 'Can not find "rar"<br />You may need to download it and extract "rar" to "/rar/" directory';
$lang[344] = 'Files that will be on the archive:';
$lang[345] = 'Archive name:';
$lang[346] = 'Options:';
$lang[347] = 'Compresion level:';
$lang[348] = 'Store';
$lang[349] = 'Fastest';
$lang[350] = 'Fast';
$lang[351] = 'Normal';
$lang[352] = 'Good';
$lang[353] = 'Best';
$lang[354] = 'Create volumes';
$lang[355] = 'Delete files after archiving';
$lang[356] = 'Create solid archive';
$lang[357] = 'Create recovery record';
$lang[358] = 'Test archive after compression';
$lang[359] = 'Ø§Ø³ØªØ®Ø¯Ù ÙÙÙÙ ÙØ±ÙØ±';
$lang[360] = 'Encrypt file names';
$lang[361] = 'Set path inside archive';
$lang[362] = 'Rar';
$lang[363] = 'Ø¥ÙØ´Ø§Ø¡ Ø§Ø±Ø´ÙÙ: <b>%1$s</b>';
$lang[364] = 'Ø¥ÙØªØ¸Ø§Ø±...';
$lang[365] = 'Go back to file list';
$lang[366] = '<b>Files from %1$s</b>:';
$lang[367] = 'Can not find "unrar"';
$lang[368] = 'Pasword needed to list files:';
$lang[369] = 'ÙÙÙÙ Ø§ÙÙØ±ÙØ± ÙØ·ÙÙØ¨Ù ÙÙÙ Ø¶ØºØ· Ø§ÙÙÙÙØ§Øª:';
$lang[370] = 'Ø®Ø·Ø£:%1$s';
$lang[371] = 'Try to list again';
$lang[372] = 'Unrar selected';
$lang[373] = '<b>Extracting files from %1$s</b>:';
$lang[374] = 'Ø§ÙØ­Ø§ÙÙ:';
$lang[375] = 'Ø§Ø®ØªÙØ§Ø± Ø§ÙÙØµ';
$lang[376] = 'ÙØ³Ø· Ø§ÙØ­Ø³Ø§Ø¨Ø§Øª :';
$lang[377] = '38 [ÙÙØ¯ÙÙ: MP4 4096x3072 | ØµÙØª: AAC 2ch 44.10kHz]';
$lang[378] = 'ØºÙÙ Ø§ÙÙØ§ÙØ°Ù';
$lang[379] = 'ÙÙÙØ§Øª';
$lang[380] = 'MD5 change should only be applied to known working formats(i.e. .rar or .zip)<br />Do you want to continue?';
$lang[381] = 'MD5 of file <b>%1$s</b> changed'; // %1$s = filename
$lang[382] = 'Error changing the MD5 of the file <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'MD5 ØªØºÙÙØ±';
$lang[384] = 'Match text';
$lang[385] = 'Match';
$lang[386] = 'Ignore case';
$lang[387] = 'Put each file on a separated archive';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [ÙÙØ¯ÙÙ: WebM 854x480 | ØµÙØª: Vorbis 2ch 44.10kHz]';
?>
<?php
if (!defined('RAPIDLEECH')) {
  require('../deny.php');
  exit;
}
// Die Deutsche sprach Datei

$lang[1]        =       'Zugriff verweigert';
$lang[2]        =       'Der Server hat deine Anfrage abgelehnt';
$lang[3]        =       'Sie haben eine ung&uuml;ltige Email-Adresse eingegeben';
$lang[4]        =       'Die Gr&ouml;sse der Parts ist nicht numerisch';
$lang[5]        =       'Unbekannter Link-Typ, <span class="font-black">Benutze nur <span class="font-blue">http</span> oder <span class="font-blue">https</span> oder das <span class="font-blue">ftp</span> Protokoll</span>';
$lang[6]        =       'Kein Pfad festgelegt, um diese Datei zu speichern';
$lang[7]        =       'Du bist nicht berechtig von <span class="font-black">%1$s (%2$s)</span> zu leechen';   // %1$s = host name %2$s = host ip
$lang[8]        =       'Weiterleitung nach:';
$lang[9]        =       'Konnte die Datei-Liste nicht aktualisieren';
$lang[10]       =       'Datei <b>%1$s</b> (<b>%2$s</b>) gespeichert!<br />Zeit: <b>%3$s</b><br />Durchschnittsgeschwindigkeit: <b>%4$s KB/s</b><br />';        // %1$s = Dateiname %2$s = Dateigrösse %3$s = time of download %4$s = geschwindigkeit
$lang[11]       =       '<script>mail("Die Datei wurde zu dieser Adresse gesendet<b>%1$s</b>.", "%2$s");</script>';     // %1$s = E-mail addresse %2$s = Dateiname
$lang[12]       =       'Fehler beim Senden der Datei!';
$lang[13]       =       'Zur&uuml;ck zur Startseite';
$lang[14]       =       'Verbindung abgebrochen, Datei gel&ouml;scht.';
$lang[15]       =       'Neu laden';
$lang[16]       =       'Bitte wechsle den Debug Modus zu <b>1</b>';
$lang[17]       =       'Maximale Anzahl (%1$s) von Links wurden erreicht';     // %1$s = Number von maximalen links
$lang[18]       =       '%1$s Links &uuml;berpr&uuml;ft in %3$s Sekunden. (Methode: <b>%4$s</b>)';      // %1$s = Nummer von links %2$s = Plural form %3$s = seconds %4$s = methode zum links überprüfen
$lang[19]       =       'en';   // Ende von plural
$lang[20]       =       'Fehlerhafe Proxy-Adresse';
$lang[21]       =       'Link';
$lang[22]       =       'Status';
$lang[23]       =       'Warten';
$lang[24]       =       'Falscher Link';
$lang[25]       =       'Vorbereitung...';
$lang[26]       =       'Gestartet';
$lang[27]       =       'Verbindung abgebrochen';
$lang[28]       =       'Beendet';
$lang[29]       =       'Start';
$lang[30]       =       'Frames werden nicht unterst&uuml;tzt. Bitte aktualisiere deinen Browser';
$lang[31]       =       'Links hinzuf&uuml;gen';
$lang[32]       =       'Links';
$lang[33]       =       'Optionen';
$lang[34]       =       'Lade Dateien';
$lang[35]       =       'Proxyeinstellungen nutzen';
$lang[36]       =       'Proxy';
$lang[37]       =       'Benutzername';
$lang[38]       =       'Passwort';
$lang[39]       =       'Imageshack Account nutzen';
$lang[40]       =       'Speichern unter';
$lang[41]       =       'Pfad';
$lang[42]       =       'Premium Account nutzen';
$lang[43]       =       'Serverseitig ausf&uuml;hren';
$lang[44]       =       'Aufschubszeit';
$lang[45]       =       'Aufschub (in seconds)';
$lang[46]       =       'Es wurde(n) keine Datei(en) zum uploaden ausgew&auml;hlt';
$lang[47]       =       'W&auml;hle bitte den gew&uuml;nschten Filehoster aus.';
$lang[48]       =       'Kein unterst&uuml;tzter Dienst zum uploaden!';
$lang[49]       =       'Upload-Fenster';
$lang[50]       =       'Link-Speicherformat';
$lang[51]       =       'Standard';
$lang[52]       =       'Markiere alles';
$lang[53]       =       'Demarkiere alles';
$lang[54]       =       'Auswahl umkehren';
$lang[55]       =       'Name';
$lang[56]       =       'Gr&ouml;sse';
$lang[57]       =       'Keine Dateien gefunden';
$lang[58]       =       'Legende f&uuml;r Link Speicherungsformat: (Gross-und Kleinschreibung)';
$lang[59]       =       'Link';
$lang[60]       =       'Name der Datei';
$lang[61]       =       'Standard-Linkstil';
$lang[62]       =       'Alles, ausser die oben angegebenen werden als String behandelt. Du bist momentan nicht in der lage das Multi-line Format auszuw&auml;hlen. F&uuml;r jeden neuen Link wird eine neue Zeile eingef&uuml;gt';
$lang[63]       =       'Uploade Datei %1$s auf %2$s'; // %1$s = Dateiname %2$s = Datei host name
$lang[64]       =       'Datei %1$s existiert nicht.';  // %1$s = Dateiname
$lang[65]       =       'Datei %1$s ist nicht lesbar vom Script.';      // %1$s = Dateiname
$lang[66]       =       'Datei ist zu gross zum uploaden.';
$lang[67]       =       'Upload-Dienst ist nicht verf&uuml;gbar';
$lang[68]       =       'Link';
$lang[69]       =       'L&ouml;sch-Link';
$lang[70]       =       'Stat-Link';
$lang[71]       =       'Admin-Link';
$lang[72]       =       'BENUTZER-ID';
$lang[73]       =       'FTP-Upload';
$lang[74]       =       'Passwort';
$lang[75]       =       'Rapidleech PlugMod - Links Hochladen';
$lang[76]       =       '<div class="linktitle">Lade Link hoch zu <strong>%1$s</strong> - <span class="bluefont">Gr&ouml;sse: <strong>%2$s</strong></span></div>';      // %1$s = Datei name %2$s = Datei Grösse
$lang[77]       =       'ERLEDIGT';
$lang[78]       =       'Zur&uuml;ck';
$lang[79]       =       'Konnte keine Verbindung zum FTP-Server %1$s herstellen.';          // %1$s = FTP server name
$lang[80]       =       'Fehlerhafter Benutzername und/oder Passwort.';
$lang[81]       =       'Verbunden mit: <b>%1$s</b>...';        // %1$s = FTP server name
$lang[82]       =       'Es ist nicht gestattet Dateien des Typs %1$s herunterzuladen';     // %1$s = Datei type
$lang[83]       =       'Datei <b>%1$s</b>, Gr&ouml;sse <b>%2$s</b>...';        // %1$s = Datei name %2$s = Datei Gr&ouml;sse
$lang[84]       =       'Fehler beim erhalten des Download-Links';
$lang[85]       =       'Text bestanden wie der Counter-String!';
$lang[86]       =       'Fehler! Bitte Javascript aktivieren.';
$lang[87]       =       'Bitte warte <b>%1$s</b> Sekunden...';   // %1$s = nummer von seconden
$lang[88]       =       'Verbindung mit %1$s &uuml;ber den Port %2$s nicht m&ouml;glich';      // %1$s = host name %2$s = port
$lang[89]       =       'Verbunden mit Proxy: <b>%1$s</b> &uuml;ber den Port <b>%2$s</b>...';   // %1$s = Proxy host %2$s = Proxy port
$lang[90]       =       'Verbunden mit: <b>%1$s</b> &uuml;ber den Port <b>%2$s</b>...'; // %1$s = host %2$s = port
$lang[91]       =       'Kein Header erhalten';
$lang[92]       =       'Du bist nicht berechtigt auf diese Seite zuzugreifen!';
$lang[93]       =       'Die Seite wurde nicht gefunden!';
$lang[94]       =       'Die Seite wurde nicht gefunden oder ist unzul&auml;ssig!';
$lang[95]       =       'Fehler! es wird weitergeleitet nach [%1$s]';    // %1$s = weiterleitungsadresse
$lang[96]       =       'Diese Seite ben&ouml;tigt eine Authentifizierung. F&uuml;r die Anzeige ist es erforderlich Benutzername und Passwort so anzugeben:<br />http://<b>benutzername:passwort@</b>www.site.com/Datei.exe';
$lang[97]       =       'Wiederaufnahme-Limit erreicht';
$lang[98]       =       'Dieser Server unterst&uuml;tzt keine Wiederaufnahme von Downloads';
$lang[99]       =       'Downloaden';
$lang[100]      =       'Dieser Premium-Account wird schon von einer anderen IP-Adresse genutzt.';
$lang[101]      =       'Datei %1$s konnte nicht im Verzeichnis %2$s gespeichert werden';       // %1$s = Datei name %2$s = Ordner name
$lang[102]      =       'Versuche den Ordner auf chmod 777 zu setzen.';
$lang[103]      =       'Erneut versuchen';
$lang[104]      =       'Datei';
$lang[105]      =       'Es ist nicht m&ouml;glich eine Aufzeichnung in der Datei %1$s durchzuf&uuml;hren';       // %1$s = Datei name
$lang[106]      =       'Falscher Link ... unbekannter Fehler aufgetreten';
$lang[107]      =       'Du hast das Limit f&uuml;r Free-User erreicht.';
$lang[108]      =       'Die Download-Session ist abgelaufen';
$lang[109]      =       'Falscher Zugriffscode.';
$lang[110]      =       'Du hast zu oft einen falschen Code eingegeben';
$lang[111]      =       'Download-Limit ausgesch&ouml;pft';
$lang[112]      =       'Error READ Data';
$lang[113]      =       'Error SEND Data';
$lang[114]      =       'aktiv';
$lang[115]      =       'Nicht verf&uuml;gbar';
$lang[116]      =       'tot';
$lang[117]      =       'Du musst die load/activate cURL-Erweiterung aktivieren (http://www.php.net/cURL). Du kannst aber auch in der config.php \'fgc\' => 1 auf 1 setzen.';
$lang[118]      =       'cURL ist aktiviert';
$lang[119]      =       'PHP5 wird empfohlen, wird aber nicht unbedingt ben&ouml;tigt';
$lang[120]      =       '&Uuml;berpr&uuml;fe, ob der Safe-Mode ausgeschaltet ist. Das Script funktioniert nicht wenn der Safe-Mode eingeschaltet ist';
$lang[121]      =       'Sende Datei <b>%1$s</b>';      // %1$s = Dateiname
$lang[122]      =       'Splitten wird nicht ben&ouml;tigt. Eine einzige Email schicken';
$lang[123]      =       'In %1$s Teile splitten';      // %1$s = part Grösse
$lang[124]      =       'Methode';
$lang[125]      =       'Sende Part <b>%1$s</b>';       //%1$s = teil number
$lang[126]      =       'Splitten wird nicht ben&ouml;tigt. Eine einzige Email schicken';
$lang[127]      =       'Keine hosts Datei gefunden';
$lang[128]      =       'Konnte die hosts Datei nicht erstellen';
$lang[129]      =       'Stunden';      // Plural
$lang[130]      =       'Stunde';
$lang[131]      =       'Minuten';      // Plural
$lang[132]      =       'Minute';
$lang[133]      =       'Sekunden';     // Plural
$lang[134]      =       'Sekunde';
$lang[135]      =       'getCpuUsage(): konnte nicht auf den STAT Pfad zugreifen oder die STAT-Datei ist fehlerhaft';
$lang[136]      =       'CPU-Auslastung';
$lang[137]      =       'Ein Fehler ist aufgetreten';
$lang[138]      =       'W&auml;hle mindestens eine Datei aus.';
$lang[139]      =       'Emails';
$lang[140]      =       'Senden';
$lang[141]      =       'L&ouml;sche erfolgreiche &Uuml;bertragungen';
$lang[142]      =       'Teile in Parts auf';
$lang[143]      =       'Part-Gr&ouml;sse';
$lang[144]      =       '<b>%1$s</b> - Falsche Email-Addresse.';      // %1$s = email addresse
$lang[145]      =       'Datei <b>%1$s</b> wurde nicht gefunden!';      // %1$s = Dateiname
$lang[146]      =       'Konnte die Dateiliste nicht aktualisieren!';
$lang[147]      =       'Dateien l&ouml;schen wurde deaktiviert';
$lang[148]      =       'L&ouml;sche Dateien';
$lang[149]      =       'Ja';
$lang[150]      =       'Nein';
$lang[151]      =       'Datei <b>%1$s</b> gel&ouml;scht';    // %1$s = Dateiname
$lang[152]      =       'Fehler beim l&ouml;schen der Datei <b>%1$s</b>!';      // %1$s = Dateiname
$lang[153]      =       'Host';
$lang[154]      =       'Port';
$lang[155]      =       'Ordner';
$lang[156]      =       'L&ouml;sche Quelldatei nach erfolgreichem Hochladen';
$lang[157]      =       'Speichere FTP-Daten';
$lang[158]      =       'L&ouml;sche FTP-Daten';
$lang[159]      =       'Konnte den Ordner <b>%1$s</b> nicht finden';     // %1$s = ordner name
$lang[160]      =       'Datei %1$s erfolgreich hochgeladen!';  // %1$s = Dateiname
$lang[161]      =       'Zeit';
$lang[162]      =       'Durchschnittsgeschwindigkeit';
$lang[163]      =       'Konnte die Datei <b>%1$s</b> nicht hochladen!';        // %1$s = Dateiname
$lang[164]      =       'Email';
$lang[165]      =       'L&ouml;sche erfolgreiche &Uuml;bertragungen';
$lang[166]      =       'Falsche Email-Addresse';
$lang[167]      =       'Bitte w&auml;hle nur die .crc oder die .001 Datei!';
$lang[168]      =       'Bitte w&auml;hle die .crc Datei!';
$lang[169]      =       'Bitte w&auml;hle nur die .crc oder die .001 Datei!';
$lang[170]      =       'CRC &uuml;berpr&uuml;fen? (empfohlen)';
$lang[171]      =       'CRC32 &Uuml;berpr&uuml;fmodus';
$lang[172]      =       'Benutze hash_file (empfohlen)';
$lang[173]      =       'Lese Datei in den Speicher';
$lang[174]      =       'F&auml;lsche crc';
$lang[175]      =       'L&ouml;sche Quelldatei nach erfolgreichem mergen';
$lang[176]      =       'Notiere';
$lang[177]      =       'Die Dateigr&ouml;sse und crc32 wird nicht &uuml;berpr&uuml;ft';
$lang[178]      =       '.crc-Datei nicht lesbar!';
$lang[179]      =       'Fehler! Die Ziel-Datei existiert bereits <b>%1$s</b>';  // %1$s = Dateiname
$lang[180]      =       'Fehler! Fehlende oder nicht komplette Parts';
$lang[181]      =       'Fehler! Dieser Dateityp %1$s ist verboten!';        // Dateitype
$lang[182]      =       '&Ouml;ffnen der Datei <b>%1$s</b> nicht m&ouml;glich';   // %1$s = Dateiname
$lang[183]      =       'Fehler beim Schreiben der Datei <b>%1$s</b>!'; // %1$s = Dateiname
$lang[184]      =       'CRC32-Checksumme passt nicht!';
$lang[185]      =       'Datei <b>%1$s</b> erfolgreich gemerged';   // %1$s = Dateiname
$lang[186]      =       'gel&ouml;scht';
$lang[187]      =       'nicht gel&ouml;scht';
$lang[188]      =       'Erweiterung hinzuf&uuml;gen';
$lang[189]      =       'ohne';
$lang[190]      =       'zu';
$lang[191]      =       'Umbenennen?';
$lang[192]      =       'Abbrechen';
$lang[193]      =       'Fehler beim umbenennen der Datei <b>%1$s</b>'; // %1$s = Dateiname
$lang[194]      =       'Datei <b>%1$s</b> wurde umbenannt in <b>%2$s</b>';     // %1$s = originaler Dateiname %2$s = Umbenannter Dateiname
$lang[195]      =       'Archivname';
$lang[196]      =       'Bitte einen Archivnamen eingeben!';
$lang[197]      =       'Fehler! Das Archiv wurde nicht erstellt.';
$lang[198]      =       'Datei %1$s wurde gepackt';     // %1$s = Dateiname
$lang[199]      =       'Verpacke Dateien in das Archiv <b>%1$s</b>';    // %1$s = Dateiname
$lang[200]      =       'Fehler! Das Archiv ist leer.';
$lang[201]      =       'Neuer Name';
$lang[202]      =       'Konnte die Datei nicht umbenennen <b>%1$s</b>!';       // %1$s = Dateiname
$lang[203]      =       'L&ouml;sche Quelldatei nach erfolgreichem splitten';
$lang[204]      =       'Dateien und Ordner';
$lang[205]      =       'Unzip';
$lang[206]      =       'YouTube-Format';
$lang[207]      =       'Link';
$lang[208]      =       'Referrer';
$lang[209]      =       'Datei downloaden';
$lang[210]      =       'Benutzer &amp; Passwort (HTTP/FTP)';
$lang[211]      =       'Benutzer';
$lang[212]      =       'Passwort';
$lang[213]      =       'Kommentar hinzuf&uuml;gen';
$lang[214]      =       'Erweiterungs-Optionen';
$lang[215]      =       'Deaktiviere alle Add-Ons';
$lang[216]      =       'YouTube-Format';
$lang[217]      =       'Direktlink';
$lang[218]      =       '&amp;fmt=';
$lang[219]      =       'Automatisch die bestm&ouml;gliche Qualit&auml;t nehmen';
$lang[220]      =       '0 [Video: FLV H263 251kbps 320x180 @ 29.896fps | Audio: MP3 64kbps 1ch @ 22.05kHz]';
$lang[221]      =       '5 [Video: FLV H263 251kbps 320x180 @ 29.885fps | Audio: MP3 64kbps 1ch @ 22.05kHz]';
$lang[222]      =       '6 [Video: FLV H263 892kbps 480x270 @ 29.887fps | Audio: MP3 96kbps 1ch @ 44.10kHz]';
$lang[223]      =       '13 [Video: 3GP H263 77kbps 176x144 @ 15.000fps | Audio: AMR 13kbps 1ch @ 8.000kHz]';
$lang[224]      =       '17 [Video: 3GP XVID 55kbps 176x144 @ 12.000fps | Audio: AAC 29kbps 1ch @ 22.05kHz]';
$lang[225]      =       '18 [Video: MP4 H264 505kbps 480x270 @ 29.886fps | Audio: AAC 125kbps 2ch @ 44.10kHz]';
$lang[226]      =       '22 [Video: MP4 H264 2001kbps 1280x720 @ 29.918fps | Audio: AAC 198kbps 2ch @ 44.10kHz]';
$lang[227]      =       '34 [Video: FLV H264 256kbps 320x180 @ 29.906fps | Audio: AAC 62kbps 2ch @ 22.05kHz]';
$lang[228]      =       '35 [Video: FLV H264 831kbps 640x360 @ 29.942fps | Audio: AAC 107kbps 2ch @ 44.10kHz]';
$lang[229]      =       'ImageShack&reg; TorrentDienst';
$lang[230]      =       'Benutzername';
$lang[231]      =       'Passwort';
$lang[232]      =       'Megaupload.com Cookie';
$lang[233]      =       'Benutzer';
$lang[234]      =       'Benutze vBulletin-Erweiterung';
$lang[235]      =       'Zus&auml;tzlicher Cookie';
$lang[236]      =       'Key=Wert';
$lang[237]      =       'Sende Datei per Email';
$lang[238]      =       'Email';
$lang[239]      =       'Teile Dateien';
$lang[240]      =       'Methode';
$lang[241]      =       'Total Commander';
$lang[242]      =       'RFC 2046';
$lang[243]      =       'Part-Gr&ouml;sse';
$lang[244]      =       'MB';
$lang[245]      =       'Benutze Proxy-Einstellungen';
$lang[246]      =       'Proxy';
$lang[247]      =       'Benutzername';
$lang[248]      =       'Passwort';
$lang[249]      =       'Benutze Premium-Account';
$lang[250]      =       'Benutzername';
$lang[251]      =       'Passwort';
$lang[252]      =       'Speichern unter';
$lang[253]      =       'Pfad';
$lang[254]      =       'Einstellungen speichern';
$lang[255]      =       'Aktuelle Einstellungen l&ouml;schen';
$lang[256]      =       'Alles markieren';
$lang[257]      =       'Alles demarkieren';
$lang[258]      =       'Auswahl umkehren';
$lang[259]      =       'Zeige';
$lang[260]      =       'Downloads';
$lang[261]      =       'alles';
$lang[262]      =       'Name';
$lang[263]      =       'Gr&ouml;sse';
$lang[264]      =       'Kommentare';
$lang[265]      =       'Datum';
$lang[266]      =       'Keine Dateien gefunden';
$lang[267]      =       'Funktioniert mit';
$lang[268]      =       'Killt';
$lang[269]      =       'Debug-Modus';
$lang[270]      =       'Nur Links anzeigen';
$lang[271]      =       'Nur Links killen';
$lang[272]      =       'Links &uuml;berpr&uuml;fen';
$lang[273]      =       'Lade...';
$lang[274]      =       'Lade, bitte warten...';
$lang[275]      =       'Server-Speicherplatz';
$lang[276]      =       'Genutzter Speicherplatz';
$lang[277]      =       'Freier Speicherplatz';
$lang[278]      =       'Festplatten-Gr&ouml;sse';
$lang[279]      =       'CPU';
$lang[280]      =       'Server-Zeit';
$lang[281]      =       'Lokale-Zeit';
$lang[282]      =       'Auto-L&ouml;schung';
$lang[283]      =       'Stunden nach Download';
$lang[284]      =       'Minuten nach Download';
$lang[285]      =       'Aktion';
$lang[286]      =       'Auf Filehoster uploaden';
$lang[287]      =       'FTP-Upload';
$lang[288]      =       'An Email senden';
$lang[289]      =       'Massen-Email';
$lang[290]      =       'Datei splitten';
$lang[291]      =       'Dateien zusammenfassen';
$lang[292]      =       'MD5-Hash anzeigen';
$lang[293]      =       'Datei(en) verpacken (tar, tar.gz, tar.bz)';
$lang[294]      =       'Datei(en) verpacken (zip)';
$lang[295]      =       'Datei(en) entpacken (zip)';
$lang[296]      =       'Datei umbenennen';
$lang[297]      =       'Mehrere Dateien umbenennen';
$lang[298]      =       'Datei(en) l&ouml;schen';
$lang[299]      =       'Links auflisten';
$lang[300]      =       'Verbindung wird aufgebaut...';
$lang[301]      =       'Enter';
$lang[302]      =       'Hier';
$lang[303]      =       'Datei herunterladen';
$lang[304]      =       'configs/files ist ist nicht beschreibar, bitte versichere dir ob die Berechtigung chmod 777 ist.';
$lang[305]      =       ' ist als dein Download-Pfad angegeben und der Ordner ist nicht beschreibar. Bitte wechsle chmod zu 777';
$lang[306]      =       'F&uuml;hre Dateien zusammen';
$lang[307]      =       'Wartend';
$lang[308]      =       'Erfolgreich';
$lang[309]      =       'Gescheitert';
$lang[310]      =       'Sie sehen m&ouml;glicherweise Warnungen, ohne diese Funktion eingeschaltet zu haben';
$lang[311]      =       'Diese Info kannst du auf diesem Server evt. nicht ansehen.';
$lang[312]      =       'Dein Server unterst&uuml;tzt m&ouml;glicherweise keine Dateien die gr&ouml;sser als 2GB sind';
$lang[313]      =       'Rapidleech Check-Script';
$lang[314]      =       'fsockopen';
$lang[315]      =       'memory_limit';
$lang[316]      =       'safe_mode';
$lang[317]      =       'cURL';
$lang[318]      =       'allow_url_fopen';
$lang[319]      =       'PHP Version - ';
$lang[320]      =       'allow_call_time_pass_reference';
$lang[321]      =       'durchlaufen';
$lang[322]      =       'Festplattenspeicher funktionen';
$lang[323]      =       'Apache Version - ';
$lang[324]      =       'Falsche Proxyadresse eingegeben';
$lang[325]      =       'Datei erfolgreich Gespeichert!';
$lang[326]      =       'Notizen speichern';
$lang[327]      =       'Notizen';
$lang[328]      =       'Aktion deaktiviert';
$lang[329]      =       'Hauptfenster';
$lang[330]      =       'Einstellungen';
$lang[331]      =       'Dateiverzeichnis';
$lang[332]      =       'Link-Checker ';
$lang[333]      =       'Plugins';
$lang[334]      =       'MULTiDOWNLOAD';
$lang[335]      =       'MULTiUPLOAD';
$lang[336]      =       'Datei-Gr&ouml;sse ist limitiert bis ';
$lang[337]      =       'Datei-Gr&ouml;ssen-Limit: ';
$lang[338]      =       'Datei(en) verpacken (rar)';
$lang[339]      =       'Datei(en) entpacken (rar)';
$lang[340]      =       'Fehler entdeckt';
$lang[341]      =       'Klicken Sie hier, um zu erweitern';
$lang[342]      =       'Fenster verschieben';
$lang[343]      =       'Konnte "rar" nicht finden<br />Eventuell m&uuml;ssen Sie "plusrar" aus dem <a href="http://www.rapidleech.com/index.php/topic/4977-plusrar/"> Rapidleech-Forum</a> laden und in das Verzeichnis "/rar/" kopieren';
$lang[344]      =       'Zu verpackende Dateien:';
$lang[345]      =       'Archivname:';
$lang[346]      =       'Optionen:';
$lang[347]      =       'Kompressions-Level:';
$lang[348]      =       'Speichere';
$lang[349]      =       'Am schnellsten';
$lang[350]      =       'Schnell';
$lang[351]      =       'Normal';
$lang[352]      =       'Gut';
$lang[353]      =       'Am besten';
$lang[354]      =       'Archiv erstellen';
$lang[355]      =       'Dateien nach der Archivierung l&ouml;schen';
$lang[356]      =       'Kompaktes Archiv erstellen';
$lang[357]      =       'Recovery-Volume erstellen';
$lang[358]      =       'Archiv nach der Kompression testen';
$lang[359]      =       'Passwort benutzen';
$lang[360]      =       'Dateinamen verschl&uuml;sseln';
$lang[361]      =       'Pfad innerhalb des Archivs setzen';
$lang[362]      =       'Verpacken';
$lang[363]      =       'Erstelle Archiv: <b>%1$s</b>';
$lang[364]      =       'Warte...';
$lang[365]      =       'Zur&uuml;ck zur Dateiliste';
$lang[366]      =       '<b>Dateien des Archivs %1$s</b>:';
$lang[367]      =       'Konnte "unrar" nicht finden';
$lang[368]      =       'Bitte Passwort eingeben um die Dateien aufzulisten:';
$lang[369]      =       'Bitte Passwort eingeben um die Dateien zu entpacken:';
$lang[370]      =       'Fehler:%1$s';
$lang[371]      =       'Erneut auflisten';
$lang[372]      =       'Auswahl entpacken';
$lang[373]      =       '<b>Entpacke Dateien von %1$s</b>:';
$lang[374]      =       'Status:';
$lang[375]      =       'Ausgew&auml;hlter Text';
$lang[376]  	=  	'Premium Accounts:';
$lang[377]      =       '37 [Video: MP4 1920Ã1080 | Audio: AAC 2ch 44.10kHz]';
$lang[378]      =       'Fenster schlie&szlig;en';
$lang[379]      =       'Dateien';
$lang[380]      =       'MD5-Hash-Ver&auml;nderungen sollten nur bei getesteten Formaten durchgef&uuml;hrt werden(z.B. .rar oder .zip)<br />M&ouml;chten Sie fortfahren?';
$lang[381]      =       'MD5-Hash der Datei <b>%1$s</b> wurde ver&auml;ndert';     // %1$s = Dateiname
$lang[382]      =       'Fehler beim ver&ouml;ndern von MD5-Hash der Datei <b>%1$s</b>!';       // %1$s = Dateiname
$lang[383]      =       'MD5-Hash ver&auml;ndern';
$lang[384]      =       'Gleichen Text suchen';
$lang[385]      =       'suchen';
$lang[386]      =       'Gro&szlig;- und Kleinschreibung ignorieren';
$lang[387]      =       'Setze jede Datei in ein seperates Archiv';
$lang[388]      =       'OpenSSL';
$lang[389]      =       '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// The English language file
// You should always use this file as a template for translating

$lang[1] = 'Access Denied';
$lang[2] = 'The server has refused to fulfill your request';
$lang[3] = 'You didn\'t enter a valid e-mail address';
$lang[4] = 'Size of parts are not numeric';
$lang[5] = 'Unknown URL Type, <span class="font-black">Only Use <span class="font-blue">http</span> or <span class="font-blue">https</span> or <span class="font-blue">ftp</span> Protocol</span>';
$lang[6] = 'Path is not specified for saving this file';
$lang[7] = 'You are not allowed to leech from <span class="font-black">%1$s (%2$s)</span>'; // %1$s = host name %2$s = host ip
$lang[8] = 'Redirecting to:';
$lang[9] = 'Couldn\'t update the files list';
$lang[10] = 'File <b>%1$s</b> (<b>%2$s</b>) Saved!<br />Time: <b>%3$s</b><br />Average Speed: <b>%4$s KB/s</b><br />'; // %1$s = filename %2$s = filesize %3$s = time of download %4$s = speed
$lang[11] = '<script>mail("File was sent to this address<b>%1$s</b>.", "%2$s");</script>'; // %1$s = E-mail address %2$s = filename
$lang[12] = 'Error sending file!';
$lang[13] = 'Go back to main';
$lang[14] = 'Connection lost, file deleted.';
$lang[15] = 'Reload';
$lang[16] = 'Please change the debug mode to <b>1</b>';
$lang[17] = 'Maximum No (%1$s) Of links have been reached.'; // %1$s = Number of maximum links
$lang[18] = '%1$s Link%2$s checked in %3$s seconds. (Method: <b>%4$s</b>)'; // %1$s = Number of links %2$s = Plural form %3$s = seconds %4$s = method for checking links
$lang[19] = 's'; // End of a plural
$lang[20] = 'Bad proxy server address';
$lang[21] = 'Link';
$lang[22] = 'Status';
$lang[23] = 'Waiting';
$lang[24] = 'Invalid URL';
$lang[25] = 'Preparing';
$lang[26] = 'Started';
$lang[27] = 'Connection lost';
$lang[28] = 'Finished';
$lang[29] = 'Start auto Transload';
$lang[30] = 'Frames not supported, update your browser';
$lang[31] = 'Add links';
$lang[32] = 'Links';
$lang[33] = 'Options';
$lang[34] = 'Transload files';
$lang[35] = 'Use Proxy Settings';
$lang[36] = 'Proxy';
$lang[37] = 'UserName';
$lang[38] = 'Password';
$lang[39] = 'Use Imageshack Account';
$lang[40] = 'Save To';
$lang[41] = 'Path';
$lang[42] = 'Use Premium Account';
$lang[43] = 'Run Server Side';
$lang[44] = 'Delay Time';
$lang[45] = 'Delay (in seconds)';
$lang[46] = 'No files or hosts selected for upload';
$lang[47] = 'Select Hosts to Upload';
$lang[48] = 'No Supported Upload Services!';
$lang[49] = 'Upload windows';
$lang[50] = 'Link save format';
$lang[51] = 'Default';
$lang[52] = 'Check All';
$lang[53] = 'Un-Check All';
$lang[54] = 'Invert Selection';
$lang[55] = 'Name';
$lang[56] = 'Size';
$lang[57] = 'No files found';
$lang[58] = 'Legend for link saving format: (case sensitive)';
$lang[59] = 'The link for the download';
$lang[60] = 'The name of the file';
$lang[61] = 'Default link style';
$lang[62] = 'Anything besides the ones stated above will be treated as string, you are unable to do multi line format now, a new line will be inserted for each link.';
$lang[63] = 'Uploading file %1$s to %2$s'; // %1$s = filename %2$s = file host name
$lang[64] = 'File %1$s does not exist.'; // %1$s = filename
$lang[65] = 'File %1$s is not readable by script.'; // %1$s = filename
$lang[66] = 'Filesize too big to upload to host.';
$lang[67] = 'Upload service not allowed';
$lang[68] = 'Download-Link';
$lang[69] = 'Delete-Link';
$lang[70] = 'Stat-Link';
$lang[71] = 'Admin-Link';
$lang[72] = 'USER-ID';
$lang[73] = 'FTP upload';
$lang[74] = 'Password';
$lang[75] = 'Rapidleech PlugMod - Upload Links';
$lang[76] = '<div class="linktitle">Upload Links for <strong>%1$s</strong> - <span class="bluefont">Size: <strong>%2$s</strong></span></div>'; // %1$s = file name %2$s = file size
$lang[77] = 'DONE';
$lang[78] = 'Go Back';
$lang[79] = 'Couldn\'t establish connection with the server %1$s.'; // %1$s = FTP server name
$lang[80] = 'Incorrect username and/or password.';
$lang[81] = 'Connected to: <b>%1$s</b>...'; // %1$s = FTP server name
$lang[82] = 'The filetype %1$s is forbidden to be downloaded'; // %1$s = File type
$lang[83] = 'File <b>%1$s</b>, Size <b>%2$s</b>...'; // %1$s = file name %2$s = file size
$lang[84] = 'Error retriving the link';
$lang[85] = 'Text passed as counter is string!';
$lang[86] = 'ERROR: Please enable JavaScript.';
$lang[87] = 'Please wait <b>%1$s</b> seconds...'; // %1$s = number of seconds
$lang[88] = 'Couldn\'t connect to %1$s at port %2$s'; // %1$s = host name %2$s = port
$lang[89] = 'Connected to proxy: <b>%1$s</b> at port <b>%2$s</b>...'; // %1$s = Proxy host %2$s = Proxy port
$lang[90] = 'Connected to: <b>%1$s</b> at port <b>%2$s</b>...'; // %1$s = host %2$s = port
$lang[91] = 'No header received';
$lang[92] = 'You are forbidden to access the page!';
$lang[93] = 'The page was not found!';
$lang[94] = 'The page was either forbidden or not found!';
$lang[95] = 'Error! it is redirected to [%1$s]'; // %1$s = redirected address
$lang[96] = 'This site requires authorization. For the indication of username and password of access it is necessary to use similar url:<br />http://<b>login:password@</b>www.site.com/file.exe';
$lang[97] = 'Resume limit exceeded';
$lang[98] = 'This server doesn\'t support resume';
$lang[99] = 'Download';
$lang[100] = 'This premium account is already in use with another ip.';
$lang[101] = 'File %1$s cannot be saved in directory %2$s'; // %1$s = file name %2$s = directory name
$lang[102] = 'Try to chmod the folder to 777.';
$lang[103] = 'Try again';
$lang[104] = 'File';
$lang[105] = 'It is not possible to carry out a record in the file %1$s'; // %1$s = file name
$lang[106] = 'Invalid URL or unknown error occured';
$lang[107] = 'You have reached the limit for Free users.';
$lang[108] = 'The download session has expired';
$lang[109] = 'Wrong access code.';
$lang[110] = 'You have entered a wrong code too many times';
$lang[111] = 'Download limit exceeded';
$lang[112] = 'Error READ Data';
$lang[113] = 'Error SEND Data';
$lang[114] = 'Active';
$lang[115] = 'Unavailable';
$lang[116] = 'Dead';
$lang[117] = 'You need to load/activate the cURL extension (http://www.php.net/cURL) or you can set \'fgc\' => 1 in config.php.';
$lang[118] = 'cURL is enabled';
$lang[119] = 'PHP version 5 is recommended although it is not obligatory';
$lang[120] = 'Check if your safe mode is turned off as the script cannot work with safe mode on';
$lang[121] = 'Sending file <b>%1$s</b>'; // %1$s = filename
$lang[122] = 'No need spliting, Send single mail';
$lang[123] = 'Spliting into %1$s part size'; // %1$s = part size
$lang[124] = 'Method';
$lang[125] = 'Sending part <b>%1$s</b>'; //%1$s = part number
$lang[126] = 'No need spliting, Send single mail';
$lang[127] = 'No host file found';
$lang[128] = 'Cannot create hosts file';
$lang[129] = 'hours'; // Plural
$lang[130] = 'hour';
$lang[131] = 'minutes'; // Plural
$lang[132] = 'minute';
$lang[133] = 'seconds'; // Plural
$lang[134] = 'second';
$lang[135] = 'getCpuUsage(): couldn\'t access STAT path or STAT file invalid';
$lang[136] = 'CPU Load';
$lang[137] = 'An error occured';
$lang[138] = 'Select at least one file.';
$lang[139] = 'Emails';
$lang[140] = 'Send';
$lang[141] = 'Delete successful submits';
$lang[142] = 'Split by Parts';
$lang[143] = 'Parts Size';
$lang[144] = '<b>%1$s</b> - Invalid E-mail Address.'; // %1$s = email address
$lang[145] = 'File <b>%1$s</b> is not found!'; // %1$s = filename
$lang[146] = 'Couldn\'t update files list!';
$lang[147] = 'File deletion is disabled';
$lang[148] = 'Delete files';
$lang[149] = 'Yes';
$lang[150] = 'No';
$lang[151] = 'File <b>%1$s</b> Deleted'; // %1$s = filename
$lang[152] = 'Error deleting the file <b>%1$s</b>!'; // %1$s = filename
$lang[153] = 'Host';
$lang[154] = 'Port';
$lang[155] = 'Directory';
$lang[156] = 'Delete source file after successful upload';
$lang[157] = 'Save FTP data';
$lang[158] = 'Delete FTP data';
$lang[159] = 'Cannot locate the folder <b>%1$s</b>'; // %1$s = directory name
$lang[160] = 'File %1$s successfully uploaded!'; // %1$s = filename
$lang[161] = 'Time';
$lang[162] = 'Average speed';
$lang[163] = 'Couldn\'t upload the file <b>%1$s</b>!'; // %1$s = filename
$lang[164] = 'Email';
$lang[165] = 'Delete successful submits';
$lang[166] = 'Invalid E-mail Address';
$lang[167] = 'Please select only the .crc or .001 file!';
$lang[168] = 'Please select the .crc file!';
$lang[169] = 'Please select the .crc or .001 file!';
$lang[170] = 'Perform a CRC check? (recommended)';
$lang[171] = 'CRC32 check mode';
$lang[172] = 'Use hash_file (Recommended)';
$lang[173] = 'Read file to memory';
$lang[174] = 'Fake crc';
$lang[175] = 'Delete source file after successful merge';
$lang[176] = 'Notice';
$lang[177] = 'The file size and crc32 won\'t be check';
$lang[178] = 'Can\'t read the .crc file!';
$lang[179] = 'Error, Output file already exists <b>%1$s</b>'; // %1$s = filename
$lang[180] = 'Error, missing or incomplete parts';
$lang[181] = 'Error, The filetype %1$s is forbidden'; // Filetype
$lang[182] = 'It is not possible to open destination file <b>%1$s</b>'; // %1$s = filename
$lang[183] = 'Error writing the file <b>%1$s</b>!'; // %1$s = filename
$lang[184] = 'CRC32 checksum doesn\'t match!';
$lang[185] = 'File <b>%1$s</b> successfully merged'; // %1$s = filename
$lang[186] = 'deleted';
$lang[187] = 'not deleted';
$lang[188] = 'Add extension';
$lang[189] = 'without';
$lang[190] = 'to';
$lang[191] = 'Rename?';
$lang[192] = 'Cancel';
$lang[193] = 'Error renaming file <b>%1$s</b>'; // %1$s = filename
$lang[194] = 'File <b>%1$s</b> has been renamed to <b>%2$s</b>'; // %1$s = original filename %2$s = renamed filename
$lang[195] = 'Archive Name';
$lang[196] = 'Please enter an archive name!';
$lang[197] = 'Error the archive has not been created.';
$lang[198] = 'File %1$s was packed'; // %1$s = filename
$lang[199] = 'Packed in archive <b>%1$s</b>'; // %1$s = filename
$lang[200] = 'Error, the archive is empty.';
$lang[201] = 'New name';
$lang[202] = 'Couldn\'t rename the file <b>%1$s</b>!'; // %1$s = filename
$lang[203] = 'Delete source file after successful split';
$lang[204] = 'files and folders';
$lang[205] = 'Unzip';
$lang[206] = 'YouTube Video Format Selector';
$lang[207] = 'Link to Transload';
$lang[208] = 'Referrer';
$lang[209] = 'Transload File';
$lang[210] = 'User &amp; Pass (HTTP/FTP)';
$lang[211] = 'User';
$lang[212] = 'Pass';
$lang[213] = 'Add Comments';
$lang[214] = 'PluginOptions';
$lang[215] = 'Disable All Plugins';
$lang[216] = 'YouTube Video Format Selector';
$lang[217] = 'Direct Link';
$lang[218] = '&amp;fmt=';
$lang[219] = 'Auto-get the highest quality format available';
$lang[220] = '17 [Video: 3GP 176x144 | Audio: AAC 2ch 44.10kHz]';
$lang[221] = '5 [Video: FLV 400x240 | Audio: MP3 1ch 22.05kHz]';
$lang[222] = '34 [Video: FLV 640x360 | Audio: AAC 2ch 44.10kHz]';
$lang[223] = '35 [Video: FLV 854x480 | Audio: AAC 2ch 44.10kHz]';
$lang[224] = '43 [Video: WebM 640x360 | Audio: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [Video: WebM 1280x720 | Audio: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [Video: MP4 480x360 | Audio: AAC 2ch 44.10kHz]';
$lang[227] = '22 [Video: MP4 1280x720 | Audio: AAC 2ch 44.10kHz]';
$lang[228] = '37 [Video: MP4 1920x1080 | Audio: AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; TorrentService';
$lang[230] = 'Username';
$lang[231] = 'Password';
$lang[232] = 'Megaupload.com Cookie Value';
$lang[233] = 'user';
$lang[234] = 'Use vBulletin Plugin';
$lang[235] = 'Additional Cookie Value';
$lang[236] = 'Key=Value';
$lang[237] = 'Send File to Email';
$lang[238] = 'Email';
$lang[239] = 'Split Files';
$lang[240] = 'Method';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'Parts Size';
$lang[244] = 'MB';
$lang[245] = 'Use Proxy Settings';
$lang[246] = 'Proxy';
$lang[247] = 'Username';
$lang[248] = 'Password';
$lang[249] = 'Use Premium Account';
$lang[250] = 'Username';
$lang[251] = 'Password';
$lang[252] = 'Save To';
$lang[253] = 'Path';
$lang[254] = 'Save Settings';
$lang[255] = 'Clear Current Settings';
$lang[256] = 'Check All';
$lang[257] = 'Un-Check All';
$lang[258] = 'Invert Selection';
$lang[259] = 'Show';
$lang[260] = 'Downloaded';
$lang[261] = 'Everything';
$lang[262] = 'Name';
$lang[263] = 'Size';
$lang[264] = 'Comments';
$lang[265] = 'Date';
$lang[266] = 'No files found';
$lang[267] = 'Works With';
$lang[268] = 'Kills';
$lang[269] = 'Debug Mode';
$lang[270] = 'Display Links Only';
$lang[271] = 'Kill Links Only';
$lang[272] = 'Check Links';
$lang[273] = 'Loading...';
$lang[274] = 'Processing, please wait...';
$lang[275] = 'Server Space';
$lang[276] = 'In Use';
$lang[277] = 'Free Space';
$lang[278] = 'Disk Space';
$lang[279] = 'CPU';
$lang[280] = 'Server Time';
$lang[281] = 'Local Time';
$lang[282] = 'Auto-Delete';
$lang[283] = 'Hours After Transload';
$lang[284] = 'Minutes After Transload';
$lang[285] = 'Action';
$lang[286] = 'Upload';
$lang[287] = 'FTP File';
$lang[288] = 'E-Mail';
$lang[289] = 'Mass E-mail';
$lang[290] = 'Split Files';
$lang[291] = 'Merge Files';
$lang[292] = 'MD5 Hash';
$lang[293] = 'Pack Files';
$lang[294] = 'ZIP Files';
$lang[295] = 'Unzip Files';
$lang[296] = 'Rename';
$lang[297] = 'Mass Rename';
$lang[298] = 'Delete';
$lang[299] = 'List Links';
$lang[300] = 'Retrieving download page';
$lang[301] = 'Enter';
$lang[302] = 'here';
$lang[303] = 'Download File';
$lang[304] = 'configs/files.lst is not writable, please make sure it is chmod to 777';
$lang[305] = '&nbsp;is selected as your download path and it is not writable. Please chmod it to 777';
$lang[306] = 'Merging File';
$lang[307] = 'Waiting';
$lang[308] = 'Passed';
$lang[309] = 'Failed';
$lang[310] = 'You might see warnings without this turned on';
$lang[311] = 'You might not be able to turn on Server Info';
$lang[312] = 'Your server might not be able to support files more than 2 GB';
$lang[313] = 'Rapidleech Checker Script';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'PHP Version - ';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'Disk Space Functions';
$lang[323] = 'Apache Version - ';
$lang[324] = 'Wrong proxy address entered';
$lang[325] = 'File successfully saved!';
$lang[326] = 'Save Notes';
$lang[327] = 'Notes';
$lang[328] = 'Actions Disabled';
$lang[329] = 'Main Window';
$lang[330] = 'Settings';
$lang[331] = 'Server Files';
$lang[332] = 'Link Checker';
$lang[333] = 'Plugins';
$lang[334] = 'Auto Transload';
$lang[335] = 'Auto Upload';
$lang[336] = 'File size is limited at ';
$lang[337] = 'File Size Limit: ';
$lang[338] = 'Rar Files';
$lang[339] = 'Unrar Files';
$lang[340] = 'Error detected';
$lang[341] = 'click here to expand';
$lang[342] = 'You can drag window from here';
$lang[343] = 'Can not find "rar"<br />You may need to download it and extract "rar" to "/rar/" directory';
$lang[344] = 'Files that will be archived:';
$lang[345] = 'Archive name:';
$lang[346] = 'Options:';
$lang[347] = 'Compresion level:';
$lang[348] = 'Store';
$lang[349] = 'Fastest';
$lang[350] = 'Fast';
$lang[351] = 'Normal';
$lang[352] = 'Good';
$lang[353] = 'Best';
$lang[354] = 'Create volumes';
$lang[355] = 'Delete files after archiving';
$lang[356] = 'Create solid archive';
$lang[357] = 'Create recovery record';
$lang[358] = 'Test archive after compression';
$lang[359] = 'Use password';
$lang[360] = 'Encrypt file names';
$lang[361] = 'Set path inside archive';
$lang[362] = 'Rar';
$lang[363] = 'Creating archive: <b>%1$s</b>';
$lang[364] = 'Waiting...';
$lang[365] = 'Go back to file list';
$lang[366] = '<b>Files from %1$s</b>:';
$lang[367] = 'Can not find "unrar"';
$lang[368] = 'Pasword needed to list files:';
$lang[369] = 'Pasword needed to extract files:';
$lang[370] = 'Error:%1$s';
$lang[371] = 'Try to list again';
$lang[372] = 'Unrar selected';
$lang[373] = '<b>Extracting files from %1$s</b>:';
$lang[374] = 'Status:';
$lang[375] = 'Select text';
$lang[376] = 'Premium Accounts :';
$lang[377] = '38 [Video: MP4 4096x3072 | Audio: AAC 2ch 44.10kHz]';
$lang[378] = 'Close window';
$lang[379] = 'Files';
$lang[380] = 'MD5 change should only be applied to known working formats(i.e. .rar or .zip)<br />Do you want to continue?';
$lang[381] = 'MD5 of file <b>%1$s</b> changed'; // %1$s = filename
$lang[382] = 'Error changing the MD5 of the file <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'MD5 change';
$lang[384] = 'Match text';
$lang[385] = 'Match';
$lang[386] = 'Ignore case';
$lang[387] = 'Put each file on a separated archive';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]';
$lang[390] = 'CRC32 Hash';
$lang[391] = 'CRC32 found in file\'s name is valid';
$lang[392] = 'CRC32 found in file\'s name (&quot;%1$s&quot;) doesn\'t match calculated CRC32';
$lang[393] = 'SHA1 Hash';
$lang[394] = 'Create RAR5 file';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// The Spanish language file

$lang[1] = 'Acceso denegado';
$lang[2] = 'El servidor se ha negado a cumplir con tu solicitud';
$lang[3] = 'No haz escrito una direcciÃ³n de correo electrÃ³nico vÃ¡lida';
$lang[4] = 'El tamaÃ±o de las piezas no es un nÃºmero';
$lang[5] = 'URL de tipo desconocida, <span class="font-black">Solo se puede usar protocolo <span class="font-blue">http</span> o <span class="font-blue">https</span> o <span class="font-blue">ftp</span></span>';
$lang[6] = 'Ruta de acceso no se especificada para guardar este archivo';
$lang[7] = 'No se te permite descargar desde <span class="font-black">%1$s (%2$s)</span>'; // %1$s = nombre host %2$s = ip del host
$lang[8] = 'Redireccionando a:';
$lang[9] = 'No se pudo actualizar la lista de archivos';
$lang[10] = 'Archivo <b>%1$s</b> (<b>%2$s</b>) Â¡Guardado!<br />Tiempo: <b>%3$s</b><br />Velocidad Promedio: <b>%4$s KB/s</b><br />'; // %1$s = nombre de archivo %2$s = tamaÃ±o de archivo %3$s = tiempo de descarga %4$s = velocidad
$lang[11] = '<script>mail("El archivo fue enviado a esta direcciÃ³n<b>%1$s</b>.", "%2$s");</script>'; // %1$s = direcciÃ³n de E-mail %2$s = nombre de archivo
$lang[12] = 'Â¡Error al enviar el archivo!';
$lang[13] = 'Volver a la pÃ¡gina principal';
$lang[14] = 'ConexiÃ³n perdida, archivo borrado.';
$lang[15] = 'Actualizar';
$lang[16] = 'Por favor, cambia el modo de depuraciÃ³n a <b>1</b>';
$lang[17] = 'El NÃºmero MÃ¡ximo (%1$s) de enlaces ha sido alcanzado.'; // %1$s = nÃºmero mÃ¡ximo de enlaces
$lang[18] = '%1$s Enlace%2$s verificados en %3$s segundos. (MÃ©todo: <b>%4$s</b>)'; // %1$s = Number of links %2$s = Plural form %3$s = seconds %4$s = method for checking links
$lang[19] = 's'; // End of a plural
$lang[20] = 'DirecciÃ³n del servidor proxy incorrecta';
$lang[21] = 'Enlace';
$lang[22] = 'Estado';
$lang[23] = 'Esperando';
$lang[24] = 'URL no vÃ¡lida';
$lang[25] = 'Preparando';
$lang[26] = 'Iniciado';
$lang[27] = 'ConexiÃ³n perdida';
$lang[28] = 'Terminado';
$lang[29] = 'Iniciar Transferencia automÃ¡tica';
$lang[30] = 'Frames no soportados, actualice su navegador';
$lang[31] = 'AÃ±adir enlaces';
$lang[32] = 'Enlaces';
$lang[33] = 'Opciones';
$lang[34] = 'Transload archivos';
$lang[35] = 'Usar proxy';
$lang[36] = 'Proxy';
$lang[37] = 'Usuario';
$lang[38] = 'ContraseÃ±a';
$lang[39] = 'Usar cuenta de Imageshack';
$lang[40] = 'Guardar en';
$lang[41] = 'Ruta';
$lang[42] = 'Usar Cuenta Premium';
$lang[43] = 'Ejecutar en el servidor';
$lang[44] = 'Tiempo de retardo';
$lang[45] = 'Retardo (en segundos)';
$lang[46] = 'No hay archivos o hosts seleccionados para subir';
$lang[47] = 'Selecciona Hosts para Subida';
$lang[48] = 'Â¡NingÃºn Servicio de Subida Soportado!';
$lang[49] = 'Ventanas de subida';
$lang[50] = 'Formato de guardado de enlace';
$lang[51] = 'Default';
$lang[52] = 'Seleccionar todos';
$lang[53] = 'Deseleccionar todos';
$lang[54] = 'Invertir SelecciÃ³n';
$lang[55] = 'Nombre';
$lang[56] = 'TamaÃ±o';
$lang[57] = 'No se encontraron archivos';
$lang[58] = 'Leyenda para formato de guardado de enlaces: (sensible a mayÃºsculas y minÃºsculas)';
$lang[59] = 'El enlace para la descarga ';
$lang[60] = 'El nombre del archivo';
$lang[61] = 'Estilo predeterminado del enlace';
$lang[62] = 'Todo excepto los indicados anteriormente serÃ¡n tratados como texto, no puedes hacer formato multi lÃ­nea ahora, una nueva linea serÃ¡ insertada por cada enlace.';
$lang[63] = 'Subiendo archivo %1$s a %2$s'; // %1$s = nombre de archivo %2$s = nombre de host para el archivo
$lang[64] = 'El archivo %1$s no existe.'; // %1$s = nombre de archivo
$lang[65] = 'El archivo %1$s no puede ser leÃ­do por el script.'; // %1$s = nombre de archivo
$lang[66] = 'TamaÃ±o del archivo demasiado grande para subir al host.';
$lang[67] = 'Servicio de subida no permitido';
$lang[68] = 'Enlace de descarga';
$lang[69] = 'Enlace para eliminar';
$lang[70] = 'Enlace de estado';
$lang[71] = 'Enlace de admin';
$lang[72] = 'ID de Usuario';
$lang[73] = 'Subida por FTP';
$lang[74] = 'ContraseÃ±a';
$lang[75] = 'Rapidleech PlugMod - Enlaces de Subida';
$lang[76] = '<div class="linktitle"> Enlaces para <strong>%1$s</strong> - <span class="bluefont"> TamaÃ±o: <strong>%2$s</strong> </span> </div> '; //%1$s = nombre de archivo %2$s = tamaÃ±o de archivo
$lang[77] = 'Terminado';
$lang[78] = 'Regresar';
$lang[79] = 'No se pudo establecer una conexiÃ³n con el servidor %1$s.'; // %1$s = nombre de servidor FTP
$lang[80] = 'Nombre de usuario y/o contraseÃ±a incorrectos';
$lang[81] = 'Conectado a: <b>%1$s</b>...'; // %1$s = nombre del servidor FTP
$lang[82] = 'No se permite descargar el tipo de archivo %1$s'; // %1$s = Tipo de archivo
$lang[83] = 'Archivo <b>%1$s</b>, TamaÃ±o <b>%2$s</b>...'; // %1$s = nombre de archivo %2$s = tamaÃ±o del archivo
$lang[84] = 'Error obteniendo el enlace';
$lang[85] = 'Â¡Texto pasado como contador no es un nÃºmero!';
$lang[86] = 'ERROR: Por favor, activa JavaScript.';
$lang[87] = 'Por favor espera <b>%1$s</b> segundos...'; // %1$s = nÃºmero de segundos
$lang[88] = 'No fue posible conectarse a %1$s en el puerto %2$s'; // %1$s = nombre de host %2$s = puerto
$lang[89] = 'Conectado al proxy: <b>%1$s</b> en el puerto <b>%2$s</b>...'; // %1$s = host del proxy %2$s = puerto del proxy
$lang[90] = 'Conectado a: <b>%1$s</b> en el puerto <b>%2$s</b>...'; // %1$s = host %2$s = puerto
$lang[91] = 'No se reciviÃ³ el encabezado';
$lang[92] = 'Â¡No tienes permiso de acceder a la pÃ¡gina!';
$lang[93] = 'Â¡La pÃ¡gina no fue encontrada!';
$lang[94] = 'Â¡La pÃ¡gina fue prohibida o no encontrada!';
$lang[95] = 'Â¡Error! ha sido redireccionado a [%1$s]'; // %1$s = direcciÃ³n de redirecciÃ³n
$lang[96] = 'Este sitio requiere autorizaciÃ³n. Para indicar el nombre de usuario y contraseÃ±a use una url como esta:<br />http://<b>login:password@</b>www.sitio.com/archivo.exe';
$lang[97] = 'Resume superado el lÃ­mite ';
$lang[98] = 'Este servidor no soporta reanudar';
$lang[99] = 'Descargar';
$lang[100] = 'Esta cuenta premium ya estÃ¡ en uso con otra ip.';
$lang[101] = 'El archivo %1$s no se puede guardar en el directorio %2$s'; // %1$s = nombre de archivo %2$s = nombre de directorio
$lang[102] = 'Prueba de la carpeta a chmod 777.';
$lang[103] = 'Intentar de nuevo';
$lang[104] = 'Archivo';
$lang[105] = 'No es posible crear un registro en el archivo %1$s'; // %1$s = nombre de archivo
$lang[106] = 'URL no vÃ¡lida o se ha producido un error desconocido';
$lang[107] = 'Ha alcanzado el lÃ­mite para usarios Gratuitos.';
$lang[108] = 'La sesiÃ³n de descarga ha expirado';
$lang[109] = 'CÃ³digo de acceso incorrecto.';
$lang[110] = 'Ha introducido un cÃ³digo incorrecto demasiadas veces';
$lang[111] = 'LÃ­mite de descarga superado';
$lang[112] = 'Error al LEER Datos';
$lang[113] = 'Error al ENVIAR datos';
$lang[114] = 'Activo';
$lang[115] = 'No disponible';
$lang[116] = 'Muerto';
$lang[117] = 'Necesitas cargar/activar la extensiÃ³n cURL (http://www.php.net/cURL) o puedes establecer \'fgc\' => 1 en config.php.';
$lang[118] = 'CURL estÃ¡ activado';
$lang[119] = 'Se recomienda PHP versiÃ³n 5, aunque no es obligatorio';
$lang[120] = 'Compruebe si el modo safe mode esta desactivado pues el script no puede funcionar con safe mode activado';
$lang[121] = 'Enviando archivo <b>%1$s</b>'; // %1$s = nombre de archivo
$lang[122] = 'No hay necesidad de dividir, EnvÃ­a un solo correo';
$lang[123] = 'Partiendo en partes de %1$s'; // %1$s = tamaÃ±o de las partes
$lang[124] = 'MÃ©todo';
$lang[125] = 'Enviando parte <b>%1$s</b>'; //%1$s = nÃºmero de parte
$lang[126] = 'No hay necesidad de dividir, EnvÃ­a un solo correo';
$lang[127] = 'No se encontrÃ³ el archivo de host';
$lang[128] = 'No se puede crear el archivo de hosts';
$lang[129] = 'horas'; // Plural
$lang[130] = 'hora';
$lang[131] = 'minutos'; // Plural
$lang[132] = 'minuto';
$lang[133] = 'segundos'; // Plural
$lang[134] = 'segundo';
$lang[135] = 'getCpuUsage (): no se puede acceder a la ruta de STAT o el archivo STAT no es vÃ¡lido';
$lang[136] = 'Carga de CPU';
$lang[137] = 'Se ha producido un error';
$lang[138] = 'Selecciona al menos un archivo.';
$lang[139] = 'Emails';
$lang[140] = 'Enviar';
$lang[141] = 'Eliminar envÃ­os exitosos';
$lang[142] = 'Dividir en partes';
$lang[143] = 'TamaÃ±o de las partes';
$lang[144] = '<b>%1$s</b> - DirecciÃ³n de E-mail no vÃ¡lida'; // %1$s = direcciÃ³n de e-mail
$lang[145] = 'Archivo <b>%1$s</b> Â¡no encontrado!'; // %1$s = nombre de archivo
$lang[146] = 'No se pudo actualizar la lista de archivos';
$lang[147] = 'Â¡La eliminaciÃ³n de archivos estÃ¡ desactivada!';
$lang[148] = 'Eliminar archivos';
$lang[149] = 'SÃ­';
$lang[150] = 'No';
$lang[151] = 'Archivo <b>%1$s</b> Borrado'; // %1$s = nombre de archivo
$lang[152] = 'Error al borrar el archivo <b>%1$s</b>!'; // %1$s = nombre de archivo
$lang[153] = 'Host';
$lang[154] = 'Puerto';
$lang[155] = 'Directorio';
$lang[156] = 'Borrar archivo de origen despuÃ©s de subida exitosa';
$lang[157] = 'Guardar datos FTP';
$lang[158] = 'Borrar datos FTP';
$lang[159] = 'No se puede encontrar el directorio <b>%1$s</b>'; // %1$s nombre del directorio
$lang[160] = 'Archivo %1$s Â¡subido correctamente!'; // %1$s = nombre de archivo
$lang[161] = 'Tiempo';
$lang[162] = 'Velocidad promedio';
$lang[163] = 'No ha sido posible subir el archivo <b>%1$s</b>!'; // %1$s = nombre de archivo
$lang[164] = 'Email';
$lang[165] = 'Borrar envÃ­os exitosos';
$lang[166] = 'DirecciÃ³n de E-mail no vÃ¡lida';
$lang[167] = 'Â¡Por favor selecciona solamente el archivo .crc o .001!';
$lang[168] = 'Â¡Por favor selecciona el archivo .crc!';
$lang[169] = 'Â¡Por favor selecciona el archivo .crc o .001!';
$lang[170] = 'Â¿Realizar verificaciÃ³n de CRC? (recomendado)';
$lang[171] = 'Modo de verificaciÃ³n CRC32';
$lang[172] = 'Usar hash_file (Recomendado)';
$lang[173] = 'Leer archivo a la memoria';
$lang[174] = 'crc falso';
$lang[175] = 'Borrar archivos de origen despuÃ©s de unirlos correctamente';
$lang[176] = 'Nota:';
$lang[177] = 'El tamaÃ±o de archivo y el crc32 no se verificarÃ¡n';
$lang[178] = 'Â¡No es sposible leer el archivo .crc!';
$lang[179] = 'Error, el archivo de salida ya existe <b>%1$s</b>'; // %1$s = nombre de archivo
$lang[180] = 'Error, partes faltantes o incompletas';
$lang[181] = 'Error, el tipo de archivo %1$s estÃ¡ prohibido'; // Tipo de archivo
$lang[182] = 'No es posible abrir el archivo de destino <b>%1$s</b>'; // %1$s = nombre de archivo
$lang[183] = 'Error al escribir el archivo <b>%1$s</b>!'; // %1$s = nombre de archivo
$lang[184] = 'Â¡La verificaciÃ³n de CRC32 no coincide!';
$lang[185] = 'Archivo <b>%1$s</b> unido correctamente'; // %1$s = nombre de archivo
$lang[186] = 'borrado';
$lang[187] = 'no borrado';
$lang[188] = 'AÃ±adir extensiÃ³n';
$lang[189] = 'sin';
$lang[190] = 'a';
$lang[191] = 'Â¿Renombrar?';
$lang[192] = 'Cancelar';
$lang[193] = 'Error al renombrar el archivo <b>%1$s</b>'; // %1$s = nombre de archivo
$lang[194] = 'El archivo <b>%1$s</b> ha sido renombrado a <b>%2$s</b>'; // %1$s = nombre original del archivo %2$s = nombre nuevo del archivo
$lang[195] = 'Nombre de archivo';
$lang[196] = 'Â¡Por favor introduce un nombre de archivo!';
$lang[197] = 'Error, el archivo no ha sido creado.';
$lang[198] = 'El archivo %1$s fue empaquetado'; // %1$s = nombre de archivo
$lang[199] = 'Empaquetado en el archivo <b>%1$s</b>'; // %1$s = nombre de archivo
$lang[200] = 'Error, el archivo estÃ¡ vacio.';
$lang[201] = 'Nuevo nombre';
$lang[202] = 'No se ha podido renombrar el archivo <b>%1$s</b>!'; // %1$s = nombre de archivo
$lang[203] = 'Eliminar archivos origen despuÃ©s de dividir correctamente';
$lang[204] = 'archivos y directorios';
$lang[205] = 'Descomprimir';
$lang[206] = 'Selector de Formato de Video de Youtube';
$lang[207] = 'Enlace a transferir';
$lang[208] = 'Referrer';
$lang[209] = 'Transferir archivo';
$lang[210] = 'Usuario &amp; ContraseÃ±a (HTTP/FTP)';
$lang[211] = 'Usuario';
$lang[212] = 'ContraseÃ±a';
$lang[213] = 'Agregar Comentario';
$lang[214] = 'Opciones de Plugin';
$lang[215] = 'Deshabilitar Todos los Plugins';
$lang[216] = 'Selector de Formato de Video de Youtube';
$lang[217] = 'Enlace Directo';
$lang[218] = '&amp;fmt=';
$lang[219] = 'Escojer automÃ¡ticamente la mejor calidad disponible';
$lang[220] = '17 [Video: 3GP 176x144 | Audio: AAC 2ch 44.10kHz]';
$lang[221] = '5 [Video: FLV 400x240 | Audio: MP3 1ch 22.05kHz]';
$lang[222] = '34 [Video: FLV 640x360 | Audio: AAC 2ch 44.10kHz]';
$lang[223] = '35 [Video: FLV 854x480 | Audio: AAC 2ch 44.10kHz]';
$lang[224] = '43 [Video: WebM 640x360 | Audio: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [Video: WebM 1280x720 | Audio: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [Video: MP4 480x360 | Audio: AAC 2ch 44.10kHz]';
$lang[227] = '22 [Video: MP4 1280x720 | Audio: AAC 2ch 44.10kHz]';
$lang[228] = '37 [Video: MP4 1920x1080 | Audio: AAC 2ch 44.10kHz]';
$lang[229] = 'TorrentService de ImageShack&reg;';
$lang[230] = 'Nombre de usuario';
$lang[231] = 'ContraseÃ±a';
$lang[232] = 'Valor de cookie de Megaupload.com';
$lang[233] = 'usuario';
$lang[234] = 'Usar Plugin de vBulletin';
$lang[235] = 'Valor adicional de Cookie';
$lang[236] = 'Clave=Valor';
$lang[237] = 'Enviar archivo a Email';
$lang[238] = 'Email';
$lang[239] = 'Dividir archivos';
$lang[240] = 'MÃ©todo';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'TamaÃ±o de las partes';
$lang[244] = 'MB';
$lang[245] = 'Usar configuraciÃ³n de Proxy';
$lang[246] = 'Proxy';
$lang[247] = 'Nombre de usuario';
$lang[248] = 'ContraseÃ±a';
$lang[249] = 'Usar Cuenta Premium';
$lang[250] = 'Nombre de usuario';
$lang[251] = 'ContraseÃ±a';
$lang[252] = 'Guardar en';
$lang[253] = 'Ruta';
$lang[254] = 'Guardar Opciones';
$lang[255] = 'Borrar Opciones Actuales';
$lang[256] = 'Marcar Todos';
$lang[257] = 'Desmarcar Todos';
$lang[258] = 'Invertir SeleciÃ³n';
$lang[259] = 'Mostrar';
$lang[260] = 'Descargados';
$lang[261] = 'Todos';
$lang[262] = 'Nombre';
$lang[263] = 'TamaÃ±o';
$lang[264] = 'Comentarios';
$lang[265] = 'Fecha';
$lang[266] = 'No se encontraron archivos';
$lang[267] = 'Funciona con';
$lang[268] = 'Elimina';
$lang[269] = 'Modo de DepuraciÃ³n';
$lang[270] = 'Solamente Mostrar Enlaces';
$lang[271] = 'Solamente Eliminar Enlaces';
$lang[272] = 'Verificar Enlaces';
$lang[273] = 'Cargando...';
$lang[274] = 'Procesando, por favor espere...';
$lang[275] = 'Espacio del Servidor';
$lang[276] = 'En Uso';
$lang[277] = 'Espacio Disponible';
$lang[278] = 'Espacio de Disco';
$lang[279] = 'CPU';
$lang[280] = 'Hora del Servidor';
$lang[281] = 'Hora Local';
$lang[282] = 'Auto - Borrado';
$lang[283] = 'Horas DespuÃ©s de la Transferencia';
$lang[284] = 'Minutos DespuÃ©s de la Transferencia';
$lang[285] = 'AcciÃ³n';
$lang[286] = 'Subir';
$lang[287] = 'Enviar por FTP';
$lang[288] = 'E-Mail';
$lang[289] = 'E-mail Masivo';
$lang[290] = 'Dividir Archivos';
$lang[291] = 'Juntar Archivos';
$lang[292] = 'Hash MD5';
$lang[293] = 'Empaquetar archivos';
$lang[294] = 'Comprimir Archivos en ZIP';
$lang[295] = 'Descomprimir Archivos en ZIP';
$lang[296] = 'Renombrar';
$lang[297] = 'Renombrar Masivo';
$lang[298] = 'Borrar';
$lang[299] = 'Listar Enlaces';
$lang[300] = 'Retrieving download page';
$lang[301] = 'Teclea';
$lang[302] = 'aquÃ­';
$lang[303] = 'Descargar Archivo';
$lang[304] = 'No se ha podido escribir en configs/files.lst asegÃºrate de que sus permisos sean 777';
$lang[305] = '&nbsp; ha sido seleccionado como tu ruta de descarga y no es escribible. Por favor, cambia sus permisos a 777';
$lang[306] = 'Uniendo Archivo';
$lang[307] = 'Esperando';
$lang[308] = 'PasÃ³';
$lang[309] = 'FallÃ³';
$lang[310] = 'PodrÃ­as ver advertencias con esto desactivado';
$lang[311] = 'QuizÃ¡ no seas capaz de activar la informaciÃ³n del servidor';
$lang[312] = 'Puede que tu servidor no soporte archivos mayores de 2 GB';
$lang[313] = 'Script Verificador de Rapidleech';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'VersiÃ³n de PHP - ';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'Funciones de Espacio de disco';
$lang[323] = 'VersiÃ³n de Apache - ';
$lang[324] = 'DirecciÃ³n de Proxy introducida es errÃ³nea';
$lang[325] = 'Archivo guardado correctamente';
$lang[326] = 'Guardar notas';
$lang[327] = 'Notas';
$lang[328] = 'Acciones Desactivadas';
$lang[329] = 'Principal';
$lang[330] = 'Opciones';
$lang[331] = 'Archivos en Servidor';
$lang[332] = 'Verificar enlaces';
$lang[333] = 'Plugins';
$lang[334] = 'Auto Transferir';
$lang[335] = 'Auto Subir';
$lang[336] = 'El TamaÃ±o del archivo estÃ¡ limitado a ';
$lang[337] = 'LÃ­mite de tamaÃ±o de archivo: ';
$lang[338] = 'Comprimir Archivos en Rar';
$lang[339] = 'Extraer Archivos en Rar';
$lang[340] = 'Error detectado';
$lang[341] = 'click aquÃ­ para expandir';
$lang[342] = 'Puedes arrastrar la ventana desde aquÃ­';
$lang[343] = 'No se encuentra "rar"<br />Puede que necesites bajarlo y extraer "rar" al directorio "/rar/"';
$lang[344] = 'Ficheros que serÃ¡n archivados:';
$lang[345] = 'Nombre del archivo:';
$lang[346] = 'Opciones:';
$lang[347] = 'Nivel de compresiÃ³n:';
$lang[348] = 'No comprimir';
$lang[349] = 'Muy rÃ¡pida';
$lang[350] = 'RÃ¡pida';
$lang[351] = 'Normal';
$lang[352] = 'Buena';
$lang[353] = 'La mejor';
$lang[354] = 'Crear volumenes';
$lang[355] = 'Eliminar ficheros tras la compresiÃ³n';
$lang[356] = 'Crear un archivo sÃ³lido';
$lang[357] = 'AÃ±adir Registro de RecuperaciÃ³n';
$lang[358] = 'Verificar ficheros comprimidos';
$lang[359] = 'Usar contraseÃ±a';
$lang[360] = 'Codificar nombres de fichero';
$lang[361] = 'Especificar ruta dentro del archivo';
$lang[362] = 'Comprimir Archivos en Rar';
$lang[363] = 'Creando archivo: <b>%1$s</b>';
$lang[364] = 'Esperando...';
$lang[365] = 'Volver a la lista de archivos';
$lang[366] = '<b>Ficheros de %1$s</b>:';
$lang[367] = 'No se encuentra "unrar"';
$lang[368] = 'ContraseÃ±a necesaria para listar ficheros:';
$lang[369] = 'ContraseÃ±a necesaria para descomprimir ficheros:';
$lang[370] = 'Error:%1$s';
$lang[371] = 'Intentar listar de nuevo';
$lang[372] = 'Descomprimir ficheros seleccionados';
$lang[373] = '<b>Extrayendo ficheros desde %1$s</b>:';
$lang[374] = 'Estado:';
$lang[375] = 'Seleccionar texto';
$lang[376] = 'Cuentas Premium :';
$lang[377] = '38 [Video: MP4 4096x3072 | Audio: AAC 2ch 44.10kHz]';
$lang[378] = 'Cerrar ventana';
$lang[379] = 'Archivos';
$lang[380] = 'El cambio de MD5 solo debeser aplicado a formatos conocidos que funcionen con Ã©l(p.e. .rar o .zip)<br />Â¿Deseas continuar?';
$lang[381] = 'MD5 del archivo <b>%1$s</b> cambiado'; // %1$s = filename
$lang[382] = 'Error cambiando el MD5 del archivo <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'Cambio de MD5';
$lang[384] = 'Coincidir texto';
$lang[385] = 'Coincidir';
$lang[386] = 'Ignorar mayÃºsculas y minÃºsculas';
$lang[387] = 'Colocar cada fichero en archivos separados';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]';
$lang[390] = 'Hash CRC32';
$lang[391] = 'El CRC32 encontrado en nombre del archivo es vÃ¡lido';
$lang[392] = 'El CRC32 encontrado en nombre del archivo (&quot;%1$s&quot;) no concuerda con el CRC32 calculado';
$lang[393] = 'Hash SHA1';
$lang[394] = 'Crear archivo RAR5';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// The Farsi language file
// You should always use this file as a template for translating
// By WebAlfa.Net Translate Team

$lang[1] = 'Ø¯Ø³ØªØ±Ø³Ù Ø§ÙÙØ§Ù Ù¾Ø°ÙØ± ÙÙÙØ¨Ø§Ø´Ø¯';
$lang[2] = 'Ø³Ø±ÙØ± Ø¯Ø³ØªØ±Ø³Ù Ø´ÙØ§ Ø±Ø§ ÙØ­Ø¯ÙØ¯ ÙØ±Ø¯Ù Ø§Ø³Øª';
$lang[3] = 'Ø§Ø¯Ø±Ø³ Ù¾Ø³Øª Ø§ÙÙØªØ±ÙÙÙÙ ÙØ¹Ø¨Ø± ÙØ§Ø±Ø¯ ÙÙÙØ¯';
$lang[4] = 'Ø­Ø¬Ù Ø§Ø² ÙØ·Ø¹Ø§Øª ÙØ³ØªÙØ¯ Ø¹Ø¯Ø¯Û ÙÛØ³Øª';
$lang[5] = 'Ø§Ø¯Ø±Ø³ ÙØ§ÙØ¹ÙÙÙ, <span class="font-black">ÙÙØ· Ø§Ø³ØªÙØ§Ø¯Ù <span class="font-blue">http</span> ÛØ§ <span class="font-blue">https</span> ÛØ§ <span class="font-blue">ftp</span> Protocol</span>';
$lang[6] = 'ÙØ³ÙØ± Ø¨Ø±Ø§Ù Ø°Ø®ÙØ±Ù Ø§ÙÙ ÙØ§ÙÙ ÙØ´Ø®Øµ ÙØ´Ø¯Ù Ø§Ø³Øª';
$lang[7] = 'Ø´ÙØ§ Ø§Ø¬Ø§Ø²Û Ø§ÙØªÙØ§Ù Ø§Ø² <span class="font-black">%1$s (%2$s)</span> Ø±Ø§ ÙØ¯Ø§Ø±ÛØ¯'; // %1$s = host name %2$s = host ip
$lang[8] = 'Ø§ÙØªÙØ§Ù Ø¨Ù:';
$lang[9] = 'Ø¨Ù Ø±ÙØ² Ø±Ø³Ø§ÙÙ ÙÙØ³Øª ÙØ§ÙÙ ÙØ§';
$lang[10] = 'ÙØ§ÙÙ <b>%1$s</b> (<b>%2$s</b>) Ø°Ø®ÙØ±Ù!<br />Ø²ÙØ§Ù: <b>%3$s</b><br />ÙÙØ§ÙÙÚ¯Ù Ø³Ø±Ø¹Øª: <b>%4$s KB/s</b><br />'; // %1$s = filename %2$s = filesize %3$s = time of download %4$s = speed
$lang[11] = '<script>Ø§ÙÙÙÙ("ÙØ§ÙÙ Ø¨Ù Ø§ÙÙÙÙ Ø´ÙØ§ Ø§Ø±Ø³Ø§Ù Ø´Ø¯<b>%1$s</b>.", "%2$s");</script>'; // %1$s = E-mail address %2$s = filename
$lang[12] = 'Ø®Ø·Ø§ Ø¯Ø± Ø§Ø±Ø³Ø§Ù ÙØ§ÙÙ!';
$lang[13] = 'Ø¨Ø§Ø²Ú¯Ø³Øª Ø¨Ù ØµÙØ­Ù Ø§ØµÙÙ';
$lang[14] = 'Ø§ØªØµØ§Ù ÙØ§ ÙÙÙÙ . ÙØ§ÙÙ Ø­Ø°Ù Ø´Ø¯Ù.';
$lang[15] = 'Ø¨Ø§Ø± Ú¯Ø°Ø§Ø±Ù ÙØ¬Ø¯Ø¯';
$lang[16] = 'ÙØ·ÙØ§ ØªØºÙÙØ± Ø¯ÙÙØ¯ Ø¯ÙØ¨Ø§Ú¯ Ø±Ø§ <b>1</b>';
$lang[17] = 'Ø­Ø¯Ø§ÙØ«Ø±  (%1$s) Ù¾ÙÙÙØ¯ ÙÙÙÙ ÙØ§.'; // %1$s = Number of maximum links
$lang[18] = '%1$s ÙÙÙÙ%2$s ÚÙ Ø´Ø¯Ù %3$s Ø«Ø§ÙÙÙ. (Method: <b>%4$s</b>)'; // %1$s = Number of links %2$s = Plural form %3$s = seconds %4$s = method for checking links
$lang[19] = 's'; // End of a plural
$lang[20] = 'Ø§Ø¯Ø±Ø³ Ø³Ø±ÙØ± Ù¾Ø±ÙÙØ³Ù';
$lang[21] = 'ÙÙÙÙ';
$lang[22] = 'ÙØ¶Ø¹ÙØª';
$lang[23] = 'ØµØ¨Ø± ÙÙÙØ¯';
$lang[24] = 'Ø§Ø¯Ø±Ø³ ÙØ§ÙØ¹ØªØ¨Ø± URL';
$lang[25] = 'Ø§ÙØ§Ø¯Ù';
$lang[26] = 'Ø´Ø±ÙØ¹ Ø´Ø¯';
$lang[27] = 'Ø§ØªØµØ§Ù ÙØ§ÙÙÙÙ';
$lang[28] = 'Ù¾Ø§ÙØ§Ù';
$lang[29] = 'Ø´Ø±ÙØ¹ Ø§Ù¾ÙÙØ¯ ÚÙØ¯ Ø±Ø³Ø§ÙÙ Ø§Ù';
$lang[30] = 'ÙØ±Ù Ù¾Ø´ØªÙØ¨Ø§ÙÙ ÙÙÙØ´ÙØ¯, Ø¨Ù Ø±ÙØ² Ø±Ø³Ø§ÙÙ ÙØ±ÙØ±Ú¯Ø±';
$lang[31] = 'Ø§Ø¶Ø§ÙÙ ÙØ±Ø¯Ù ÙÙÙÙ';
$lang[32] = 'ÙÙÙÙ ÙØ§';
$lang[33] = 'ØªÙØ¸ÙÙØ§Øª';
$lang[34] = 'Transload ÙØ§ÙÙ ÙØ§';
$lang[35] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² ØªÙØ¸ÙÙØ§Øª Ù¾Ø±ÙÙØ³Ù';
$lang[36] = 'Ù¾Ø±ÙÙØ³Ù';
$lang[37] = 'ÙØ§Ù ÙØ§Ø±Ø¨Ø±Ù';
$lang[38] = 'ÙÙÙÙ Ø¹Ø¨ÙØ±';
$lang[39] = 'Ø§Ø³ØªÙØ§Ø¯Ù Imageshack Ø§Ø² Ø­Ø³Ø§Ø¨';
$lang[40] = 'Ø°Ø®ÙØ±Ù Ø¯Ø±';
$lang[41] = 'ÙØ­Ù';
$lang[42] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² Ø§ÙØ§ÙØª Ù¾ÙÙÙ';
$lang[43] = 'Ø§Ø¬Ø±Ø§Ù Ø³Ø±ÙØ± Ø³Ø§ÙØ¯';
$lang[44] = 'Ø²ÙØ§Ù ØªØ§Ø®ÙØ±';
$lang[45] = 'ØªØ§Ø®ÙØ± (Ø¯Ø± Ø«Ø§ÙÙÙ)';
$lang[46] = 'ÙÙØ¬ ÙØ§ÙÙ ÙØ§ ÙÙØ²Ø¨Ø§ÙÙ Ø§ÙØªØ®Ø§Ø¨ ÙØ´Ø¯Ù';
$lang[47] = 'ÙÙØ²Ø¨Ø§ÙÙ Ø±Ø§ Ø¨Ø±Ø§Ù Ø§Ù¾ÙÙØ¯ Ø§ÙØªØ®Ø§Ø¨ ÙÙÙØ¯';
$lang[48] = 'Ø§ÙÙ Ø³Ø±ÙÙØ³ Ù¾Ø´ØªÙØ¨Ø§ÙÙ ÙÙÙØ´ÙØ¯!';
$lang[49] = 'Ø§Ù¾ÙÙØ¯ Ù¾ÙØ¬Ø±Ù ÙØ§';
$lang[50] = 'ÙØ±ÙØª Ø°Ø®ÙØ±Ù ÙÙÙÙ';
$lang[51] = 'Ù¾ÙØ´ÙØ±Ø¶';
$lang[52] = 'Ø§ÙØªØ®Ø§Ø¨ ÙÙÙ ';
$lang[53] = 'ÙÙ Ø§ÙØªØ®Ø§Ø¨ ÙÙÙ';
$lang[54] = 'Ø¨Ø±Ø¹ÙØ³ Ø´ÙØ¯';
$lang[55] = 'ÙØ§Ù';
$lang[56] = 'Ø­Ø¬Ù';
$lang[57] = 'ÙØ§ÙÙÙ ÙØ§ÙØª ÙØ´Ø¯';
$lang[58] = 'ÙØ±ÙØª Ø°Ø®ÙØ±Ù ÙÙÙÙ ÙØ§: (Ø­Ø³Ø§Ø³ Ø¨Ù ÙÙÚÙÙ Ø­Ø±ÙÙ)';
$lang[59] = 'ÙÙÙÙ Ø¯Ø§ÙÙÙØ¯';
$lang[60] = 'ÙØ§Ù ÙØ§ÙÙ';
$lang[61] = 'ÙÙÙÙ Ù¾ÙØ´ÙØ±Ø¶';
$lang[62] = 'Anything besides the ones stated above will be treated as string, you are unable to do multi line format now, a new line will be inserted for each link.';
$lang[63] = 'Ø§Ù¾ÙÙØ¯ ÙØ§ÙÙ  %1$s to %2$s'; // %1$s = filename %2$s = file host name
$lang[64] = 'ÙØ§ÙÙ %1$s ÙØ¬ÙØ¯ ÙØ¯Ø§Ø±Ø¯.'; // %1$s = filename
$lang[65] = 'ÙØ§ÙÙ %1$s ÙØ§Ø¨Ù Ø®ÙØ§ÙØ¯Ù ÙÙØ³Øª ØªÙØ³Ø· Ø§Ø³ÙØ±ÙÙ¾Øª.'; // %1$s = filename
$lang[66] = 'ÙØ§ÙÙ Ø¨Ø±Ø§Ù Ø§Ù¾ÙÙØ¯ Ø¨Ø²Ø±Ú¯ØªØ± Ø§Ø² Ø­Ø¯ ÙØ¬Ø§Ø² Ø§Ø³Øª.';
$lang[67] = 'Ø³Ø±ÙÙØ³ Ø§Ù¾ÙÙØ¯ Ø¯Ø± Ø¯Ø³ØªØ±Ø³ ÙÙØ³Øª';
$lang[68] = 'ÙÙÙÙ - Ø¯Ø§ÙÙÙØ¯';
$lang[69] = 'Ø­Ø°Ù - ÙØ§ÙÙ';
$lang[70] = 'ÙØ¶Ø¹ÙØª - ÙÙÙÙ';
$lang[71] = 'ÙØ¯ÙØ±ÙØª - ÙÙÙÙ';
$lang[72] = 'ÙØ§Ù-ID';
$lang[73] = 'FTP Ø§Ù¾ÙÙØ¯';
$lang[74] = 'ÙÙÙÙ Ø¹Ø¨ÙØ±';
$lang[75] = 'Rapidleech PlugMod - Ø§Ù¾ÙÙØ¯ ÙÙÙÙ';
$lang[76] = '<div class="linktitle">Ø§Ù¾ÙÙØ¯ ÙÙÙÙ Ø¨Ø±Ø§Ù <strong>%1$s</strong> - <span class="bluefont">Ø­Ø¬Ù: <strong>%2$s</strong></span></div>'; // %1$s = file name %2$s = file size
$lang[77] = 'Ø§ÙØ¬Ø§Ù Ø´Ø¯';
$lang[78] = 'Ø¨Ø§Ø²Ú¯Ø³Øª';
$lang[79] = 'ÙØªØµÙ Ø´Ø¯Ù Ø¨Ù Ø³Ø±ÙØ± %1$s.'; // %1$s = FTP server name
$lang[80] = 'ÙØ§Ù ÙØ§Ø±Ø¨Ø±Ù ÙÙÙÙÙ Ø¹Ø¨ÙØ± ÙØ§Ø¯Ø±Ø³Øª Ø§Ø³Øª.';
$lang[81] = 'ÙØµÙ Ø´Ø¯ Ø¨Ù: <b>%1$s</b>...'; // %1$s = FTP server name
$lang[82] = 'ÙØ§ÙÙ %1$s is Ø®Ø·Ø§ Ø¯Ø± Ø§ÙØªÙØ§Ù'; // %1$s = File type
$lang[83] = 'ÙØ§ÙÙ <b>%1$s</b>, Ø­Ø¬Ù <b>%2$s</b>...'; // %1$s = file name %2$s = file size
$lang[84] = 'Ø®Ø·Ø§ Ø¯Ø± Ø§ÙØªÙØ§Ù ÙÙÙÙ';
$lang[85] = 'ÙØªÙ ØªØµÙÙØ¨ Ø´Ø¯Ù!';
$lang[86] = 'Ø®Ø·Ø§: ÙØ·ÙØ§ Ø¬Ø§ÙØ§ Ø§Ø³ÙØ±ÙÙ¾Øª Ø±Ø§ ÙØ¹Ø§Ù ÙÙÙØ¯.';
$lang[87] = 'ÙØ·ÙØ§ ØµØ¨Ø± ÙÙÙØ¯ <b>%1$s</b> Ø«Ø§ÙÙÙ...'; // %1$s = number of seconds
$lang[88] = 'ÙØªØµÙ ÙØ´Ø¯Ù %1$s Ø¨Ù Ù¾ÙØ±Øª %2$s'; // %1$s = host name %2$s = port
$lang[89] = 'ÙØªØµÙ Ø´Ø¯ Ø¨Ù Ù¾Ø±ÙÙØ³Ù: <b>%1$s</b> Ù¾ÙØ±Øª <b>%2$s</b>...'; // %1$s = Proxy host %2$s = Proxy port
$lang[90] = 'ÙØªØµÙ Ø´Ø¯: <b>%1$s</b> Ù¾ÙØ±Øª <b>%2$s</b>...'; // %1$s = host %2$s = port
$lang[91] = 'ÙÙÚ Ø³Ø±ÙØµÙÙ ÙØ§ÙØª ÙØ´Ø¯';
$lang[92] = 'Ø¯Ø³ØªØ±Ø³Ù Ø´ÙØ§ Ø¨Ù Ø§ÙÙ ØµÙØ­Ù Ø§ÙÙØ§Ù Ù¾Ø°ÙØ± ÙÙÙ Ø¨Ø§Ø´Ø¯!';
$lang[93] = 'ØµÙØ­Ù ÙØ§ÙØª ÙØ´Ø¯!';
$lang[94] = 'Ø¯Ø³ØªØ±Ø³Ù Ø¨Ù Ø§ÙÙ ØµÙØ­Ù Ø§ÙÙØ§Ù Ù¾Ø°ÙØ± ÙÙØ³Øª ÙØ§ ÙØ§ÙØª ÙØ´Ø¯!';
$lang[95] = 'Ø®Ø·Ø§! Ø§ÙØªÙØ§Ù Ø¨Ù [%1$s]'; // %1$s = redirected address
$lang[96] = 'This site requires authorization. For the indication of username and password of access it is necessary to use similar url:<br />http://<b>login:password@</b>www.site.com/file.exe';
$lang[97] = 'ÙØ­Ø¯ÙØ¯ÙØª Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² resume ';
$lang[98] = 'Ø³Ø±ÙØ± Ù¾Ø´ØªÙØ¨Ø§ÙÙ ÙÙÙÙÙØ¯ Ø§Ø²resume';
$lang[99] = 'Ø¯Ø§ÙÙÙØ¯';
$lang[100] = 'Ø§ÙÙ Ø­Ø³Ø§Ø¨ ÙØ§Ø±Ø¨Ø±Ù Ù Ø§Ù Ù¾Ù Ø¯Ø± Ø­Ø§Ù Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø³Øª.';
$lang[101] = 'ÙØ§ÙÙ %1$s Ø°Ø®ÙØ±Ù ÙØ´Ø¯ Ø¯Ø± %2$s'; // %1$s = file name %2$s = directory name
$lang[102] = 'Ø³Ø·Ø­ Ø¯Ø³ØªØ±Ø³Ù ÙØ§ÙÙ ÙØ§ Ø¨Ù777.';
$lang[103] = 'ØªÙØ§Ø´ Ø¯ÙØ¨Ø§Ø±Ù';
$lang[104] = 'ÙØ§ÙÙ';
$lang[105] = 'Ø§ÙØ¬Ø§Ù Ø°Ø®ÙØ±Ù Ø¯Ø± %1$s'; // %1$s = file name
$lang[106] = 'Ø§Ø¯Ø±Ø³ ÙØ§ÙØ¹ØªØ¨Ø± Ø§Ø³Øª';
$lang[107] = 'Ø´ÙØ§ ÙØ§Ø±Ø¨Ø± Ø±Ø§ÙÚ¯Ø§Ù ÙØ³ØªÙØ¯ Ø­Ø¯Ø§ÙØ«Ø± Ø§Ø³ØªÙØ§Ø¯Ù Ø±Ø§ ÙØ±Ø¯Ù Ø§ÙØ¯.';
$lang[108] = 'Ø²ÙØ§Ù Ø¯Ø§ÙÙÙØ¯ ØªÙØ§Ù Ø´Ø¯';
$lang[109] = 'ÙØ¯ Ø¯Ø³ØªØ±Ø³Ù Ø§Ø´ØªØ¨Ø§Ù Ø§Ø³Øª.';
$lang[110] = 'Ø´ÙØ§ ÚÙØ¯ Ø¨Ø§Ø± Ø¨ÙØ´ØªØ± ÙÙÙØªÙØ§ÙÙØ¯ ÙØ¯ Ø±Ø§ Ø§Ø´ØªØ¨Ø§Ù ÙØ§Ø±Ø¯ ÙÙÙØ¯';
$lang[111] = 'Ø¯Ø§ÙÙÙØ¯ Ø¨ÙØ´ Ø§Ø² Ø­Ø¯ ÙØ¬Ø§Ø²';
$lang[112] = 'Ø®Ø·Ø§ Ø®ÙØ§ÙØ¯Ù Ø§Ø·ÙØ§Ø¹Ø§Øª';
$lang[113] = 'Ø®Ø·Ø§ Ø¯Ø± Ø§Ø±Ø³Ø§Ù Ø§Ø·ÙØ§Ø¹Ø§Øª';
$lang[114] = 'ÙØ¹Ø§Ù';
$lang[115] = 'Ø¯Ø±Ø¯Ø³ØªØ±Ø³ ÙÙØ³Øª';
$lang[116] = 'ØºÙØ± ÙØ¹Ø§Ù';
$lang[117] = 'You need to load/activate the cURL extension (http://www.php.net/cURL) or you can set \'fgc\' => 1 in config.php.';
$lang[118] = 'cURL ÙØ¹Ø§Ù';
$lang[119] = 'PHP version 5 is recommended although it is not obligatory';
$lang[120] = 'Check if your safe mode is turned off as the script cannot work with safe mode on';
$lang[121] = 'Ø§Ø±Ø³Ø§Ù ÙØ§ÙÙ <b>%1$s</b>'; // %1$s = filename
$lang[122] = 'ÙÙØ§Ø² ÙÙØ³Øª, Ø§Ø±Ø³Ø§Ù Ø¨Ù Ø§ÙÙÙÙ';
$lang[123] = 'Ø¬Ø¯Ø§Ø´Ø¯ Ø¨Ù ÙØ³ÙØª ÙØ§Û  %1$s'; // %1$s = part size
$lang[124] = 'Ø±ÙØ´';
$lang[125] = 'Ø§Ø±Ø³Ø§Ù  <b>%1$s</b>'; //%1$s = part number
$lang[126] = 'ÙÙØ§Ø²Ù ÙÙØ³Øª Ø¨Ù Ø§Ø±Ø³Ø§Ù Ø§ÙÙÙÙ';
$lang[127] = 'ÙØ§Ø³Øª Ù ÙØ§ÙÙ ÙØ§ÙØª ÙØ´Ø¯';
$lang[128] = 'Ø¯Ø³ØªØ±Ø³Ù Ø¨Ù Ø³Ø§Ø®ØªÙ ÙØ§Ø³Øª';
$lang[129] = 'Ø³Ø§Ø¹Øª'; // Plural
$lang[130] = 'Ø³Ø§Ø¹Øª';
$lang[131] = 'Ø¯ÙÙÙÙ'; // Plural
$lang[132] = 'Ø¯ÙÙÙÙ';
$lang[133] = 'Ø«Ø§ÙÙÙ'; // Plural
$lang[134] = 'Ø«Ø§ÙÙÙ';
$lang[135] = 'getCpuUsage(): couldn\'t access STAT path or STAT file invalid';
$lang[136] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² cpu';
$lang[137] = 'Ø®Ø·Ø§ Ø±Ø® Ø¯Ø§Ø¯Ù Ø§Ø³Øª';
$lang[138] = 'Ø­Ø¯Ø§ÙÙ ÙÙ ÙØ§ÙÙ.';
$lang[139] = 'Ø§ÛÙÛÙ ÙØ§';
$lang[140] = 'Ø§Ø±Ø³Ø§Ù';
$lang[141] = 'Ø­Ø°Ù Ø¨Ø¹Ø¯ Ø§Ø² ØªØ§Ø¦ÙØ¯';
$lang[142] = 'Ø§Ø³Ù¾ÙÛØª ØªÙØ³Ø· ÙØ·Ø¹Ø§Øª';
$lang[143] = 'ÙØ·Ø¹Ø§Øª Ø­Ø¬Ù';
$lang[144] = '<b>%1$s</b> - Ø§ÙÙÙÙ ÙØ§ÙØ¹ØªØ¨Ø±.'; // %1$s = email address
$lang[145] = 'ÙØ§ÙÙ <b>%1$s</b> ÙØ§ÙØª ÙØ´Ø¯!'; // %1$s = filename
$lang[146] = 'Ø¨Ù Ø±ÙØ² Ø±Ø³Ø§ÙÙ ÙØ§ÙÙ ÙØ§!';
$lang[147] = 'Ø­Ø°Ù ÙØ§ÙÙ ØºÙØ± ÙØ¹Ø§Ù';
$lang[148] = 'Ø­Ø°Ù ÙØ§ÙÙ';
$lang[149] = 'Ø¨ÙÙ';
$lang[150] = 'Ø®ÙØ±';
$lang[151] = 'ÙØ§ÙÙ <b>%1$s</b> Ø­Ø°Ù Ø´Ø¯'; // %1$s = filename
$lang[152] = 'Ø®Ø·Ø§ Ø¯Ø± Ø­Ø°Ù ÙØ§ÙÙ <b>%1$s</b>!'; // %1$s = filename
$lang[153] = 'ÙØ§Ø³Øª';
$lang[154] = 'Ù¾ÙØ±Øª';
$lang[155] = 'ÙÙØ±Ø³Øª';
$lang[156] = 'Ø­Ø°Ù ÙØ§ÙÙ ÙÙØ¨Ø¹ Ø¨Ø¹Ø¯ Ø§Ø² Ø§ÙØªÙØ§Ù ÙÙÙÙÙØª Ø§ÙÙØ²';
$lang[157] = 'Save FTP data';
$lang[158] = 'Delete FTP data';
$lang[159] = 'Ø®Ø·Ø§ Ø¯Ø± Ù¾ÙØ´Ù <b>%1$s</b>'; // %1$s = directory name
$lang[160] = 'ÙØ§ÙÙ %1$s Ø¨Ø§ ÙÙÙÙÙØª Ø¨Ù Ø±ÙØ² Ø±Ø³Ø§ÙÙ Ø´Ø¯!'; // %1$s = filename
$lang[161] = 'Ø²ÙØ§Ù';
$lang[162] = 'ÙÙØ§ÙÚ¯ÙÙ Ø³Ø±Ø¹Øª';
$lang[163] = 'ØªÙØ§ÙØ§Ù Ø§Ù¾ÙÙØ¯ ÙØ§ÙÙ Ø±Ø§ ÙØ¯Ø§Ø±Ø¯ <b>%1$s</b>!'; // %1$s = filename
$lang[164] = 'Ø§ÙÙÙÙ';
$lang[165] = 'Ø­Ø°Ù ÙÙÙÙÙØª Ø§ÙÙØ²';
$lang[166] = 'Ø§ÙÙÙÙ ÙØ§ÙØ¹ØªØ¨Ø±';
$lang[167] = 'ÙØ·ÙØ§ ÙÙØ· Ø§ÙØªØ®Ø§Ø¨ ÙÙÙØ¯ .crc or .001 file!';
$lang[168] = 'ÙØ·ÙØ§ Ø§ÙØªØ®Ø§Ø¨ ÙÙÙØ¯ .crc file!';
$lang[169] = 'ÙØ·ÙØ§ Ø§ÙØªØ®Ø§Ø¨ ÙÙÙØ¯ .crc or .001 file!';
$lang[170] = 'Ø¨Ø±Ø±Ø³Ù CRC ? (ØªÙØµÙÙ Ø´Ø¯Ù)';
$lang[171] = 'CRC32 ØªØºÙÙØ± ÙÙØ¯';
$lang[172] = 'Ø§Ø³ØªÙØ§Ø¯Ù hash_file (ØªÙØµÙÙ Ø´Ø¯Ù)';
$lang[173] = 'Ø®ÙØ§ÙØ¯ ÙØ§ÙÙ Ø§Ø² Ø­Ø§ÙØ¸Ù';
$lang[174] = 'Ø¬Ø¹ÙÙ';
$lang[175] = 'Ø­Ø°Ù ÙØ§ÙÙ Ø¨Ø¹Ø¯ Ø§Ø² Ø§Ø¯ØºØ§Ù';
$lang[176] = 'ÙÙØªÙ';
$lang[177] = 'Ø­Ø¬Ù ÙØ§ÙÙ crc32 Ø¨Ø±Ø±Ø³Ù Ø´ÙØ¯';
$lang[178] = 'Ø®Ø·Ø§ Ø¯Ø± Ø®ÙØ§ÙØ¯Ù .crc file!';
$lang[179] = 'Ø®Ø·Ø§, ÙØ§ÙÙ Ø¨Ø§ ÙÙÙÙÙØª Ø®Ø§Ø±Ø¬ Ø´Ø¯ <b>%1$s</b>'; // %1$s = filename
$lang[180] = 'Ø®Ø·Ø§, ÙØ§ÙÙ ÙØ§ÙØµ Ø§Ø³Øª';
$lang[181] = 'Ø®Ø·Ø§, ÙÙØ¹ ÙØ§ÙÙ %1$s Ù¾Ø´ØªÙØ¨Ø§ÙÙ ÙÙÙØ´ÙØ¯'; // Filetype
$lang[182] = 'Ø¨Ø§Ø² ÙØ±Ø¯Ù ÙØ§ÙÙ Ø§ÙÙØ§Ù Ù¾Ø°ÙØ± ÙÙÙØ¨Ø§Ø´Ø¯ <b>%1$s</b>'; // %1$s = filename
$lang[183] = 'Ø®Ø·Ø§ Ø¯Ø± ÙÙØ´ØªÙ ÙØ§ÙÙ <b>%1$s</b>!'; // %1$s = filename
$lang[184] = 'CRC32 checksum doesn\'t match!';
$lang[185] = 'ÙØ§ÙÙ <b>%1$s</b> Ø¨Ø§ ÙÙÙÙÙØª Ø§Ø¯ØºØ§Ù Ø´Ø¯'; // %1$s = filename
$lang[186] = 'Ø­Ø°Ù Ø´Ø¯';
$lang[187] = 'Ø­Ø°Ù ÙØ´Ø¯';
$lang[188] = 'Ø§Ø¶Ø§ÙÙ ÙØ±Ø¯Ù ÙØ±ÙØª';
$lang[189] = 'Ø¨Ø¯ÙÙ';
$lang[190] = 'Ø¨Ù';
$lang[191] = 'ØªØºÙÙØ± ÙØ§Ù?';
$lang[192] = 'Ø§ÙØµØ±Ø§Ù';
$lang[193] = 'Ø®Ø·Ø§ Ø¯Ø± ØªØºÙÙØ± ÙØ§Ù ÙØ§ÙÙ <b>%1$s</b>'; // %1$s = filename
$lang[194] = 'ÙØ§ÙÙ <b>%1$s</b>ØªØºÙÙØ± ÙØ§Ù Ù¾ÙØ¯Ø§ ÙØ±Ø¯ Ø¨Ù <b>%2$s</b>'; // %1$s = original filename %2$s = renamed filename
$lang[195] = 'ÙØ§Ù Ø§Ø±Ø´ÙÙ';
$lang[196] = 'ÙØ·ÙØ§ ÙØ§Ù Ø§Ø±Ø´ÙÙ Ø±Ø§ ÙØ§Ø±Ø¯ ÙÙÙØ¯!';
$lang[197] = 'Ø®Ø·Ø§ Ø¯Ø± Ø§Ø±Ø´ÙÙ ÙØ§ÙÙ ÙØ§.';
$lang[198] = 'ÙØ§ÙÙ %1$s Ø¨Ø³ØªÙ Ø¨ÙØ¯Ù Ø´Ø¯'; // %1$s = filename
$lang[199] = 'Ø¯Ø± Ø§Ø±Ø´ÙÙ <b>%1$s</b>'; // %1$s = filename
$lang[200] = 'Ø®Ø·Ø§, Ø§Ø±Ø´ÙÙ Ø®Ø§ÙÙ Ø§Ø³Øª.';
$lang[201] = 'ÙØ§Ù Ø¬Ø¯ÙØ¯';
$lang[202] = 'Ø®Ø·Ø§ Ø¯Ø± ØªØºÙÙØ± ÙØ§Ù <b>%1$s</b>!'; // %1$s = filename
$lang[203] = 'Ø­Ø°Ù ÙØ§ÙÙ ÙÙØ¨Ø¹';
$lang[204] = 'ÙØ§ÙÙ ÙØ§ ÙÙ¾ÙØ´Ù ÙØ§';
$lang[205] = 'Unzip';
$lang[206] = 'YouTube ÙØ±ÙØª ÙÙØ¯Ø¦Ù ';
$lang[207] = 'Ø§ÙØªÙØ§Ù ÙÙÙÙ ÙØ§';
$lang[208] = 'ÙØ¹Ø±Ù';
$lang[209] = 'Ø§ÙØªÙØ§Ù ÙØ§ÙÙ';
$lang[210] = 'ÙØ§Ù &amp; ÙÙÙÙ Ø¹Ø¨ÙØ± (HTTP/FTP)';
$lang[211] = 'ÙØ§Ù';
$lang[212] = 'ÙÙÙÙ Ø¹Ø¨ÙØ±';
$lang[213] = 'Ø§Ø¶Ø§ÙÙ ÙØ±Ø¯Ù ÙØ¸Ø±';
$lang[214] = 'ØªÙØ¸ÙÙØ§Øª Ù¾ÙØ§Ú¯ÙÙ';
$lang[215] = 'ØºÙØ± ÙØ¹Ø§Ù ÙØ±Ø¯Ù ØªÙØ§ÙÙ Ù¾ÙØ§Ú¯ÙÙ ÙØ§';
$lang[216] = 'YouTube ÙØ±ÙØª ÙÙØ¯Ø¦Ù';
$lang[217] = 'ÙÙÙÙ ÙØ³ØªÙÙÙ';
$lang[218] = '&amp;fmt=';
$lang[219] = 'Ø¯Ø±ÙØ§ÙØª Ø¨Ø§ Ø¨Ø§ÙØ§ØªØ±ÙÙ ÙÙÙÙØª';
$lang[220] = '17 [Video: 3GP 176x144 | Audio: AAC 2ch 44.10kHz]';
$lang[221] = '5 [Video: FLV 400x240 | Audio: MP3 1ch 22.05kHz]';
$lang[222] = '34 [Video: FLV 640x360 | Audio: AAC 2ch 44.10kHz]';
$lang[223] = '35 [Video: FLV 854x480 | Audio: AAC 2ch 44.10kHz]';
$lang[224] = '43 [Video: WebM 640x360 | Audio: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [Video: WebM 1280x720 | Audio: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [Video: MP4 480x360 | Audio: AAC 2ch 44.10kHz]';
$lang[227] = '22 [Video: MP4 1280x720 | Audio: AAC 2ch 44.10kHz]';
$lang[228] = '37 [Video: MP4 1920x1080 | Audio: AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; TorrentService';
$lang[230] = 'ÙØ§Ù ÙØ§Ø±Ø¨Ø±Ù';
$lang[231] = 'ÙÙÙÙ Ø¹Ø¨ÙØ±';
$lang[232] = 'Megaupload.com ÙÙÙÙ';
$lang[233] = 'ÙØ§Ù';
$lang[234] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² Ù¾ÙØ§Ú¯ÙÙ vBulletin ';
$lang[235] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² ÙÙÙÙ';
$lang[236] = 'Key=Value';
$lang[237] = 'Ø§Ø±Ø³Ø§Ù ÙØ§ÙÙ Ø¨Ù Ø§ÙÙÙÙ';
$lang[238] = 'Ø§ÙÙÙÙ';
$lang[239] = 'Ø¬Ø¯Ø§Ú©Ø±Ø¯Ù ÙØ§ÙÙ';
$lang[240] = 'Ø±ÙØ´';
$lang[241] = 'ÙÙÙ ÙØ¸Ø±Ø§Øª';
$lang[242] = 'RFC 2046';
$lang[243] = 'Ø­Ø¬Ù ÙØ·Ø¹Ø§Øª';
$lang[244] = 'MB';
$lang[245] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² ØªÙØ¸ÙÙØ§Øª Ù¾Ø±ÙÙØ³Ù';
$lang[246] = 'Ù¾Ø±ÙÙØ³Ù';
$lang[247] = 'ÙØ§Ù ÙØ§Ø±Ø¨Ø±Ù';
$lang[248] = 'ÙÙÙÙ Ø¹Ø¨ÙØ±';
$lang[249] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² Ø§ÙØ§ÙØª';
$lang[250] = 'ÙØ§Ù ÙØ§Ø±Ø¨Ø±Ù';
$lang[251] = 'ÙÙÙÙ Ø¹Ø¨ÙØ±';
$lang[252] = 'Ø°Ø®ÙØ±Ù Ø¯Ø±';
$lang[253] = 'ÙØ³ÙØ±';
$lang[254] = 'Ø°Ø®ÙØ±Ù ØªÙØ¸ÙÙØ§Øª';
$lang[255] = 'Ù¾Ø§Ù ÙØ±Ø¯Ù ØªÙØ¸ÙÙØ§Øª';
$lang[256] = 'Ø§ÙØªØ®Ø§Ø¨ ÙÙÙ';
$lang[257] = 'Ø¹Ø¯Ù Ø§ÙØªØ®Ø§Ø¨';
$lang[258] = 'ØªØºÙÙØ±';
$lang[259] = 'ÙÙØ§ÙØ´';
$lang[260] = 'Ø¯Ø§ÙÙÙØ¯ Ø´Ø¯Ù';
$lang[261] = 'Ø¯Ø±ÙØ§ÙØª Ø´Ø¯Ù';
$lang[262] = 'ÙØ§Ù';
$lang[263] = 'Ø­Ø¬Ù';
$lang[264] = 'ÙØ¸Ø±';
$lang[265] = 'ØªØ§Ø±ÙØ®';
$lang[266] = 'ÙØ§ÙÙÙ ÙØ§ÙØª ÙØ´Ø¯';
$lang[267] = 'Ø§ÛÙ ÙØ³Ø®Ù ÙØ§ Ú©Ø§Ø± ÙÛÚ©ÙØ¯';
$lang[268] = 'ÙØ±Ø¯Ù';
$lang[269] = 'Debug Ø­Ø§ÙØª';
$lang[270] = 'ÙÙØ§ÙØ´ ÙÙÙÙ ÙØ§';
$lang[271] = 'Ø¹Ø¯Ù ÙÙØ§ÙØ´ ÙÙÙÙ';
$lang[272] = 'ÚÙ ÙØ±Ø¯Ù ÙÙÙÙ ÙØ§';
$lang[273] = 'ÙØ·ÙØ§ ØµØ¨Ø± ÙÙÙØ¯...';
$lang[274] = 'Ø¯Ø±Ø­Ø§Ù Ù¾Ø±Ø¯Ø§Ø²Ø´, ÙØ·ÙØ§ ØµØ¨Ø± ÙÙÙØ¯...';
$lang[275] = 'ÙØ¶Ø§Ù Ø³Ø±ÙØ±';
$lang[276] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø´Ø¯Ù';
$lang[277] = 'ÙØ¶Ø§Ù Ø§Ø²Ø§Ø¯';
$lang[278] = 'ÙØ¶Ø§Ù Ø¯ÙØ³Ù';
$lang[279] = 'CPU';
$lang[280] = 'Ø²ÙØ§Ù Ø³Ø±ÙØ±';
$lang[281] = 'Ø³Ø§Ø¹Øª ÙØ­ÙÙ';
$lang[282] = 'Ø­Ø°Ù Ø®ÙØ¯ÙØ§Ø±';
$lang[283] = 'Ø³Ø§Ø¹Øª Ø¨Ø¹Ø¯ Ø§Ø² Ø§ÙØªÙØ§Ù ÙØ§ÙÙ';
$lang[284] = 'Ø¯ÙÙÙ Ø¨Ø¹Ø¯ Ø§Ø² Ø§ÙØªÙØ§Ù ÙØ§ÙÙ';
$lang[285] = 'Ø§ÙØªØ®Ø§Ø¨ ÙÙÙØ¯';
$lang[286] = 'Ø§Ù¾ÙÙØ¯';
$lang[287] = 'FTP ÙØ§ÙÙ';
$lang[288] = 'Ø§ÙÙÙÙ';
$lang[289] = 'Ø§ÙÙÙÙ Ø§ÙØ¨ÙÙ';
$lang[290] = 'Ø¬Ø¯Ø§Ú©Ø±Ø¯Ù ÙØ§ÙÙ';
$lang[291] = 'Ø§Ø¯ØºØ§Ù ÙØ§ÙÙ';
$lang[292] = 'MD5 Hash';
$lang[293] = 'Ø¨Ø³ØªÙ ÙØ§ÙÙ';
$lang[294] = 'ZIP ÙØ§ÙÙ';
$lang[295] = 'Unzip ÙØ§ÙÙ';
$lang[296] = 'ØªØºÙÙØ± ÙØ§Ù';
$lang[297] = 'ØªØºÙÙØ± ÙØ§Ù';
$lang[298] = 'Ø­Ø°Ù';
$lang[299] = 'ÙÙØ³Øª ÙÙÙÙ ÙØ§';
$lang[300] = 'Ø¯Ø± Ø­Ø§Ù Ø¯Ø±ÙØ§ÙØª ØµÙØ­Ù Ø¯Ø§ÙÙÙØ¯';
$lang[301] = 'ÙØ§Ø±Ø¯ ÙÙÙØ¯';
$lang[302] = 'Ø¯Ø± Ø§ÙÙØ¬Ø§';
$lang[303] = 'Ø¯Ø§ÙÙÙØ¯ ÙØ§ÙÙ';
$lang[304] = 'configs/files.lst ÙØ·ÙØ§ Ø³Ø·Ø­ Ø¯Ø³ØªØ±Ø³Ù ÙØ§ÙÙ Ø±Ø§ ØªØºÙÙØ± Ø¯ÙÙØ¯ 777';
$lang[305] = '&nbsp;is ÙØ³ÙØ±Ù ÙÙ ÙØ§ÙÙ Ø¯Ø± Ø§Ù Ø°Ø®ÙØ±Ù ÙÙØ´ÙØ¯ Ø±Ø§ Ø³Ø·Ø­ Ø¯Ø³ØªØ±Ø³Ù Ø§Ù Ø±Ø§ ØªØºÙÙØ± Ø¯ÙÙØ¯ to 777';
$lang[306] = 'Ø§Ø¯ØºØ§Ù ÙØ§ÙÙ';
$lang[307] = 'ÙØ·ÙØ§ ØµØ¨Ø± ÙÙÙØ¯';
$lang[308] = 'Ø³Ù¾Ø±Û Ø´Ø¯Ù';
$lang[309] = 'ÙØ§ÙÙÙÙ';
$lang[310] = 'Ø´ÙØ§ ÙÙÚ©Ù Ø§Ø³Øª ÙØ´Ø¯Ø§Ø±ÙØ§Û Ø¨Ø¯ÙÙ Ø§ÛÙ Ø±Ø§ Ø¨Ø¨ÛÙÛØ¯ ØªØ¨Ø¯ÛÙ Ø´Ø¯Ù Ø¯Ø±';
$lang[311] = 'Ø´ÙØ§ ÙÙÚ©Ù Ø§Ø³Øª ÙØ§Ø¯Ø± Ø¨Ù ÙØ¹Ø§Ù Ú©Ø±Ø¯Ù Ø§Ø·ÙØ§Ø¹Ø§Øª Ø³Ø±ÙØ± ÙØ¨Ø§Ø´ÛØ¯';
$lang[312] = 'Ø³Ø±ÙØ± Ø´ÙØ§ ÙÙÚ©Ù Ø§Ø³Øª ÙØ§Ø¯Ø± Ø¨Ù Ù¾Ø´ØªÛØ¨Ø§ÙÛ Ø§Ø² ÙØ§ÛÙ ÙØ§Û Ø¨ÛØ´ Ø§Ø² 2 Ú¯ÛÚ¯Ø§Ø¨Ø§ÛØª ÙØ¨Ø§Ø´Ø¯ .';
$lang[313] = 'Ø§Ø³Ú©Ø±ÛÙ¾Øª Ø¨Ø±Ø³Û Ø±Ù¾ÛØ¯ÙÚ';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'ÙØ³Ø®Ù php - ';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'Ø¹ÙÙØ§Øª ÙØ¶Ø§Û Ø¯ÛØ³Ú© Ø³Ø®Øª ';
$lang[323] = 'ÙØ³Ø®Ù Apache - ';
$lang[324] = 'Ø¢Ø¯Ø±Ø³ Ù¾Ø±ÙÚ©Ø³Û Ø§Ø´ØªØ¨Ø§Ù Ø§Ø³Øª';
$lang[325] = 'ÙØ§ÛÙ Ø¨Ø§ ÙÙÙÙÛØª Ø°Ø®ÛØ±Ù Ø´Ø¯!';
$lang[326] = 'Ø°Ø®ÛØ±Ù ÛØ§Ø¯Ø§Ø´Øª';
$lang[327] = 'ÛØ§Ø¯Ø§Ø´Øª ÙØ§';
$lang[328] = 'Ø¹ÙÙÛØ§Øª ØºÛØ±ÙØ¹Ø§Ù Ø´Ø¯Ù';
$lang[329] = 'ØµÙØ­Ù Ø§ØµÙÛ';
$lang[330] = 'ØªÙØ¸ÛÙØ§Øª';
$lang[331] = 'ÙØ§ÛÙ ÙØ§';
$lang[332] = 'Ø¨Ø±Ø±Ø³Û ÙÛÙÚ©';
$lang[333] = 'Ù¾ÙØ§Ú¯ÛÙ ÙØ§';
$lang[334] = 'Ø§ÙØªÙØ§Ù Ø®ÙØ¯Ú©Ø§Ø±';
$lang[335] = 'Ø¢Ù¾ÙÙØ¯ Ø®ÙØ¯Ú©Ø§Ø±';
$lang[336] = 'Ø³Ø§ÛØ² ÙØ§ÛÙ ÙØ­Ø¯ÙØ¯ Ø§Ø³Øª Ø Ø¯Ø± ';
$lang[337] = 'ÙØ­Ø¯ÙØ¯Ù Ø­Ø¬Ù ÙØ§ÛÙ : ';
$lang[338] = 'Rar ÙØ§ÛÙÙØ§';
$lang[339] = 'Unrar ÙØ§ÛÙÙØ§';
$lang[340] = 'Ø®Ø·Ø§ Ø´ÙØ§Ø³Ø§ÛÛ Ø´Ø¯';
$lang[341] = 'Ø§ÛÙØ¬Ø§ Ø±Ø§ Ú©ÙÛÚ© Ú©ÙÛØ¯ Ø¨Ø±Ø§Û Ú¯Ø³ØªØ±Ø´';
$lang[342] = 'Ø´ÙØ§ ÙÛ ØªÙØ§ÙÛØ¯ Ù¾ÙØ¬Ø±Ù Ø±Ø§ Ø§Ø² Ø§ÛÙØ¬Ø§ Ø¨Ú©Ø´ÛØ¯';
$lang[343] = 'Can not find "rar"<br />You may need to download it and extract "rar" to "/rar/" directory';
$lang[344] = 'ÙØ§ÛÙ ÙØ§Û Ú©Ø¯ Ø¯Ø± ÙØ§ÛÙ ÙØ´Ø±Ø¯Ù ÙØ±Ø§Ø± ÙÛÚ¯ÛØ±ÙØ¯ :';
$lang[345] = 'ÙØ§Ù ÙØ§ÛÙ ÙØ´Ø±Ø¯Ù';
$lang[346] = 'ØªÙØ¸ÛÙØ§Øª:';
$lang[347] = 'Ø³Ø·Ø­ ÙØ´Ø±Ø¯Ù Ø³Ø§Ø²Û :';
$lang[348] = 'Ø°Ø®ÙØ±Ù Ú©Ø±Ø¯Ù';
$lang[349] = 'Ø­ÛÙÛ Ø³Ø±ÛØ¹';
$lang[350] = 'Ø³Ø±ÛØ¹';
$lang[351] = 'ÙØ¹ÙÙÙÛ';
$lang[352] = 'Ø®ÙØ¨';
$lang[353] = 'Ø¹Ø§ÙÛ';
$lang[354] = 'Ø§ÛØ¬Ø§Ø¯ Ø¬ÙØ¯';
$lang[355] = 'Ø­Ø°Ù ÙØ§ÛÙ ÙØ§ Ø¨Ø¹Ø¯ Ø§Ø² Ø³Ø§Ø®Øª ÙØ§ÛÙ ÙØ´Ø±Ø¯Ù';
$lang[356] = 'Ø§ÛØ¬Ø§Ø¯ ÙØ§ÛÙ Ø¬Ø§ÙØ¯';
$lang[357] = 'Ø§ÛØ¬Ø§Ø¯ Ø±Ú©ÙØ±Ø¯ Ø¨Ø§Ø²ÛØ§Ø¨Û';
$lang[358] = 'ØªØ³Øª Ø¨Ø¹Ø¯ Ø§Ø² ÙØ´Ø±Ø¯Ù Ø³Ø§Ø²Û';
$lang[359] = 'Ø§Ø³ØªÙØ§Ø¯Ù Ø§Ø² Ú©ÙÙÙ Ø¹Ø¨ÙØ±';
$lang[360] = 'Ø±ÙØ²Ú¯Ø°Ø§Ø±Û ÙØ§Ù ÙØ§ÛÙ';
$lang[361] = 'ÙØ³ÛØ± ØªÙØ¸ÛÙ Ø¯Ø± Ø¯Ø§Ø®Ù ÙØ§ÛÙ';
$lang[362] = 'Rar';
$lang[363] = 'Ø³Ø§Ø®Øª ÙØ§ÛÙ ÙØ´Ø±Ø¯Ù: <b>%1$s</b>';
$lang[364] = 'ØµØ¨Ø± Ú©ÙÛØ¯ ...';
$lang[365] = 'Ø¨Ø±Ú¯Ø´Øª Ø¨Ù ÙÛØ³Øª ÙØ§ÛÙÙØ§';
$lang[366] = '<b>ÙØ§ÛÙ ÙØ§ Ø§Ø² %1$s</b>:';
$lang[367] = 'unrar Ù¾ÛØ¯Ø§ ÙØ´Ø¯ ';
$lang[368] = 'Ú©ÙÙÙ Ø¹Ø¨ÙØ± Ø¨Ø±Ø§Û ÙÛØ³Øª ÙØ§ÛÙ ÙØ§ :';
$lang[369] = 'Ú©ÙÙÙ Ø¹Ø¨ÙØ± Ø¨Ø±Ø§Û Ø§Ø³ØªØ®Ø±Ø§Ø¬ ÙØ§ÛÙ ÙØ§ :';
$lang[370] = 'Ø®Ø·Ø§:%1$s';
$lang[371] = 'Ø³Ø¹Û Ø¯ÙØ¨Ø§Ø±Ù Ø¨Ø±Ø§Û ÙÛØ³Øª Ú©Ø±Ø¯Ù ÙØ§ÛÙÙØ§';
$lang[372] = 'Unrar Ø§ÙØªØ®Ø§Ø¨ Ø´Ø¯Ù .';
$lang[373] = '<b>Ø§Ø³Ø®Ø±Ø§Ø¬ ÙØ§ÛÙ ÙØ§ Ø§Ø² %1$s</b>:';
$lang[374] = 'ÙØ¶Ø¹ÛØª:';
$lang[375] = 'Ø§ÙØªØ®Ø§Ø¨ ÙØªÙ :';
$lang[376] = 'Ø­Ø³Ø§Ø¨ ÙØ§Û Premium :';
$lang[377] = '38 [Video: MP4 4096x3072 | Audio: AAC 2ch 44.10kHz]';
$lang[378] = 'Ø¨Ø³ØªÙ Ù¾ÙØ¬Ø±Ù';
$lang[379] = 'ÙØ§ÛÙ ÙØ§';
$lang[380] = 'ØªØºÛÛØ± MD5 ÙÙØ· Ø¨Ø± Ø±ÙÛ Ù¾Ø³ÙÙØ¯ÙØ§Û Ø´ÙØ§Ø®ØªÙ Ø´Ø¯Ù Ø§ÙØ¬Ø§Ù Ù¾Ø°ÛØ± Ø§Ø³Øª (i.e. .rar or .zip)<br /> Ø¢ÛØ§ ÙÛØ®ÙØ§ÙÛØ¯ Ø§Ø¯Ø§ÙÙ Ø¨Ø¯ÙÛØ¯ Ø';
$lang[381] = 'MD5 of file <b>%1$s</b> ØªØºÛÛØ± ÛØ§ÙØª'; // %1$s = filename
$lang[382] = 'Ø®Ø·Ø§ Ø¯Ø± ØªØºÛÛØ± MD5 ÙØ§ÛÙ <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'ØªØºÛÛØ± MD5';
$lang[384] = 'ØªØ·Ø§Ø¨Ù ÙØªÙ';
$lang[385] = 'ØªØ·Ø§Ø¨Ù';
$lang[386] = 'ÙÙØ§Ø±Ø¯ ÚØ´ÙÙ¾ÙØ´Û';
$lang[387] = 'ÙØ±Ø§Ø± ÙØ± ÙØ§ÛÙ Ø±Ø§ Ø¯Ø± ÛÚ© Ø¢Ø±Ø´ÛÙ Ø¬Ø¯Ø§';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// Le fichier de langue anglaise
// Vous devriez toujours utiliser ce fichier comme mod&egrave;le pour la traduction

$lang[1] = 'Acc&egrave;s refus&eacute;';
$lang[2] = 'Le serveur a refus&eacute; de r&eacute;pondre &agrave; votre demande';
$lang[3] = 'Vous n\'avez pas entr&eacute; une adresse e-mail valide';
$lang[4] = 'La taille des pi&egrave;ces n\'est num&eacute;rique';
$lang[5] = 'Type d\'URL inconnu, <span class=&quot;font-black&quot;> Utilser ubiquement les protocoles <span class=&quot;font-blue&quot;> http </ span> ou <span class=&quot;font-blue&quot;> https </ span> ou <span class=&quot;font-blue&quot;> FTP </ span>';
$lang[6] = 'Le chemin pour enregistrer ce fichier n\'est pas d&eacute;fini';
$lang[7] = 'Vous n\'&ecirc;tes pas autoris&eacute; &agrave; t&eacute;l&eacute;charger &agrave; partir de <span class=&quot;font-black&quot;>%1$s (%2$s)</span>'; // %1$s = nom d'h&ocirc;te %2$s = ip de l'h&ocirc;te
$lang[8] = 'Redirection vers:';
$lang[9] = 'Actualisation de la liste des fichiers impossible';
$lang[10] = 'Fichier <b>%1$s</b> (<b>%2$s</b>) sauvegard&eacute;!<br />Dur&eacute;e: <b>%3$s<br />Vitesse moyenne : <b>%4$s KB/s</b><br />'; // %1$s = nom du fichier %2$s = filesize %3$s = time of download %4$s = speed
$lang[11] = '<script>mail(&quot;Le fichier a &eacute;t&eacute; envoy&eacute; &agrave; cette adresse<b>%1$s</b>.&quot;, &quot;%2$s&quot;);</ script>'; // %1$s = E-mail address %2$s = nom du fichier
$lang[12] = 'Erreur lors de l\'envoi du fichier!';
$lang[13] = 'Revenir au menu principal';
$lang[14] = 'Connexion perdue, fichier supprim&eacute;.';
$lang[15] = 'Recharger';
$lang[16] = 'S\'il vous pla&icirc;t, changer le mode de d&eacute;bogage &agrave; <b>1</b>';
$lang[17] = 'Le nombre maximum (%1$s) de liens a &eacute;t&eacute; atteint.'; // %1$s = Nombre de liens maximum
$lang[18] = '%1$s lien%2$s v&eacute;rifi&eacute;%2$s en %3$s seconde%2$s. (M&eacute;thode: <b>%4$s</b>)'; //%1$s = Nombre de liens%, %2$s = forme plurielle, 3$s = secondes, %4$s = m&eacute;thode pour v&eacute;rifier les liens
$lang[19] = 's'; // caract&egrave;re de fin d'un pluriel
$lang[20] = 'Mauvaise adresse du serveur proxy';
$lang[21] = 'Lien';
$lang[22] = 'Statut';
$lang[23] = 'attente';
$lang[24] = 'URL Invalide';
$lang[25] = 'Pr&eacute;paration';
$lang[26] = 'Commenc&eacute;';
$lang[27] = 'Connexion perdue';
$lang[28] = 'Termin&eacute;';
$lang[29] = 'D&eacute;marrer le transfert automatique';
$lang[30] = 'Frames pas pris en charge, mettre &agrave; jour votre navigateur';
$lang[31] = 'Ajouter des liens';
$lang[32] = 'Liens';
$lang[33] = 'Options';
$lang[34] = 'Transf&eacute;rer des fichiers';
$lang[35] = 'Utiliser les param&egrave;tres du Proxy';
$lang[36] = 'Proxy';
$lang[37] = 'Utilisateur';
$lang[38] = 'Mot de passe';
$lang[39] = 'Utiliser le compte ImagesHack';
$lang[40] = 'Enregistrer dans';
$lang[41] = 'Chemin';
$lang[42] = 'Utiliser le compte Premium';
$lang[43] = 'Ex&eacute;cuter c&ocirc;t&eacute; serveur';
$lang[44] = 'D&eacute;lai';
$lang[45] = 'D&eacute;lai (en secondes)';
$lang[46] = 'Pas de fichiers ou d\'h&ocirc;tes s&eacute;lectionn&eacute;s pour l\'envoi';
$lang[47] = 'S&eacute;lectionnez les h&ocirc;tes pour l\'envoi';
$lang[48] = 'Aucun service de t&eacute;l&eacute;chargement pris en charge!';
$lang[49] = 'Fen&ecirc;tre d\'envoi';
$lang[50] = 'Format du lien de sauvegarde';
$lang[51] = 'Default';
$lang[52] = 'Tout s&eacute;lectionner';
$lang[53] = 'Tout d&eacute;s&eacute;lectionner';
$lang[54] = 'Inverser la s&eacute;lection';
$lang[55] = 'Nom';
$lang[56] = 'Taille';
$lang[57] = 'Aucun fichier trouv&eacute;';
$lang[58] = 'L&eacute;gende pour le format du lien de sauvegarde : (sensible &agrave; la casse)';
$lang[59] = 'Le lien pour le t&eacute;l&eacute;chargement';
$lang[60] = 'Le nom du fichier';
$lang[61] = 'Style par d&eacute;faut du lien';
$lang[62] = 'Toutes choses autres que celles indiqu&eacute;es ci-dessus seront trait&eacute;es comme des cha&icirc;nes, actuellement le format multi-ligne est impossible, une nouvelle ligne sera ins&eacute;r&eacute;e pour chaque lien.';
$lang[63] = 'Envoi du fichier %1$s &agrave; %2$s'; // %1$s = nom du fichier, %2$s = nom du fichier h&ocirc;te
$lang[64] = 'Le fichier %1$s n\'existe pas.'; // %1$s = nom du fichier
$lang[65] = 'Le fichier %1$s n\'est pas lisible par le script.'; // %1$s = nom du fichier
$lang[66] = 'Taille du fichier trop grande pour envoyer &agrave; l\'h&ocirc;te.';
$lang[67] = 'Service de t&eacute;l&eacute;chargement non autoris&eacute;';
$lang[68] = 'Lien de t&eacute;l&eacute;chargement';
$lang[69] = 'Supprimer le lien';
$lang[70] = 'Stat-Link';
$lang[71] = 'Admin-Link';
$lang[72] = 'User-ID';
$lang[73] = 'upload FTP';
$lang[74] = 'Mot de passe';
$lang[75] = 'rapidleech PlugMod - Envoyez les liens';
$lang[76] = '<div class=&quot;linktitle&quot;>Liens de t&eacute;l&eacute;chargement pour <strong>%1$s</strong> - <span class=&quot;bluefont&quot;>Taille : <strong>%2$s</strong></span></div>'; // %1$s = nom de fichier, %2$s = taille de fichier
$lang[77] = 'Termin&eacute;';
$lang[78] = 'Retour';
$lang[79] = 'La connexion avec le serveur %1$s n\'a pu &ecirc;tre &eacute;tablie.'; // %1$s = nom du serveur FTP
$lang[80] = 'Nom d\'utilisateur et/ou mot de passe incorrect.';
$lang[81] = 'Connect&eacute; &agrave;: <b>%1$s</ b >...'; // %1$s = nom du serveur FTP
$lang[82] = 'Le type de fichier %1$s est interdit au t&eacute;l&eacute;chargement'; // %1$s = type de fichier
$lang[83] = 'Fichier <b>%1$s</ b>, Taille <b>%2$s</ b >...'; // %1$s = nom de fichier, %2$s = taille de fichier
$lang[84] = 'Erreur lors de la r&eacute;cup&eacute;ration du lien';
$lang[85] = 'Le texte pass&eacute; au compteur est une chaine de caract&egrave;res !';
$lang[86] = 'ERREUR : S\'il vous pla&icirc;t, activer JavaScript.';
$lang[87] = 'S\'il vous pla&icirc;t, patienter <b>%1$s</ b> secondes ...'; // %1$s = nombre de secondes
$lang[88] = 'Connection &agrave; %1$s, port : %2$s impossible'; // %1$s = nom de l'h&ocirc;te, %2$s = port
$lang[89] = 'Connect&eacute; au proxy: <b>%1$s</ b> sur le port <b>%2$s</ b >...'; // %1$s = Proxy h&ocirc;te, %2$s = Port Proxy
$lang[90] = 'Connect&eacute; &agrave;: <b>%1$s</ b> sur le port <b>%2$s</ b >...'; // %1$s = h&ocirc;te, %2$s = port
$lang[91] = 'Aucun ent&ecirc;te re&ccedil;u';
$lang[92] = 'Il vous est interdit d\'acc&eacute;der &agrave; la page!';
$lang[93] = 'La page est introuvable!';
$lang[94] = 'Cette page est soit interdite, soit introuvable!';
$lang[95] = 'Erreur! Cette adresse est redirig&eacute;e vers [%1$s]'; // %1$s = adresse redirig&eacute;e
$lang[96] = 'Ce site n&eacute;cessite une autorisation. Pour indiquer un nom d\'utilisateur et un mot de passe d\'acc&egrave;s, il est n&eacute;cessaire d\'utiliser des url similaires &agrave; : <br />http://<b>login:password@</b>www.site.com/fichier.extension';
$lang[97] = 'Limite de reprise du t&eacute;l&eacute;chargement d&eacute;pass&eacute;e';
$lang[98] = 'Ce serveur ne supporte pas la reprise du t&eacute;l&eacute;chargement';
$lang[99] = 'T&eacute;l&eacute;charger';
$lang[100] = 'Ce compte Premium est d&eacute;j&agrave; utilis&eacute; avec une autre adresse ip.';
$lang[101] = 'Le fichier %1$s ne peut &ecirc;tre sauvegard&eacute; dans le r&eacute;pertoire %2$s'; // %1$s = file name, %2$s = nom de r&eacute;pertoire
$lang[102] = 'Essayez de chmoder le dossier &agrave; 777.';
$lang[103] = 'R&eacute;essayer';
$lang[104] = 'Fichier';
$lang[105] = 'Il n\'est pas possible de proc&eacute;der &agrave; un enregistrement dans le fichier %1$s'; // %1$s = nom de fichier
$lang[106] = 'URL non valide ou une erreur inconnue s\'est produite';
$lang[107] = 'Vous avez atteint la limite pour les utilisateurs &agrave; titre gratuit.';
$lang[108] = 'La session de t&eacute;l&eacute;chargement a expir&eacute;';
$lang[109] = 'Code d\'acc&egrave;s erron&eacute;.';
$lang[110] = 'Vous avez entr&eacute; un mauvais code trop de fois';
$lang[111] = 'Quota de t&eacute;l&eacute;chargement d&eacute;pass&eacute;';
$lang[112] = 'Erreur lors de la lecture des donn&eacute;es';
$lang[113] = 'Erreur lors de l\'envoi des donn&eacute;es';
$lang[114] = 'Actif';
$lang[115] = 'Non disponible';
$lang[116] = 'Mort';
$lang[117] = 'Vous avez besoin de charger/activer l\'extension cURL (http://www.php.net/cURL) ou vous pouvez d&eacute;finir \'fgc\' => 1 dans config.php.';
$lang[118] = 'Curl est activ&eacute;';
$lang[119] = 'PHP version 5 est recommand&eacute;, m&ecirc;me s\'il n\'est pas obligatoire';
$lang[120] = 'V&eacute;rifier que Safe Mode est d&eacute;sactiv&eacute; car le script ne peut pas fonctionner avec Safe Mode activ&eacute;';
$lang[121] = 'Envoi du fichier <b>%1$s</ b>'; // %1$s = nom du fichier
$lang[122] = 'D&eacute;coupe inutile, envoi d\'un message unique';
$lang[123] = 'D&eacute;coupage en morceaux de %1$s'; // %1$s = taille du morceau
$lang[124] = 'M&eacute;thode';
$lang[125] = 'Envoi du morceau <b>%1$s</ b>'; // %1$s = num&eacute;ro du morceau
$lang[126] = 'D&eacute;coupe inutile, envoi d\'un message unique';
$lang[127] = 'Fichier h&ocirc;te non trouv&eacute;';
$lang[128] = 'Impossible de cr&eacute;er le fichier hosts';
$lang[129] = 'heures'; // Pluriel
$lang[130] = 'Heure';
$lang[131] = 'minutes'; // Pluriel
$lang[132] = 'minute';
$lang[133] = 'secondes'; // Pluriel
$lang[134] = 'seconde';
$lang[135] = 'getCpuUsage () : chemin d\'acc&egrave;s inaccessible ou fichier STAT non valide';
$lang[136] = 'Charge CPU';
$lang[137] = 'Une erreur s\'est produite';
$lang[138] = 'S&eacute;lectionner au moins un fichier.';
$lang[139] = 'Courriels';
$lang[140] = 'Envoyer';
$lang[141] = 'Supprimer les soumissions r&eacute;ussies';
$lang[142] = 'D&eacute;couper en morceaux';
$lang[143] = 'Taille des morceaux';
$lang[144] = '<b>%1$s</ b> - Adresse de courriel invalide.'; // %1$s = adresse e-mail
$lang[145] = 'Le fichier <b>%1$s</ b> est introuvable!'; // %1$s = nom du fichier
$lang[146] = 'Mise &agrave; jour de la liste des fichiers impossible !';
$lang[147] = 'La suppression de fichier est d&eacute;sactiv&eacute;e';
$lang[148] = 'Supprimer les fichiers';
$lang[149] = 'Oui';
$lang[150] = 'Non';
$lang[151] = 'Fichier <b>%1$s</ b> supprim&eacute;'; // %1$s = nom du fichier
$lang[152] = 'Erreur lors de la suppression du fichier <b>%1$s</ b> !'; // %1$s = nom du fichier
$lang[153] = 'H&ocirc;te';
$lang[154] = 'Port';
$lang[155] = 'R&eacute;pertoire';
$lang[156] = 'Supprimer le fichier source apr&egrave;s le transfert';
$lang[157] = 'Sauvegarder les donn&eacute;es de FTP';
$lang[158] = 'Supprimer les donn&eacute;es de FTP';
$lang[159] = 'Impossible de localiser le dossier <b>%1$s</ b>'; // %1$s = nom de r&eacute;pertoire
$lang[160] = 'Le fichier %1$s a &eacute;t&eacute; transf&eacute;r&eacute; avec succ&egrave;s !'; //  %1$s = nom du fichier
$lang[161] = 'Temps';
$lang[162] = 'Vitesse moyenne';
$lang[163] = 'Transfert du fichier <b>%1$s</ b> impossible !'; // %1$s = nom du fichier
$lang[164] = 'Courriel';
$lang[165] = 'Supprimer les soumissions r&eacute;ussies';
$lang[166] = 'Adresse de courriel invalide';
$lang[167] = 'S\'il vous pla&icirc;t, s&eacute;lectionnez uniquement les fichiers. crc ou .001 !';
$lang[168] = 'S\'il vous pla&icirc;t, s&eacute;lectionnez le fichier. CRC !';
$lang[169] = 'S\'il vous pla&icirc;t, s&eacute;lectionnez le fichier. crc ou .001 !';
$lang[170] = 'Effectuer une v&eacute;rification CRC ? (recommand&eacute;)';
$lang[171] = 'Mode de contr&ocirc;le CRC32';
$lang[172] = 'Utiliser le fichier hash ? (recommand&eacute;)';
$lang[173] = 'Lire le fichier en m&eacute;moire';
$lang[174] = 'CRC Faux';
$lang[175] = 'Supprimer le fichier source si la fusion a r&eacute;ussi';
$lang[176] = 'Notification';
$lang[177] = 'La taille du fichier et le CRC32 ne seront pas v&eacute;rifi&eacute;s';
$lang[178] = 'Le fichier CRC ne peut pas &ecirc;tre lu !';
$lang[179] = 'Erreur, le fichier de sortie existe d&eacute;j&agrave; <b>%1$s</ b>'; // %1$s = nom du fichier
$lang[180] = 'Erreur, morceaux manquants ou incomplets';
$lang[181] = 'Error, le type de fichier %1$s est interdit'; // Type de fichier
$lang[182] = 'Impossible d\'ouvrir de fichier de destination <b>%1$s</ b>'; // %1$s = nom du fichier
$lang[183] = 'Erreur lors de l\'&eacute;criture du fichier <b>%1$s</ b> !'; // %1$s = nom du fichier
$lang[184] = 'La somme de cont&ocirc;le CRC32 est diff&eacute;rente !';
$lang[185] = 'Le fichier <b>%1$s</ b> a fusionn&eacute; avec succ&egrave;s.'; // %1$s = nom du fichier
$lang[186] = 'supprim&eacute;';
$lang[187] = 'non supprim&eacute;';
$lang[188] = 'Ajouter une extension';
$lang[189] = 'sans';
$lang[190] = 'vers';
$lang[191] = 'Renommer ?';
$lang[192] = 'Annuler';
$lang[193] = 'Erreur lors du renommage du fichier <b>%1$s</ b>'; // %1$s = nom du fichier
$lang[194] = 'Le fichier <b>%1$s</ b> a &eacute;t&eacute; renomm&eacute; en <b>%2$s</ b>'; // %1$s = nom de fichier original, %2$s = nom du fichier renomm&eacute;
$lang[195] = 'Nom de l\'archive';
$lang[196] = 'S\'il vous pla&icirc;t, entrer un nom d\'archive!';
$lang[197] = 'Erreur, l\'archive n\'a pas &eacute;t&eacute; cr&eacute;&eacute;e.';
$lang[198] = 'Le fichier %1$s a &eacute;t&eacute; compress&eacute;'; // %1$s = nom du fichier
$lang[199] = 'compress&eacute; dans l\'archives <b>%1$s</ b>'; // %1$s = nom du fichier
$lang[200] = 'Erreur, l\'archive est vide.';
$lang[201] = 'Nouveau nom';
$lang[202] = 'Impossible de renommer le fichier <b>%1$s</ b>!'; // %1$s = nom du fichier
$lang[203] = 'Supprimer le fichier source en cas de d&eacute;coupe r&eacute;ussie';
$lang[204] = 'des fichiers et des r&eacute;pertoires';
$lang[205] = 'D&eacute;zipper';
$lang[206] = 'Liste de choix du format de vid&eacute;o YouTube';
$lang[207] = 'Lien &agrave; transf&eacute;rer';
$lang[208] = 'Referrer';
$lang[209] = 'Transfert du fichier';
$lang[210] = 'Utilisateur &amp; Mot de passe (HTTP/FTP)';
$lang[211] = 'Utilisateur';
$lang[212] = 'Mot de passe';
$lang[213] = 'Ajouter un commentaire';
$lang[214] = 'Options du Plugin';
$lang[215] = 'D&eacute;sactiver tous les Plugins';
$lang[216] = 'Liste de choix du format de vid&eacute;o YouTube';
$lang[217] = 'Lien direct';
$lang[218] = '&amp;fmt=';
$lang[219] = 'Acqu&eacute;rir automatiquement la plus haute qualit&eacute; disponible';
$lang[220] = '17 [Video: 3GP 176x144 | Audio: AAC 2ch 44.10kHz]';
$lang[221] = '5 [Video: FLV 400x240 | Audio: MP3 1ch 22.05kHz]';
$lang[222] = '34 [Video: FLV 640x360 | Audio: AAC 2ch 44.10kHz]';
$lang[223] = '35 [Video: FLV 854x480 | Audio: AAC 2ch 44.10kHz]';
$lang[224] = '43 [Video: WebM 640x360 | Audio: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [Video: WebM 1280x720 | Audio: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [Video: MP4 480x360 | Audio: AAC 2ch 44.10kHz]';
$lang[227] = '22 [Video: MP4 1280x720 | Audio: AAC 2ch 44.10kHz]';
$lang[228] = '37 [Video: MP4 1920x1080 | Audio: AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; TorrentService';
$lang[230] = 'Utilisateur';
$lang[231] = 'Mot de passe';
$lang[232] = 'Valeur du Cookie Megaupload.com';
$lang[233] = 'Utilisateur';
$lang[234] = 'Utiliser le plugin vBulletin';
$lang[235] = 'Valeur du Cookie suppl&eacute;mentaire';
$lang[236] = 'Key=Value';
$lang[237] = 'Envoyer un fichier par messagerie';
$lang[238] = 'Courriel';
$lang[239] = 'D&eacute;couper les fichiers';
$lang[240] = 'M&eacute;thode';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'Taille des morceaux';
$lang[244] = 'Mo';
$lang[245] = 'Utiliser les param&egrave;tres du proxy';
$lang[246] = 'proxy';
$lang[247] = 'Utilisateur';
$lang[248] = 'Mot de passe';
$lang[249] = 'Utiliser le compte Premium';
$lang[250] = 'Utilisateur';
$lang[251] = 'Mot de passe';
$lang[252] = 'Enregistrer dans';
$lang[253] = 'Chemin';
$lang[254] = 'Enregistrer les param&egrave;tres';
$lang[255] = 'Effacer les param&egrave;tres actuels';
$lang[256] = 'Tout cocher';
$lang[257] = 'Tout d&eacute;cocher';
$lang[258] = 'Inverser la s&eacute;lection';
$lang[259] = 'Afficher';
$lang[260] = 'T&eacute;l&eacute;charg&eacute;';
$lang[261] = 'Tout';
$lang[262] = 'Nom';
$lang[263] = 'Taille';
$lang[264] = 'Commentaires';
$lang[265] = 'Date';
$lang[266] = 'Aucun fichier trouv&eacute;';
$lang[267] = 'fonctionne avec';
$lang[268] = 'Supprimer';
$lang[269] = 'Mode de d&eacute;bogage';
$lang[270] = 'Afficher les liens uniquement';
$lang[271] = 'Supprimer les liens uniquement';
$lang[272] = 'V&eacute;rifier les liens';
$lang[273] = 'Chargement en cours ...';
$lang[274] = 'Traitement en cours, patientez s\'il vous pla&icirc;t ...';
$lang[275] = 'Espace Serveur';
$lang[276] = 'Occup&eacute;';
$lang[277] = 'Espace libre';
$lang[278] = 'Espace disque';
$lang[279] = 'CPU';
$lang[280] = 'Heure du Serveur';
$lang[281] = 'Heure locale';
$lang[282] = 'Auto-Supprimer';
$lang[283] = 'Heures apr&egrave;s le transfert';
$lang[284] = 'Minutes apr&egrave;s le transfert';
$lang[285] = 'Action';
$lang[286] = 'Envoyer';
$lang[287] = 'Fichier FTP';
$lang[288] = 'Courriel';
$lang[289] = 'Courriel en masse';
$lang[290] = 'D&eacute;couper le fichier';
$lang[291] = 'Fusionner les fichiers';
$lang[292] = 'MD5 Hash';
$lang[293] = 'Zipper les fichiers';
$lang[294] = 'Fichiers ZIP';
$lang[295] = 'D&eacute;zipper les fichiers';
$lang[296] = 'Renommer';
$lang[297] = 'Renommer en masse';
$lang[298] = 'Supprimer';
$lang[299] = 'Liste des liens';
$lang[300] = 'R&eacute;cup&eacute;rer la page de t&eacute;l&eacute;chargement';
$lang[301] = 'Entrer';
$lang[302] = 'ici';
$lang[303] = 'T&eacute;l&eacute;charger le fichier';
$lang[304] = 'configs/files.lst n\'est pas accessible en &eacute;criture, s\'il vous pla&icirc;t, assurez-vous qu\'il est chmod&eacute; &agrave; 777';
$lang[305] = '&nbsp;est s&eacute;lectionn&eacute; comme chemin de t&eacute;l&eacute;chargement et il n\'est pas accessible en &eacute;criture. S\'il vous pla&icirc;t, mettre le chmod &agrave; 777';
$lang[306] = 'Fusion du fichier';
$lang[307] = 'En attente';
$lang[308] = 'R&eacute;ussi';
$lang[309] = 'Rat&eacute;';
$lang[310] = 'Vous pourriez voir des avertissements sans qu\'ils soient activ&eacute;s';
$lang[311] = 'Vous pourriez ne pas &ecirc;tre en mesure d\'activer les statistiques du serveur';
$lang[312] = 'Votre serveur peut ne pas &ecirc;tre en mesure de supporter les fichiers de 2 Go';
$lang[313] = 'Rapidleech Checker Script';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'curl';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'PHP Version - ';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'Fonctions Espace Disque';
$lang[323] = 'Apache version -';
$lang[324] = 'Mauvaise adresse de Proxy indiqu&eacute;e';
$lang[325] = 'Le fichier a &eacute;t&eacute; enregistr&eacute; avec succ&egrave;s !';
$lang[326] = 'Enregistrer les notes';
$lang[327] = 'Notes';
$lang[328] = 'Actions D&eacute;sactiv&eacute;es';
$lang[329] = 'Fen&ecirc;tre principale';
$lang[330] = 'Param&egrave;tres';
$lang[331] = 'Fichiers du serveur';
$lang[332] = 'Testeur de liens';
$lang[333] = 'Modules';
$lang[334] = 'T&eacute;l&eacute:chargement Automatique';
$lang[335] = 'T&eacute;l&eacute;versement Automatique';
$lang[336] = 'Taille des fichiers limit&eacute;e &agrave; ';
$lang[337] = 'Limite de taille du fichier: ';
$lang[338] = 'Compresser les RARs';
$lang[339] = 'DÃ©compresser les RARs';
$lang[340] = 'Erreur d&eacute;tect&eacute;';
$lang[341] = 'cliquez ici pour agrandir';
$lang[342] = 'You can drag window from here';
$lang[343] = 'Can not find "rar"<br />You may need to download it and extract "rar" to "/rar/" directory';
$lang[344] = 'Fichiers qui vont &ecirc;tres dans l\'archive:';
$lang[345] = 'Nom de l\'archive:';
$lang[346] = 'Options:';
$lang[347] = 'Niveau de compression:';
$lang[348] = 'Stockage';
$lang[349] = 'Plus rapide';
$lang[350] = 'Rapide';
$lang[351] = 'Normal';
$lang[352] = 'Bonne';
$lang[353] = 'Meilleure';
$lang[354] = 'Create volumes';
$lang[355] = 'Delete files after archiving';
$lang[356] = 'Create solid archive';
$lang[357] = 'Create recovery record';
$lang[358] = 'Test archive after compression';
$lang[359] = 'Use password';
$lang[360] = 'Encrypt file names';
$lang[361] = 'Set path inside archive';
$lang[362] = 'Rar';
$lang[363] = 'Creating archive: <b>%1$s</b>';
$lang[364] = 'Waiting...';
$lang[365] = 'Go back to file list';
$lang[366] = '<b>Files from %1$s</b>:';
$lang[367] = 'Can not find "unrar"';
$lang[368] = 'Pasword needed to list files:';
$lang[369] = 'Pasword needed to extract files:';
$lang[370] = 'Error:%1$s';
$lang[371] = 'Try to list again';
$lang[372] = 'Unrar selected';
$lang[373] = '<b>Extracting files from %1$s</b>:';
$lang[374] = 'Status:';
$lang[375] = 'Select text';
$lang[376] = 'Premium Accounts :';
$lang[377] = '38 [Video: MP4 4096x3072 | Audio: AAC 2ch 44.10kHz]';
$lang[378] = 'Close window';
$lang[379] = 'Files';
$lang[380] = 'MD5 change should only be applied to known working formats(i.e. .rar or .zip)<br />Do you want to continue?';
$lang[381] = 'MD5 of file <b>%1$s</b> changed'; // %1$s = filename
$lang[382] = 'Error changing the MD5 of the file <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'MD5 change';
$lang[384] = 'Match text';
$lang[385] = 'Match';
$lang[386] = 'Ignore case';
$lang[387] = 'Put each file on a separated archive';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// file per la lingua italiana

$lang[1] = 'Accesso Negato';
$lang[2] = 'Il server ha rifiutato di eseguire la tua richiesta';
$lang[3] = 'Non hai introdotto un indirizzo e-mail valido';
$lang[4] = 'La dimensione delle parti non &eacute; numerico';
$lang[5] = 'Tipo URL Sconosciuto, <span class="font-black">Usa Solo Il Protocollo<span class="font-blue">http</span> oppure <span class="font-blue">https</span> oppure <span class="font-blue">ftp</span></span>';
$lang[6] = 'Non &eacute; stata specificata un percorso per questo file';
$lang[7] = 'Non hai il permesso di scaricare da <span class="font-black">%1$s (%2$s)</span>'; // %1$s = nome del server %2$s = ip del server
$lang[8] = 'Reindirizzato a:';
$lang[9] = 'Non posso aggiornare la lista dei files';
$lang[10] = 'File <b>%1$s</b> (<b>%2$s</b>) Salvato!<br />Tempo: <b>%3$s</b><br />Velocit&agrave media: <b>%4$s KB/s</b><br />'; // %1$s = nome del file %2$s = dimensione %3$s = tempo di download %4$s = velocit&agrave
$lang[11] = '<script>mail("Il file &eacute; stato inviato a questo indirizzo<b>%1$s</b>.", "%2$s");</script>'; // %1$s = indirizzo E-mail  %2$s = nome del file
$lang[12] = 'Errore nell\'invio del file!';
$lang[13] = 'Torna alla pagina principale';
$lang[14] = 'Connessione persa, file cancellato.';
$lang[15] = 'Ricarica';
$lang[16] = 'Per favore cambia la modalit&agrave debugger a <b>1</b>';
$lang[17] = 'Il numero massimo di indirizzi (%1$s) &eacute; stato raggiunto.'; // %1$s = Numero massimo di indirizzi
$lang[18] = '%1$s Indirizzi%2$s controllati in %3$s secondi. (Metodo: <b>%4$s</b>)'; // %1$s = Numero di indirizzi %2$s = Forma plurale %3$s = secondi %4$s = metodo per controllare gli indirizzi
$lang[19] = 's'; // End of a plural
$lang[20] = 'Indirizzo del server proxy errato';
$lang[21] = 'Indirizzo';
$lang[22] = 'Stato';
$lang[23] = 'Attendere';
$lang[24] = 'URL non valido';
$lang[25] = 'Sto iniziando';
$lang[26] = 'Inizio';
$lang[27] = 'Conessione persa';
$lang[28] = 'Finito';
$lang[29] = 'Inizio auto Trasferimento';
$lang[30] = 'Frames not supporteti, aggiorna il browser';
$lang[31] = 'Aggiungi gli indirizzi';
$lang[32] = 'Indirizzi';
$lang[33] = 'Opzioni';
$lang[34] = 'Trasferisci i files';
$lang[35] = 'Usa i dati di configurazione del proxy';
$lang[36] = 'Proxy';
$lang[37] = 'Nome utente';
$lang[38] = 'Password';
$lang[39] = 'Usa l\'account imageshack';
$lang[40] = 'Salva a';
$lang[41] = 'Percorso';
$lang[42] = 'Usa l\'Account Premium';
$lang[43] = 'Esegui Lato Server';
$lang[44] = 'Tempo di ritardo';
$lang[45] = 'Ritardo (in secondi)';
$lang[46] = 'Nessun files o server sezionati per l\'upload';
$lang[47] = 'Seleziona il server per l\'upload';
$lang[48] = 'Servizio per l\'upload non supportato!';
$lang[49] = 'Finestra dell\'upload';
$lang[50] = 'Formato degli indirizzi salvati';
$lang[51] = 'Default';
$lang[52] = 'seleziona tutto';
$lang[53] = 'Deseleziona tutto';
$lang[54] = 'Inverti la selezione';
$lang[55] = 'Nome';
$lang[56] = 'Dimensione';
$lang[57] = 'Files non trovati';
$lang[58] = 'Legenda per il formato dei link salvati: (Sensibile al carattere)';
$lang[59] = 'L\'indirizzo per il download';
$lang[60] = 'Il nome del file';
$lang[61] = 'Stile degli indirizzi predeterminato';
$lang[62] = 'Qualsiasi aggiunta sopra sar&agrave trattata come testo, non puoi fare il formato multilinea , una nuova linea sar&agrave inserita per ogni indirizzo.';
$lang[63] = 'Upload file %1$s to %2$s'; // %1$s = nome del file %2$s = nome del server
$lang[64] = 'Il file %1$s non esiste.'; // %1$s = nome del file
$lang[65] = 'Il file %1$s non &eacute; leggibile dallo script.'; // %1$s = nome del file
$lang[66] = 'La dimensione del file &eacute; troppo grande per caricarlo su questo server.';
$lang[67] = 'Servizio di upload non permesso';
$lang[68] = 'Indirizzo di download';
$lang[69] = 'Indirizzo di cancellazione';
$lang[70] = 'Indirizzo di stato';
$lang[71] = 'Indirizzo di amministrazione';
$lang[72] = 'ID-UTENTE';
$lang[73] = 'Upload FTP';
$lang[74] = 'Password';
$lang[75] = 'Rapidleech PlugMod - Indirizzi Upload';
$lang[76] = '<div class="linktitle">Indirizzi di upload <strong>%1$s</strong> - <span class="bluefont">Dimensione: <strong>%2$s</strong></span></div>'; // %1$s = nome del file %2$s = dimensione file
$lang[77] = 'Eseguito';
$lang[78] = 'Torna indietro';
$lang[79] = 'Non posso stabilire una connessione con il server %1$s.'; // %1$s = nome del server FTP
$lang[80] = 'Errato username e/o password.';
$lang[81] = 'Connesso a: <b>%1$s</b>...'; // %1$s = nome del server FTP
$lang[82] = 'Il tipo di file %1$s &eacute; vietato di essere scaricato'; // %1$s = File type
$lang[83] = 'File <b>%1$s</b>, Dimensione <b>%2$s</b>...'; // %1$s = nome del file %2$s = dimensione file
$lang[84] = 'Errore nel ricevere l\'indirizzo';
$lang[85] = 'Il testo passato come contatore &eacute; di tipo stringa!';
$lang[86] = 'ERRORE: Per piacere abilita JavaScript.';
$lang[87] = 'Per piacere attendi <b>%1$s</b> secondi...'; // %1$s = numberp di secondi
$lang[88] = 'Non posso connettermi a %1$s at port %2$s'; // %1$s = nome server %2$s = porta
$lang[89] = 'Connesso al proxy: <b>%1$s</b> alla porta <b>%2$s</b>...'; // %1$s = Server proxy %2$s = Porta proxy
$lang[90] = 'Connesso a: <b>%1$s</b> alla porta <b>%2$s</b>...'; // %1$s = server %2$s = porta
$lang[91] = 'Nessuna intestazione rivevuta';
$lang[92] = 'Non hai il permesso di accedere alla pagina!';
$lang[93] = 'La pagina non &eacute; stata trovata!';
$lang[94] = 'La pagina era vietata o inesistente!';
$lang[95] = 'Errore! Esso &eacute; reindirizzato a [%1$s]'; // %1$s = nuovo indirizzo
$lang[96] = 'Questo sito richiede l\'autorizzazione. Per inviare nome utente e Password bisogna usare il seguente formato:<br />http://<b>login:password@</b>www.sito.com/file.exe';
$lang[97] = 'Il limite di resume &eacute; stato oltrepassato';
$lang[98] = 'Questo server non supporta il resume';
$lang[99] = 'Download';
$lang[100] = 'Questo account premium &eacute; gi&agrave in uso da un\'altro ip.';
$lang[101] = 'Il file %1$s non pu&ograve essere salvato nella directory %2$s'; // %1$s = nome del file %2$s = nome directory
$lang[102] = 'Prova a cambiare il chmod della cartella a 777.';
$lang[103] = 'Ritenta';
$lang[104] = 'File';
$lang[105] = 'Non &eacute; possibile creare un registro nel file %1$s'; // %1$s = nome del file
$lang[106] = 'URL non valido o &eacute; avvenuto un errore sconosciuto';
$lang[107] = 'Hai raggiunto il limite come utente Free.';
$lang[108] = 'La sessione di download &eacute; scaduta';
$lang[109] = 'Codice d\'accesso errato.';
$lang[110] = 'Hai introdotto un codice errato troppe volte';
$lang[111] = 'Limite di download oltrepassato';
$lang[112] = 'Errore Nella Lettura Dei Dati';
$lang[113] = 'Errore Nell\'Invio Dei Dati';
$lang[114] = 'Attivo';
$lang[115] = 'Non disponibile';
$lang[116] = 'Inattivo';
$lang[117] = 'Hai bisogno di caricare/attivare l\'estensione cURL (http://www.php.net/cURL) oppure puoi settare \'fgc\' => 1 in config.php.';
$lang[118] = 'cURL &eacute; attivo';
$lang[119] = '&Eacute; raccomandata la versione 5 di PHP sebbene non sia obbligatoria';
$lang[120] = 'Verifica se l\'opzione safe mode &eacute; disattivata poich&eacute; lo script non funziona con safe mode attivo';
$lang[121] = 'Invio file <b>%1$s</b>'; // %1$s = nome del file
$lang[122] = 'Non hai bisogno di dividere, Invia una sigola mail';
$lang[123] = 'Sto dividendo in %1$s dimensione di ogni porzione'; // %1$s = dimensione porzione
$lang[124] = 'Metodo';
$lang[125] = 'Sto inviando la porzione <b>%1$s</b>'; //%1$s = numero porzioni
$lang[126] = 'Non hai bisogno di dividere, Invia una sigola mail';
$lang[127] = 'Nessun file server trovato';
$lang[128] = 'Non posso creare il file dei server';
$lang[129] = 'ore'; // Plural
$lang[130] = 'ora';
$lang[131] = 'minuti'; // Plural
$lang[132] = 'minuto';
$lang[133] = 'secondi'; // Plural
$lang[134] = 'secondo';
$lang[135] = 'getCpuUsage(): non posso accedere alla directory STAT o il file STAT non &eacute; valido';
$lang[136] = 'Carico CPU';
$lang[137] = '&Eacute; avvenuto un errore';
$lang[138] = 'Seleziona almeno un file.';
$lang[139] = 'Emails';
$lang[140] = 'Invio';
$lang[141] = 'Cancella invii con successo';
$lang[142] = 'Dividi in parti';
$lang[143] = 'Dimnsione parti';
$lang[144] = '<b>%1$s</b> - Indirizzo E-mail errato.'; // %1$s = indirizzo email
$lang[145] = 'File <b>%1$s</b> non trovato!'; // %1$s = nome del file
$lang[146] = 'Non posso aggiornare la lista dei file!';
$lang[147] = 'Cancellazione dei file disabilitata';
$lang[148] = 'Cancella i files';
$lang[149] = 'Si';
$lang[150] = 'No';
$lang[151] = 'File <b>%1$s</b> Cancellato'; // %1$s = nome del file
$lang[152] = 'Errore nella cancellazione del file <b>%1$s</b>!'; // %1$s = nome del file
$lang[153] = 'Server';
$lang[154] = 'Porta';
$lang[155] = 'Percorso';
$lang[156] = 'Cancella il file sorgente dopo l\'upload con successo';
$lang[157] = 'Salva i dati di FTP';
$lang[158] = 'Eliminare i dati di FTP';
$lang[159] = 'Non trovo il percorso della cartella <b>%1$s</b>'; // %1$s = nome percorso
$lang[160] = 'File %1$s caricato con successo!'; // %1$s = nome del file
$lang[161] = 'Tempo';
$lang[162] = 'Velocit&agrave media';
$lang[163] = 'Non posso caricare il file <b>%1$s</b>!'; // %1$s = nome del file
$lang[164] = 'Email';
$lang[165] = 'Cancella inviati con successo';
$lang[166] = 'Indirizzo E-mail non valido';
$lang[167] = 'Per piacere seleziona solo con estensione .crc oppure .001!';
$lang[168] = 'Per piacere seleziona il file .crc !';
$lang[169] = 'Per piacere seleziona il file con estensione .crc oppure .001!';
$lang[170] = 'Esegui un controllo CRC? (Raccomandato)';
$lang[171] = 'modalit&agrave controllo CRC32';
$lang[172] = 'Usa l\'hash_file (Raccomandato)';
$lang[173] = 'Leggi il file alla memoria';
$lang[174] = 'crc alterato';
$lang[175] = 'Cancella il file sorgente dopo l\'unione con successo';
$lang[176] = 'Avviso';
$lang[177] = 'La dimensione del file e il crc32 non sono stati controllati';
$lang[178] = 'Non posso leggere il file .crc!';
$lang[179] = 'Errore, Il file gi&agrave esiste <b>%1$s</b>'; // %1$s = nome del file
$lang[180] = 'Errore, parti non trovate o incomplete';
$lang[181] = 'Errore, Il tipo del file %1$s non &eacute; permesso'; // Filetype
$lang[182] = 'Non &eacute; possibile aprire il file di destinazione <b>%1$s</b>'; // %1$s = nome del file
$lang[183] = 'Errore scrivendo il file <b>%1$s</b>!'; // %1$s = nome del file
$lang[184] = 'CRC32 checksum errato!';
$lang[185] = 'File <b>%1$s</b> Unito con successo'; // %1$s = nome del file
$lang[186] = 'cancellato';
$lang[187] = 'non cancellato';
$lang[188] = 'Aggiungi estensione';
$lang[189] = 'senza';
$lang[190] = 'a';
$lang[191] = 'Rinomina?';
$lang[192] = 'Cancella';
$lang[193] = 'Errore nel rinominare il file <b>%1$s</b>'; // %1$s = nome del file
$lang[194] = 'File <b>%1$s</b> &eacute; stato rinominato a <b>%2$s</b>'; // %1$s = nome file originale %2$s = nome file rinominato
$lang[195] = 'Nome Archivio';
$lang[196] = 'Per piacere introduci il nome dell\'archivio!';
$lang[197] = 'Errore l\'archivio non &eacute; stato creato.';
$lang[198] = 'File %1$s era impacchettato'; // %1$s = nome del file
$lang[199] = 'Impacchettato nell\'archivio <b>%1$s</b>'; // %1$s = nome del file
$lang[200] = 'Errore, l\'archivio &eacute; vuoto.';
$lang[201] = 'Nuovo nome';
$lang[202] = 'Non posso rinominare il file <b>%1$s</b>!'; // %1$s = nome del file
$lang[203] = 'Cancella il file sorgente dopo la divisione con successo';
$lang[204] = 'files e cartelle';
$lang[205] = 'Unzip';
$lang[206] = 'YouTube Selettore Formato Video';
$lang[207] = 'Indirizzo di Trasferimento';
$lang[208] = 'Riferimento';
$lang[209] = 'Transferisci il File';
$lang[210] = 'Utente &amp; Password (HTTP/FTP)';
$lang[211] = 'Utente';
$lang[212] = 'Password';
$lang[213] = 'Aggiungi commenti';
$lang[214] = 'Opzioni dei plugins';
$lang[215] = 'Disabilita tutti i plugins';
$lang[216] = 'YouTube Selettore Formato Video';
$lang[217] = 'Indirizzo Diretto';
$lang[218] = '&amp;fmt=';
$lang[219] = 'Richiedi automaticamente la miglior qualit&agrave disponibile';
$lang[220] = '17 [Video: 3GP 176x144 | Audio: AAC 2ch 44.10kHz]';
$lang[221] = '5 [Video: FLV 400x240 | Audio: MP3 1ch 22.05kHz]';
$lang[222] = '34 [Video: FLV 640x360 | Audio: AAC 2ch 44.10kHz]';
$lang[223] = '35 [Video: FLV 854x480 | Audio: AAC 2ch 44.10kHz]';
$lang[224] = '43 [Video: WebM 640x360 | Audio: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [Video: WebM 1280x720 | Audio: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [Video: MP4 480x360 | Audio: AAC 2ch 44.10kHz]';
$lang[227] = '22 [Video: MP4 1280x720 | Audio: AAC 2ch 44.10kHz]';
$lang[228] = '37 [Video: MP4 1920x1080 | Audio: AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; TorrentService';
$lang[230] = 'Utente';
$lang[231] = 'Password';
$lang[232] = 'Megaupload.com valore del Cookie';
$lang[233] = 'Utente';
$lang[234] = 'Usa il Plugin vBulletin';
$lang[235] = 'Valore da aggiungere al Cookie';
$lang[236] = 'Chiave=Valore';
$lang[237] = 'Invia il File all\'Email';
$lang[238] = 'Email';
$lang[239] = 'Dividi Files';
$lang[240] = 'Metodo';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'Dimensione Parti';
$lang[244] = 'MB';
$lang[245] = 'Usa la configurazione proxy';
$lang[246] = 'Proxy';
$lang[247] = 'Utente';
$lang[248] = 'Password';
$lang[249] = 'Usa l\'account Premium';
$lang[250] = 'Utente';
$lang[251] = 'Password';
$lang[252] = 'Salva a';
$lang[253] = 'Percorso';
$lang[254] = 'Salva la configurazione';
$lang[255] = 'Cancella la configurazione corrente';
$lang[256] = 'Seleziona tutti';
$lang[257] = 'Deseleziona tutti';
$lang[258] = 'Inverti la selezione';
$lang[259] = 'Visualizza';
$lang[260] = 'Downloads Completi';
$lang[261] = 'Tutto';
$lang[262] = 'Nome';
$lang[263] = 'Dimensione';
$lang[264] = 'Commenti';
$lang[265] = 'Data';
$lang[266] = 'Files non trovati';
$lang[267] = 'Funziona con';
$lang[268] = 'Cancella';
$lang[269] = 'Modalit&agrave Debug';
$lang[270] = 'Visualizza solo indirizzi';
$lang[271] = 'Cancella solo indirizzi';
$lang[272] = 'Controlla indirizzi';
$lang[273] = 'Sto caricando...';
$lang[274] = 'Sto eseguendo, per piacere attendi...';
$lang[275] = 'Spazio nel server';
$lang[276] = 'In Uso';
$lang[277] = 'Spazio libero';
$lang[278] = 'Spazio del disco';
$lang[279] = 'CPU';
$lang[280] = 'Orario nel server';
$lang[281] = 'Orario locale';
$lang[282] = 'Auto-Cancella';
$lang[283] = 'Ore Dopo Il Trasferimento';
$lang[284] = 'Minuti Dopo Il Trasferimento';
$lang[285] = 'Azione';
$lang[286] = 'Upload';
$lang[287] = 'FTP File';
$lang[288] = 'E-Mail';
$lang[289] = 'E-mail Multiple';
$lang[290] = 'Dividi Files';
$lang[291] = 'Unisci Files';
$lang[292] = 'MD5 Hash';
$lang[293] = 'Impacchetta Files';
$lang[294] = 'ZIP Files';
$lang[295] = 'Unzip Files';
$lang[296] = 'Rinomina';
$lang[297] = 'Rinomine multiple';
$lang[298] = 'Cancella';
$lang[299] = 'Lista indirizzi';
$lang[300] = 'Sto ricevendo la pagina di download';
$lang[301] = 'Introduci';
$lang[302] = 'qui';
$lang[303] = 'Download File';
$lang[304] = 'configs/files.lst non &eacute; scrivibile, assicurati che il chmod &eacute; 777';
$lang[305] = '&nbsp;&eacute; selezionato come tuo percorso di download ed &eacute; non scrivibile. Per piacere setta il chmod a 777';
$lang[306] = 'Sto unendo il File';
$lang[307] = 'Attendi';
$lang[308] = 'Passato';
$lang[309] = 'Fallito';
$lang[310] = 'Puoi vedere gli avvisi se questo non &eacute; settato on';
$lang[311] = 'Non hai la possibilit&agrave di settare on le statistiche sul server';
$lang[312] = 'Il tuo server non supporta file pi&ugrave grandi di 2 GB';
$lang[313] = 'Rapidleech Script di verifica';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'PHP Versione - ';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'Funzioni Sullo Spazio Del Disco';
$lang[323] = 'Versione Apache - ';
$lang[324] = 'Indirizzo proxy introdotto errato';
$lang[325] = 'File salvato con successo!';
$lang[326] = 'Salva Le Note';
$lang[327] = 'Note';
$lang[328] = 'Azione Disattivata';
$lang[329] = 'Main Window';
$lang[330] = 'Settings';
$lang[331] = 'Server Files';
$lang[332] = 'Link Checker';
$lang[333] = 'Plugins';
$lang[334] = 'Auto Transload';
$lang[335] = 'Auto Upload';
$lang[336] = 'Dimensioni del file &egrave; limitata a ';
$lang[337] = 'File Size Limit: ';
$lang[338] = 'Rar Files';
$lang[339] = 'Unrar Files';
$lang[340] = 'Error detected';
$lang[341] = 'click here to expand';
$lang[342] = 'You can drag window from here';
$lang[343] = 'Can not find "rar"<br />You may need to download it and extract "rar" to "/rar/" directory';
$lang[344] = 'Files that will be archived:';
$lang[345] = 'Archive name:';
$lang[346] = 'Options:';
$lang[347] = 'Compresion level:';
$lang[348] = 'Store';
$lang[349] = 'Fastest';
$lang[350] = 'Fast';
$lang[351] = 'Normal';
$lang[352] = 'Good';
$lang[353] = 'Best';
$lang[354] = 'Create volumes';
$lang[355] = 'Delete files after archiving';
$lang[356] = 'Create solid archive';
$lang[357] = 'Create recovery record';
$lang[358] = 'Test archive after compression';
$lang[359] = 'Use password';
$lang[360] = 'Encrypt file names';
$lang[361] = 'Set path inside archive';
$lang[362] = 'Rar';
$lang[363] = 'Creating archive: <b>%1$s</b>';
$lang[364] = 'Waiting...';
$lang[365] = 'Go back to file list';
$lang[366] = '<b>Files from %1$s</b>:';
$lang[367] = 'Can not find "unrar"';
$lang[368] = 'Pasword needed to list files:';
$lang[369] = 'Pasword needed to extract files:';
$lang[370] = 'Error:%1$s';
$lang[371] = 'Try to list again';
$lang[372] = 'Unrar selected';
$lang[373] = '<b>Extracting files from %1$s</b>:';
$lang[374] = 'Status:';
$lang[375] = 'Select text';
$lang[376] = 'Premium Accounts :';
$lang[377] = '38 [Video: MP4 4096x3072 | Audio: AAC 2ch 44.10kHz]';
$lang[378] = 'Close window';
$lang[379] = 'Files';
$lang[380] = 'MD5 change should only be applied to known working formats(i.e. .rar or .zip)<br />Do you want to continue?';
$lang[381] = 'MD5 of file <b>%1$s</b> changed'; // %1$s = filename
$lang[382] = 'Error changing the MD5 of the file <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'MD5 change';
$lang[384] = 'Match text';
$lang[385] = 'Match';
$lang[386] = 'Ignore case';
$lang[387] = 'Put each file on a separated archive';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// Arquivo para o idioma Portuguï¿½s-BR
// You should always use this file as a template for translating

$lang[1] = 'Acesso negado';
$lang[2] = 'O servidor recusou-se a satisfazer o seu pedido';
$lang[3] = 'Voc&ecirc; n&atilde;o inseriu um endere&ccedil;o de e-mail v&aacute;lido';
$lang[4] = 'Tamanho das partes n&atilde;o s&atilde;o num&eacute;ricos';
$lang[5] = 'Desconhecido Tipo de URL, <span class="font-black">Use apenas <span class="font-blue">http</span> ou <span class="font-blue">https</span> ou <span class="font-blue">ftp</span> Protocol</span>';
$lang[6] = 'O caminho n&atilde;o especificado para salvar este arquivo';
$lang[7] = 'Voc&ecirc; n&atilde;o est&aacute; autorizado a baixar de <span class="font-black">%1$s (%2$s)</span>'; // %1$s = host name %2$s = host ip
$lang[8] = 'Redirecionando para:';
$lang[9] = 'N&atilde;o foi poss&iacute;vel atualizar a lista de arquivos';
$lang[10] = 'Arquivo <b>%1$s</b> (<b>%2$s</b>) Salvo!<br />Tempo: <b>%3$s</b><br />Velocidade M&eacute;dia: <b>%4$s KB/s</b><br />'; // %1$s = filename %2$s = filesize %3$s = time of download %4$s = speed
$lang[11] = '<script>E-mail("O arquivo foi enviado para este endere&ccedil;o<b>%1$s</b>.", "%2$s");</script>'; // %1$s = E-mail address %2$s = filename
$lang[12] = 'Erro ao enviar arquivo!';
$lang[13] = 'Voltar para a principal';
$lang[14] = 'Conex&atilde;o perdida, arquivo foi exclu&iacute;do.';
$lang[15] = 'Atualizar';
$lang[16] = 'Por favor, altere o modo de depura&ccedil;&atilde;o para <b>1</b>';
$lang[17] = 'No m&aacute;ximo (%1$s) dos links foram alcan&ccedil;ados.'; // %1$s = Number of maximum links
$lang[18] = '%1$s Link%2$s checados em %3$s segundos. (M&eacute;todo: <b>%4$s</b>)'; // %1$s = Number of links %2$s = Plural form %3$s = seconds %4$s = method for checking links
$lang[19] = 's'; // End of a plural
$lang[20] = 'Bad proxy server address';
$lang[21] = 'Link';
$lang[22] = 'Status';
$lang[23] = 'Esperando';
$lang[24] = 'URL Inv&aacute;lida';
$lang[25] = 'Preparando';
$lang[26] = 'Iniciado';
$lang[27] = 'Conex&atilde;o perdida';
$lang[28] = 'Conclu&iacute;do';
$lang[29] = 'Baixar arquivos';
$lang[30] = 'Frames sem suporte, atualize seu navegador';
$lang[31] = 'Adicionar links';
$lang[32] = 'Links';
$lang[33] = 'Op&ccedil;&otilde;es';
$lang[34] = 'Baixar arquivos';
$lang[35] = 'Use configura&ccedil;&otilde;es de proxy';
$lang[36] = 'Proxy';
$lang[37] = 'Usu&aacute;rio';
$lang[38] = 'Senha';
$lang[39] = 'Utilizar Imageshack Conta';
$lang[40] = 'Salvar em';
$lang[41] = 'Caminho';
$lang[42] = 'Use Conta Premium';
$lang[43] = 'Executar Server Side';
$lang[44] = 'Tempo de atraso';
$lang[45] = 'Atraso (em segundos)';
$lang[46] = 'Nenhum arquivo ou hosts selecionados para upload';
$lang[47] = 'Selecione os Hosts para upload';
$lang[48] = 'N&atilde;o suporta servi&ccedil;os de upload!';
$lang[49] = 'Upload em janelas';
$lang[50] = 'Link para o formato salvo';
$lang[51] = 'Default';
$lang[52] = 'Marcar Todos';
$lang[53] = 'Desmarcar Todos';
$lang[54] = 'Inverter Sele&ccedil;&atilde;o';
$lang[55] = 'Nome';
$lang[56] = 'Tamanho';
$lang[57] = 'N&atilde;o foram encontrados arquivos';
$lang[58] = 'Leganda para o link salvo no formato: (mai&uacute;sculas e min&uacute;sculas)';
$lang[59] = 'O link para baixar';
$lang[60] = 'O nome do arquivo';
$lang[61] = 'Padr&atilde;o de estilo link';
$lang[62] = 'Qualquer coisa al&eacute;m do declarado acima ser&aacute; tratado como fio, voc&ecirc; n&atilde;o pode enfileirar multi formate agora, uma linha nova ser&aacute; inserida para cada link.';
$lang[63] = 'Arquivo carregando %1$s to %2$s'; // %1$s = filename %2$s = file host name
$lang[64] = 'Arquivo %1$s n&atilde;o existe.'; // %1$s = filename
$lang[65] = 'Arquivo %1$s n&atilde;o &eacute; lido pelo script.'; // %1$s = filename
$lang[66] = 'Tamanho do arquivo muito grande para fazer o upload no host.';
$lang[67] = 'Servi&ccedil;o de upload n&atilde;o permitido';
$lang[68] = 'Baixar-Link';
$lang[69] = 'Deletar-Link';
$lang[70] = 'Iniciar-Link';
$lang[71] = 'Admin-Link';
$lang[72] = 'USER-ID';
$lang[73] = 'FTP upload';
$lang[74] = 'Senha';
$lang[75] = 'Rapidleech PlugMod - Upload Links';
$lang[76] = '<div class="linktitle">Links para upload <strong>%1$s</strong> - <span class="bluefont">Tamanho: <strong>%2$s</strong></span></div>'; // %1$s = file name %2$s = file size
$lang[77] = 'Conclu&iacute;do';
$lang[78] = 'Voltar';
$lang[79] = 'N&atilde;o foi poss&iacute;vel estabelecer uma conex&atilde;o com o servidor %1$s.'; // %1$s = FTP server name
$lang[80] = 'Nome de usu&aacute;rio incorreto e/ou senha.';
$lang[81] = 'Conectado a: <b>%1$s</b>...'; // %1$s = FTP server name
$lang[82] = 'O tipo de ficheiro %1$s &eacute; proibido de ser baixado'; // %1$s = File type
$lang[83] = 'Arquivo <b>%1$s</b>, Tamanho <b>%2$s</b>...'; // %1$s = file name %2$s = file size
$lang[84] = 'Erro ao recuperar o link';
$lang[85] = 'Texto contador &eacute; passado como string!';
$lang[86] = 'ERRO: Por favor habilite o JavaScript.';
$lang[87] = 'Por favor, aguarde <b>%1$s</b> segundos...'; // %1$s = number of seconds
$lang[88] = 'N&atilde;o foi poss&iacute;vel conectar %1$s na porta %2$s'; // %1$s = host name %2$s = port
$lang[89] = 'Conectado ao proxy: <b>%1$s</b> na porta <b>%2$s</b>...'; // %1$s = Proxy host %2$s = Proxy port
$lang[90] = 'Conectado a: <b>%1$s</b> na porta <b>%2$s</b>...'; // %1$s = host %2$s = port
$lang[91] = 'N&atilde;o recebeu o cabe&ccedil;alho';
$lang[92] = 'Voc&ecirc; est&aacute; proibido de acessar a p&aacute;gina!';
$lang[93] = 'A p&aacute;gina n&atilde;o foi encontrada!';
$lang[94] = 'A p&aacute;gina foi proibida ou n&atilde;o &eacute; encontrada!';
$lang[95] = 'Error! it is redirected to [%1$s]'; // %1$s = redirected address
$lang[96] = 'Este site requer autoriza&ccedil;&atilde;o. Para a indica&ccedil;&atilde;o do nome de usu&aacute;rio e senha de acesso &eacute; necess&aacute;rio usar uma URL similar a essa:<br />http://<b>usu&aacute;rio:senha@</b>www.site.com/arquivo.exe';
$lang[97] = 'O limite do resumo excedeu';
$lang[98] = 'Este servidor n&atilde;o suporta resumo';
$lang[99] = 'Baixar';
$lang[100] = 'Est&aacute; conta premium j&aacute; est&aacute; em uso com outro ip.';
$lang[101] = 'Arquivo %1$s n&atilde;o pode ser salvo no direct&oacute;rio %2$s'; // %1$s = file name %2$s = directory name
$lang[102] = 'Tente chmod 777 para a pasta.';
$lang[103] = 'Tentar novamente';
$lang[104] = 'Arquivo';
$lang[105] = 'N&atilde;o &eacute; poss&iacute;vel realizar um registro no arquivo %1$s'; // %1$s = file name
$lang[106] = 'URL inv&aacute;lida ou erro desconhecido';
$lang[107] = 'Voc&ecirc; atingiu o limite para os usu&aacute;rios free.';
$lang[108] = 'A sess&atilde;o de download expirou';
$lang[109] = 'C&oacute;digo de acesso errado.';
$lang[110] = 'Voc&ecirc; digitou um c&oacute;digo errado muitas vezes';
$lang[111] = 'Limite de transfer&ecirc;ncia excedido';
$lang[112] = 'Erro de leitura de dados';
$lang[113] = 'Erro ao enviar dados';
$lang[114] = 'Ativo';
$lang[115] = 'Indispon&iacute;vel';
$lang[116] = 'Morto';
$lang[117] = 'Voc&ecirc; precisa carregar/ativar a extens&atilde;o cURL (http://www.php.net/cURL) ou voc&ecirc; pode definir \'fgc\' => 1 em config.php.';
$lang[118] = 'cURL est&aacute; habilitado';
$lang[119] = 'PHP vers&atilde;o 5 &eacute; recomendada, embora n&atilde;o seja obrigat&oacute;rio';
$lang[120] = 'Verifique se o safe mode est&aacute; desativado pois o script n&atilde;o funciona com ele ativado';
$lang[121] = 'Enviado arquivo <b>%1$s</b>'; // %1$s = filename
$lang[122] = 'N&atilde;o h&aacute; necessidade de dividir, Enviar e-mail &uacute;nico';
$lang[123] = 'Dividindo em partes no tamanho de %1$s'; // %1$s = part size
$lang[124] = 'M&eacute;todo';
$lang[125] = 'Enviado parte <b>%1$s</b>'; //%1$s = part number
$lang[126] = 'N&atilde;o h&aacute; necessidade dividir, enviar e-mail &uacute;nico';
$lang[127] = 'Arquivo n&atilde;o encontrado no host';
$lang[128] = 'N&atilde;o &eacute; poss&iacute;vel criar o arquivo no host';
$lang[129] = 'horas'; // Plural
$lang[130] = 'hora';
$lang[131] = 'minutos'; // Plural
$lang[132] = 'minuto';
$lang[133] = 'segundos'; // Plural
$lang[134] = 'segundo';
$lang[135] = 'getCpuUsage(): N&atilde;o foi poss&iacute;vel acessar o in&iacute;cio do caminho ou come&ccedil;o de arquivo inv&aacute;lido';
$lang[136] = 'Carga da CPU';
$lang[137] = 'Ocorreu um erro';
$lang[138] = 'Selecione pelo menos um arquivo.';
$lang[139] = 'Emails';
$lang[140] = 'Enviar';
$lang[141] = 'Exclus&atilde;o de submits com sucesso';
$lang[142] = 'Dividir por partes';
$lang[143] = 'Tamanho das Partes';
$lang[144] = '<b>%1$s</b> - E-mail Inv&aacute;lido.'; // %1$s = email address
$lang[145] = 'Arquivo <b>%1$s</b> n&atilde;o &eacute; encontrado!'; // %1$s = filename
$lang[146] = 'N&atilde;o foi poss&iacute;vel atualizar a lista de arquivos!';
$lang[147] = 'Exclus&atilde;o de arquivos est&aacute; desativada';
$lang[148] = 'Excluir arquivos';
$lang[149] = 'Sim';
$lang[150] = 'N&atilde;o';
$lang[151] = 'Arquivo <b>%1$s</b> exclu&iacute;do'; // %1$s = filename
$lang[152] = 'Erro ao excluir o arquivo <b>%1$s</b>!'; // %1$s = filename
$lang[153] = 'Host';
$lang[154] = 'Porta';
$lang[155] = 'Diret&oacute;rio';
$lang[156] = 'Exclus&atilde;o do arquivo de origem ap&oacute;s o upload com sucesso';
$lang[157] = 'Salvar dados de FTP';
$lang[158] = 'Apagar dados de FTP';
$lang[159] = 'N&atilde;o &eacute; poss&iacute;vel localizar a pasta <b>%1$s</b>'; // %1$s = directory name
$lang[160] = 'Arquivo %1$s carregado com sucesso!'; // %1$s = filename
$lang[161] = 'Tempo';
$lang[162] = 'Velocidade m&eacute;dia';
$lang[163] = 'N&atilde;o foi poss&iacute;vel carregar o arquivo <b>%1$s</b>!'; // %1$s = filename
$lang[164] = 'Email';
$lang[165] = 'Exclus&atilde;o de submits com sucesso';
$lang[166] = 'E-mail Inv&aacute;lido';
$lang[167] = 'Por favor, selecione apenas o .CRC ou .001 do arquivo!';
$lang[168] = 'Por favor, selecione o arquivo .CRC!';
$lang[169] = 'Por favor, selecione o arquivo .CRC ou .001 do arquivo!';
$lang[170] = 'Realize uma verifica&ccedil;&atilde;o de CRC? (recomendado)';
$lang[171] = 'CRC32 modo de verifica&ccedil;&atilde;o';
$lang[172] = 'Use hash_file (Recomendado)';
$lang[173] = 'Ler o arquivo para a mem&oacute;ria';
$lang[174] = 'Falso crc';
$lang[175] = 'Excluir o arquivo de origem ap&oacute;s a bem sucedida jun&ccedil;&atilde;o';
$lang[176] = 'Aviso';
$lang[177] = 'O tamanho do arquivo e CRC32 n&atilde;o ser&aacute; verificado';
$lang[178] = 'N&atilde;o &eacute; poss&iacute;vel ler o arquivo .CRC!';
$lang[179] = 'Erro, arquivo de sa&iacute;da j&aacute; existe <b>%1$s</b>'; // %1$s = filename
$lang[180] = 'Erro, partes em falta ou incompletas';
$lang[181] = 'Erro, O tipo de arquivo %1$s &eacute; proibido'; // Filetype
$lang[182] = 'N&atilde;o &eacute; poss&iacute;vel abrir o arquivo de destino <b>%1$s</b>'; // %1$s = filename
$lang[183] = 'Erro ao gravar o arquivo <b>%1$s</b>!'; // %1$s = filename
$lang[184] = 'CRC32 checksum n&atilde;o corresponder!';
$lang[185] = 'Arquivo <b>%1$s</b> unido com &ecirc;xito'; // %1$s = filename
$lang[186] = 'exclu&iacute;do';
$lang[187] = 'n&atilde;o exclu&iacute;do';
$lang[188] = 'Adicionar extens&atilde;o';
$lang[189] = 'externamente';
$lang[190] = 'para';
$lang[191] = 'Renomear?';
$lang[192] = 'Cancelar';
$lang[193] = 'Erro ao renomear arquivo <b>%1$s</b>'; // %1$s = filename
$lang[194] = 'Arquivo <b>%1$s</b> foi renomeado para <b>%2$s</b>'; // %1$s = original filename %2$s = renamed filename
$lang[195] = 'Nome do Arquivo';
$lang[196] = 'Por favor, entre com o nome do arquivo!';
$lang[197] = 'Erro o arquivo n&atilde;o foi criado.';
$lang[198] = 'Arquivo %1$s foi packed'; // %1$s = filename
$lang[199] = 'Packed no arquivo <b>%1$s</b>'; // %1$s = filename
$lang[200] = 'Erro, o arquivo est&aacute; vazio.';
$lang[201] = 'Novo nome';
$lang[202] = 'N&atilde;o foi poss&iacute;vel renomear o arquivo <b>%1$s</b>!'; // %1$s = filename
$lang[203] = 'Excluir o arquivo de origem depois de dividir com sucesso';
$lang[204] = 'arquivos e pastas';
$lang[205] = 'Unzip';
$lang[206] = 'YouTube Formato de V&iacute;deo Seletor';
$lang[207] = 'Link para Baixar';
$lang[208] = 'Refer&ecirc;ncia';
$lang[209] = 'Baixar Arquivo';
$lang[210] = 'Usu&aacute;rio &amp; Senha (HTTP/FTP)';
$lang[211] = 'Usu&aacute;rio';
$lang[212] = 'Senha';
$lang[213] = 'Adicionar Coment&aacute;rios';
$lang[214] = 'Op&ccedil;&otilde;es de Plugin';
$lang[215] = 'Desabilitar Todos os Plugins';
$lang[216] = 'YouTube Formato de V&iacute;deo Seletor';
$lang[217] = 'Link direto';
$lang[218] = '&amp;fmt=';
$lang[219] = 'Auto-obter o formato de alta qualidade dispon&iacute;vel';
$lang[220] = '17 [V&iacute;deo: 3GP 176x144 | &Aacute;udio: AAC 2ch 44.10kHz]';
$lang[221] = '5 [V&iacute;deo: FLV 400x240 | &Aacute;udio: MP3 1ch 22.05kHz]';
$lang[222] = '34 [V&iacute;deo: FLV 640x360 | &Aacute;udio: AAC 2ch 44.10kHz]';
$lang[223] = '35 [V&iacute;deo: FLV 854x480 | &Aacute;udio: AAC 2ch 44.10kHz]';
$lang[224] = '43 [V&iacute;deo: WebM 640x360 | &Aacute;udio: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [V&iacute;deo: WebM 1280x720 | &Aacute;udio: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [V&iacute;deo: MP4 480x360 | &Aacute;udio: AAC 2ch 44.10kHz]';
$lang[227] = '22 [V&iacute;deo: MP4 1280x720 | &Aacute;udio: AAC 2ch 44.10kHz]';
$lang[228] = '37 [V&iacute;deo: MP4 1920x1080 | &Aacute;udio: AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; Servi&ccedil;o de Torrent';
$lang[230] = 'Usu&aacute;rio';
$lang[231] = 'Senha';
$lang[232] = 'Megaupload.com Valor de Cookie';
$lang[233] = 'Usu&aacute;rio';
$lang[234] = 'Use vBulletin Plugin';
$lang[235] = 'Valor Adicional de Cookie';
$lang[236] = 'Key=Valor';
$lang[237] = 'Enviar arquivo para E-mail';
$lang[238] = 'Email';
$lang[239] = 'Dividir Arquivos';
$lang[240] = 'M&eacute;todo';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'Tamanho das Partes';
$lang[244] = 'MB';
$lang[245] = 'Usar Configura&ccedil;&otilde;es Proxy 	';
$lang[246] = 'Proxy';
$lang[247] = 'Usu&aacute;rio';
$lang[248] = 'Senha';
$lang[249] = 'Usar Conta Premium';
$lang[250] = 'Usu&aacute;rio';
$lang[251] = 'Senha';
$lang[252] = 'Salvar Em';
$lang[253] = 'Caminho';
$lang[254] = 'Salvar Configura&ccedil;&otilde;es';
$lang[255] = 'Apagar Configura&ccedil;&atilde;o Atual';
$lang[256] = 'Marcar Todos';
$lang[257] = 'Desmarcar Todos';
$lang[258] = 'Inverter Sele&ccedil;&atilde;o';
$lang[259] = 'Mostrar';
$lang[260] = 'Baixados';
$lang[261] = 'Tudo';
$lang[262] = 'Nome';
$lang[263] = 'Tamanho';
$lang[264] = 'Coment&aacute;rios';
$lang[265] = 'Data';
$lang[266] = 'N&atilde;o foram encontrados arquivos';
$lang[267] = 'Funciona com';
$lang[268] = 'Mortos';
$lang[269] = 'Modo Depurar';
$lang[270] = 'Mostrar Apenas Links';
$lang[271] = 'Matar Apenas Links';
$lang[272] = 'Verificar Links';
$lang[273] = 'Carregando...';
$lang[274] = 'Processando, aguarde...';
$lang[275] = 'Espa&ccedil;o do Server';
$lang[276] = 'Em uso';
$lang[277] = 'Espa&ccedil;o Livre';
$lang[278] = 'Espa&ccedil;o do Disco';
$lang[279] = 'CPU';
$lang[280] = 'Hora do Server';
$lang[281] = 'Hora Local';
$lang[282] = 'Auto-Delete';
$lang[283] = 'Horas Ap&oacute;s Baixado';
$lang[284] = 'Minutos Ap&oacute;s Baixado';
$lang[285] = 'A&ccedil;&atilde;o';
$lang[286] = 'Upload';
$lang[287] = 'Arquivo FTP';
$lang[288] = 'E-Mail';
$lang[289] = 'E-mail em Massa';
$lang[290] = 'Dividir Arquivos';
$lang[291] = 'Juntar Arquivos';
$lang[292] = 'MD5 Hash';
$lang[293] = 'Pacote de Arquivos';
$lang[294] = 'ZIP Arquivos';
$lang[295] = 'Unzip Arquivos';
$lang[296] = 'Renomear';
$lang[297] = 'Adicionar extens&atilde;o';
$lang[298] = 'Excluir';
$lang[299] = 'Lista de Links';
$lang[300] = 'Recuperando p&aacute;gina de download';
$lang[301] = 'Digite';
$lang[302] = 'aqui';
$lang[303] = 'Baixar Arquivo';
$lang[304] = 'configs/files.lst n&atilde;o &eacute; grav&aacute;vel, por favor, certifique-se que &eacute; chmod para 777';
$lang[305] = '&nbsp;&eacute; selecionado como o caminho de download e n&atilde;o &eacute; grav&aacute;vel. Por favor chmod para 777';
$lang[306] = 'Juntando Arquivos';
$lang[307] = 'Esperando';
$lang[308] = 'Passou';
$lang[309] = 'Falhou';
$lang[310] = 'Voc&ecirc; pode ver os avisos sem esta ligado';
$lang[311] = 'Voc&ecirc; pode n&atilde;o ser capaz de transformar em estat&iacute;sticas do servidor';
$lang[312] = 'O servidor pode n&atilde;o ser capaz de suportar arquivos com tamanho superior a 2GB';
$lang[313] = 'Rapidleech Checker Script';
$lang[314] = 'fsockopen';
$lang[315] = 'limite de mem&oacute;ria';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'permitir url fopen';
$lang[319] = 'Vers&atilde;o do PHP &#45;';
$lang[320] = 'permitir passar tempo de perman&ecirc;ncia de refer&ecirc;ncia';
$lang[321] = 'Passar';
$lang[322] = 'Fun&ccedil;&otilde;es de Espa&ccedil;o de Disco';
$lang[323] = 'Apache vers&atilde;o &#45; ';
$lang[324] = 'Endere&ccedil;o de proxy errado';
$lang[325] = 'Arquivo salvo com sucesso!';
$lang[326] = 'Salvar Notas';
$lang[327] = 'Notas';
$lang[328] = 'A&ccedil;&otilde;es Desabilitadas';
$lang[329] = 'In&iacute;cio';
$lang[330] = 'Configura&ccedil;&otilde;es';
$lang[331] = 'Arquivos no Servidor';
$lang[332] = 'Verificador de Links';
$lang[333] = 'Plugins';
$lang[334] = 'Auto Baixar';
$lang[335] = 'Auto Enviar';
$lang[336] = 'Tamanho do arquivo &eacute; limitado a ';
$lang[337] = 'Tamanho limite do arquivo: ';
$lang[338] = 'Rar Files';
$lang[339] = 'Unrar Files';
$lang[340] = 'Erro detectado';
$lang[341] = 'Clique aqui para ampliar';
$lang[342] = 'Voc&ecirc; pode arrastar a janela daqui';
$lang[343] = 'N&atilde;o &eacute; poss&iacute;vel encontrar &quot;rar&quot;<br />Voc&ecirc; pode precisar fazer o download e extrair &quot;rar&quot; para o diret&oacute;rio &quot;/rar/&quot;';
$lang[344] = 'Os arquivos que ser&atilde;o arquivados:';
$lang[345] = 'Nome do arquivo:';
$lang[346] = 'Op&ccedil;&otilde;es:';
$lang[347] = 'N&iacute;vel de compress&atilde;o:';
$lang[348] = 'Armazenar';
$lang[349] = 'Mais r&aacute;pido';
$lang[350] = 'R&aacute;pido';
$lang[351] = 'Normal';
$lang[352] = 'Bom';
$lang[353] = '&Oacute;timo';
$lang[354] = 'Criar volumes';
$lang[355] = 'Excluir arquivos ap&oacute;s arquivamento';
$lang[356] = 'Criar arquivo s&oacute;lido';
$lang[357] = 'Criar um registro de recupera&ccedil;&atilde;o';
$lang[358] = 'Teste de arquivo ap&oacute;s a compress&atilde;o';
$lang[359] = 'Use a senha';
$lang[360] = 'Criptografar os nomes de arquivo';
$lang[361] = 'Definir o caminho dentro de arquivo';
$lang[362] = 'Rar';
$lang[363] = 'Cria&ccedil;&atilde;o do arquivo: <b>%1$s</b>';
$lang[364] = 'Aguarde...';
$lang[365] = 'Voltar para a lista de arquivos';
$lang[366] = '<b>Arquivos de %1$s</b>:';
$lang[367] = 'N&atilde;o &eacute; poss&iacute;vel encontrar "unrar"';
$lang[368] = 'Senha necess&aacute;ria para listar os arquivos:';
$lang[369] = 'Senha necess&aacute;ria para extrair os arquivos:';
$lang[370] = 'Erro:%1$s';
$lang[371] = 'Tente novamente listar';
$lang[372] = 'Unrar selecionados';
$lang[373] = '<b>Extraindo arquivos de %1$s</b>:';
$lang[374] = 'Status:';
$lang[375] = 'Selecione o texto';
$lang[376] = 'Contas Premium :';
$lang[377] = '38 [V&iacute;deo: MP4 4096x3072 | &Aacute;udio: AAC 2ch 44.10kHz]';
$lang[378] = 'Fechar a janela';
$lang[379] = 'Arquivos';
$lang[380] = 'Mudan&ccedil;a de MD5 deve ser aplicado apenas para os formatos conhecidos de trabalho (ie. rar ou. zip)<br />Voc&ecirc; quer continuar?';
$lang[381] = 'MD5 do arquivo <b>%1$s</b> alterado'; // %1$s = filename
$lang[382] = 'Erro ao alterar o MD5 do arquivo <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'MD5 mudan&ccedil;a';
$lang[384] = 'Match text';
$lang[385] = 'Match';
$lang[386] = 'Ignore caso';
$lang[387] = 'Coloque cada arquivo em um arquivo separado';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [V&iacute;deo: WebM 854x480 | &Aacute;udio: Vorbis 2ch 44.10kHz]';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// à¹à¸à¸¥à¹à¸ à¸²à¸©à¸²à¹à¸à¸¢ | à¹à¸à¸¥à¹à¸à¸¢ Jaideejung007 | THZAA.COM
// You should always use this file as a template for translating

$lang[1] = 'à¸à¸²à¸£à¹à¸à¹à¸²à¸à¸¶à¸à¸à¸¹à¸à¸à¸à¸´à¹à¸ªà¸';
$lang[2] = 'à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹à¸¡à¸µà¸à¸²à¸£à¸à¸à¸´à¹à¸ªà¸à¸à¸µà¹à¸à¸°à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£à¸à¸²à¸¡à¸à¸³à¸à¸­à¸à¸­à¸à¸à¸¸à¸';
$lang[3] = 'à¸à¸¸à¸à¹à¸¡à¹à¹à¸à¹à¸à¹à¸­à¸à¸à¸µà¹à¸­à¸¢à¸¹à¹à¸­à¸µà¹à¸¡à¸¥à¸à¸µà¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[4] = 'à¸à¸à¸²à¸à¸à¸­à¸à¸à¸´à¹à¸à¸ªà¹à¸§à¸à¸à¸µà¹à¸¢à¸±à¸à¹à¸¡à¹à¹à¸à¹à¹à¸à¹à¸à¸à¸±à¸§à¹à¸¥à¸';
$lang[5] = 'à¹à¸¡à¹à¸£à¸¹à¹à¸à¸±à¸à¸£à¸¹à¸à¹à¸à¸ URL, <span class="font-black">à¹à¸à¹à¹à¸à¸à¸²à¸°à¹à¸à¸¥à¹à¸à¸à¸­à¸¥ <span class="font-blue">http</span> à¸«à¸£à¸·à¸­ <span class="font-blue">https</span> à¸«à¸£à¸·à¸­ <span class="font-blue">ftp</span> à¹à¸à¹à¸²à¸à¸±à¹à¸</span>';
$lang[6] = 'à¹à¸¡à¹à¹à¸à¹à¸£à¸°à¸à¸¸à¹à¸ªà¹à¸à¸à¸²à¸à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸²à¸£à¸à¸±à¸à¸à¸¶à¸à¹à¸à¸¥à¹à¸à¸µà¹';
$lang[7] = 'à¸à¸¸à¸à¸¢à¸±à¸à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸­à¸à¸¸à¸à¸²à¸à¹à¸«à¹à¹à¸à¹ Leech à¸à¸²à¸ <span class="font-black">%1$s (%2$s)</span>'; // %1$s = host name %2$s = host ip
$lang[8] = 'à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸ªà¹à¸à¸à¸²à¸à¹à¸à¸¢à¸±à¸:';
$lang[9] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸­à¸±à¸à¹à¸à¸à¸£à¸²à¸¢à¸à¸·à¹à¸­à¹à¸à¸¥à¹';
$lang[10] = 'à¹à¸à¸¥à¹ <b>%1$s</b> (<b>%2$s</b>) à¸à¸±à¸à¸à¸¶à¸à¹à¸¥à¹à¸§!<br />à¹à¸§à¸¥à¸²: <b>%3$s</b><br />à¸à¸§à¸²à¸¡à¹à¸£à¹à¸§à¹à¸à¸¥à¸µà¹à¸¢: <b>%4$s KB/s</b><br />'; // %1$s = filename %2$s = filesize %3$s = time of download %4$s = speed
$lang[11] = '<script>mail("à¹à¸à¹à¸¡à¸à¸µà¹à¸à¸¹à¸à¸ªà¹à¸à¹à¸à¸¢à¸±à¸à¸à¸µà¹à¸­à¸¢à¸¹à¹à¸à¸µà¹ <b>%1$s</b>.", "%2$s");</script>'; // %1$s = E-mail address %2$s = filename
$lang[12] = 'à¸¡à¸µà¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¸£à¸°à¸«à¸§à¹à¸²à¸à¸­à¸±à¸à¹à¸«à¸¥à¸à¹à¸à¹à¸¡!';
$lang[13] = 'à¸à¸¥à¸±à¸à¹à¸à¸à¸µà¹à¸«à¸à¹à¸²à¸«à¸¥à¸±à¸';
$lang[14] = 'à¸à¸²à¸£à¹à¸à¸·à¹à¸­à¸¡à¸à¹à¸­à¸«à¸²à¸¢à¹à¸, à¹à¸à¸¥à¹à¸à¸¹à¸à¸¥à¸';
$lang[15] = 'à¸£à¸µà¹à¸«à¸¥à¸';
$lang[16] = 'à¸à¸£à¸¸à¸à¸²à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸«à¸¡à¸à¸à¸µà¸à¸±à¸à¹à¸à¹à¸ <b>1</b>';
$lang[17] = 'à¸ªà¸¹à¸à¸ªà¸¸à¸à¹à¸¡à¹à¹à¸à¸´à¸ (%1$s) à¸¥à¸´à¸à¸à¹à¸ªà¸³à¸«à¸£à¸±à¸à¹à¸à¸·à¹à¸­à¸¡à¹à¸¢à¸'; // %1$s = Number of maximum links
$lang[18] = '%1$s à¸¥à¸´à¸à¸à¹ %2$s à¸à¸£à¸§à¸à¸ªà¸­à¸à¹à¸ %3$s à¸§à¸´à¸à¸²à¸à¸µ (à¸§à¸´à¸à¸µà¸à¸²à¸£: <b>%4$s</b>)'; // %1$s = Number of links %2$s = Plural form %3$s = seconds %4$s = method for checking links
$lang[19] = ''; // End of a plural //s
$lang[20] = 'à¸à¸µà¹à¸­à¸¢à¸¹à¹à¸à¸£à¹à¸­à¸à¸à¸µà¹à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[21] = 'à¸¥à¸´à¸à¸à¹';
$lang[22] = 'à¸ªà¸à¸²à¸à¸°';
$lang[23] = 'à¸à¸³à¸¥à¸±à¸à¸£à¸­';
$lang[24] = 'URL à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[25] = 'à¸à¸³à¸¥à¸±à¸à¹à¸à¸£à¸µà¸¢à¸¡à¸à¸²à¸£';
$lang[26] = 'à¹à¸£à¸´à¹à¸¡à¸à¹à¸';
$lang[27] = 'à¸à¸²à¸£à¹à¸à¸·à¹à¸­à¸¡à¸à¹à¸­à¸«à¸²à¸¢à¹à¸';
$lang[28] = 'à¹à¸ªà¸£à¹à¸à¹à¸¥à¹à¸§';
$lang[29] = 'à¹à¸£à¸´à¹à¸¡à¸à¹à¸²à¸¢à¹à¸­à¸à¹à¸à¸¥à¹à¸­à¸­à¹à¸à¹';
$lang[30] = 'à¹à¸à¸£à¸¡à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸à¸²à¸£à¸ªà¸à¸±à¸à¸ªà¸à¸¸à¸ à¸à¸²à¸£à¸à¸£à¸±à¸à¸à¸£à¸¸à¸à¹à¸à¸£à¸²à¸§à¹à¹à¸à¸­à¸£à¹à¸à¸­à¸à¸à¸¸à¸';
$lang[31] = 'à¹à¸à¸´à¹à¸¡à¸¥à¸´à¸à¸à¹';
$lang[32] = 'à¸¥à¸´à¸à¸à¹';
$lang[33] = 'à¸à¸±à¸§à¹à¸¥à¸·à¸­à¸';
$lang[34] = 'à¸à¹à¸²à¸¢à¹à¸­à¸à¹à¸à¸¥à¹';
$lang[35] = 'à¹à¸à¹à¸à¸²à¸£à¸à¸±à¹à¸à¸à¹à¸²à¸à¸£à¹à¸­à¸à¸à¸µà¹';
$lang[36] = 'à¸à¸£à¹à¸­à¸à¸à¸µ';
$lang[37] = 'à¸à¸·à¹à¸­à¸à¸¹à¹à¹à¸à¹';
$lang[38] = 'à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸';
$lang[39] = 'à¸à¸±à¸à¸à¸µà¸à¸¹à¹à¹à¸à¹ Imageshack';
$lang[40] = 'à¸à¸±à¸à¸à¸¶à¸à¹à¸à¸¢à¸±à¸';
$lang[41] = 'à¹à¸ªà¹à¸à¸à¸²à¸';
$lang[42] = 'à¹à¸à¹à¸à¸±à¸à¸à¸µ Premium';
$lang[43] = 'à¹à¸£à¸µà¸¢à¸à¹à¸à¹à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹à¹à¸à¸à¹';
$lang[44] = 'à¸«à¸à¹à¸§à¸à¹à¸§à¸¥à¸²';
$lang[45] = 'à¸«à¸à¹à¸§à¸à¹à¸§à¸¥à¸² (à¹à¸à¹à¸ à¸§à¸´à¸à¸²à¸à¸µ)';
$lang[46] = 'à¹à¸¡à¹à¸¡à¸µà¹à¸à¸¥à¹à¸«à¸£à¸·à¸­à¹à¸®à¸ªà¸à¹à¸à¸µà¹à¹à¸¥à¸·à¸­à¸à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸²à¸£à¸­à¸±à¸à¹à¸«à¸¥à¸';
$lang[47] = 'à¹à¸¥à¸·à¸­à¸à¹à¸®à¸ªà¸à¹à¸à¸µà¹à¸à¹à¸­à¸à¸à¸²à¸£à¸­à¸±à¸à¹à¸«à¸¥à¸';
$lang[48] = 'à¹à¸¡à¹à¸ªà¸à¸±à¸à¸ªà¸à¸¸à¸à¸à¸£à¸´à¸à¸²à¸£à¸­à¸±à¸à¹à¸«à¸¥à¸!';
$lang[49] = 'à¸«à¸à¹à¸²à¸à¹à¸²à¸à¸­à¸±à¸à¹à¸«à¸¥à¸';
$lang[50] = 'à¸£à¸¹à¸à¹à¸à¸à¸à¸²à¸£à¸à¸±à¸à¸à¸¶à¸à¸¥à¸´à¸à¸à¹';
$lang[51] = 'à¸¡à¸²à¸à¸£à¸à¸²à¸';
$lang[52] = 'à¹à¸¥à¸·à¸­à¸à¸à¸±à¹à¸à¸«à¸¡à¸';
$lang[53] = 'à¸¢à¸à¹à¸¥à¸´à¸à¸à¸²à¸£à¹à¸¥à¸·à¸­à¸à¸à¸±à¹à¸à¸«à¸¡à¸';
$lang[54] = 'à¸à¸¥à¸±à¸à¸à¸²à¸£à¹à¸¥à¸·à¸­à¸';
$lang[55] = 'à¸à¸·à¹à¸­';
$lang[56] = 'à¸à¸à¸²à¸';
$lang[57] = 'à¹à¸¡à¹à¸à¸à¹à¸à¸¥à¹';
$lang[58] = 'à¸à¸³à¸­à¸à¸´à¸à¸²à¸¢à¸ªà¸³à¸«à¸£à¸±à¸à¸£à¸¹à¸à¹à¸à¸à¸à¸²à¸£à¸à¸±à¸à¸à¸¶à¸à¸¥à¸´à¸à¸à¹: (à¸à¸£à¸à¸µà¸à¸µà¹à¸¡à¸µà¸à¸§à¸²à¸¡à¸¥à¸°à¹à¸­à¸µà¸¢à¸à¸­à¹à¸­à¸)';
$lang[59] = 'à¸¥à¸´à¸à¸à¹à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸²à¸£à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸';
$lang[60] = 'à¸à¸·à¹à¸­à¹à¸à¸¥à¹';
$lang[61] = 'à¸£à¸¹à¸à¹à¸à¸à¸¥à¸´à¸à¸à¹à¸¡à¸²à¸à¸£à¸à¸²à¸';
$lang[62] = 'à¸ªà¸´à¹à¸à¸à¸µà¹à¸à¸­à¸à¹à¸«à¸à¸·à¸­à¸à¸²à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¸£à¸°à¸à¸¸à¹à¸§à¹à¸à¹à¸²à¸à¸à¹à¸à¸à¸°à¸à¸·à¸­à¸§à¹à¸²à¹à¸à¹à¸à¸ªà¸à¸£à¸´à¸, à¸à¸¸à¸à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸³à¸£à¸¹à¸à¹à¸à¸à¸«à¸¥à¸²à¸¢à¸à¸£à¸£à¸à¸±à¸à¹à¸à¸à¸à¸°à¸à¸µà¹à¸à¸£à¸£à¸à¸±à¸à¹à¸«à¸¡à¹à¸à¸°à¸à¸¹à¸à¹à¸à¸£à¸à¸ªà¸³à¸«à¸£à¸±à¸à¹à¸à¹à¸¥à¸°à¸¥à¸´à¸à¸à¹';
$lang[63] = 'à¸­à¸±à¸à¹à¸«à¸¥à¸à¹à¸à¸¥à¹ %1$s à¹à¸à¸¢à¸±à¸ %2$s'; // %1$s = filename %2$s = file host name
$lang[64] = 'à¹à¸à¸¥à¹ %1$s à¹à¸¡à¹à¸¡à¸µà¸­à¸¢à¸¹à¹'; // %1$s = filename
$lang[65] = 'à¹à¸à¸¥à¹ %1$s à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸­à¹à¸²à¸à¹à¸à¹à¹à¸à¸¢à¸ªà¸à¸£à¸´à¸à¸à¹'; // %1$s = filename
$lang[66] = 'à¸à¸à¸²à¸à¹à¸à¸¥à¹à¹à¸«à¸à¹à¹à¸à¸´à¸à¹à¸à¸à¸µà¹à¸à¸°à¸­à¸±à¸à¹à¸«à¸¥à¸à¹à¸à¸¢à¸±à¸à¹à¸®à¸ªà¸à¹';
$lang[67] = 'à¸à¸£à¸´à¸à¸²à¸£à¸­à¸±à¸à¹à¸«à¸¥à¸à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸­à¸à¸¸à¸à¸²à¸';
$lang[68] = 'à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸à¸¥à¸´à¸à¸à¹';
$lang[69] = 'à¸¥à¸à¸¥à¸´à¸à¸à¹';
$lang[70] = 'à¸ªà¸à¸´à¸à¸´à¸¥à¸´à¸à¸à¹';
$lang[71] = 'à¸à¸±à¸à¸à¸²à¸£à¸¥à¸´à¸à¸à¹';
$lang[72] = 'USER-ID';
$lang[73] = 'à¸­à¸±à¸à¹à¸«à¸¥à¸ FTP';
$lang[74] = 'à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸';
$lang[75] = 'Rapidleech PlugMod - à¸­à¸±à¸à¹à¸«à¸¥à¸à¸¥à¸´à¸à¸à¹';
$lang[76] = '<div class="linktitle">à¸­à¸±à¸à¹à¸«à¸¥à¸à¸¥à¸´à¸à¸à¹à¸ªà¸³à¸«à¸£à¸±à¸ <strong>%1$s</strong> - <span class="bluefont">à¸à¸à¸²à¸: <strong>%2$s</strong></span></div>'; // %1$s = file name %2$s = file size
$lang[77] = 'à¹à¸ªà¸£à¹à¸à¹à¸£à¸µà¸¢à¸à¸£à¹à¸­à¸¢';
$lang[78] = 'à¸¢à¹à¸­à¸à¸à¸¥à¸±à¸';
$lang[79] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¸£à¹à¸²à¸à¸à¸²à¸£à¹à¸à¸·à¹à¸­à¸¡à¸à¹à¸­à¸à¸±à¸à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹ %1$s'; // %1$s = FTP server name
$lang[80] = 'à¸à¸·à¹à¸­à¸à¸¹à¹à¹à¸à¹à¸«à¸£à¸·à¸­à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[81] = 'à¹à¸à¸·à¹à¸­à¸¡à¸à¹à¸­à¹à¸à¸¢à¸±à¸: <b>%1$s</b>...'; // %1$s = FTP server name
$lang[82] = 'à¸£à¸¹à¸à¹à¸à¸à¹à¸à¸¥à¹ %1$s à¸à¸¹à¸à¸«à¹à¸²à¸¡à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸²à¸£à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸'; // %1$s = File type
$lang[83] = 'à¹à¸à¸¥à¹ <b>%1$s</b>, à¸à¸à¸²à¸ <b>%2$s</b>...'; // %1$s = file name %2$s = file size
$lang[84] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¸£à¸±à¸à¸¥à¸´à¸à¸à¹';
$lang[85] = 'à¸à¹à¸­à¸à¸§à¸²à¸¡à¸à¹à¸²à¸à¹à¸à¹à¸à¸à¸±à¸§à¸à¸±à¸à¹à¸à¹à¸à¸ªà¸à¸£à¸´à¸!';
$lang[86] = 'à¸à¸´à¸à¸à¸¥à¸²à¸: à¸à¸£à¸¸à¸à¸²à¹à¸à¸´à¸à¹à¸à¹à¸à¸²à¸ JavaScript';
$lang[87] = 'à¹à¸à¸£à¸à¸£à¸­à¸­à¸µà¸ <b>%1$s</b> à¸§à¸´à¸à¸²à¸à¸µ...'; // %1$s = number of seconds
$lang[88] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸·à¹à¸­à¸¡à¸à¹à¸­à¹à¸à¸¢à¸±à¸ %1$s à¸à¸­à¸à¸à¸­à¸£à¹à¸ %2$s à¹à¸à¹à¹à¸à¸à¸à¸°à¸à¸µà¹'; // %1$s = host name %2$s = port
$lang[89] = 'à¹à¸à¸·à¹à¸­à¸¡à¸à¹à¸­à¹à¸à¸¢à¸±à¸à¸à¸£à¹à¸­à¸à¸à¸µà¹: <b>%1$s</b> à¸à¸­à¸à¸à¸­à¸£à¹à¸ <b>%2$s</b>...'; // %1$s = Proxy host %2$s = Proxy port
$lang[90] = 'à¸¡à¸µà¸à¸²à¸£à¹à¸à¸·à¹à¸­à¸¡à¸à¹à¸­à¹à¸à¸¢à¸±à¸: <b>%1$s</b> à¸à¸­à¸à¸à¸­à¸£à¹à¸ <b>%2$s</b>...'; // %1$s = host %2$s = port
$lang[91] = 'à¹à¸¡à¹à¸¡à¸µà¸à¸²à¸£à¸£à¸±à¸à¸ªà¹à¸§à¸à¸«à¸±à¸§';
$lang[92] = 'à¸à¸¸à¸à¸à¸¹à¸à¸«à¹à¸²à¸¡à¹à¸¡à¹à¹à¸«à¹à¹à¸à¹à¸²à¸à¸¶à¸à¸«à¸à¹à¸²à¸à¸µà¹!';
$lang[93] = 'à¹à¸¡à¹à¸à¸à¸«à¸à¹à¸² à¸à¸²à¸¡à¸à¸µà¹à¸à¸¸à¸à¸à¹à¸­à¸à¸à¸²à¸£!';
$lang[94] = 'à¸«à¸à¹à¸²à¸à¸µà¹à¸à¸¹à¸à¸«à¹à¸²à¸¡à¹à¸à¹à¸²à¸à¸¶à¸à¸«à¸£à¸·à¸­à¹à¸¡à¹à¸à¸!';
$lang[95] = 'à¸à¸´à¸à¸à¸¥à¸²à¸! à¸à¸¹à¸à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸ªà¹à¸à¸à¸²à¸à¹à¸à¸¢à¸±à¸ [%1$s]'; // %1$s = redirected address
$lang[96] = 'à¹à¸§à¹à¸à¹à¸à¸à¹à¸à¸µà¹à¸à¸°à¸à¹à¸­à¸à¹à¸à¹à¸£à¸±à¸à¸ªà¸´à¸à¸à¸´à¹ à¸ªà¸³à¸«à¸£à¸±à¸à¸à¹à¸­à¸à¹à¸à¸à¸µà¹à¸à¸­à¸à¸à¸·à¹à¸­à¸à¸¹à¹à¹à¸à¹à¹à¸¥à¸°à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¸à¸­à¸à¸à¸²à¸£à¹à¸à¹à¸²à¸à¸¶à¸à¸¡à¸µà¸à¸§à¸²à¸¡à¸à¸³à¹à¸à¹à¸à¸à¹à¸­à¸à¹à¸à¹ URL à¸à¸µà¹à¸à¸¥à¹à¸²à¸¢à¸à¸±à¸:<br />http://<b>login:password@</b>www.site.com/file.exe';
$lang[97] = 'à¹à¸à¸´à¸à¸à¸µà¸à¸à¸³à¸à¸±à¸à¸à¸²à¸£à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£à¸à¹à¸­';
$lang[98] = 'à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹à¹à¸¡à¹à¸ªà¸à¸±à¸à¸ªà¸à¸¸à¸à¸à¸²à¸£à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£à¸à¹à¸­à¸à¸µà¹';
$lang[99] = 'à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸';
$lang[100] = 'à¸à¸±à¸à¸à¸µà¸à¸­à¸à¸à¸£à¸µà¹à¸¡à¸µà¹à¸¢à¸¡à¸à¸µà¹à¸à¸°à¸à¸¹à¸à¹à¸à¹à¹à¸à¹à¸¥à¹à¸§à¸à¸±à¸à¹à¸­à¸à¸µà¸­à¸·à¹à¸.';
$lang[101] = 'à¹à¸à¸¥à¹ %1$s à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸±à¸à¸à¸¶à¸à¹à¸à¹à¸à¹à¸£à¸à¸à¸­à¸£à¸µ %2$s'; // %1$s = file name %2$s = directory name
$lang[102] = 'à¸¥à¸­à¸ chmod à¹à¸à¸¥à¹à¸à¸­à¸£à¹à¹à¸à¹à¸ 777.';
$lang[103] = 'à¸¥à¸­à¸à¸­à¸µà¸à¸à¸£à¸±à¹à¸';
$lang[104] = 'à¹à¸à¸¥à¹';
$lang[105] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£à¸à¸±à¸à¸à¸¶à¸à¸¥à¸à¹à¸à¹à¸à¹à¸¡ %1$s'; // %1$s = file name
$lang[106] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸ URL à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸à¸«à¸£à¸·à¸­à¹à¸¡à¹à¸à¸£à¸²à¸à¸ªà¸²à¹à¸«à¸à¸¸';
$lang[107] = 'à¸à¸¸à¸à¸à¸¶à¸à¸à¸µà¸à¸à¸³à¸à¸±à¸à¸ªà¸³à¸«à¸£à¸±à¸ à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸µ';
$lang[108] = 'à¹à¸à¸ªà¸à¸±à¹à¸à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸à¹à¸à¹à¸«à¸¡à¸à¸­à¸²à¸¢à¸¸à¹à¸¥à¹à¸§';
$lang[109] = 'à¸£à¸«à¸±à¸ªà¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[110] = 'à¸à¸¸à¸à¹à¸à¹à¹à¸ªà¹à¸£à¸«à¸±à¸ªà¸à¸´à¸à¸«à¸¥à¸²à¸¢à¸à¸£à¸±à¹à¸à¹à¸à¸´à¸à¹à¸';
$lang[111] = 'à¸à¸³à¸à¸±à¸à¸à¸²à¸£à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸à¹à¸à¸´à¸';
$lang[112] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¸­à¹à¸²à¸à¸à¹à¸­à¸¡à¸¹à¸¥';
$lang[113] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¸ªà¹à¸à¸à¹à¸­à¸¡à¸¹à¸¥';
$lang[114] = 'à¹à¸à¹à¸à¸²à¸';
$lang[115] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¹à¸à¸²à¸';
$lang[116] = 'Dead';
$lang[117] = 'à¸à¸¸à¸à¸à¸³à¹à¸à¹à¸à¸à¹à¸­à¸à¹à¸«à¸¥à¸/à¹à¸à¸´à¸à¹à¸à¹à¸ªà¹à¸§à¸à¸à¸¢à¸²à¸¢à¸à¸­à¸ cURL (http://www.php.net/cURL) à¸«à¸£à¸·à¸­à¸à¸¸à¸à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸±à¹à¸à¸à¹à¸²à¹à¸à¹à¸ \'fgc\' => 1 in config.php.';
$lang[118] = 'cURL à¸à¸¹à¸à¹à¸à¸´à¸à¹à¸à¹à¸à¸²à¸';
$lang[119] = 'PHP version 5 à¸à¸­à¹à¸à¸°à¸à¸³à¹à¸«à¹à¹à¸à¹ à¹à¸¡à¹à¸§à¹à¸²à¸à¸°à¹à¸¡à¹à¸à¸±à¸à¸à¸±à¸à¸à¹à¸à¸²à¸¡';
$lang[120] = 'à¸à¸£à¸§à¸à¸ªà¸­à¸à¸§à¹à¸² safe mode à¸à¸­à¸à¸à¸¸à¸à¸à¸¹à¸à¸à¸´à¸à¹à¸à¹à¸à¸ªà¸à¸£à¸´à¸à¸à¹à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸³à¸à¸²à¸à¸à¸±à¸ safe mode à¹à¸à¸ªà¸à¸²à¸à¸° on';
$lang[121] = 'à¸ªà¹à¸à¹à¸à¸¥à¹ <b>%1$s</b>'; // %1$s = filename
$lang[122] = 'à¹à¸¡à¹à¸à¹à¸­à¸à¸¡à¸µà¸à¸²à¸£à¹à¸à¹à¸à¹à¸à¸¥à¹, à¸ªà¹à¸à¸à¸à¸«à¸¡à¸²à¸¢à¹à¸à¸à¹à¸à¸µà¹à¸¢à¸§';
$lang[123] = 'à¹à¸à¹à¸à¸à¸à¸²à¸à¸à¸²à¸£à¹à¸à¹à¸à¸¥à¹à¸­à¸­à¸à¹à¸à¹à¸ %1$s'; // %1$s = part size
$lang[124] = 'à¸§à¸´à¸à¸µà¸à¸²à¸£';
$lang[125] = 'à¸ªà¹à¸à¸à¸²à¸£à¹à¸à¹à¸à¸¥à¹ <b>%1$s</b>'; //%1$s = part number
$lang[126] = 'à¹à¸¡à¹à¸à¹à¸­à¸à¸¡à¸µà¸à¸²à¸£à¹à¸à¹à¸à¹à¸à¸¥à¹, à¸ªà¹à¸à¸à¸à¸«à¸¡à¸²à¸¢à¹à¸à¸à¹à¸à¸µà¹à¸¢à¸§';
$lang[127] = 'à¹à¸à¸¥à¹à¹à¸®à¸ªà¸à¹à¹à¸¡à¹à¸à¸';
$lang[128] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¸£à¹à¸²à¸à¹à¸à¸¥à¹à¹à¸à¹à¸®à¸ªà¸à¹à¹à¸à¹';
$lang[129] = 'à¸à¸±à¹à¸§à¹à¸¡à¸'; // Plural
$lang[130] = 'à¸à¸±à¹à¸§à¹à¸¡à¸';
$lang[131] = 'à¸à¸²à¸à¸µ'; // Plural
$lang[132] = 'à¸à¸²à¸à¸µ';
$lang[133] = 'à¸§à¸´à¸à¸²à¸à¸µ'; // Plural
$lang[134] = 'à¸§à¸´à¸à¸²à¸à¸µ';
$lang[135] = 'getCpuUsage(): à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¹à¸²à¸à¸¶à¸à¹à¸à¸¥à¹à¹à¸ªà¹à¸à¸à¸²à¸ STAT à¸«à¸£à¸·à¸­ STAT à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[136] = 'à¹à¸«à¸¥à¸ CPU';
$lang[137] = 'à¹à¸à¸´à¸à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸';
$lang[138] = 'à¹à¸¥à¸·à¸­à¸à¸­à¸¢à¹à¸²à¸à¸à¹à¸­à¸¢à¸«à¸à¸¶à¹à¸à¹à¸à¹à¸¡';
$lang[139] = 'à¸­à¸µà¹à¸¡à¸¥à¹';
$lang[140] = 'à¸ªà¹à¸';
$lang[141] = 'à¸¥à¸à¹à¸à¸¥à¹à¸à¸µà¹à¸ªà¹à¸à¹à¸ªà¸£à¹à¸';
$lang[142] = 'à¹à¸¢à¸à¸à¸´à¹à¸à¸ªà¹à¸§à¸';
$lang[143] = 'à¹à¸¢à¸à¸­à¸­à¸à¹à¸à¹à¸à¸ªà¹à¸§à¸à¹ à¸¥à¸°';
$lang[144] = '<b>%1$s</b> - à¸à¸µà¹à¸­à¸¢à¸¹à¹ E-mail à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸'; // %1$s = email address
$lang[145] = 'à¹à¸à¸¥à¹ <b>%1$s</b> à¹à¸¡à¹à¸à¸!'; // %1$s = filename
$lang[146] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸­à¸±à¸à¹à¸à¸à¸£à¸²à¸¢à¸à¸·à¹à¸­à¹à¸à¹à¸¡!';
$lang[147] = 'à¸à¸²à¸£à¸¥à¸à¹à¸à¸¥à¹à¸à¸¹à¸à¸à¸´à¸à¹à¸à¹à¸à¸²à¸';
$lang[148] = 'à¸¥à¸à¹à¸à¸¥à¹';
$lang[149] = 'à¹à¸à¹';
$lang[150] = 'à¹à¸¡à¹';
$lang[151] = 'à¹à¸à¸¥à¹ <b>%1$s</b> à¸à¸¹à¸à¸¥à¸à¹à¸¥à¹à¸§'; // %1$s = filename
$lang[152] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¸¥à¸à¹à¸à¸¥à¹ <b>%1$s</b>!'; // %1$s = filename
$lang[153] = 'à¹à¸®à¸ªà¸à¹';
$lang[154] = 'à¸à¸­à¸£à¹à¸';
$lang[155] = 'à¹à¸à¹à¸£à¸·à¸à¸à¸£à¸­à¸£à¸µà¹';
$lang[156] = 'à¸¥à¸à¸à¸µà¹à¸¡à¸²à¸à¸­à¸à¹à¸à¸¥à¹à¸«à¸¥à¸±à¸à¸à¸²à¸à¸­à¸±à¸à¹à¸«à¸¥à¸à¸ªà¸³à¹à¸£à¹à¸à¹à¸¥à¹à¸§';
$lang[157] = 'à¸à¸±à¸à¸à¸¶à¸à¸à¹à¸­à¸¡à¸¹à¸¥ FTP';
$lang[158] = 'à¸¥à¸à¸à¹à¸­à¸¡à¸¹à¸¥ FTP';
$lang[159] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸£à¸°à¸à¸¸à¸à¸³à¹à¸«à¸à¹à¸à¹à¸à¸¥à¹à¸à¸­à¸£à¹ <b>%1$s</b>'; // %1$s = directory name
$lang[160] = 'à¹à¸à¸¥à¹ %1$s à¸­à¸±à¸à¹à¸«à¸¥à¸à¸ªà¸³à¹à¸£à¹à¸à¹à¸¥à¹à¸§!'; // %1$s = filename
$lang[161] = 'à¹à¸§à¸¥à¸²';
$lang[162] = 'à¸à¸§à¸²à¸¡à¹à¸£à¹à¸§à¹à¸à¸¥à¸µà¹à¸¢';
$lang[163] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸­à¸±à¸à¹à¸«à¸¥à¸à¹à¸à¸¥à¹ <b>%1$s</b>!'; // %1$s = filename
$lang[164] = 'à¸­à¸µà¹à¸¡à¸¥à¹';
$lang[165] = 'à¸¥à¸à¹à¸à¸¥à¹à¸à¸µà¹à¸ªà¹à¸à¸ªà¸³à¹à¸£à¹à¸à¹à¸¥à¹à¸§';
$lang[166] = 'à¸à¸µà¹à¸­à¸¢à¸¹à¹ E-mail à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[167] = 'à¹à¸à¸£à¸à¹à¸¥à¸·à¸­à¸à¹à¸à¸¥à¹ .crc à¸«à¸£à¸·à¸­ .001 à¹à¸à¹à¸²à¸à¸±à¹à¸!';
$lang[168] = 'à¹à¸à¸£à¸à¹à¸¥à¸·à¸­à¸à¹à¸à¸¥à¹ .crc à¹à¸à¹à¸²à¸à¸±à¹à¸!';
$lang[169] = 'à¹à¸à¸£à¸à¹à¸¥à¸·à¸­à¸à¹à¸à¸¥à¹ .crc à¸«à¸£à¸·à¸­ .001 à¹à¸à¹à¸²à¸à¸±à¹à¸!';
$lang[170] = 'à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£à¸à¸£à¸§à¸à¸ªà¸­à¸ CRC? (à¹à¸à¸°à¸à¸³)';
$lang[171] = 'à¹à¸«à¸¡à¸à¸à¸²à¸£à¸à¸£à¸§à¸à¸ªà¸­à¸ CRC32';
$lang[172] = 'à¹à¸à¹ hash_file (à¹à¸à¸°à¸à¸³)';
$lang[173] = 'à¸­à¹à¸²à¸à¹à¸à¸¥à¹à¹à¸à¸¢à¸±à¸à¸«à¸à¹à¸§à¸¢à¸à¸§à¸²à¸¡à¸à¸³';
$lang[174] = 'à¸à¸¥à¸­à¸¡ crc';
$lang[175] = 'à¸¥à¸à¸à¸µà¹à¸¡à¸²à¹à¸à¸¥à¹à¸«à¸¥à¸±à¸à¸à¸²à¸à¸£à¸§à¸¡à¹à¸à¸¥à¹à¸ªà¸³à¹à¸£à¹à¸à¹à¸¥à¹à¸§';
$lang[176] = 'à¸à¸£à¸°à¸à¸²à¸¨';
$lang[177] = 'à¸à¸à¸²à¸à¸à¸­à¸à¹à¸à¸¥à¹à¹à¸¥à¸° crc32 à¸à¸°à¹à¸¡à¹à¸à¸£à¸§à¸à¸ªà¸­à¸';
$lang[178] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸­à¹à¸²à¸à¹à¸à¸¥à¹ .crc!';
$lang[179] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸, à¸à¸¥à¸²à¸¢à¸à¸²à¸à¹à¸à¸¥à¹ <b>%1$s</b> à¸¡à¸µà¸­à¸¢à¸¹à¹à¹à¸¥à¹à¸§'; // %1$s = filename
$lang[180] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸, à¸«à¸£à¸·à¸­à¹à¸¡à¹à¸ªà¸¡à¸à¸¹à¸£à¸à¹à¸ªà¹à¸§à¸à¸à¸²à¸£à¹à¸à¸à¸µà¹à¸à¸²à¸à¸«à¸²à¸¢à¹à¸';
$lang[181] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸, à¸£à¸¹à¸à¹à¸à¸à¹à¸à¸¥à¹ %1$s à¸à¸¹à¸à¸«à¹à¸²à¸¡à¹à¸à¹à¸²à¹à¸à¹'; // Filetype
$lang[182] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸´à¸à¹à¸à¹à¸¡à¸à¸¥à¸²à¸¢à¸à¸²à¸ <b>%1$s</b>'; // %1$s = filename
$lang[183] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¹à¸à¸µà¸¢à¸à¹à¸à¸¥à¹ <b>%1$s</b>!'; // %1$s = filename
$lang[184] = 'CRC32 checksum à¹à¸¡à¹à¸à¸£à¸à¸à¸±à¸!';
$lang[185] = 'à¹à¸à¸¥à¹ <b>%1$s</b> à¸£à¸§à¸¡à¹à¸à¸¥à¹à¹à¸£à¸µà¸¢à¸à¸£à¹à¸­à¸¢à¹à¸¥à¹à¸§'; // %1$s = filename
$lang[186] = 'à¸¥à¸à¹à¸¥à¹à¸§';
$lang[187] = 'à¹à¸¡à¹à¸à¸¹à¸à¸¥à¸';
$lang[188] = 'à¹à¸à¸´à¹à¸¡à¸ªà¹à¸§à¸à¸à¸¢à¸²à¸¢';
$lang[189] = 'à¹à¸¡à¹à¸¡à¸µ';
$lang[190] = 'à¹à¸à¸¢à¸±à¸';
$lang[191] = 'à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸·à¹à¸­?';
$lang[192] = 'à¸¢à¸à¹à¸¥à¸´à¸';
$lang[193] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸·à¹à¸­à¹à¸à¸¥à¹ <b>%1$s</b>'; // %1$s = filename
$lang[194] = 'à¹à¸à¸¥à¹ <b>%1$s</b> à¹à¸à¹à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸·à¹à¸­à¹à¸à¹à¸ <b>%2$s</b>'; // %1$s = original filename %2$s = renamed filename
$lang[195] = 'à¸à¸·à¹à¸­à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸';
$lang[196] = 'à¸à¸£à¸¸à¸à¸²à¹à¸ªà¹à¸à¸·à¹à¸­à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸!';
$lang[197] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸à¸¢à¸±à¸à¹à¸¡à¹à¹à¸à¹à¸ªà¸£à¹à¸²à¸';
$lang[198] = 'à¹à¸à¸¥à¹ %1$s à¸à¸¹à¸à¸à¸µà¸à¸­à¸±à¸à¹à¸¥à¹à¸§'; // %1$s = filename
$lang[199] = 'à¸à¸£à¸£à¸à¸¸à¹à¸à¹à¸à¹à¸¡à¸à¸µà¸à¸­à¸±à¸ <b>%1$s</b>'; // %1$s = filename
$lang[200] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸ à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸à¹à¸à¸¥à¹à¸²';
$lang[201] = 'à¸à¸·à¹à¸­à¹à¸«à¸¡à¹';
$lang[202] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸·à¹à¸­à¹à¸à¸¥à¹ <b>%1$s</b>!'; // %1$s = filename
$lang[203] = 'à¸¥à¸à¹à¸à¸¥à¹à¸à¹à¸à¸à¸à¸±à¸à¸«à¸¥à¸±à¸à¸à¸²à¸à¹à¸à¹à¸à¹à¸à¸¥à¹à¸ªà¸³à¹à¸£à¹à¸à¹à¸¥à¹à¸§';
$lang[204] = 'à¹à¸à¸¥à¹à¹à¸¥à¸°à¹à¸à¸¥à¹à¸à¸­à¸£à¹';
$lang[205] = 'à¸à¸¥à¸²à¸¢à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸';
$lang[206] = 'à¹à¸¥à¸·à¸­à¸à¸£à¸¹à¸à¹à¸à¸à¸§à¸µà¸à¸µà¹à¸­ YouTube';
$lang[207] = 'à¸à¸£à¸­à¸à¸à¸µà¹à¸­à¸¢à¸¹à¹à¸¥à¸´à¸à¸à¹à¸ªà¸³à¸«à¸£à¸±à¸à¸à¹à¸²à¸¢à¹à¸­à¸à¹à¸à¸¥à¹ <a href="http://www.thzaa.com" target="_blank"><font color=#FFFFFF>THZAA.COM</font></a>';
$lang[208] = 'à¸à¸£à¸­à¸à¸à¸µà¹à¸­à¸¢à¸¹à¹à¸¥à¸´à¸à¸à¹à¸­à¹à¸²à¸à¸­à¸´à¸';
$lang[209] = 'à¹à¸£à¸´à¹à¸¡à¸à¹à¸²à¸¢à¹à¸­à¸à¹à¸à¸¥à¹';
$lang[210] = 'à¸à¸¹à¹à¹à¸à¹ &amp; à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸ (HTTP/FTP)';
$lang[211] = 'à¸à¸¹à¹à¹à¸à¹';
$lang[212] = 'à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸';
$lang[213] = 'à¹à¸à¸´à¹à¸¡à¸à¸§à¸²à¸¡à¸à¸´à¸à¹à¸«à¹à¸';
$lang[214] = 'à¸à¸±à¸§à¹à¸¥à¸·à¸­à¸à¸à¸±à¸§à¹à¸ªà¸£à¸´à¸¡';
$lang[215] = 'à¸à¸´à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸à¸à¸±à¸§à¹à¸ªà¸£à¸´à¸¡à¸à¸±à¹à¸à¸«à¸¡à¸';
$lang[216] = 'à¹à¸¥à¸·à¸­à¸à¸£à¸¹à¸à¹à¸à¸à¸§à¸µà¸à¸µà¹à¸­ YouTube';
$lang[217] = 'à¸¥à¸´à¸à¸à¹à¹à¸à¸¢à¸à¸£à¸';
$lang[218] = '&amp;fmt=';
$lang[219] = 'à¸£à¸±à¸à¸£à¸¹à¸à¹à¸à¸à¸à¸µà¹à¸¡à¸µà¸à¸¸à¸à¸ à¸²à¸à¸ªà¸¹à¸à¸ªà¸¸à¸à¹à¸à¸¢à¸­à¸±à¸à¹à¸à¸¡à¸±à¸à¸´';
$lang[220] = '17 [à¸§à¸µà¸à¸µà¹à¸­: 3GP 176x144 | à¸­à¸­à¸à¸´à¹à¸­: AAC 2ch 44.10kHz]';
$lang[221] = '5 [à¸§à¸µà¸à¸µà¹à¸­: FLV 400x240 | à¸­à¸­à¸à¸´à¹à¸­: MP3 1ch 22.05kHz]';
$lang[222] = '34 [à¸§à¸µà¸à¸µà¹à¸­: FLV 640x360 | à¸­à¸­à¸à¸´à¹à¸­: AAC 2ch 44.10kHz]';
$lang[223] = '35 [à¸§à¸µà¸à¸µà¹à¸­: FLV 854x480 | à¸­à¸­à¸à¸´à¹à¸­: AAC 2ch 44.10kHz]';
$lang[224] = '43 [à¸§à¸µà¸à¸µà¹à¸­: WebM 640x360 | à¸­à¸­à¸à¸´à¹à¸­: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [à¸§à¸µà¸à¸µà¹à¸­: WebM 1280x720 | à¸­à¸­à¸à¸´à¹à¸­: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [à¸§à¸µà¸à¸µà¹à¸­: MP4 480x360 | à¸­à¸­à¸à¸´à¹à¸­: AAC 2ch 44.10kHz]';
$lang[227] = '22 [à¸§à¸µà¸à¸µà¹à¸­: MP4 1280x720 | à¸­à¸­à¸à¸´à¹à¸­: AAC 2ch 44.10kHz]';
$lang[228] = '37 [à¸§à¸µà¸à¸µà¹à¸­: MP4 1920x1080 | à¸­à¸­à¸à¸´à¹à¸­: AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; TorrentService';
$lang[230] = 'à¸à¸·à¹à¸­à¸à¸¹à¹à¹à¸à¹';
$lang[231] = 'à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸';
$lang[232] = 'Megaupload.com Cookie Value';
$lang[233] = 'à¸à¸¹à¹à¹à¸à¹';
$lang[234] = 'Use vBulletin Plugin';
$lang[235] = 'Additional Cookie Value';
$lang[236] = 'Key=Value';
$lang[237] = 'à¸ªà¹à¸à¹à¸à¸¥à¹à¹à¸à¸¢à¸±à¸à¸­à¸µà¹à¸¡à¸¥à¹';
$lang[238] = 'à¸­à¸µà¹à¸¡à¸¥';
$lang[239] = 'à¹à¸¢à¸à¹à¸à¸¥à¹';
$lang[240] = 'à¸§à¸´à¸à¸µà¸à¸²à¸£';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'à¸à¸à¸²à¸à¸à¸²à¸£à¹à¸';
$lang[244] = 'MB';
$lang[245] = 'à¹à¸à¹à¸à¸²à¸£à¸à¸±à¹à¸à¸à¹à¸²à¸à¸£à¹à¸­à¸à¸à¸µà¹';
$lang[246] = 'à¸à¸£à¹à¸­à¸à¸à¸µà¹';
$lang[247] = 'à¸à¸·à¹à¸­à¸à¸¹à¹à¹à¸à¹';
$lang[248] = 'à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸';
$lang[249] = 'à¹à¸à¹à¸à¸±à¸à¸à¸µà¸à¸£à¸µà¹à¸¡à¸µà¸¢à¸¡';
$lang[250] = 'à¸à¸·à¹à¸­à¸à¸¹à¹à¹à¸à¹';
$lang[251] = 'à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸';
$lang[252] = 'à¸à¸±à¸à¸à¸¶à¸à¹à¸à¸¢à¸±à¸';
$lang[253] = 'à¹à¸ªà¹à¸à¸à¸²à¸';
$lang[254] = 'à¸à¸±à¸à¸à¸¶à¸à¸à¸²à¸£à¸à¸±à¹à¸à¸à¹à¸²';
$lang[255] = 'à¸¥à¹à¸²à¸à¸à¸²à¸£à¸à¸±à¹à¸à¸à¹à¸²à¸à¸±à¸à¸à¸¸à¸à¸±à¸';
$lang[256] = 'à¹à¸¥à¸·à¸­à¸à¸à¸±à¹à¸à¸«à¸¡à¸';
$lang[257] = 'à¸¢à¸à¹à¸¥à¸´à¸à¸à¸²à¸£à¹à¸¥à¸·à¸­à¸à¸à¸±à¹à¸à¸«à¸¡à¸';
$lang[258] = 'à¸à¸¥à¸±à¸à¸à¸²à¸£à¹à¸¥à¸·à¸­à¸';
$lang[259] = 'à¹à¸ªà¸à¸';
$lang[260] = 'à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸';
$lang[261] = 'à¸à¸¸à¸à¸­à¸¢à¹à¸²à¸';
$lang[262] = 'à¸à¸·à¹à¸­';
$lang[263] = 'à¸à¸à¸²à¸';
$lang[264] = 'à¸à¹à¸­à¸à¸´à¸à¹à¸«à¹à¸';
$lang[265] = 'à¸§à¸±à¸';
$lang[266] = 'à¹à¸¡à¹à¸à¸à¹à¸à¸¥à¹';
$lang[267] = 'à¸à¸³à¸à¸²à¸à¸£à¹à¸§à¸¡à¸à¸±à¸';
$lang[268] = 'à¸à¸³à¸à¸±à¸';
$lang[269] = 'à¹à¸«à¸¡à¸à¸à¸µà¸à¸±à¸';
$lang[270] = 'à¹à¸ªà¸à¸à¸¥à¸´à¸à¸à¹à¹à¸à¹à¸²à¸à¸±à¹à¸';
$lang[271] = 'à¸à¸³à¸à¸±à¸à¸¥à¸´à¸à¸à¹à¹à¸à¹à¸²à¸à¸±à¹à¸';
$lang[272] = 'à¸à¸£à¸§à¸à¸ªà¸­à¸à¸¥à¸´à¸à¸à¹';
$lang[273] = 'à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...';
$lang[274] = 'à¸à¸³à¸¥à¸±à¸à¸à¸£à¸°à¸¡à¸§à¸¥à¸à¸¥ à¹à¸à¸£à¸à¸£à¸­à¸ªà¸±à¸à¸à¸£à¸¹à¹...';
$lang[275] = 'à¸à¸·à¹à¸à¸à¸µà¹à¸§à¹à¸²à¸à¸à¸à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹';
$lang[276] = 'à¹à¸à¹à¹à¸';
$lang[277] = 'à¹à¸«à¸¥à¸·à¸­à¸­à¸¢à¸¹à¹';
$lang[278] = 'à¸à¸´à¸ªà¸à¹à¸à¸±à¹à¸à¸«à¸¡à¸';
$lang[279] = 'CPU';
$lang[280] = 'à¹à¸§à¸¥à¸²à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹';
$lang[281] = 'à¹à¸§à¸¥à¸²à¸à¹à¸­à¸à¸à¸´à¹à¸';
$lang[282] = 'à¸¥à¸à¸­à¸±à¸à¹à¸à¸¡à¸±à¸à¸´';
$lang[283] = 'à¸à¸±à¹à¸§à¹à¸¡à¸à¸«à¸¥à¸±à¸à¸à¸²à¸à¸à¹à¸²à¸¢à¹à¸­à¸à¹à¸à¸¥à¹';
$lang[284] = 'à¸à¸²à¸à¸µà¸«à¸¥à¸±à¸à¸à¸²à¸à¸à¹à¸²à¸¢à¹à¸­à¸à¹à¸à¸¥à¹';
$lang[285] = 'à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£';
$lang[286] = 'à¸­à¸±à¸à¹à¸«à¸¥à¸à¸à¸¶à¹à¸ à¹à¸§à¹à¸à¸à¸²à¸à¹à¸à¸¥à¹';
$lang[287] = 'à¸­à¸±à¸à¹à¸«à¸¥à¸à¸à¸¶à¹à¸ FTP';
$lang[288] = 'à¸­à¸±à¸à¹à¸«à¸¥à¸à¸à¸¶à¹à¸ à¸­à¸µà¹à¸¡à¸¥à¹';
$lang[289] = 'à¸­à¸±à¸à¹à¸«à¸¥à¸à¸à¸¶à¹à¸ à¸­à¸µà¹à¸¡à¸¥à¹à¸à¸£à¹à¸­à¸¡à¸à¸±à¸';
$lang[290] = 'à¹à¸¢à¸à¹à¸à¸¥à¹';
$lang[291] = 'à¸£à¸§à¸¡à¹à¸à¸¥à¹';
$lang[292] = 'MD5 Hash';
$lang[293] = 'à¸à¸µà¸à¸­à¸±à¸à¹à¸à¸¥à¹';
$lang[294] = 'à¸à¸µà¸à¸­à¸±à¸à¹à¸à¸¥à¹ ZIP';
$lang[295] = 'à¹à¸à¸à¹à¸à¸¥à¹ ZIP';
$lang[296] = 'à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸·à¹à¸­';
$lang[297] = 'à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸·à¹à¸­à¸à¸£à¹à¸­à¸¡à¸à¸±à¸';
$lang[298] = 'à¸¥à¸';
$lang[299] = 'à¸ªà¸£à¹à¸²à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸¥à¸´à¸à¸à¹';
$lang[300] = 'à¹à¸£à¸µà¸¢à¸à¸«à¸à¹à¸²à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸';
$lang[301] = 'à¸à¸£à¸­à¸';
$lang[302] = 'à¸à¸µà¹à¸à¸µà¹';
$lang[303] = 'à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸à¹à¸à¸¥à¹';
$lang[304] = 'configs/files.lst à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸µà¸¢à¸à¹à¸à¹à¹à¸à¸£à¸à¸à¸£à¸§à¸à¸ªà¸­à¸à¸§à¹à¸² chmod à¹à¸à¹à¸ 777';
$lang[305] = '&nbsp;à¸à¸¹à¸à¹à¸¥à¸·à¸­à¸à¹à¸à¹à¸à¹à¸ªà¹à¸à¸à¸²à¸à¸à¸²à¸£à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸à¸à¸­à¸à¸à¸¸à¸à¹à¸¥à¸°à¸à¸°à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸µà¸¢à¸à¹à¸à¹ à¸à¸£à¸¸à¸à¸² chmod à¹à¸à¹à¸ 777';
$lang[306] = 'à¸à¸³à¸¥à¸±à¸à¸£à¸§à¸¡à¹à¸à¸¥à¹';
$lang[307] = 'à¸£à¸­';
$lang[308] = 'à¸à¹à¸²à¸à¹à¸¥à¹à¸§';
$lang[309] = 'à¸¥à¹à¸¡à¹à¸«à¸¥à¸§';
$lang[310] = 'à¸à¸¸à¸à¸­à¸²à¸à¸à¸°à¹à¸«à¹à¸à¸à¸³à¹à¸à¸·à¸­à¸à¸à¸µà¹à¹à¸à¹à¹à¸à¸¢à¹à¸¡à¹à¸à¹à¸­à¸à¹à¸à¸´à¸';
$lang[311] = 'à¸à¸¸à¸à¹à¸¡à¹à¸­à¸²à¸à¸à¸°à¹à¸à¸´à¸à¸à¸¹à¸à¹à¸­à¸¡à¸¹à¸¥ Server';
$lang[312] = 'à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹à¸à¸­à¸à¸à¸¸à¸à¸­à¸²à¸à¸à¸°à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸£à¸­à¸à¸£à¸±à¸à¹à¸à¸¥à¹à¸¡à¸²à¸à¸à¸§à¹à¸² 2 GB';
$lang[313] = 'à¸à¸£à¸§à¸à¸ªà¸­à¸à¸ªà¸à¸£à¸´à¸à¸à¹ Rapidleech';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'à¹à¸§à¸­à¸£à¹à¸à¸±à¸ PHP - ';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'à¸à¸±à¸à¸à¹à¸à¸±à¹à¸à¸à¸·à¹à¸à¸à¸µà¹à¸à¸´à¸ªà¸à¹';
$lang[323] = 'à¹à¸§à¸­à¸£à¹à¸à¸±à¸ Apache - ';
$lang[324] = 'à¸à¸£à¸­à¸à¸à¸µà¹à¸­à¸¢à¸¹à¹à¸à¸£à¹à¸­à¸à¸à¸µà¹à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸­à¸';
$lang[325] = 'à¸à¸±à¸à¸à¸¶à¸à¹à¸à¸¥à¹ à¸ªà¸³à¹à¸£à¹à¸à¹à¸¥à¹à¸§!';
$lang[326] = 'à¸à¸±à¸à¸à¸¶à¸à¸à¸±à¸§à¸à¹à¸§à¸¢à¸à¸³';
$lang[327] = 'Notes';
$lang[328] = 'à¸à¸²à¸£à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£à¸à¸´à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸';
$lang[329] = 'à¸«à¸à¹à¸²à¸à¹à¸²à¸à¸«à¸¥à¸±à¸';
$lang[330] = 'à¸à¸²à¸£à¸à¸±à¹à¸à¸à¹à¸²';
$lang[331] = 'à¹à¸à¸¥à¹à¹à¸à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸­à¸£à¹';
$lang[332] = 'à¸à¸£à¸§à¸à¸ªà¸­à¸à¸¥à¸´à¸à¸à¹';
$lang[333] = 'Plugins';
$lang[334] = 'à¸à¹à¸²à¸¢à¹à¸­à¸à¹à¸à¸¥à¹à¸­à¸­à¹à¸à¹';
$lang[335] = 'à¸­à¸±à¸à¹à¸«à¸¥à¸à¸­à¸­à¹à¸à¹';
$lang[336] = 'à¸à¸à¸²à¸à¸à¸­à¸à¹à¸à¸¥à¹à¸à¸°à¸à¸¹à¸à¸à¸³à¸à¸±à¸à¹à¸§à¹à¸à¸µà¹ ';
$lang[337] = 'à¸à¸µà¸à¸à¸³à¸à¸±à¸à¸à¸­à¸à¸à¸à¸²à¸à¹à¸à¸¥à¹: ';
$lang[338] = 'à¹à¸à¸¥à¹ Rar';
$lang[339] = 'à¸à¸¥à¸²à¸¢à¹à¸à¸¥à¹ Rar';
$lang[340] = 'à¸à¸£à¸§à¸à¸à¸à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸';
$lang[341] = 'à¸à¸¥à¸´à¸à¸à¸µà¹à¸à¸µà¹à¹à¸à¸·à¹à¸­à¸à¸¢à¸²à¸¢';
$lang[342] = 'à¸à¸¸à¸à¸ªà¸²à¸¡à¸²à¸£à¸à¸¥à¸²à¸à¸«à¸à¹à¸²à¸à¹à¸²à¸à¹à¸à¹à¸à¸²à¸à¸à¸µà¹à¸à¸µà¹';
$lang[343] = 'à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¹à¸à¸«à¸² "rar"<br />à¸à¸¸à¸à¸­à¸²à¸à¸à¸³à¹à¸à¹à¸à¸à¹à¸­à¸à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸à¹à¸¥à¸°à¸à¸¥à¸²à¸¢à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸ "rar" à¹à¸à¸¢à¸±à¸à¹à¸à¸¥à¹à¸à¸­à¸£à¹ "/rar/"';
$lang[344] = 'à¹à¸à¸¥à¹à¸à¸µà¹à¸à¸°à¸à¸¹à¸à¸à¸µà¸à¸­à¸±à¸à¹à¸§à¹:';
$lang[345] = 'à¸à¸·à¹à¸­à¹à¸à¸¥à¹à¸à¸±à¸à¸­à¸±à¸:';
$lang[346] = 'à¸à¸±à¸§à¹à¸¥à¸·à¸­à¸:';
$lang[347] = 'à¸£à¸°à¸à¸±à¸à¸à¸²à¸£à¸à¸µà¸à¸­à¸±à¸à¹à¸à¸¥à¹:';
$lang[348] = 'à¹à¸à¹à¸à¹à¸à¸¢à¹';
$lang[349] = 'à¹à¸£à¹à¸§à¸à¸µà¹à¸ªà¸¸à¸';
$lang[350] = 'à¹à¸£à¹à¸§';
$lang[351] = 'à¸à¸à¸à¸´';
$lang[352] = 'à¸à¸µ';
$lang[353] = 'à¸à¸µà¹à¸¢à¸µà¹à¸¢à¸¡';
$lang[354] = 'à¸ªà¸£à¹à¸²à¸à¹à¸à¸£à¸à¹';
$lang[355] = 'à¸¥à¸à¹à¸à¸¥à¹à¸«à¸¥à¸±à¸à¸à¸²à¸£à¸à¸µà¸à¸­à¸±à¸à¸à¹à¸­à¸¡à¸¹à¸¥';
$lang[356] = 'à¸ªà¸£à¹à¸²à¸à¹à¸à¸¥à¹à¹à¸à¸ Solid';
$lang[357] = 'à¹à¸ªà¹à¹à¸£à¹à¸à¸à¸­à¸£à¹à¸à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸²à¸£à¸à¸¹à¹à¸à¹à¸­à¸¡à¸¹à¸¥';
$lang[358] = 'à¸à¸à¸ªà¸­à¸à¹à¸­à¸à¸ªà¸²à¸£à¸«à¸¥à¸±à¸à¸à¸²à¸à¸à¸µà¸à¸­à¸±à¸à¹à¸ªà¸£à¹à¸';
$lang[359] = 'à¹à¸à¹à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸';
$lang[360] = 'à¹à¸à¹à¸²à¸£à¸«à¸±à¸ªà¸à¸·à¹à¸­à¹à¸à¸¥à¹';
$lang[361] = 'à¸à¸±à¹à¸à¸à¹à¸²à¹à¸ªà¹à¸à¸à¸²à¸à¸à¸­à¸à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸';
$lang[362] = 'Rar';
$lang[363] = 'à¸à¸³à¸¥à¸±à¸à¸ªà¸£à¹à¸²à¸à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸: <b>%1$s</b>';
$lang[364] = 'à¸£à¸­...';
$lang[365] = 'à¸à¸¥à¸±à¸à¹à¸à¸à¸µà¹à¸£à¸²à¸¢à¸à¸·à¹à¸­à¹à¸à¸¥à¹';
$lang[366] = '<b>à¸à¸²à¸à¹à¸à¸¥à¹ %1$s</b>:';
$lang[367] = 'à¹à¸¡à¹à¸à¸ "unrar"';
$lang[368] = 'à¸à¸£à¸­à¸à¸£à¸«à¸±à¸ªà¸ªà¸³à¸«à¸£à¸±à¸à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¸¥à¹:';
$lang[369] = 'à¸à¸£à¸­à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸¥à¸²à¸¢à¹à¸à¸¥à¹à¸à¸µà¸à¸­à¸±à¸:';
$lang[370] = 'à¸à¸´à¸à¸à¸¥à¸²à¸:%1$s';
$lang[371] = 'à¸¥à¸­à¸à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¸¥à¹à¹à¸«à¸¡à¹à¸­à¸µà¸à¸à¸£à¸±à¹à¸';
$lang[372] = 'à¹à¸¥à¸·à¸­à¸ Unrar';
$lang[373] = '<b>à¸à¸¥à¸²à¸¢à¹à¸à¸¥à¹à¸à¸²à¸ %1$s</b>:';
$lang[374] = 'à¸ªà¸à¸²à¸à¸°:';
$lang[375] = 'à¹à¸¥à¸·à¸­à¸à¸à¹à¸­à¸à¸§à¸²à¸¡';
$lang[376] = 'à¸à¸±à¸à¸à¸µà¸à¸£à¸µà¹à¸¡à¸µà¸¢à¸¡:';
$lang[377] = '38 [à¸§à¸µà¸à¸µà¹à¸­: MP4 4096x3072 | à¸­à¸­à¸à¸´à¹à¸­: AAC 2ch 44.10kHz]';
$lang[378] = 'à¸à¸´à¸à¸«à¸à¹à¸²à¸à¹à¸²à¸';
$lang[379] = 'à¹à¸à¸¥à¹';
$lang[380] = 'à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸ MD5 à¸à¸§à¸£à¸à¸°à¸à¸³à¹à¸à¹à¸à¹à¸à¸±à¸à¸£à¸¹à¸à¹à¸à¸à¸à¸µà¹à¸£à¸¹à¹à¸à¸±à¸à¸à¸±à¸(à¹à¸à¹à¸ .rar à¸«à¸£à¸·à¸­ .zip)<br />à¸à¸¸à¸à¸à¹à¸­à¸à¸à¸²à¸£à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸£à¸à¹à¸­?';
$lang[381] = 'MD5 à¸à¸­à¸à¹à¸à¸¥à¹ <b>%1$s</b> à¸à¸¹à¸à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸¥à¹à¸§'; // %1$s = filename
$lang[382] = 'à¸à¹à¸­à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸ MD5 à¸à¸­à¸à¹à¸à¸¥à¹ <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'à¹à¸à¸¥à¸µà¹à¸¢à¸ MD5';
$lang[384] = 'à¸à¸±à¸à¸à¸¹à¹à¸à¹à¸­à¸à¸§à¸²à¸¡';
$lang[385] = 'à¸à¸±à¸à¸à¸¹à¹';
$lang[386] = 'à¹à¸¡à¹à¸ªà¸à¹à¸à¹à¸à¸ªà¸à¸µà¹';
$lang[387] = 'à¹à¸¢à¸à¹à¸à¹à¸¥à¸°à¹à¸­à¸à¸ªà¸²à¸£à¹à¸à¸à¸µà¹à¹à¸à¸¥à¹à¸à¸­à¸£à¹à¸à¸µà¹à¹à¸¢à¸à¸à¸²à¸à¸à¸±à¸';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [à¸§à¸µà¸à¸µà¹à¸­: WebM 854x480 | à¸­à¸­à¸à¸´à¹à¸­: Vorbis 2ch 44.10kHz]';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// Translated by Laztrix www.diviksfilm.com
// The Turkish language file
// You should always use this file as a template for translating

$lang[1] = 'EriÅim Engellendi.';
$lang[2] = 'Sunucu isteÄinizi geri Ã§evirdi';
$lang[3] = 'GerÃ§erli bir e-mail adresi belirtmediniz.';
$lang[4] = 'ParÃ§alarÄ±n boyutlarÄ± numerik deÄil';
$lang[5] = 'Bilinmeyen URL biÃ§imi, <span class="font-black">Sadece <span class="font-blue">http</span> ya da <span class="font-blue">https</span> or <span class="font-blue">ftp</span> ProtokolÃ¼ kullanÄ±nÄ±z.</span>';
$lang[6] = 'DosyanÄ±n kaydedilecek yolu belirtilmemiÅ';
$lang[7] = 'Åu adresten indirmek iÃ§in yeterli izniniz bulunmuyor: <span class="font-black">%1$s (%2$s)</span>'; // %1$s = host name %2$s = host ip
$lang[8] = 'Adrese YÃ¶nlendiriliyor:';
$lang[9] = 'Dosya listesi gÃ¼ncellenemedi.';
$lang[10] = 'Dosya(lar) <b>%1$s</b> (<b>%2$s</b>) Kaydedildi!<br />SÃ¼re: <b>%3$s</b><br />Ortalama HÄ±z: <b>%4$s KB/s</b><br />'; // %1$s = filename %2$s = filesize %3$s = time of download %4$s = speed
$lang[11] = '<script>mail("Dosya E-Mail Adresine GÃ¶nerildi.<b>%1$s</b>.", "%2$s");</script>'; // %1$s = E-mail address %2$s = filename
$lang[12] = 'Dosya GÃ¶nerimi BaÅarÄ±sÄ±z!';
$lang[13] = 'BaÅa DÃ¶n';
$lang[14] = 'BaÄlantÄ± Kaybedildi, Dosya yitirildi.';
$lang[15] = 'Tekrar YÃ¼kle';
$lang[16] = 'Debug Modunu Åununla deÄiÅtiriniz: <b>1</b>';
$lang[17] = 'Azami dosya (%1$s) sayÄ±sÄ±na eriÅildi.'; // %1$s = Number of maximum links
$lang[18] = '%1$s BaÄlantÄ±%2$lar %3$ sÃ¼rede kontrol edildi. (YÃ¶ntem: <b>%4$s</b>)'; // %1$s = Number of links %2$s = Plural form %3$s = seconds %4$s = method for checking links
$lang[19] = 'lar'; // End of a plural
$lang[20] = 'HatalÄ± vekil sunucu adresi';
$lang[21] = 'BaÄlantÄ±';
$lang[22] = 'Durum';
$lang[23] = 'Bekleme';
$lang[24] = 'GerÃ§ersiz BaÄlantÄ±';
$lang[25] = 'HazÄ±rlanÄ±yor';
$lang[26] = 'BaÅladÄ±';
$lang[27] = 'BaÄlantÄ± Yitirildi';
$lang[28] = 'TamamlandÄ±';
$lang[29] = 'Otomatik Indirmeyi BaÅlat';
$lang[30] = 'TarayÄ±cÄ±nÄ±z ÃerÃ§eve (Frame) desteklemiyor. TarayÄ±cÄ±nÄ±zÄ± deÄiÅtiriniz.';
$lang[31] = 'BaÄlantÄ± Ekle';
$lang[32] = 'BaÄlantÄ±lar';
$lang[33] = 'SeÃ§enekler';
$lang[34] = 'DosyalarÄ± Indir';
$lang[35] = 'Äroxy Sunucu AyarÄ± Kullan';
$lang[36] = 'Proxy';
$lang[37] = 'KullanÄ±cÄ± AdÄ±';
$lang[38] = 'Åifre';
$lang[39] = 'Imageshack HesabÄ±nÄ± Kullan';
$lang[40] = 'Kaydedilecek Yer';
$lang[41] = 'Dosya Yolu';
$lang[42] = 'Premium Hesap Kullan';
$lang[43] = 'Server TarafÄ±ndan YÃ¼rÃ¼t';
$lang[44] = 'Gecikme SÃ¼resi';
$lang[45] = 'Gecikme (saniye bazÄ±nda)';
$lang[46] = 'YÃ¼klemek iÃ§in herhangi bir dosya seÃ§ilmedi';
$lang[47] = 'Host SeÃ§imini YapÄ±nÄ±z';
$lang[48] = 'Desteklenen YÃ¼kleme Servisi Bulunmuyor!';
$lang[49] = 'YÃ¼kleme Penceresi';
$lang[50] = 'Link Kaydetme FormatÄ±';
$lang[51] = 'Default';
$lang[52] = 'Hepsini SeÃ§';
$lang[53] = 'SeÃ§imi KaldÄ±r';
$lang[54] = 'SeÃ§imi Tersine DÃ¶ndÃ¼r';
$lang[55] = 'Ä°sim';
$lang[56] = 'Boyut';
$lang[57] = 'Dosya BulunamadÄ±';
$lang[58] = 'Legend for link saving format: (case sensitive)';
$lang[59] = 'Indirme BaÄlantÄ±sÄ±';
$lang[60] = 'Dosya AdÄ±';
$lang[61] = 'VarsayÄ±lan BaÄlantÄ± BiÃ§imi';
$lang[62] = 'Anything besides the ones stated above will be treated as string, you are unable to do multi line format now, a new line will be inserted for each link.';
$lang[63] = '%1$s DosyasÄ± %2$s adresine yÃ¼kleniyor...'; // %1$s = filename %2$s = file host name
$lang[64] = '%1$s DosyasÄ± mevcut deÄil'; // %1$s = filename
$lang[65] = '%1$s DosyasÄ± yazÄ±lÄ±m tarafÄ±ndan algÄ±lanamadÄ± (tanÄ±namadÄ±).'; // %1$s = filename
$lang[66] = 'Dosya boyutu izin verilen boyutlarÄ± aÅÄ±yor.';
$lang[67] = 'Upload izni yok';
$lang[68] = 'Indirme BaÄlantÄ±sÄ±';
$lang[69] = 'Silme BaÄlantÄ±sÄ±';
$lang[70] = 'Istatistik BaÄlantÄ±sÄ±';
$lang[71] = 'YÃ¶netici BaÄlantÄ±sÄ±';
$lang[72] = 'KullanÄ±cÄ± AdÄ±';
$lang[73] = 'FTP ile yÃ¼kleme';
$lang[74] = 'Åifre';
$lang[75] = 'Rapidleech PlugMod - Upload Linkler';
$lang[76] = '<div class="linktitle">%1$s<strong> iÃ§in upload linkleri </strong> - <span class="bluefont">Boyut: <strong>%2$s</strong></span></div>'; // %1$s = file name %2$s = file size
$lang[77] = 'TamamlandÄ±';
$lang[78] = 'Geri DÃ¶n';
$lang[79] = '%1$s Sunucusu ile baÄlantÄ± kurulamadÄ±.'; // %1$s = FTP server name
$lang[80] = 'HatalÄ± Åifre ya da kullanÄ±cÄ± adÄ±.';
$lang[81] = 'BaÄlanÄ±lan Sunucu: <b>%1$s</b>...'; // %1$s = FTP server name
$lang[82] = '%1$s dosya tÃ¼rÃ¼nÃ¼n indirilmesi yasaklanmÄ±Ä±Å.'; // %1$s = File type
$lang[83] = 'Dosya <b>%1$s</b>, Boyut <b>%2$s</b>...'; // %1$s = file name %2$s = file size
$lang[84] = 'IÅlem HatasÄ±...';
$lang[85] = 'Text passed as counter is string!';
$lang[86] = 'Hata: LÃ¼tfen JavaScript EtkinleÅtiriniz.';
$lang[87] = 'LÃ¼tfen <b>%1$s</b> saniye bekleyiniz...'; // %1$s = number of seconds
$lang[88] = '%1$s sunucusuna %2$s portu Ã¼zerinden baÄlanÄ±lamadÄ±.'; // %1$s = host name %2$s = port
$lang[89] = 'Veekil sunucusuna baÄlanÄ±ldÄ±: <b>%1$s</b> port numarasÄ± <b>%2$s</b>...'; // %1$s = Proxy host %2$s = Proxy port
$lang[90] = '<b>%1$s</b> Sunusuna portu Ã¼zerinden baÄlanÄ±ldÄ±. <b>%2$s</b>...'; // %1$s = host %2$s = port
$lang[91] = 'BaÄlÄ±Äa ulaÅÄ±lamadÄ±';
$lang[92] = 'Bu sayfaya eriÅiminiz durduruldu!';
$lang[93] = 'Sayfa bulunamadÄ±!';
$lang[94] = 'bu sayfa ya yasaklÄ± ya da bulunamadÄ±!';
$lang[95] = 'Hata! [%1$s] adresine yÃ¶nlendirildi'; // %1$s = redirected address
$lang[96] = 'Bu site kullanÄ±cÄ± doÄrulamasÄ± istemektedir. KullanÄ±cÄ± adÄ± ve Åifreyi Åu formatta kullanarak eriÅimde bulunabilirsiniz:<br />http://<b>login:password@</b>www.sitenizin adresi.com/dosyaadi.exe';
$lang[97] = 'Azami boyuta eriÅildi (indirme limiti)';
$lang[98] = 'Bu sunucu sÃ¼rdÃ¼rme Ã¶zelliÄini desteklemiyor';
$lang[99] = 'Indirme';
$lang[100] = 'Bu premium hesabÄ± baÅka bir IP Ã¼zerinden halihazÄ±rda kullanÄ±lÄ±yor.';
$lang[101] = '%1$s DosyasÄ± %2$s dizinine kaydedilemiyor.'; // %1$s = file name %2$s = directory name
$lang[102] = 'KlasÃ¶rÃ¼n yazma izinlerini 777 olarak ayarlayÄ±nÄ±z.';
$lang[103] = 'Tekrar Deneyiniz.';
$lang[104] = 'Dosya';
$lang[105] = 'It is not possible to carry out a record in the file %1$s'; // %1$s = file name
$lang[106] = 'HatalÄ± baÄlantÄ± girildi ya da bilinmeyen bir hata oluÅtu';
$lang[107] = 'Ãcretsiz kullanÄ±cÄ±lar iÃ§in azami indirme boyutuna eriÅtiniz.';
$lang[108] = 'Indirme oturumu sona erdi.';
$lang[109] = 'HatalÄ± giriÅ kodu.';
$lang[110] = 'GiriÅ kodunu birÃ§ok kez yanlÄ±Å girdiniz';
$lang[111] = 'Indirme Limiti AÅÄ±ldÄ±';
$lang[112] = 'Verinin OkunmasÄ±nda Hata OluÅtu';
$lang[113] = 'Verinin GÃ¶nderiminde Hata OluÅtu';
$lang[114] = 'Etkin';
$lang[115] = 'EriÅim Åu An IÃ§in MÃ¼mkÃ¼n deÄil';
$lang[116] = 'ÃlÃ¼';
$lang[117] = 'Sunucunuzda CURL Ã¶zelliÄi etkin olmasÄ± gerekiyor (http://www.php.net/cURL) yada  config.php yi \'fgc\' => 1 Åeklinde ayarlayÄ±n .';
$lang[118] = 'cURL Etkin';
$lang[119] = 'PHP 5 sÃ¼rÃ¼mÃ¼ tavsiye ediliyor ancak yazÄ±lÄ±mÄ±n Ã§alÄ±ÅmasÄ± iÃ§in bir zorunluluÄu yok';
$lang[120] = 'Sunucunuzda GÃ¼venlik Kipi\'nin (Safe Mode) kapalÄ± olduÄundan emin olunuz. YazÄ±lÄ±m gÃ¼venlik kipi aÃ§Ä±kken Ã§alÄ±ÅmamamktadÄ±r. ';
$lang[121] = 'Dosya gÃ¶nderiliyor <b>%1$s</b>'; // %1$s = filename
$lang[122] = 'ParÃ§alamaya gerek yok, tek e-mail gÃ¶nder';
$lang[123] = '%1$s boyutlarÄ± ile barÃ§alanÄ±yor'; // %1$s = part size
$lang[124] = 'YÃ¶ntem';
$lang[125] = 'ParÃ§a GÃ¶nderiliyor <b>%1$s</b>'; //%1$s = part number
$lang[126] = 'ParÃ§alamaya gerek yok, tek e-mail gÃ¶nder';
$lang[127] = 'Host Dosya bulunamadÄ±';
$lang[128] = 'Host dosyalarÄ± oluÅturulamÄ±yor';
$lang[129] = 'saatler'; // Plural
$lang[130] = 'saat';
$lang[131] = 'dakikalar'; // Plural
$lang[132] = 'dakika';
$lang[133] = 'saniyeler'; // Plural
$lang[134] = 'saniye';
$lang[135] = 'getCpuUsage(): Durum iÃ§in gerekli dosya yoluna yada dosyasÄ±na ulaÅÄ±lamÄ±yor';
$lang[136] = 'Sunucu YÃ¼kÃ¼ (CPU)';
$lang[137] = 'Bir hata oluÅtu';
$lang[138] = 'En azÄ±ndan bir dosya seÃ§iniz.';
$lang[139] = 'E-Mailler';
$lang[140] = 'GÃ¶nder';
$lang[141] = 'BaÅarÄ±lÄ± GÃ¶nderimleri Sil';
$lang[142] = 'ParÃ§alara BÃ¶l';
$lang[143] = 'ParÃ§a Boyutu';
$lang[144] = '<b>%1$s</b> - GeÃ§ersiz E-Mail adresi.'; // %1$s = email address
$lang[145] = '<b>%1$s</b> dosyasÄ± bulunamadÄ±!'; // %1$s = filename
$lang[146] = 'Dosya listesi yenilenemedi!';
$lang[147] = 'Dosya silinmesine izin verilmiyor';
$lang[148] = 'DosyalarÄ± Sil';
$lang[149] = 'Evet';
$lang[150] = 'HayÄ±r';
$lang[151] = '<b>%1$s</b> DosyasÄ± silindi.'; // %1$s = filename
$lang[152] = '<b>%1$s</b> dosyasÄ±nÄ± silerken hata oluÅtu!'; // %1$s = filename
$lang[153] = 'Host';
$lang[154] = 'Port';
$lang[155] = 'Dizin';
$lang[156] = 'Kaynak dosyalarÄ±nÄ± baÅarÄ±lÄ± yÃ¼kleme sonrasÄ± sil';
$lang[157] = 'DosyalarÄ± Kopyala';
$lang[158] = 'DosyalarÄ± TaÅÄ±';
$lang[159] = '<b>%1$s</b> Dizini Tesbit Edilemedi.'; // %1$s = directory name
$lang[160] = '%1$s dosyasÄ± baÅarÄ±lÄ± bir Åekilde yÃ¼klendi!'; // %1$s = filename
$lang[161] = 'Zaman';
$lang[162] = 'Ortalama HÄ±z';
$lang[163] = '<b>%1$s</b> DosyasÄ± yÃ¼klenilemedi!'; // %1$s = filename
$lang[164] = 'Email';
$lang[165] = 'BaÅarÄ±lÄ± gÃ¶nderimleri sil';
$lang[166] = 'HatalÄ± E-Mail Adresi';
$lang[167] = 'LÃ¼tfen Sadece .crc ya da .001 dosyasÄ±nÄ± seÃ§iniz!';
$lang[168] = 'lÃ¼tfen.crc dosyasÄ±nÄ± seÃ§iniz!';
$lang[169] = 'LÃ¼tfen .crc ya da .001 dosyasÄ±nÄ± seÃ§iniz!';
$lang[170] = 'CRC Testi Yap? (Ã¶nerilen)';
$lang[171] = 'CRC32 Kontrol modu';
$lang[172] = 'hash_file Kullan(Ã¶nerilen)';
$lang[173] = 'Dosya hafÄ±zasÄ±nÄ± oku';
$lang[174] = 'Sahte crc';
$lang[175] = 'Kaynak dosyalarÄ±nÄ± baÅarÄ±lÄ± birleÅtirme sonrasÄ±nda sil';
$lang[176] = 'Not';
$lang[177] = 'Dosya boyutu ile crc32 dosyasÄ± uyum gÃ¶stermiyor';
$lang[178] = '.crc dosyasÄ± okunamÄ±yor!';
$lang[179] = 'Hata, <b>%1$s</b> hedefe Ã§Ä±karÄ±lacak dosya halihazÄ±rda mevcut'; // %1$s = filename
$lang[180] = 'Hata, hatalÄ± ya da eksik parÃ§a';
$lang[181] = 'Hata, %1$s dosa biÃ§imi sistem tarafÄ±ndan engelli.'; // Filetype
$lang[182] = '<b>%1$s</b> hedefe dosyanÄ±n oluÅturmasÄ± mÃ¼mkÃ¼n deÄil'; // %1$s = filename
$lang[183] = '<b>%1$s</b> dosyasÄ±nÄ± yazarken hata!'; // %1$s = filename
$lang[184] = 'CRC32 checksum uymuyor!';
$lang[185] = '<b>%1$s</b> dosyasÄ± baÅarÄ±lÄ± bir Åekilde birleÅtirildi'; // %1$s = filename
$lang[186] = 'silindi';
$lang[187] = 'silinmedi';
$lang[188] = 'UzantÄ± Ekle';
$lang[189] = 'siz';
$lang[190] = 'ye';
$lang[191] = 'Ad DeÄiÅtir?';
$lang[192] = 'Iptal';
$lang[193] = '<b>%1$s</b> dosyasÄ±nÄ± isimlendirirken hata'; // %1$s = filename
$lang[194] = '<b>%1$s</b> dosyasÄ±Ä±nÄ±n adÄ± <b>%2$s</b> olarak deÄiÅtirildi.'; // %1$s = original filename %2$s = renamed filename
$lang[195] = 'ArÅiv AdÄ±';
$lang[196] = 'LÃ¼tfen bir arÅiv adÄ± giriniz!';
$lang[197] = 'Hata, arÅiv oluÅturulamadÄ±.';
$lang[198] = '%1$s dosyasÄ± paketlendi.'; // %1$s = filename
$lang[199] = 'Packed in archive <b>%1$s</b>'; // %1$s = filename
$lang[200] = 'Hata, arÅiv boÅ.';
$lang[201] = 'Yeni Ad';
$lang[202] = '<b>%1$s</b> dosyasÄ±nÄ±n ismi deÄiÅtirilemedi!'; // %1$s = filename
$lang[203] = 'BaÅarÄ±lÄ± bÃ¶lme iÅleminden sonra kaynak dosyayÄ± sil';
$lang[204] = 'dosyalar ve dizinler';
$lang[205] = 'Unzip';
$lang[206] = 'YouTube Video Format SeÃ§imi';
$lang[207] = 'Sunucuya indirilecek Link';
$lang[208] = 'YÃ¶nlendirme';
$lang[209] = 'Sunucuya indir';
$lang[210] = 'KullanÄ±cÄ± adÄ± &amp; Åifre (HTTP/FTP)';
$lang[211] = 'KullanÄ±cÄ± adÄ±';
$lang[212] = 'Åifre';
$lang[213] = 'AÃ§Ä±klama ekle';
$lang[214] = 'Eklenti ayarlarÄ±';
$lang[215] = 'BÃ¼tÃ¼n eklentileri iptal et';
$lang[216] = 'YouTube Video Format SeÃ§ici';
$lang[217] = 'Direk Link';
$lang[218] = '&amp;fmt=';
$lang[219] = 'Otomatik en yÃ¼ksek kalitede format seÃ§imi';
$lang[220] = '17 [Video: 3GP 176x144 | Audio: AAC 2ch 44.10kHz]';
$lang[221] = '5 [Video: FLV 400x240 | Audio: MP3 1ch 22.05kHz]';
$lang[222] = '34 [Video: FLV 640x360 | Audio: AAC 2ch 44.10kHz]';
$lang[223] = '35 [Video: FLV 854x480 | Audio: AAC 2ch 44.10kHz]';
$lang[224] = '43 [Video: WebM 640x360 | Audio: Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [Video: WebM 1280x720 | Audio: Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [Video: MP4 480x360 | Audio: AAC 2ch 44.10kHz]';
$lang[227] = '22 [Video: MP4 1280x720 | Audio: AAC 2ch 44.10kHz]';
$lang[228] = '37 [Video: MP4 1920x1080 | Audio: AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; TorrentService';
$lang[230] = 'KullanÄ±cÄ± AdÄ±';
$lang[231] = 'Åifre';
$lang[232] = 'Megaupload.com Cookie DeÄeri';
$lang[233] = 'KullanÄ±cÄ±';
$lang[234] = 'vBulletin eklentisi kullan';
$lang[235] = 'Ek Ã§erez deÄeri';
$lang[236] = 'Ahahtar=DeÄer';
$lang[237] = 'DosyayÄ± emaile gÃ¶nder';
$lang[238] = 'Email';
$lang[239] = 'DosyayÄ± bÃ¶l';
$lang[240] = 'Metod';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'ParÃ§a boyutu';
$lang[244] = 'MB';
$lang[245] = 'Proxy ayarlarÄ±nÄ± kullan';
$lang[246] = 'Proxy';
$lang[247] = 'KullanÄ±cÄ± adÄ±';
$lang[248] = 'Åifre';
$lang[249] = 'Premium hesap kullan';
$lang[250] = 'KullanÄ±cÄ± adÄ±';
$lang[251] = 'Åifre';
$lang[252] = 'Dosya kayÄ±t yeri';
$lang[253] = 'Yol';
$lang[254] = 'AyarlarÄ± Kaydet';
$lang[255] = 'GeÃ§erli AyarlarÄ± Temizle';
$lang[256] = 'TÃ¼mÃ¼nÃ¼ Ä°Åaretle';
$lang[257] = 'BÃ¼tÃ¼n iÅaretleri KaldÄ±r';
$lang[258] = 'Tersine Ãevir';
$lang[259] = 'Ä°ndirilenleri';
$lang[260] = 'GÃ¶ster';
$lang[261] = 'GÃ¶ster,';
$lang[262] = 'Ad';
$lang[263] = 'Boyut';
$lang[264] = 'AÃ§Ä±klama';
$lang[265] = 'Tarih';
$lang[266] = 'Dosya bulunamadÄ±';
$lang[267] = 'Ä°le Ã§alÄ±ÅÄ±r';
$lang[268] = 'Temizle';
$lang[269] = 'Debug Mode';
$lang[270] = 'Sadece Linkleri gÃ¶ster';
$lang[271] = 'Sadece Linkleri temzile';
$lang[272] = 'Linkleri Kontrol et';
$lang[273] = 'YÃ¼kleniyor...';
$lang[274] = 'Ä°Ålem sÃ¼rÃ¼yor, LÃ¼tfen bekleyin...';
$lang[275] = 'Server AlanÄ±';
$lang[276] = 'KullanÄ±lan';
$lang[277] = 'BoÅ Alan';
$lang[278] = 'Disk AlanÄ±';
$lang[279] = 'CPU';
$lang[280] = 'Server Saati';
$lang[281] = 'Yerel Saat';
$lang[282] = 'Otomatik sil';
$lang[283] = 'Hours After Transload';
$lang[284] = 'Minutes After Transload';
$lang[285] = 'Ä°Ålem';
$lang[286] = 'YÃ¼kle';
$lang[287] = 'FTP YÃ¼kleme';
$lang[288] = 'E-Mail';
$lang[289] = 'Toplu e-posta';
$lang[290] = 'DosyalarÄ± BÃ¶l';
$lang[291] = 'DosyalarÄ± BirleÅtir';
$lang[292] = 'MD5 Hash';
$lang[293] = 'Dosya Paketle';
$lang[294] = 'Dosya ziple';
$lang[295] = 'Dosya Unziple';
$lang[296] = 'Tekrar adlandÄ±r';
$lang[297] = 'Toplu ad deÄiÅtirme';
$lang[298] = 'Sil';
$lang[299] = 'Linkleri Listele';
$lang[300] = 'Retrieving download page';
$lang[301] = 'GiriÅ';
$lang[302] = 'Buraya';
$lang[303] = 'DosyayÄ± indir';
$lang[304] = 'configs/files.lst yazÄ±labilir deÄil, chmod 777 olduÄuna emin olun';
$lang[305] = '&nbsp; SeÃ§tiÄiniz &nbsp; yolu yazlÄ±labilir deÄil. chmod  777 olduÄuna emin olun';
$lang[306] = 'Dosya birleÅtiriliyor';
$lang[307] = 'Bekliyor';
$lang[308] = 'GeÃ§ildi';
$lang[309] = 'BaÅarÄ±sÄ±z';
$lang[310] = 'You might see warnings without this turned on';
$lang[311] = 'Server durumunu Ã§alÄ±ÅtÄ±ramÄ±yabilirsiniz.';
$lang[312] = 'Serveriniz 2 gb dan bÃ¼yÃ¼k dosyalarÄ± desteklemiyor olabilir';
$lang[313] = 'Rapidleech Kontrol Script';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'PHP Version - ';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'Disk Space Functions';
$lang[323] = 'Apache Version - ';
$lang[324] = 'YanlÄ±Å proxy adresi girildi';
$lang[325] = 'Dosya baÅarÄ±lÄ± kaydedildi!';
$lang[326] = 'Notu kaydet';
$lang[327] = 'Notlar';
$lang[328] = 'Eylemleri Ä°ptal et';
$lang[329] = 'Ana Sayfa';
$lang[330] = 'Ayarlar';
$lang[331] = 'Server DosyalarÄ±';
$lang[332] = 'Link Kontrol';
$lang[333] = 'Eklenti';
$lang[334] = 'Toplu indirme';
$lang[335] = 'Toplu yÃ¼kleme';
$lang[336] = 'Dosya boyutu sÄ±nÄ±rlandÄ±rma ';
$lang[337] = 'Dosya Boyut SÄ±nÄ±rÄ±: ';
$lang[338] = 'Rarla';
$lang[339] = 'ÃÄ±kart';
$lang[340] = 'Hata Bulundu';
$lang[341] = 'GeniÅletmek Ä°Ã§in tÄ±kla';
$lang[342] = 'Pencereyi Buradan SÃ¼rÃ¼kleyebilirsiniz';
$lang[343] = 'Can not find "rar"<br />You may need to download it and extract "rar" to "/rar/" directory';
$lang[344] = 'ArÅivlenecek Dosya AdlarÄ±:';
$lang[345] = 'ArÅiv AdÄ±:';
$lang[346] = 'SeÃ§enekler:';
$lang[347] = 'SÄ±kÄ±ÅtÄ±rma HÄ±zÄ±:';
$lang[348] = 'ÃokYavaÅ';
$lang[349] = 'En HÄ±zlÄ±';
$lang[350] = 'HÄ±zlÄ±';
$lang[351] = 'Normal';
$lang[352] = 'Ä°yi';
$lang[353] = 'En Ä°yi';
$lang[354] = 'ParÃ§ala';
$lang[355] = 'ArÅiv OluÅturduktan Sonra DosyayÄ± Sil';
$lang[356] = 'Tek ArÅiv OluÅtur';
$lang[357] = 'Kurtarma KaydÄ± OluÅtur';
$lang[358] = 'SÄ±kÄ±ÅtÄ±rma Akabinde Kontrol Et';
$lang[359] = 'Åifre Kullan';
$lang[360] = 'Dosya AdlarÄ±nÄ± Kriptola';
$lang[361] = 'ArÅiv Ä°Ã§inde Dosya Yolu GÃ¶ster';
$lang[362] = 'Rar';
$lang[363] = 'ArÅiv OluÅturuluyor: <b>%1$s</b>';
$lang[364] = 'Bekleniyor...';
$lang[365] = 'Dosya Listesine Geri DÃ¶n';
$lang[366] = '<b>Dosylar %1$s</b>:';
$lang[367] = '"unrar" BulunamÄ±yor';
$lang[368] = 'DosyalarÄ±n Listelenmesi Ä°Ã§in Åifre Gerekiyor:';
$lang[369] = 'DosyalarÄ± ÃÄ±kartmak Ä°Ã§in Åifre Gerekiyor:';
$lang[370] = 'Hata:%1$s';
$lang[371] = 'Tekrar Listelemeye ÃalÄ±Å';
$lang[372] = 'Rardan ÃÄ±kart';
$lang[373] = '<b>%1$s ArÅivinden Dosya ÃÄ±kartÄ±lÄ±yor</b>:';
$lang[374] = 'Durum:';
$lang[375] = 'Metni SeÃ§';
$lang[376] = 'Premium Accounts :';
$lang[377] = '38 [Video: MP4 4096x3072 | Audio: AAC 2ch 44.10kHz]';
$lang[378] = 'Pencereyi Kapat';
$lang[379] = 'Dosyalar';
$lang[380] = 'MD5 change should only be applied to known working formats(i.e. .rar or .zip)<br />Do you want to continue?';
$lang[381] = 'MD5 of file <b>%1$s</b> changed'; // %1$s = filename
$lang[382] = 'Error changing the MD5 of the file <b>%1$s</b>!'; // %1$s = filename
$lang[383] = 'MD5 DeÄiÅtirme';
$lang[384] = 'Metni EÅleÅtir';
$lang[385] = 'EÅleÅtir';
$lang[386] = 'Durumu GÃ¶zardÄ± Et';
$lang[387] = 'Her DosyayÄ± AyrÄ± Bir ArÅive koy';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [Video: WebM 854x480 | Audio: Vorbis 2ch 44.10kHz]';
?>
<?php

if (!defined('RAPIDLEECH')) {
    require('../deny.php');
    exit;
}
// The Simplified Chinese language file
// These words has been html entitied to prevent wrong encodings

$lang[1] = 'æç»è®¿é®';
$lang[2] = 'æå¡å¨æç»æ§è¡æ¨çè¯·æ±';
$lang[3] = 'æ¨æ²¡æè¾å¥ä¸ä¸ªææçe-mailå°å';
$lang[4] = 'åæ®µå¤§å°ä¸æ¯æ°å­';
$lang[5] = 'æªç¥URLç±»åï¼<span class="font-black">åªä½¿ç¨<span class="font-blue">http</span> æ <span class="font-blue">https</span> æ <span class="font-blue">ftp</span> åè®®</span>';
$lang[6] = 'æªæå®ä¿å­æ­¤æä»¶è·¯å¾';
$lang[7] = 'ä½ ä¸è¢«åè®¸ä»<span class="font-black">%1$s (%2$s)</span> ä¸ä¸è½½åå®¹ '; // %1$s = host name %2$s = host ip
$lang[8] = 'éå®åå°';
$lang[9] = 'æ æ³æ´æ°çæä»¶åè¡¨';
$lang[10] = 'æä»¶<b>%1$s</b> (<b>%2$s</b>) ä»¥ä¿å­ï¼<br />ç¨æ¶ï¼ <b>%3$s</b><br />å¹³åéåº¦ï¼ <b>%4$s KB/s</b><br /> '; // %1$s = filename %2$s = filesize %3$s = time of download %4$s = speed
$lang[11] = '<script>mail("æä»¶å°è¢«åéå°å°å<b>%1$s</b>ã", "%2$s");</script> '; // %1$s = E-mail address %2$s = filename
$lang[12] = 'åéæä»¶æ¶åºéï¼';
$lang[13] = 'åå°ä¸»é¡µ';
$lang[14] = 'è¿æ¥ä¸¢å¤±ï¼æä»¶å·²å é¤ã';
$lang[15] = 'éæ°å è½½';
$lang[16] = 'è¯·æ´æ¹è°è¯æ¨¡å¼å° <b>1</b>';
$lang[17] = 'å·²è¾¾å°æå¤§è¿æ¥æ°ï¼%1$sï¼ã '; // %1$s = Number of maximum links
$lang[18] = '%1$s é¾æ¥%2$s è¢«æ£æµå°ï¼ç¨æ¶ %3$s ç§ãï¼æ¹æ³ï¼<b>%4$s</b>ï¼ '; // %1$s = Number of links %2$s = Plural form %3$s = seconds %4$s = method for checking links
$lang[19] = ''; // End of a plural
$lang[20] = 'éè¯¯çä»£çæå¡å¨å°å';
$lang[21] = 'é¾æ¥';
$lang[22] = 'ç¶æ';
$lang[23] = 'è¯·ç¨å';
$lang[24] = 'éè¯¯çURLå°å';
$lang[25] = 'åå¤';
$lang[26] = 'å·²å¯å¨';
$lang[27] = 'è¿æ¥ä¸¢å¤±';
$lang[28] = 'å·²å®æ';
$lang[29] = 'å¯å¨èªå¨Transload';
$lang[30] = 'ä¸æ¯ææ¡æ¶ï¼è¯·æ´æ°ä½ çæµè§å¨';
$lang[31] = 'æ·»å é¾æ¥';
$lang[32] = 'é¾æ¥';
$lang[33] = 'éé¡¹';
$lang[34] = 'Transloadæä»¶';
$lang[35] = 'ä½¿ç¨ä»£çè®¾ç½®';
$lang[36] = 'ä»£ç';
$lang[37] = 'ç¨æ¶å';
$lang[38] = 'å¯ç ';
$lang[39] = 'ä½¿ç¨Imageshackå¸æ·';
$lang[40] = 'ä¿å­å°';
$lang[41] = 'è·¯å¾';
$lang[42] = 'ä½¿ç¨é«çº§å¸æ·';
$lang[43] = 'å¨æå¡å¨ç«¯è¿è¡';
$lang[44] = 'å»¶è¿æ¶é´';
$lang[45] = 'å»¶è¿ï¼ç§ï¼';
$lang[46] = 'æ²¡æéæ©ä¸ä¼ çæä»¶æä¸»æº';
$lang[47] = 'éæ©è¦ä¸ä¼ çä¸»æº';
$lang[48] = 'ä¸è¢«æ¯æçä¸ä¼ æå¡ï¼';
$lang[49] = 'ä¸ä¼ çªå£';
$lang[50] = 'é¾æ¥ä¿å­æ ¼å¼';
$lang[51] = 'é»è®¤';
$lang[52] = 'å¨é¨éä¸­';
$lang[53] = 'åæ¶å¨é¨éä¸­';
$lang[54] = 'ååéæ©';
$lang[55] = 'åç§°';
$lang[56] = 'å¤§å°';
$lang[57] = 'æ²¡æåç°æä»¶';
$lang[58] = 'é¾æ¥ä¿å­æ ¼å¼ç¤ºä¾ï¼ï¼åºåå¤§å°åï¼';
$lang[59] = 'ä¸è½½é¾æ¥';
$lang[60] = 'æä»¶çåç§°';
$lang[61] = 'é»è®¤é¾æ¥æ ·å¼';
$lang[62] = 'é¤äºä¸é¢ä»¥å¤çä»»ä½ä¸è¥¿é½å°è¢«è§ä¸ºå­ç¬¦ä¸²ï¼ä½ ç°å¨æ æ³ä½¿ç¨å¤è¡æ ¼å¼ï¼æ°è¡å°è¢«æå¥å°æ¯ä¸ªé¾æ¥ã';
$lang[63] = 'ä¸ä¼ æä»¶ %1$s å° %2$s '; // %1$s = filename %2$s = file host name
$lang[64] = 'æä»¶ %1$s ä¸å­å¨ã '; // %1$s = filename
$lang[65] = 'æä»¶ %1$s ä¸å¯ä»¥ç¨èæ¬è¯»åã '; // %1$s = filename
$lang[66] = 'ä¸ä¼ å°ä¸»æºçæä»¶è¿å¤§ã';
$lang[67] = 'ä¸ä¼ æå¡ä¸è¢«åè®¸';
$lang[68] = 'ä¸è½½é¾æ¥';
$lang[69] = 'å é¤é¾æ¥';
$lang[70] = 'ç¶æé¾æ¥';
$lang[71] = 'ç®¡çåé¾æ¥';
$lang[72] = 'ç¨æ·å';
$lang[73] = 'FTPä¸ä¼ ';
$lang[74] = 'å¯ç ';
$lang[75] = 'Rapidleech PlugMod - ä¸ä¼ é¾æ¥';
$lang[76] = '<div class="linktitle">ä¸ä¼ é¾æ¥ <strong>%1$s</strong> - <span class="bluefont">å¤§å°ï¼ <strong>%2$s</strong></span></div> '; // %1$s = file name %2$s = file size
$lang[77] = 'å®æ';
$lang[78] = 'åé';
$lang[79] = 'æ æ³å»ºç«ä¸æå¡å¨%1$s çè¿æ¥ã '; // %1$s = FTP server name
$lang[80] = 'éè¯¯çç¨æ·åå/æå¯ç ã';
$lang[81] = 'å·²è¿æ¥å°ï¼ <b>%1$s</b>... '; // %1$s = FTP server name
$lang[82] = 'æä»¶ç±»å %1$s æ¯ç¦æ­¢ä¸è½½ç '; // %1$s = File type
$lang[83] = 'æä»¶ <b>%1$s</b>ï¼å¤§å° <b>%2$s</b>... '; // %1$s = file name %2$s = file size
$lang[84] = 'æ£ç´¢é¾æ¥æ¶åºé';
$lang[85] = 'ææ¬ä½ä¸ºè®¡æ°å¨å­ç¬¦ä¸²ä¼ éï¼';
$lang[86] = 'éè¯¯ï¼è¯·å¯ç¨JavaScriptã';
$lang[87] = 'è¯·ç­å¾ <b>%1$s</b> ç§... '; // %1$s = number of seconds
$lang[88] = 'æ æ³è¿æ¥å° %1$s ç«¯å£ %2$s '; // %1$s = host name %2$s = port
$lang[89] = 'è¿æ¥å°ä»£çï¼ <b>%1$s</b> ç«¯å£ <b>%2$s</b>... '; // %1$s = Proxy host %2$s = Proxy port
$lang[90] = 'å·²è¿æ¥å°ï¼ <b>%1$s</b> ç«¯å£ <b>%2$s</b>... '; // %1$s = host %2$s = port
$lang[91] = 'æ²¡ææ¶å°æ é¢';
$lang[92] = 'ä½ è¢«ç¦æ­¢è®¿é®é¡µé¢ï¼';
$lang[93] = 'è¯¥ç½é¡µæªæ¾å°ï¼';
$lang[94] = 'é¡µé¢è¢«ç¦æ­¢è®¿é®ææ²¡ææ¾å°ï¼';
$lang[95] = 'éè¯¯ï¼å®è¢«éå®åå° [%1$s] '; // %1$s = redirected address
$lang[96] = 'è¿ä¸ªç½ç«éè¦ææãè¦æå®è®¿é®çç¨æ·åå¯ç éè¦ä½¿ç¨ç±»ä¼¼ä»¥ä¸æ ¼å¼çURLï¼<br />http:';
$lang[97] = 'æ¢å¤è¶åºéå¶';
$lang[98] = 'æ­¤æå¡å¨ä¸æ¯ææ¢å¤';
$lang[99] = 'ä¸è½½';
$lang[100] = 'ç½éå¸å·å·²ç¨äºå¦ä¸ä¸ªIPã';
$lang[101] = 'ä¸è½ä¿å­æä»¶ %1$s å°ç®å½ %2$s ä¸­ '; // %1$s = file name %2$s = directory name
$lang[102] = 'å°è¯ç¨chmodæ´æ¹æä»¶å¤¹å°777æéã';
$lang[103] = 'éè¯';
$lang[104] = 'æä»¶';
$lang[105] = 'ä¸è½å®æè®°å½å°æä»¶ %1$s '; // %1$s = file name
$lang[106] = 'æ æçç½åæåçæªç¥éè¯¯';
$lang[107] = 'æ¨å·²ç»è¾¾å°äºåè´¹ç¨æ·çéå¶ã';
$lang[108] = 'ä¸è½½ä¼è¯å·²è¿æ';
$lang[109] = 'éè¯¯çè®¿é®å¯é¥';
$lang[110] = 'ä½ è¾å¥äºéè¯¯çå¯é¥çæ¬¡æ°å¤ªå¤äº';
$lang[111] = 'è¶åºä¸è½½éå¶';
$lang[112] = 'è¯»åæ°æ®éè¯¯';
$lang[113] = 'åéæ°æ®éè¯¯';
$lang[114] = 'æ´»å¨';
$lang[115] = 'ä¸å¯ç¨';
$lang[116] = 'å¤±æ';
$lang[117] = 'ä½ éè¦å è½½/æ¿æ´» cURL æ©å±(http:';
$lang[118] = 'cURLå¯ç¨';
$lang[119] = 'æ¨èä½¿ç¨PHP version 5 ä½è¿ä¸æ¯å¼ºå¶ç';
$lang[120] = 'æ£æ¥å¦æä½ çå®å¨æ¨¡å¼æ¯å³é­ç¶æä¸ï¼èæ¬å°ä¸è½ä½¿ç¨å®å¨æ¨¡å¼';
$lang[121] = 'åéæä»¶<b>%1$s</b> '; // %1$s = filename
$lang[122] = 'ä¸éè¦åå²ï¼åéåä¸ªé®ä»¶';
$lang[123] = 'æ %1$s å¤§å°è¿è¡åå² '; // %1$s = part size
$lang[124] = 'æ¹æ³';
$lang[125] = 'åéé¨å <b>%1$s</b> '; //%1$s = part number
$lang[126] = 'ä¸éè¦åå²ï¼åéåä¸ªé®ä»¶';
$lang[127] = 'æ²¡æåç°ä¸»æºæä»¶';
$lang[128] = 'æ æ³åå»ºä¸»æºæä»¶';
$lang[129] = 'æ¶ '; // Plural
$lang[130] = 'æ¶';
$lang[131] = 'å '; // Plural
$lang[132] = 'å';
$lang[133] = 'ç§ '; // Plural
$lang[134] = 'ç§';
$lang[135] = 'getCpuUsage(): æ æ³è®¿é®STATè·¯å¾æSTATæä»¶éè¯¯';
$lang[136] = 'CPUè´è½½';
$lang[137] = 'åçéè¯¯';
$lang[138] = 'è³å°éæ©ä¸ä¸ªæä»¶ã';
$lang[139] = 'çµå­é®ä»¶';
$lang[140] = 'åé';
$lang[141] = 'å é¤æåæäº¤';
$lang[142] = 'æåæ®µåå²';
$lang[143] = 'åæ®µå¤§å°';
$lang[144] = '<b>%1$s</b> - æ æçE-mailå°åã '; // %1$s = email address
$lang[145] = 'æªæ¾å°æä»¶ <b>%1$s</b> ï¼'; // %1$s = filename
$lang[146] = 'æ æ³æ´æ°æä»¶åè¡¨ï¼';
$lang[147] = 'ç¦ç¨æä»¶å é¤';
$lang[148] = 'å é¤æä»¶';
$lang[149] = 'æ¯';
$lang[150] = 'å¦';
$lang[151] = 'æä»¶<b>%1$s</b> å·²å é¤ '; // %1$s = filename
$lang[152] = 'å é¤æä»¶ <b>%1$s</b> æ¶éå°éè¯¯ï¼ '; // %1$s = filename
$lang[153] = 'ä¸»æº';
$lang[154] = 'ç«¯å£';
$lang[155] = 'æä»¶å¤¹';
$lang[156] = 'ä¸ä¼ æååå é¤æºæä»¶';
$lang[157] = 'ä¿å­FTPæ°æ®';
$lang[158] = 'å é¤FTPæ°æ®';
$lang[159] = 'æ æ³æ¾å°æä»¶å¤¹ <b>%1$s</b> '; // %1$s = directory name
$lang[160] = 'æåä¸ä¼ æä»¶ %1$s ï¼'; // %1$s = filename
$lang[161] = 'æ¶é´';
$lang[162] = 'å¹³åæ¶é';
$lang[163] = 'æ æ³ä¸ä¼ æä»¶ <b>%1$s</b>ï¼ '; // %1$s = filename
$lang[164] = 'çµå­é®ä»¶';
$lang[165] = 'å é¤æåæäº¤';
$lang[166] = 'éè¯¯ççµå­é®ä»¶å°å';
$lang[167] = 'è¯·åªéæ© .crc æ .001 æä»¶ï¼';
$lang[168] = 'è¯·éæ© .crc æä»¶ï¼';
$lang[169] = 'è¯·éæ© .crc æ .001 æä»¶ï¼';
$lang[170] = 'æ§è¡CRCæ ¡éªï¼ï¼æ¨èï¼';
$lang[171] = 'CRC32æ ¡éªæ¨¡å¼';
$lang[172] = 'ä½¿ç¨ åå¸æä»¶ï¼æ¨èï¼';
$lang[173] = 'è¯»æä»¶å°åå­';
$lang[174] = 'åCRC';
$lang[175] = 'æååå¹¶åå é¤æºæä»¶';
$lang[176] = 'å¬å';
$lang[177] = 'ä¸ä¼æ£æ¥æ­¤æä»¶çå¤§å°åCRC32';
$lang[178] = 'æ æ³è¯»å .CRC æä»¶ï¼';
$lang[179] = 'éè¯¯ï¼è¾åºæä»¶å·²ç»å­å¨ <b>%1$s</b> '; // %1$s = filename
$lang[180] = 'éè¯¯ï¼ç¼ºå¤±æä¸å®æ´çåæ®µ';
$lang[181] = 'éè¯¯ï¼æä»¶ç±»å %1$s æ¯ç¦æ­¢ç '; // Filetype
$lang[182] = 'ç®æ æä»¶ <b>%1$s</b> æ¯ä¸å¯è½æå¼ç '; // %1$s = filename
$lang[183] = 'åå¥æä»¶ <b>%1$s</b> éè¯¯ï¼'; // %1$s = filename
$lang[184] = 'CRC32æ ¡éªä¸å¹éï¼';
$lang[185] = 'æååå¹¶æä»¶ <b>%1$s</b> '; // %1$s = filename
$lang[186] = 'å é¤';
$lang[187] = 'æªå é¤';
$lang[188] = 'æ·»å æ©å±';
$lang[189] = 'ä¸åæ¬';
$lang[190] = 'å°';
$lang[191] = 'éå½åï¼';
$lang[192] = 'åæ¶';
$lang[193] = 'éå½åæä»¶ <b>%1$s</b> éè¯¯ '; // %1$s = filename
$lang[194] = 'æä»¶ <b>%1$s</b> å·²æ´åä¸º <b>%2$s</b> '; // %1$s = original filename %2$s = renamed filename
$lang[195] = 'å­æ¡£åç§°';
$lang[196] = 'è¯·è¾å¥å­æ¡£åç§°ï¼';
$lang[197] = 'éè¯¯ å­æ¡£æ²¡æåå»ºã';
$lang[198] = 'æä»¶ %1$s æ¯ä¸ä¸ªæå '; // %1$s = filename
$lang[199] = 'æåå¨å­æ¡£ <b>%1$s</b> é '; // %1$s = filename
$lang[200] = 'éè¯¯ï¼å­æ¡£æ¯ç©ºçã';
$lang[201] = 'æ°åç§°';
$lang[202] = 'æ æ³éå½åæä»¶ <b>%1$s</b>ï¼'; // %1$s = filename
$lang[203] = 'æååå²åå é¤æºæä»¶';
$lang[204] = 'æä»¶åæä»¶å¤¹';
$lang[205] = 'è§£å';
$lang[206] = 'YouTube è§é¢æ ¼å¼éæ©å¨';
$lang[207] = 'é¾æ¥å°Transload';
$lang[208] = 'å¼ç¨';
$lang[209] = 'Transloadæä»¶';
$lang[210] = 'ç¨æ·å &amp; å¯ç  (HTTP/FTP)';
$lang[211] = 'ç¨æ·';
$lang[212] = 'å¯ç ';
$lang[213] = 'æ·»å æ³¨é';
$lang[214] = 'æä»¶éé¡¹';
$lang[215] = 'ç¦ç¨æææä»¶';
$lang[216] = 'YouTube è§é¢æ ¼å¼éæ©å¨';
$lang[217] = 'ç´æ¥é¾æ¥';
$lang[218] = '&amp;fmt=';
$lang[219] = 'èªå¨è·åå¯ç¨çæé«è´¨éæ ¼å¼';
$lang[220] = '17 [è§é¢ï¼ 3GP 176x144 | é³é¢ï¼ AAC 2ch 44.10kHz]';
$lang[221] = '5 [è§é¢ï¼ FLV 400x240 | é³é¢ï¼ MP3 1ch 22.05kHz]';
$lang[222] = '34 [è§é¢ï¼ FLV 640x360 | é³é¢ï¼ AAC 2ch 44.10kHz]';
$lang[223] = '35 [è§é¢ï¼ FLV 854x480 | é³é¢ï¼ AAC 2ch 44.10kHz]';
$lang[224] = '43 [è§é¢ï¼ WebM 640x360 | é³é¢ï¼ Vorbis 2ch 44.10kHz]';
$lang[225] = '45 [è§é¢ï¼ WebM 1280x720 | é³é¢ï¼ Vorbis 2ch 44.10kHz]';
$lang[226] = '18 [è§é¢ï¼ MP4 480x360 | é³é¢ï¼ AAC 2ch 44.10kHz]';
$lang[227] = '22 [è§é¢ï¼ MP4 1280x720 | é³é¢ï¼ AAC 2ch 44.10kHz]';
$lang[228] = '37 [è§é¢ï¼ MP4 1920x1080 | é³é¢ï¼ AAC 2ch 44.10kHz]';
$lang[229] = 'ImageShack&reg; Torrent æå¡';
$lang[230] = 'ç¨æ·å';
$lang[231] = 'å¯ç ';
$lang[232] = 'Megaupload.com Cookie å¼';
$lang[233] = 'ç¨æ·';
$lang[234] = 'ä½¿ç¨ vBulletin æä»¶';
$lang[235] = 'éå Cookieå¼';
$lang[236] = 'Key=Value';
$lang[237] = 'åéæä»¶å°çµå­é®ä»¶';
$lang[238] = 'çµå­é®ä»¶';
$lang[239] = 'åå²æä»¶';
$lang[240] = 'æ¹æ³';
$lang[241] = 'Total Commander';
$lang[242] = 'RFC 2046';
$lang[243] = 'åæ®µå¤§å°';
$lang[244] = 'MB';
$lang[245] = 'ä½¿ç¨ä»£çè®¾ç½®';
$lang[246] = 'ä»£ç';
$lang[247] = 'ç¨æ·å';
$lang[248] = 'å¯ç ';
$lang[249] = 'ä½¿ç¨é«çº§å¸æ·';
$lang[250] = 'ç¨æ·å';
$lang[251] = 'å¯ç ';
$lang[252] = 'ä¿å­å°';
$lang[253] = 'è·¯å¾';
$lang[254] = 'ä¿å­è®¾ç½®';
$lang[255] = 'æ¸é¤å½åè®¾ç½®';
$lang[256] = 'å¨é¨éä¸­';
$lang[257] = 'åæ¶å¨é¨éä¸­';
$lang[258] = 'ååéæ©';
$lang[259] = 'æ¾ç¤º';
$lang[260] = 'ä¸è½½';
$lang[261] = 'ææ';
$lang[262] = 'åç§°';
$lang[263] = 'å¤§å°';
$lang[264] = 'æ³¨é';
$lang[265] = 'æ¥æ';
$lang[266] = 'æ²¡æåç°æä»¶';
$lang[267] = 'æ¯æä»¥ä¸ç½ç«';
$lang[268] = 'æé¤ä»¥ä¸æ¯æ';
$lang[269] = 'è°è¯æ¨¡å¼';
$lang[270] = 'åªæ¾ç¤ºé¾æ¥';
$lang[271] = 'åªæ¾ç¤ºå é¤é¾æ¥';
$lang[272] = 'æ£æ¥é¾æ¥';
$lang[273] = 'è½½å¥ä¸­...';
$lang[274] = 'å¤çä¸­ï¼è¯·ç¨å...';
$lang[275] = 'æå¡å¨ç©ºé´';
$lang[276] = 'å¨ä½¿ç¨';
$lang[277] = 'å©ä½ç©ºé´';
$lang[278] = 'ç£çç©ºé´';
$lang[279] = 'CPU';
$lang[280] = 'æå¡å¨æ¶é´';
$lang[281] = 'æ¬å°æ¶é´';
$lang[282] = 'èªå¨å é¤';
$lang[283] = 'å°æ¶åTransload';
$lang[284] = 'åéå Transload';
$lang[285] = 'å¨ä½';
$lang[286] = 'ä¸ä¼ ';
$lang[287] = 'FTPæä»¶';
$lang[288] = 'çµå­é®ä»¶';
$lang[289] = 'å¤§éçµå­é®ä»¶';
$lang[290] = 'åå²æä»¶';
$lang[291] = 'åå¹¶æä»¶';
$lang[292] = 'MD5åå¸';
$lang[293] = 'åæä»¶';
$lang[294] = 'å¶ä½ZIPæä»¶';
$lang[295] = 'è§£åZipæä»¶';
$lang[296] = 'éå½å';
$lang[297] = 'æ¹ééå½å';
$lang[298] = 'å é¤';
$lang[299] = 'é¾æ¥åè¡¨';
$lang[300] = 'æ£ç´¢ä¸è½½é¡µé¢';
$lang[301] = 'è¾å¥';
$lang[302] = 'è¿é';
$lang[303] = 'ä¸è½½æä»¶';
$lang[304] = 'configs/files.lst æ æ³åå¥ï¼è¯·ç¡®è®¤chmod æéå° 777';
$lang[305] = '&nbsp; éççä¸è½½è·¯å¾æ æ³åå¥ãè¯·CHMODå°777';
$lang[306] = 'åå¹¶æä»¶';
$lang[307] = 'è¯·ç¨å';
$lang[308] = 'éè¿';
$lang[309] = 'å¤±è´¥';
$lang[310] = 'æ²¡æå¼å¯è¿ä¸ªä½ å¯è½ä¼æ¶å°è­¦å';
$lang[311] = 'æ¨å¯è½æ æ³æ¥çæå¡å¨çä¿¡æ¯';
$lang[312] = 'ä½ çæå¡å¨å¯è½ä¸æ¯æè¶è¿2Gçæä»¶';
$lang[313] = 'Rapidleechæ£æ¥èæ¬';
$lang[314] = 'fsockopen';
$lang[315] = 'memory_limit';
$lang[316] = 'safe_mode';
$lang[317] = 'cURL';
$lang[318] = 'allow_url_fopen';
$lang[319] = 'PHPçæ¬ -';
$lang[320] = 'allow_call_time_pass_reference';
$lang[321] = 'passthru';
$lang[322] = 'ç£çç©ºé´åè½';
$lang[323] = 'Apacheçæ¬ -';
$lang[324] = 'è¾å¥ä»£çå°åéè¯¯';
$lang[325] = 'æä»¶ä¿å­æåï¼';
$lang[326] = 'ä¿å­ç¬è®°';
$lang[327] = 'Notes';
$lang[328] = 'ç¦æ­¢å¨ä½';
$lang[329] = 'ä¸»çªå£';
$lang[330] = 'è®¾ç½®';
$lang[331] = 'æå¡å¨æä»¶';
$lang[332] = 'é¾æ¥æ£æ¥å¨';
$lang[333] = 'æä»¶';
$lang[334] = 'èªå¨Transload';
$lang[335] = 'èªå¨ä¸ä¼ ';
$lang[336] = 'æä»¶å¤§å°æ¯æéå¶çå¨';
$lang[337] = 'æä»¶å¤§å°éå¶ï¼';
$lang[338] = 'å¶ä½RARæä»¶';
$lang[339] = 'è§£åRARæä»¶';
$lang[340] = 'æ£æµå°éè¯¯';
$lang[341] = 'ç¹å»è¿éå±å¼';
$lang[342] = 'ä½ å¯ä»¥ä»è¿éæå¨çªå£';
$lang[343] = 'æ æ³æ¾å°"rar"<br /> ä½ éè¦ä¸è½½âRARâå¹¶è§£åå®å°"/rar/" æä»¶å¤¹ä¸';
$lang[344] = 'æä»¶å°ä¼è¢«å­æ¡£ï¼';
$lang[345] = 'å­æ¡£åç§°:';
$lang[346] = 'éé¡¹ï¼';
$lang[347] = 'åç¼©ç­çº§ï¼';
$lang[348] = 'å¨å­';
$lang[349] = 'æå¿«';
$lang[350] = 'å¿«é';
$lang[351] = 'æ å';
$lang[352] = 'è¾å¥½';
$lang[353] = 'æå¥½';
$lang[354] = 'åå»ºå·';
$lang[355] = 'å­æ¡£åå é¤æä»¶';
$lang[356] = 'åå»ºåºå®å­æ¡£';
$lang[357] = 'åå»ºæ¢å¤è®°å½';
$lang[358] = 'åç¼©å®åæµè¯å­æ¡£';
$lang[359] = 'ä½¿ç¨å¯ç ';
$lang[360] = 'å å¯æä»¶å';
$lang[361] = 'è®¾ç½®å­æ¡£åé¨è·¯å¾';
$lang[362] = 'RAR';
$lang[363] = 'åå»ºå­æ¡£ï¼ <b>%1$s</b>';
$lang[364] = 'è¯·ç¨å';
$lang[365] = 'è¿åå°æä»¶åè¡¨';
$lang[366] = '<b>ä»æä»¶ %1$s</b>ï¼';
$lang[367] = 'æ æ³æ¾å° âunrarâ';
$lang[368] = 'æ¾ç¤ºæä»¶åè¡¨éè¦å¯ç ï¼';
$lang[369] = 'è§£åæä»¶éè¦å¯ç ï¼';
$lang[370] = 'éè¯¯ï¼%1$s';
$lang[371] = 'åæ¬¡å°è¯æ¾ç¤ºåè¡¨';
$lang[372] = 'éæ©érar';
$lang[373] = '<b>è§£åç¼©æä»¶ %1$s</b>ï¼';
$lang[374] = 'ç¶æï¼';
$lang[375] = 'éæ©ææ¬';
$lang[376] = 'é«çº§å¸æ·ï¼';
$lang[377] = '38 [è§é¢ï¼ MP4 4096x3072 | é³é¢ï¼ AAC 2ch 44.10kHz]';
$lang[378] = 'å³é­çªå£';
$lang[379] = 'æä»¶';
$lang[380] = 'MD5 æ´æ¹åªè½åºç¨äºå·²ç¥å¯æä½æ ¼å¼ï¼å¦ .rar æ .zipï¼ä¸ï¼<br />ä½ è¦ç»§ç»­åï¼';
$lang[381] = 'æä»¶ <b>%1$s</b> çMD5å·²æ´æ¹ '; // %1$s = filename
$lang[382] = 'æ´æ¹æä»¶ <b>%1$s</b> çMD5åºéï¼ '; // %1$s = filename
$lang[383] = 'MD5æ´æ¹';
$lang[384] = 'æææ¬å¹é';
$lang[385] = 'å¹é';
$lang[386] = 'å¿½ç¥å¤§å°å';
$lang[387] = 'æ¯ä¸ªæä»¶æ¾å¨ä¸ä¸ªåç¬çå­æ¡£ä¸­';
$lang[388] = 'OpenSSL';
$lang[389] = '44 [è§é¢ï¼ WebM 854x480 | é³é¢ï¼ Vorbis 2ch 44.10kHz]';
?>
<?php

require_once('rl_init.php');
if ($options['notes_disable']) {
	require_once('deny.php');
	exit();
}

login_check();

include(TEMPLATE_DIR.'header.php'); ?>
<br />
<?php

	if (!file_exists(DOWNLOAD_DIR.basename(lang(327)).'.txt')) {
		$temp = fopen(DOWNLOAD_DIR.basename(lang(327)).'.txt', 'w');
		fclose($temp);
	}
	if (isset($_POST['notes']) && $_POST['notes']) {
		file_put_contents(DOWNLOAD_DIR.basename(lang(327)).'.txt', $_POST['notes']);
?>
	<p><?php echo lang(325); ?></p>
<?php
	}
	$content = file_get_contents(DOWNLOAD_DIR.basename(lang(327)).'.txt');
?>
<div align="center">
<form method="post" action="<?php echo $PHP_SELF;?>">
<textarea class="notes" name="notes" rows="1" cols="1"><?php echo htmlentities($content); ?></textarea>
<br /><input type="submit" name="submit" value="<?php echo lang(326); ?>" />
</form>
</div>
<?php include(TEMPLATE_DIR.'footer.php'); ?>
order deny,allow
deny from all
Rapidleech PlugMod (by eqbal)
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\

====================================
Rev. 430 - Dec 31, 2014

[SECURITY] Fixed XSS on file's comments.
More strict .htaccess at /files/
[FIX] Issues at parsing link password in "link|pass" format.
Regexp in DownloadClass's reCAPTCHA function.
[CHANGE] Some changes in http headers.
Added 2 functions to DownloadClass for SolveMedia captchas.
Rewritten /class/cookie.php, for avoid rare cookie-related issues.
Added putfile() function in /class/http.php for uploading files with PUT
requests.
Revised upfile function.
Added Origin headers automatically on upfile() and putfile().
[PLUGINS] Deleted many non existing/working hosts.
Added some updated plugins.
Added GenericXFS_DL (alpha), plugins using it will come soon.


====================================
Rev. 42 - 19 Mar 2011
[PLUGIN] Added some newly made plugins(Baking, kaox, Raj Malhotra)
[PLUGIN] Removed some died sites plugins(Raj Malhotra)
[FIX]Little security fix ,to file downloaded RL not show more the full file path
[SECURITY] WARNING: Bug found due to the insert_location() function (download system) which reveals premium cookies and base_64 encoded auth-strings to end user(s). The premium accounts of rapidleech servers providing premium-account downloads to public, are in danger of having their premium accounts compromised! Private rapidleech servers are safe for now, but are strongly encouraged to upgrade
[SECURITY] Standard auth system for premium accounts is put in place, any premium plugins not adhering to the new standard will either be compromised, or won't work with the new system. Premium account data using base64 authorisation are no longer passed via the insert_location function, instead they are retrieved internally
[SECURITY] New premium cookie encryption system implemented (due to the complexity of cookie system and to keep load on 3rd-party servers to a minimum, cookies are encrypted instead, and then decrypted when needed)
[SECURITY] New $secretkey in accounts.php, which is used for cookie encryption. A standard key is included, but you must create your own random string, max 56 characters in length
[SECURITY] Rapidshare, Hotfile, Megaupload, Netload premium system updated. Other filehost premium plugins will need to be updated, if needed (this includes paid-for plugins also)

Rev. 41 - 28 June 2009
[PLUGIN] Added some newly made plugins (Baking, kaox)
[SECURITY] Replaced megaupload download plugin for password protected files, to prevent premium cookie leak (thanhquanky)
[FIX] Not sure if it will increase speed, but definately updated http.php for socket connections
[FIX] Remove the var_dump in the imageshack.us plugin.
[SECURITY] Prevented same host leeching with bw_save = false
[BUG] Fixed forward slash shown in link list.
[BUG] Fixed list links showing links that are url encoded.
[FIX] Possible fix for mass submit problem with email
[FIX] Fixed a problem with the mail function.
[PLUGIN] Added Supernova member upload plugin (kaox)
[FIX] Merged filefactory free fix (mrbrownee) with premium options pluin
[FIX] Fixed Megavideo upload plugin (minor GetCookies problem)
[FEATURE] Choose between Youtube formats (&fmt=18 or 34, more to follow)
[FIX] Updated youtube_com.php download plugin for new selector, and set &fmt=18 back to the default HQ method; also some minor edits to main.php needed
[FIX] Updated hotfile_com.php (kaox), turboupload.com for member upload, and renamed turboupload free to turboupload.com_free.php
[PLUGIN] Added uploadbox.com member upload plugin
[REMOVED] Deleted died hosts plugins.
[FIX] Edited to megavideo_com.php to meet plugin specifications.
[FIX] Fixed a problem where the bar for CPU load and hard drive space are not shown.
[FIX] Removed improper entry from options/.htaccess.
[FIX #0000041] Fixed server info not display in page in classes/.htaccess thanks to capitanonemo
[FEATURE] Added link list feature.
[FIX] Fixed filefactory_com.php premium download plugin. Will now also work with setting a premium (FileFactory) account under Settings Tab.
[FIX] Fixed autoupload opened window is less than entered.
[FEATURE] Now able to preview files and folders inside zip files before unzipping them
[FEATURE] Removed the add directory option when zipping files
[BUG] Fixed adding non-existent zip file when creation of zip file failed
[BUG] Fixed adding extra entry when zip file already present.
[FIX #0000037] Fixed zip features make zip file in "rapidleech" directory not in "files" directory
[PLUGIN] Added uploaded.to member upload plugin
[FIX] Fixed filefactory.com_member upload plugin
[PLUGIN] Added in several of kaox's plugins and replaced some older versions with new
[FIX] Fixed unable to pack files.
[FIX] Fixed a js.php problem where it wasn't allowed because of missing directive in classes/.htaccess
[FIX #0000014] Reimplemented fix when autoupload not sending correct file name to upload.php on files with special characters in name Thanks to DanielX_x
[FIX] Fixed a typo error in autoupload error message.
[FIX] Fixed youtube_com.php download plugin for getting HQ downloads (untested for all original file formats)
[PLUGIN] Added usershare.net member upload plugin (kaox)
[SECURITY] Added .htaccess files to each directory (also added index.html files for extra security), and added comment about using checker.php to root .htaccess
[FIX] Fixed existing index.html files' paths to RL logo
[FIX #0000033] Fixed file size not displayed after merging a file without crc Thanks to DanielX_x
[FIX] Fixed unable to use premium account when auto download in server-side.
[FIX] Fixed unable to split files.


Rev. 40 - 06/12/2009
[FEATURE] Added server side auto download capability.
[CHANGE] Removed the <form> tag when files aren't present and made some html corrections thanks to DanielX_x
[FIX #0000031] Fixed bytesToKbOrMbOrGb gives warning when filesize is 0 (Reported by DanielX_x)
[FIX] Fixed most of the plugin so that it will work with the new auto transload system.
[CHANGE] The way depositfiles and easyshare premium plugin created was quite incorrect, it should be together with the free user plugin and be able to accept premium details from $_POST and in config.php
[FIX] Added a missing configuration parameter
[FIX] Fixed rapidshare plugin problem when auto transload
[FIX] Fixed unable to use premium account in auto transload.
[FIX] Fixed netload premium download plugin
[BUG] Fixed a bug which was fixed previously actually but just replaced by the new version of auto upload.
[CHANGE] Moved download plugin files into separate download/ folder in hosts/ directory
[FEATURE] Updated to latest auto upload script.
[SECURITY] Patched up a hole which was reported by BKiS long ago and should have been fixed but wasn't include in the previous release.

Rev. 39b - 06/10/2009
[CHANGE] Edited most $Array[String] to $Array["String"] which should improve speed a little
[CHANGE] Separated options' actions to make it easier to manage.
[FIX] Fixed 'call-time pass-by-reference has been deprecated' warnings.
[CHANGE] Removed gigaup.fr upload plugin on request

Rev. 39 - 06/08/2009
[FIX] Added more information on error when page is not found or forbidden.
[CHANGE] Editted javascript so that the download progress will be displayed in front on titlebar so that you can see it even if you open a lot of tabs.
[FIX] Fixed the split/merge option. Thanks to DanielX_x!
[CHANGE] Rewrote get header function
[CHANGE] Rewrote formpostdata function
[CHANGE] GetCookies function will only get cookie name and its value
[CHANGE] Rewrote bytesToKbOrMbOrGb function so that it can actually format to Yotabytes, and it's shorter too
[FEATURE] Will check configs/files.lst and download directory chmod now
[CHANGE] Made some documentation in http.php
[SECURITY] Fixed a security exploit with merge/split - thanks to DanielX_x
[FEATURE] Implemented doum's auto download
[FIX] Fixed auto download not starting due to javascript problem
[FIX #0000027] Fixed a javascript problem which cause the clearsettings cookie not being set
[FIX #0000028] fixed bug in .htaccess that allowed running maliciously named php files
[CHANGE] edited hosts/rapidshare_com.php to allow usage of the premium details which can be set via the settings tab
[CHANGE] Removed .JD files which existed for unknown reasons
[BUG] Upload is now working ok and most of the <? short tags have been replaced with proper <?php tags
[FIX] Fixed netload premium plugin.
+lots of latest plugins integrated
+old theme returned, as black background is too dark, some minor css changes needed


Rev. 38 - 05/09/2009
+lots of plugins updated, including premium features
+new GetCookies() function (should be faster)
+AJAX Link Checker and Storage infos
+server and local times synchronised, fixed formatting
+various http.php download function improvements
+index.php redirects updated for case insensitive location: redirects
+fixed a js/progressbar problem when uploading a file containing an apostrophe (') [see http://bugs.rapidleech.com/view.php?id=13]
+auul.php updated for ' in filenames (use base64 instead)
+some minor .htaccess updates
+some minor css updates

Rev. 37 - (buggy test update)

Rev.36 - 12/8/2008
+Upload-Plugin > Rapidshare.com(Premium), Netload.in, Megaupload.com, Uploadstube.de, Shareator.com, Flyupload.com, Load.to
+Added > Imageshack-torrent account to Auto-Download.
+Fixed > Letitbit.net

Rev. 35 - 11/12/2008
+Download-Plugin > Uploaded.to(premium), vBulletin attachment (Set un/pass in config.php or Settings > Use Premium Account)
+Upload-Plugin > 4shared.com, Fileflyer.com, MyBloop.com, Ziddu.com
+Fixed > ADrive.com
+Updated > index.php, main.php, config.php
+RapidgetPro Upload-plugin > mediafire.com(fixed), sharedzilla.com, uploadground.com, dl4.ru, asapload.com, turboupload.com, storeandserve.com, fileshare.in.ua, old.nahraj.cz, filex.kz

Rev. 34 - 11/5/2008
+Upload-Plugin > Adrive.com(needs cURL), 2shared.com

Rev. 33 - 10/30/2008
+Upload-Plugin > MegaVideo.com
+Download-Plugin > Megashares.com Premium-plugin (by doum-ti-di-li-doom)
+Some php4 compatibility fixes. (thanx to doum-ti-di-li-doom)

Rev. 32 - 10/28/2008
+Config.php > Auto-Rename (prefix/suffix)
+Updated > http.php, ftp.php, Rapidshare-Plugin
+Some minor fixes.

Rev. 31 - 10/21/2008
+Download-Plugin > www.share-online.biz (only premium)
+Config.php > Auto-Delete(by doum-ti-di-li-doom)

Rev. 30
+Upload-Plugin > Depositfiles.com (premium & free account)
+Download-Plugin > FileSend.net
+Fixed > netload.in(premium)
+Some minor fixes.
---by doum-ti-di-li-doom:
+Download-Plugin > Gigasize.com(Premium)
+Fixed > 4shared.com

Rev. 29 - 10/1/2008
+Upload-Plugin > www.filesend.net(Premium).
+Download Plugin(by doum-ti-di-li-doom) > uploads.bizhat.com
+fixed(by doum-ti-di-li-doom) > ziddu.com, ADrive.com.

Rev. 28 - 9/6/2008
+Upload-Plugin > Gigasize.com(Premium and Free Account).
+Download-Plugin (by doum-ti-di-li-doom) > Sharebase.to, Megashare.com[Free&Premium], Sharedzilla.com, Depositfiles.com, Ziddu.com,  Uploaded.to .
+http.php fixed.
---Update 1:
	+Gigasize.com upload-plugin fixed.
---Update 2:
	+Updated > http.php/other.php/upload.php
---Update 3:
	+Letitbit.net fixed. (by doum-ti-di-li-doom)
	+Rapidshare.com updated.
	+LinkChecker fixed.
---Update 4:
	+ Security update.

Rev. 27 - 8/25/2008
+UploadLinks format changed from plain-text to html.
+$download_dir_is_changeable fixed. (default: false)
---Update 1:
	+Some minor fixes.
---Update 2:
	+Some other fixes.

Rev. 26 - 8/22/2008
+Upload-Section added.
+Upload-Plugin > yousendit.com, badongo.com(free-account)
+Config.php > Disable All Actions.
+Some other fixes.
---Update 1:
	+PHPRAPIDGET Upload-Plugins Added.
---Update 2:
	+Mediafire.com fixed.

Rev. 25 - 8/18/2008
+Mediafire.com added.
+Sharebase.de added.
+Youtube.com MP4 fixed.
+ADrive.com fixed.

Rev. 24 - 8/17/2008
+Netload.in premium added.(netload_in.php updated)
+config.php updated. ($premium_acc["netload"])

Rev. 23 - 8/9/2008
+Filego.net added.
+Zippyshare.com added.
+Youtube.com fixed.
+Some other fixes.

Rev. 22 - 7/29/2008
+Link Checker added. (coded by dman biatches)
+Megaupload.com premium fixed.
+Sendspace.com fixed.
--Update 1
	-main.php fixed.

Rev. 21 - 7/10/2008
+Security update:
	_Config.php -> check forbidden-filetypes before unzipping.
+Adrive.com updated.

Rev. 20 - 7/3/2008
+Fixed:
    _Rapidshare.com
	_Filefactory.com
	_Netload.in

Rev. 19 - 6/27/2008
+Rapidshare.com updated.
+http.php updated.
+Basic Authentication for audl.php.
+Big-File Split Problem Fixed. (by Kingstone)


Rev. 18 - 6/16/2008
+MD5 hash added.
+config.php > Bandwidth saving.
+Rapidshare.com updated.

Rev. 17 - 6/9/2008
+2shared.com added.
+savefile.com added.
+4shared.com fixed.
+index.php fixed and now you can use any port in the Direct-URL. (like this: http://220.239.128.62:443/SONGS/SINHALA/ABEY%20-%20NIRANJALA/009%20-%20Diyapita%20Anda.mp3)
+config.php > Auto-Download Premium Accounts.

Rev. 16 - 6/4/2008
+Rapidshare.com fixed.

--Update 5
+mirror-server-list fixed.
--Update 4
+Rapidshare Download-button fixed.
--Update 3
+Megaupload.com premium updated. (now support both direct and indirect mode)
+Some minor bugs fixed.
--Update 2
+Waiting-time fixed.
--Update 1
+RS Happy Hour fixed.

Rev. 15 - 6/2/2008
+Imageshack.us torrent plugin updated. (Use only final-direct-download-link, NOT http://img~.imageshack.us/tor/browse/?id=~)
+4shared.com updated.
+List style changed.
+Unzip files - beta.(zip archive will be extracted to your DOWNLOAD directory - '$download_dir' > default: 'files/')

Rev. 14 - 6/1/2008
+PluginOptions > Megaupload.com Cookie Value (like: b658b369856766f621ca292fac113a5c, that contains un&pass of premium account and can be shared with others, because it's an encrypted value).
+Megaupload.com plugin updated.
+You can set Imageshack-account and Megaupload-cookie in config.php.
+filefactory.com fixed.
+MassRename.(batch file extension rename)
+Server Info. (space, cpu-load, time - you can disable it, see config.php)

Rev. 13 - 5/30/2008
+PluginOptions > Disable All Plugins.

Rev. 12 - 5/30/2008
+Imageshack torrent plugin added.

Rev. 11 - 5/27/2008
+www.files.to added.
+www.fileflyer.com added.
+easy-share.com updated.

Rev. 10 - 5/23/2008
+Security update.

Rev. 9 - 5/21/2008
+Youtube.com updated.
+Options.php fixed.
+netload.in fixed.

Rev. 8 - 5/19/2008
+easy-share.com added.
+netload.in added.

Rev. 7 - 5/18/2008
+Megashares plugin updated.
+disable_deleting option fixed.
+Error style changed.
+RapidgetPro Auto-Download added.

Rev. 6 - 5/14/2008
+Megashares.com added.
+cURL module is not needed anymore for Rapidshare.com plugin.
+New option: disable file deletion. (config.php)

Rev. 5 - 5/9/2008
+Speedyshare.com fixed.
+array_walk error fixed.

Rev. 4 - 5/9/2008
+Youtube fixed.
+PluginOptions > youtube HQ video.

Rev. 3 - 5/8/2008
+RSCaptcha-image directory changed.

Rev. 2 :
+Logo fixed.

Rev. 1 :
+www.gigasize.com added.
<?php

// This file must be included to work
if (count(get_included_files()) == 1) {
	require('deny.php');
	exit;
}

@set_time_limit(0);
@ini_set('memory_limit', '1024M');
if (ini_get('zlib.output_compression')) @ini_set('zlib.output_compression', 0);
if (ob_get_level()) ob_end_clean();
ob_implicit_flush(true);
header('X-Accel-Buffering: no');
clearstatcache();
error_reporting(6135);
$nn = "\r\n";
$fromaddr = 'RapidLeech';
$dev_name = 'Development Stage';
$rev_num = '43';
$plusrar_v = '4.2';
$PHP_SELF = $_SERVER['SCRIPT_NAME'];
define('RAPIDLEECH', 'yes');
define('ROOT_DIR', realpath('./'));
define('PATH_SPLITTER', ((strpos(ROOT_DIR, '\\') !== false) ? '\\' : '/'));
define('HOST_DIR', 'hosts/');
define('CLASS_DIR', 'classes/');
define('CONFIG_DIR', 'configs/');
define('BUILD', '30May2011');
define('CREDITS', '<a href="http://www.rapidleech.com/" class="rl-link"><b>RapidLeech</b></a>&nbsp;<b class="rev-dev">PlugMod (eqbal) rev. ' . $rev_num . '</b> <span class="rev-dev">' . $dev_name . '</span><br><small class="small-credits">Credits to Pramode &amp; Checkmate &amp; Kloon</small>');

require_once(CONFIG_DIR . 'setup.php');

// $options['download_dir'] should always end with a '/'
if (substr($options['download_dir'], - 1) != '/') $options['download_dir'] .= '/';
define('DOWNLOAD_DIR', (substr($options['download_dir'], 0, 6) == 'ftp://' ? '' : $options['download_dir']));
define('TEMPLATE_DIR', 'templates/' . $options['template_used'] . '/');
define('IMAGE_DIR', TEMPLATE_DIR . 'images/');
header('X-Frame-Options: SAMEORIGIN');
// Avoid Caching
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . gmdate ("D, d M Y H:i:s") . 'GMT');
header('Cache-Control: max-age=0, no-store, no-cache, must-revalidate, proxy-revalidate, post-check=0, pre-check=0');
header('Pragma: no-cache');

require_once(CLASS_DIR . 'other.php');


?>
order deny,allow
deny from all
order deny,allow

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files ~ "^\.">
deny from all
</files>
<?php
// You can do something here before finish executing the script
?>
</body>
</html>
<?php
/**
 * Renders the file actions, this function does NOT output directly to the browser
 * 
 * @return string The string will contain the <select></select> tag
 *
 */
function renderActions() {
	global $options;
	$return = "";
	$return .= '<select name="act" onchange="javascript:void(document.flist.submit());">';
	if ($options['disable_actions']) {
		$return .= '<option selected="selected">'.lang(328).'</option>';
		$return .= '</select>';
		return $return;
	}
	$return .= '<option selected="selected">'.lang(285).'</option>';
	if (!$options['disable_upload']) $return .= '<option value="upload">'.lang(286).'</option>';
	if (!$options['disable_ftp']) $return .= '<option value="ftp">'.lang(287).'</option>';
	if (!$options['disable_email']) $return .= '<option value="mail">'.lang(288).'</option>';
	if (!$options['disable_mass_email']) $return .= '<option value="boxes">'.lang(289).'</option>';
	if (!$options['disable_split']) $return .= '<option value="split">'.lang(290).'</option>';
	if (!$options['disable_merge']) $return .= '<option value="merge">'.lang(291).'</option>';
	if (!$options['disable_hashing']) $return .= '<option value="crc32">'.lang(390).'</option>' . '<option value="md5">'.lang(292).'</option>' . '<option value="sha1">'.lang(393).'</option>';
	if (!$options['disable_md5_change']) $return .= '<option value="md5_change">'.lang(383).'</option>';
	if ((file_exists ( CLASS_DIR . "pear.php" ) || file_exists ( CLASS_DIR . "tar.php" )) && !$options['disable_tar'])
		$return .= '<option value="pack">'.lang(293).'</option>';
	if (file_exists ( CLASS_DIR . "pclzip.php" ) && !$options['disable_zip'])
		$return .= '<option value="zip">'.lang(294).'</option>';
	if (file_exists ( CLASS_DIR . "unzip.php" ) && !$options['disable_unzip'])
		$return .= '<option value="unzip">'.lang(295).'</option>';
	if (substr(PHP_OS, 0, 3) != "WIN" && @file_exists(CLASS_DIR."rar.php")) {
		if (!$options['disable_rar']) { $return .= '<option value="rar">'.lang(338).'</option>'; }
		if (!$options['disable_unrar']) {
			if (@file_exists(ROOT_DIR.'/rar/rar') || @file_exists(ROOT_DIR.'/rar/unrar')) { $return .= '<option value="unrar">'.lang(339).'</option>'; }
		}
	}
	if (!$options['disable_rename']) $return .= '<option value="rename">'.lang(296).'</option>';
	if (!$options['disable_mass_rename']) $return .= '<option value="mrename">'.lang(297).'</option>';
	if (!$options['disable_delete']) $return .= '<option value="delete">'.lang(298).'</option>';
	if (!$options['disable_list']) $return .= '<option value="list">'.lang(299).'</option>';
	$return .= '</select>';
	return $return;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="blacklizt">
<meta name="robots" content="all">
<meta name="description" content="Neatblue simple skins for rapidleech">
<meta name="keywords" content="neatblue">
<link rel="stylesheet" href="templates/neatblue/styles/rl_style_pm.css">
<title><?php
if (!isset($nn)) $nn = "\r\n";
if (!isset($page_title)) {
	echo 'Rapidleech v2 rev. '.$GLOBALS['rev_num'];
} else {
	echo htmlspecialchars($page_title);
}
?></title>
<script type="text/javascript">
/* <![CDATA[ */
var php_js_strings = [];
php_js_strings[87] = " <?php echo lang(87); ?>";
pic1= new Image(); 
pic1.src="templates/neatblue/images/ajax-loading.gif";
/* ]]> */
</script>
<script src="classes/js.js"></script>
<?php
if ($GLOBALS['options']['ajax_refresh']) { echo '<script src="classes/ajax_refresh.js"></script>'.$nn; }
if ($GLOBALS['options']['flist_sort']) { echo '<script src="classes/sorttable.js"></script>'.$nn; }
?>
<script type="text/javascript">function toggle(b){var a=document.getElementById(b);if(a.style.display=="none"){a.style.display="block"}else{a.style.display="none"}};</script>
</head>
<body>
<header><img src="templates/neatblue/images/logo_pm.gif" height="62" width="369" alt="rapidleech neatblue"></header><br />
order deny,allow

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files ~ "^\.">
deny from all
</files>
<?php
if (!defined('RAPIDLEECH')) {
	require_once("index.html");
	exit;
}
?>
<table align="center">
<tbody>
<tr>
<td valign="top">
<table width="100%">
<tr>
<td valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr><td width="131" height="100%"><a onclick="toggle('hide-plg'); return false;"><div class="cell-plugin"><?php echo count($host); ?> <?php echo lang(333); ?></div></a></td></tr>
<tr>
<td height="100%" style="padding:0px;">
<span id="hide-plg" style="display: none;">
<div dir="rtl" align="left" style="overflow-y:scroll; height:150px; padding-left:3px;">
<?php
ksort($host);
foreach ($host as $site => $file)
	{
	echo '<span class="plugincollst">'.$site.'</span><br />';
	}
?>
</div>
<br />
</span>
<?php global $premium_acc;
if ( !empty ( $premium_acc ) )
{?>
<a onclick="toggle('hide'); return false;"><div class="cell-plugin"><?php echo lang(376); ?></div></a>
<span id="hide" style="display: none;">
<table border="0">
<tr>
<td height="100%" style="padding:3px;">
<div dir="rtl" align="left" style="padding-left:5px;">
<?php if ( !empty ( $premium_acc ) )
			{
				foreach ( $premium_acc as $serverName => $value )
				{
					echo '<span class="plugincollst">'. str_replace( '_', '.', $serverName ) .'</span><br />';
				}
			}
?>
</div>
</td>
</tr>
</table>
</span>
<br />
<?php
}
?>
<aside>
<?php
if (!$options['auto_download_disable']) {
?>    
<input class="button-auto" type="button" value="<?php echo lang(334); ?>" onclick="window.open('audl.php');return false;" /><br />
<?php
}
if (!$options['auto_upload_disable']) {
?>
<input class="button-auto" type="button" value="<?php echo lang(335); ?>" onclick="window.open('auul.php');return false;" /><br />
<?php
}
if (!$options['notes_disable']) {
?>
[ <a href="javascript:openNotes();"><?php echo lang(327); ?>.txt</a> ]
<?php
}
?>
</aside>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td align="center" valign="top"><table border="0" cellpadding="0" cellspacing="1">
<tbody>
<tr>
<td id="navcell1" class="cell-nav" onclick="javascript:switchCell(1);"><?php echo lang(329); ?></td>
<td id="navcell2" class="cell-nav" onclick="javascript:switchCell(2);"><?php echo lang(330); ?></td>
<td id="navcell3" class="cell-nav" onclick="javascript:switchCell(3);"><?php echo lang(331); ?></td>
<td id="navcell4" class="cell-nav" onclick="javascript:switchCell(4);"><?php echo lang(332); ?></td>
</tr>
</tbody>
</table>
<table id="tb_content">
<tbody>
<tr>
<td align="center">
<form action="<?php echo $PHP_SELF; ?>" name="transload" method="post"<?php if ($options['new_window']) { echo ' target="_blank"'; } ?>>
<table class="tab-content" id="tb1" cellspacing="5" width="100%">
<tbody>
<tr>
<td align="left">
<p align="left"><b><?php echo lang(207); ?>:</b><br />&nbsp;<input type="text" name="link" id="link" size="50" /></p>
<p align="left"><b><?php echo lang(208); ?>:</b><br />&nbsp;<input type="text" name="referer" id="referer" size="50" /></p>
</td>
<td align="left" valign="top">
<div style="padding-top:26px;"></div>
<input value="<?php echo lang(209); ?>" type="<?php echo ($options['new_window'] && $options['new_window_js']) ? 'button" onclick="new_transload_window();' : 'submit'; ?>" />
</td>
</tr>
<tr>
</tr>
<tr><td align="left">
<input type="checkbox" name="user_pass" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('usernpass').style.display=displ;" value="on" />&nbsp;<?php echo lang(210); ?></td></tr>
<tr id="usernpass" style="display: none;"><td align="center">
<?php echo lang(211); ?>: <input type="text" name="iuser" value="" /><br />
<?php echo lang(212); ?>: <input type="text" name="ipass" value="" />
</td></tr>
<tr>
<td align="left"><input type="checkbox" name="add_comment" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('comment').style.display=displ;" />&nbsp;<?php echo lang(213); ?></td>
</tr>
<tr id="comment" style="display: none;">
<td>
<textarea name="comment" rows="4" cols="50"></textarea>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
</tbody>
</table>
<table class="hide-table" id="tb2" cellspacing="5" width="100%">
<tbody>
<tr>
<td align="center">
<table align="center" style="text-align: justify;">
<tr><td align="left">
<small style="color:#55bbff"><?php echo lang(214); ?>:</small><hr />
<label><input type="checkbox" name="dis_plug" />&nbsp;<small><?php echo lang(215); ?></small></label>
</td></tr>
<tr>
<td align="left">
<label><input type="checkbox" name="cookieuse" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('cookieblock').style.display=displ;" />&nbsp;<small><?php echo lang(235); ?></small></label>
<table width="150"  border="0" id="cookieblock" style="display: none;">
<tr><td><?php echo lang(236); ?>;</td><td><input type="text" name="cookie" id="cookie" size="25" value="" /></td></tr>
</table>
</td>
</tr>
<td align="left"><small style="color:#55bbff"><?php echo lang(330); ?>:</small><hr /></td>
<?php if (!$options['disable_email']) { ?>
<tr>
<td><input type="checkbox" name="domail" id="domail" onclick="document.getElementById('emailtd').style.display=document.getElementById('splittd').style.display=this.checked?'':'none';document.getElementById('methodtd').style.display=(document.getElementById('splitchkbox').checked ? (this.checked ? '' : 'none') : 'none');"<?php echo isset($_COOKIE['domail']) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(237); ?></td>
<td>&nbsp;</td>
<td id="emailtd"<?php echo isset($_COOKIE['domail']) ? '' : ' style="display: none;"'; ?>><?php echo lang(238); ?>:&nbsp;<input type="text" name="email" id="email"<?php echo !empty($_COOKIE['email']) ? ' value="'.$_COOKIE['email'].'"' : ''; ?> /></td>
</tr>
<?php } ?>
<tr><td></td></tr>
<tr id="splittd"<?php echo isset($_COOKIE["split"]) ? '' : ' style="display: none;"'; ?>>
<td><input id="splitchkbox" type="checkbox" name="split" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('methodtd').style.display=displ;"<?php echo isset($_COOKIE["split"]) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(239); ?></td>
<td>&nbsp;</td>
<td id="methodtd"<?php echo isset($_COOKIE["split"]) ? '' : ' style="display: none;"'; ?>>
<table>
<tr>
<td>
<?php echo lang(240); ?>:&nbsp;<select name="method"><option value="tc"<?php echo isset($_COOKIE["method"]) && $_COOKIE["method"] == "tc" ? " selected" : ""; ?>><?php echo lang(241); ?></option><option value="rfc"<?php echo isset($_COOKIE["method"]) && $_COOKIE["method"] == "rfc" ? ' selected="selected"' : ''; ?>><?php echo lang(242); ?></option></select>
</td>
</tr>
<tr>
<td>
<?php echo lang(243); ?>:&nbsp;<input type="text" name="partSize" size="2" value="<?php echo isset($_COOKIE["partSize"]) && is_numeric($_COOKIE["partSize"]) ? $_COOKIE["partSize"] : 10; ?>" />&nbsp;<?php echo lang(244); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><input type="checkbox" id="useproxy" name="useproxy" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('proxy').style.display=displ;"<?php echo isset($_COOKIE["useproxy"]) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(245); ?></td>
<td>&nbsp;</td>
<td id="proxy"<?php echo isset($_COOKIE["useproxy"]) ? '' : ' style="display: none;"'; ?>>
<table width="150" border="0">
<tr><td><?php echo lang(246); ?>:&nbsp;</td><td><input type="text" name="proxy" id="proxyproxy" size="20"<?php echo !empty($_COOKIE["proxy"]) ? ' value="'.$_COOKIE["proxy"].'"' : ''; ?> /></td></tr>
<tr><td><?php echo lang(247); ?>:&nbsp;</td><td><input type="text" name="proxyuser" id="proxyuser" size="20"<?php echo !empty($_COOKIE["proxyuser"]) ? ' value="'.$_COOKIE["proxyuser"].'"' : ''; ?> /></td></tr>
<tr><td><?php echo lang(248); ?>:&nbsp;</td><td><input type="text" name="proxypass" id="proxypass" size="20"<?php echo !empty($_COOKIE["proxypass"]) ? ' value="'.$_COOKIE["proxypass"].'"' : ''; ?> /></td></tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><input type="checkbox" name="premium_acc" id="premium_acc" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('premiumblock').style.display=displ;"<?php if (count($premium_acc) > 0) print ' checked="checked"'; ?> />&nbsp;<?php echo lang(249); ?></td>
<td>&nbsp;</td>
<td id="premiumblock" style="display: none;">
<table width="150" border="0">
<tr><td><?php echo lang(250); ?>:&nbsp;</td><td><input type="text" name="premium_user" id="premium_user" size="15" value="" /></td></tr>
<tr><td><?php echo lang(251); ?>:&nbsp;</td><td><input type="password" name="premium_pass" id="premium_pass" size="15" value="" /></td></tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr<?php echo (!$options['download_dir_is_changeable'] ? ' style="display:none;"' : '');?>>
<td><input type="checkbox" name="saveto" id="saveto" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('path').style.display=displ;"<?php echo isset($_COOKIE["saveto"]) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(252); ?></td>
<td>&nbsp;</td>
<td id="path"<?php echo isset($_COOKIE["saveto"]) ? '' : ' style="display: none;"'; ?>><?php echo lang(253); ?>:&nbsp;<input type="text" name="path" size="40" value="<?php echo (!empty($_COOKIE["path"]) ? $_COOKIE["path"] : (substr($options['download_dir'], 0, 6) != "ftp://" ? realpath(DOWNLOAD_DIR) : $options['download_dir'])); ?>" /></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><input type="checkbox" name="savesettings" id="savesettings"<?php echo isset($_COOKIE["savesettings"]) ? ' checked="checked"' : ''; ?> onclick="javascript:var displ=this.checked?'':'none';document.getElementById('clearsettings').style.display=displ;" />&nbsp;<?php echo lang(254); ?></td>
<td>&nbsp;</td>
<td id="clearsettings"<?php echo isset($_COOKIE["savesettings"]) ? '' : ' style="display: none;"'; ?>><a href="javascript:clearSettings();"><?php echo lang(255); ?></a></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</form>
<table class="hide-table" id="tb3" cellspacing="5" width="100%">
<tbody><tr><td align="center" width="100%">
<?php
_create_list();
require_once(CLASS_DIR."options.php");
if($list)
  {
  if ($options['show_all'] === true)
    {
    unset($Path);
    }
?>
<a href="javascript:setCheckboxes(1);" class="chkmenu"><?php echo lang(256); ?></a> |
<a href="javascript:setCheckboxes(0);" class="chkmenu"><?php echo lang(257); ?></a> |
<a href="javascript:setCheckboxes(2);" class="chkmenu"><?php echo lang(258); ?></a> |
<a href="#" onclick="$('#flist_match_hitems').toggle();$('#flist_match_search').focus();return false;" class="chkmenu"><?php echo lang(384); ?></a>
<?php
  if ($options['show_all'] === true) {
?>
| <a href="javascript:showAll();"><?php echo lang(259); ?>&#173;
<script type="text/javascript">
if(getCookie("showAll") == 1)
  {
  document.write("<?php echo lang(260); ?>");
  }
else
  {
  document.write("<?php echo lang(261); ?>");
  }
</script></a>
<?php
  }
?>
<span id="flist_match_hitems" style="display:none;padding-top: 20px;"><br /><br />
<input type="text" size="20" id="flist_match_search" onkeypress="javascript:if(event.keyCode==13){flist_match();}" />
<input type="button" value="<?php echo lang(385); ?>" onclick="flist_match();" /><input type="checkbox" id="flist_match_ins" checked="checked" /><?php echo lang(386); ?>
</span>
<br /><br />
<form action="<?php echo $PHP_SELF; ?>" name="flist" method="post">
<?php echo renderActions(); ?>
<div style="position:relative; width:800px; padding:1px 0px 1px 0px;">
<div style="overflow:auto; height:auto; max-height:450px; width: 800px;">
<?php if ($options['flist_h_fixed']) { ?>
<table id="table_filelist_h" cellpadding="3" cellspacing="1" class="filelist" align="left" style="position:absolute;left:0px;top:0px;">
<tbody>
<tr class="flisttblhdr" valign="bottom">
<td id="file_list_checkbox_title_h">&nbsp;</td>
<td><b><?php echo lang(262); ?></b></td>
<td><b><?php echo lang(263); ?></b></td>
<td><b><?php echo lang(264); ?></b></td>
<td><b><?php echo lang(265); ?></b></td>
</tr>
</tbody>
</table>
<?php } ?>
<table id="table_filelist" cellpadding="3" cellspacing="1" width="100%" class="filelist" align="left">
<thead>
<tr class="flisttblhdr" valign="bottom">
<td id="file_list_checkbox_title" class="sorttable_checkbox">&nbsp;</td>
<td class="sorttable_alpha"><b><?php echo lang(262); ?></b></td>
<td><b><?php echo lang(263); ?></b></td>
<td><b><?php echo lang(264); ?></b></td>
<td><b><?php echo lang(265); ?></b></td>
</tr>
</thead>
<tbody>
<?php
  }
else
  {
  echo "<center>".lang(266)."</center>";
  if ($options['show_all'] === true)
    {
    unset($Path);
?>
<a href="javascript:showAll();"><?php echo lang(259); ?>&#173;
<script type="text/javascript">
if(getCookie("showAll") == 1)
  {
  document.write("<?php echo lang(260); ?>");
  }
else
  {
  document.write("<?php echo lang(261); ?>");
  }
</script></a><br /><br />
<?php
    }
  }
if($list)
  {
  $total_files = $filecount = $total_size = 0;
  foreach($list as $key => $file)
    {
    if (($size_time = file_data_size_time($file["name"])) === false) { continue; }
    $total_files++;
    $total_size+=$size_time[0];
?>
<tr class="flistmouseoff" onmouseover="this.className='flistmouseon'" onmouseout="this.className='flistmouseoff'" align="center" title="<?php echo htmlentities(basename($file["name"])); ?>" onmousedown="checkFile(<?php echo $filecount; ?>); return false;">
<td><input onmousedown="checkFile(<?php echo $filecount;?>); return false;" id="files<?php echo $filecount; ?>" type="checkbox" name="files[]" value="<?php echo $file["date"]; ?>" /></td>
<td><?php echo link_for_file($file["name"], FALSE, 'style="font-weight: bold; color: #000;"'); ?></td>
<td><?php echo $file["size"]; ?></td>
<td><?php echo (!empty($file['comment']) ? nl2br($file['comment']) : ''); ?></td>
<td><?php echo date("d.m.Y H:i:s", $file["date"]) ?></td>
</tr>
<?php
$filecount ++;
}
?>
</tbody>
<?php
  if (($total_files > 1) && ($total_size > 0)) {
    $tmp = '<tbody><tr class="flisttblftr">'.$nn.'<td>&nbsp;</td>'.$nn.'<td>Total:</td>'.$nn.'<td>'.bytesToKbOrMbOrGb($total_size).'</td>'.$nn.'<td>&nbsp;</td>'.$nn.'<td>&nbsp;</td>'.$nn.'</tr></tbody>';
    echo $tmp;
    if ($options['flist_h_fixed']) {
      echo '</table><table id="table_filelist_f" cellpadding="3" cellspacing="1" class="filelist" align="left" style="position:absolute;left:0px;bottom:0px;">'.$tmp;
    }
  }
  unset($total_files,$total_size);
?>
</table>
</div>
</div>
</form>
<?php
  }
?>
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready(function() {
<?php if ($options['flist_sort']) { ?>
  sorttable.makeSortable(document.getElementById('table_filelist'));
<?php } if ($options['flist_h_fixed']) { ?>
  $('#table_filelist_h tr.flisttblhdr td').each(function(id) {
    $(this).click((function (x) { return function() { $('#table_filelist tr.flisttblhdr td:eq('+x+')').click(); table_filelist_refresh_headers(); }; })(id));
  });
<?php } ?>
});
/* ]]> */
</script>
<!--Start Lix Checker-->
<table class="hide-table" id="tb4" cellspacing="5" width="100%">
<tbody>
<tr>
<td align="center" width="100%">
<div style="text-align:center">
<div align="center"><b><?php echo lang(267); ?></b></div>
<?php
// Print out workable sites for link checker
$name = array_keys($sites);
sort($name);
$workswith = implode(' | ', $name);
?>
<div class="workswith"><?php echo $workswith; ?>
<br /><b><?php echo lang(268); ?></b><br />
Anonym.to | Linkbucks.com | Lix.in<br />
Rapidshare.com Folders | Usercash.com</div><br />
<div align="center">
<form action="ajax.php?ajax=linkcheck" method="post" id="linkchecker" onsubmit="return startLinkCheck();">
<textarea rows="10" cols="87" name="links" id="links"></textarea><br /><br />
<div style="text-align:center; margin:0 auto; width:450px;"><a href="<?php echo $PHP_SELF.'?debug=1' ?>" style="color:#3B5A6F"><b><?php echo lang(269); ?></b></a></div><br />
<?php echo lang(270); ?>: <input type="checkbox" value="1" name="d" id="chk_d" />
<?php echo lang(271); ?>: <input type="checkbox" value="1" name="k" id="chk_k" /><br /><br />
<input type="submit" id="submit" value="<?php echo lang(272); ?>" name="submit" />
</form>
</div>
<p style="text-align:center; font-size:11px">
<small>Lix Checker v3.0.0 | Copyright Dman - MaxW.org | Optimized by zpikdum and sarkar<br />
<b>Mod by eqbal | Ajax'd by TheOnly92 | Updated by Th3-822</b></small>
</p>
<span id="loading" style="display: none;">
&nbsp;&nbsp;
<?php echo lang(273); ?>
<img alt="<?php echo lang(274); ?>" src="templates/neatblue/images/ajax-loading.gif" name="pic1" />
</span>
<div align="center"><div id="linkchecker-results" style="text-align: left;"></div></div>
</div>
</td>
</tr>
</tbody>
</table>
<!--End lix checker-->
<?php
	if(isset($_GET["act"]))
	  {
		echo '<script type="text/javascript">switchCell(3);</script>';
	  }
	elseif(isset($_GET["debug"]) || isset($_POST["links"]))
	  {
		echo '<script type="text/javascript">switchCell(4);</script>';
	  }
	else
	  {
		echo '<script type="text/javascript">'."$('#navcell1').addClass('selected');</script>";
	  }
?>
</td>
<td valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
<td valign="top">
<!--Start r-sidebar , Put your content in this block-->
<!-- End r-sidebar -->
</td>
</tr>
</tbody>
</table>
<br />
<table width="60%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div align="center"></div>
<script type="text/javascript">
var show = 0;
var show2 = 0;
</script>
<div align="center">
<?php
if ($options['file_size_limit'] > 0) {
echo '<span style="color:#DCDCDC">'.lang(337).' <b>' . bytesToKbOrMbOrGb ( $options['file_size_limit']*1024*1024 ) . '</b><br /></span>';
}
?>	
<?php
$delete_delay = $options['delete_delay'];
if (is_numeric($delete_delay) && $delete_delay > 0){
if($delete_delay > 3600){
$ddelay = round($delete_delay/3600, 1);
print '<span class="autodel">'.lang(282).': <b>'.$ddelay.'</b>&nbsp;'.lang(283).'</span>';
}else{
$ddelay = round($delete_delay/60);
print '<span class="autodel">'.lang(282).': <b>'.$ddelay.'</b>&nbsp;'.lang(284).'</span>';
}
}
?>
</div>
<div id="sinfo">
<?php if($options['server_info']) {
ob_start();
?>
<div id="server_stats"><?php require_once(CLASS_DIR."sinfo.php"); ?></div>
<?php if ($options['ajax_refresh']) { ?>
<script type="text/javascript">var stats_timer = setTimeout("refreshStats()",10 * 1000);</script>
<?php
}
ob_end_flush();
}
?>
<hr />
<?php echo CREDITS;?><footer>&copy; Design : blacklizt</footer>
</div>
</td>
</tr>
</table>
<?php
if (isset($_GET["act"]) && ($_GET["act"] == 'unrar_go') && !$options['disable_unrar']) {
require_once(CLASS_DIR."options/unrar.php");
unrar_go_go();
}
elseif (isset($_GET["act"]) && ($_GET["act"] == 'rar_go') && !$options['disable_rar']) {
require_once(CLASS_DIR."options/rar.php");
rar_go_go();
}
?>
<hr />
<center>
<table class="ss-cpu-table">
<tr>
<td valign="top" class="ss-td-style"><span class="ss-span-style"></span>
<?php echo lang(276); ?>:<b><span id="inuse"><?php echo ZahlenFormatieren($belegt); ?></span></b>&nbsp;<b>/ <span id="diskspace"><?php echo ZahlenFormatieren($insgesamt); ?></span></b><br />
<?php if (extension_loaded('gd') && function_exists('gd_info')) { ?>
<img src="<?php echo CLASS_DIR ?>bar.php?rating=<?php echo round($prozent_belegt,"2"); ?>" id="diskpercent" alt="" /><br />
<?php } ?>
</td>
<td valign="top" class="cpu-td"><span class="cpu-span">
<?php
if ($cpu_string === -1) { "getCpuUsage(): couldn\'t access STAT path or STAT file invalid".'</span><hr />'; }
else { echo '</span>'.$cpu_string; }
?>
</td>
</tr>
</table>
</center>
order deny,allow

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files ~ "^\.">
deny from all
</files>
/*
Theme Name		: Neat Blue
Theme URl		: http://www.rapidleech.com/topic/11813-neatblue-skin/
Author			: blacklizt
Description		: The Rapidleech theme that graced versions v2 rev. 43 r395 and prior
Version			: 3.2.6 (Update 2011, 7th Nov)
*/
footer,header{display:block}textarea,input{background:#505050;color:#fff;border:1px solid #666;font-size:16px}input:hover{background:#454545;border:1px solid #a57e33}hr{height:1px;border-width:0;padding:0;margin:1px 0 2px 0;background:#4a4a4a}img,table{border:0}body{font:14px "segoe ui",tahoma,sans-serif;color:#fff;background:#111;margin:0;padding:0}tr{font:12px verdana,arial,helvetica,sans-serif;color:#fff}input,select,textarea,.caption,.transloadui,.uploadui{font:14px tahoma,sans-serif}a,.chkmenu{color:#5af}th{border-left:1px solid #fff}.hide-table{display:none;width:100%}.filelist a,.rl-link{text-decoration:none}.filelist a:hover{text-decoration:underline}.title{font-size:18px}header,.g,.y,.r,.n{text-align:center}.g{color:#0f0}.y{color:#ff0}.r,.checkerf{color:#f00}.n{color:#00f}.style1{font-size:12px}.style2,.style1,.title{font-weight:bold}.linkchecker-load{opacity:.2}.font-black{color:#000}.font-blue{color:#05f}.warning{color:#f60}.htmlerror{color:#fff;background:#666;padding:3px;border:thin solid #dcdcdc}.flisttblhdr,.flisttblftr{background:#333;text-align:center;color:#fff}.ftpprogress{background:#fff;margin:1px;width:0;height:8px}.checkerp{color:#008000}.upstyles-dllink{border:2px solid #5af}.upstyles-dellink,.upstyles-statlink,.upstyles-admlink,.upstyles-userid,.upstyles-ftpuplink,.upstyles-accesspass,.upstyles-dllink{width:470px;border:1px solid #5af;background:#fff;padding:3px}.flistmouseon{background:#ccc;color:#373737}.flistmouseoff{background:#a9a9a9;color:#000}.workswith{text-align:center;padding:3px;color:#dedede;margin:0 auto;width:450px;font-size:9px;height:50px;overflow:auto;border:1px solid #666}.autodel{color:#dcdcdc}.cell-plugin,.button-auto{height:26px;width:114px;font:12px tahoma,sans-serif;padding-top:3px;color:#ccc;text-align:center;border:1px solid #505050;cursor:pointer}.cell-plugin:hover{background:#333;border:1px solid #a57e33}.button-auto{margin-bottom:1px;margin-top:1px;background:#333;border:0}.tab-content{padding:5px;width:100%}.progressouter{border:2px solid #000;width:300px;height:15px;box-shadow:inset 0 1px 0 rgba(255,255,255,0.5),0 0 3px rgba(0,0,0,0.9),0 0 6px rgba(255,255,255,0.9)}.progressdown,.progressup{background:#0c47f8;box-shadow:inset 0 1px rgba(255,255,255,0.3),inset 0 10px rgba(255,255,255,0.2),inset 0 10px 20px rgba(255,255,255,0.25),inset 0 -15px 30px rgba(0,0,0,0.3);width:0;height:15px;margin:1px}.cell-nav:hover,.button-auto:hover,.cell-plugin:hover,.flistmouseon{-o-transition-duration:400ms;-o-transition-timing-function:ease;-moz-transition-duration:400ms;-moz-transition-timing-function:ease;-webkit-transition-duration:400ms;-webkit-transition-timing-function:ease}.cell-nav:hover,.button-auto:hover{color:#000;background:#ccc}.selected{background:#1ec2f8!important}.cell-nav{height:33px;width:125px;font:14px tahoma,sans-serif;font-weight:800;color:#fff;text-align:center;border-top:1px dotted #505050;cursor:pointer}.md5table{font-family:monospace;color:#ffa300}.md5table th{background:#333;border:0}.md5table td{background:#454545}.rar-main-td,.unrar-main-td,.unrar-options{border:1px solid #666;border-bottom:0;padding:6px;background:#000}.rar-options-right-td,.unrar-main2-td,.rar-rb-td,.unrar-rb-td,.rar-options-left-td,.unrar-lb-td{padding:2px;background:#000}.rar-rb-td,.unrar-rb-td,.rar-options-right-td{border-right:1px solid #666}.rar-options-left-td,.unrar-lb-td,.unrar-main2-td{border-left:1px solid #666}.rar-space-td,.unrar-space-td{border-top:1px solid #666}.rar-table{text-align:left}.unrar-options{padding:2px}.notes{width:70%;height:300px}.rev-dev{color:#696969}.small-credits,footer{color:#999}.rapidleechhost{margin:0 auto}#sinfo{text-align:center;color:#e49}.ss-cpu-table{border-collapse:separate;border-spacing:0}.ss-td-style,.cpu-td,.cell-plugin a{color:#ccc;text-align:center}.cpu-td{width:200px}.container{border:1px solid #666;width:90%;background:#000}.adlinks{width:600px;height:400px;border:1px solid #505050}
<br />
<table align="center" cellspacing="0" cellpadding="0" class="transloadui" id="progressblock">
	<tr>
		<td></td>
		<td>
			<div class="progressouter">
				<div style="width:298px">
					<div id="progress" class="progressdown"></div>
				</div>
			</div>
		</td>
		<td></td>
	</tr>
	<tr>
		<td align="left" id="received">0 KB</td>
		<td align="center" id="percent">0%</td>
		<td align="right" id="speed">0 KB/s</td>
	</tr>
</table>
<br />
<div id="resume" align="center"></div>
<script type="text/javascript">
/* <![CDATA[ */
function pr(percent, received, speed)
{
	document.getElementById('received').innerHTML = '<b>' + received + '</b>';
	document.getElementById('percent').innerHTML = '<b>' + percent + '%</b>';
	document.getElementById('progress').style.width = percent + '%';
	document.getElementById('speed').innerHTML = '<b>' + speed + ' KB/s</b>';
	document.title = percent + '% Downloaded';
	return true;
}

function mail(str, field)
{
	document.getElementById('mailPart.' + field).innerHTML = str;
	return true;
}
/* ]]> */
</script>
<br />
<br />
<table align="center" cellspacing="0" cellpadding="0" class="uploadui" id="progressblock">
	<tr>
		<td></td>
		<td>
			<div class="progressouter">
				<div style="width:298px">
					<div id="progress" class="progressup"></div>
				</div>
			</div>
		</td>
		<td></td>
	</tr>
	<tr>
		<td align="left" id="received">0 KB</td>
		<td align="center" id="percent">0%</td>
		<td align="right" id="speed">0 KB/s</td>
	</tr>
</table>
<br />
<script type="text/javascript">
/* <![CDATA[ */
function pr(percent, received, speed)
{
	document.getElementById('received').innerHTML = '<b>' + received + '</b>';
	document.getElementById('percent').innerHTML = '<b>' + percent + '%</b>';
	document.getElementById('progress').style.width = percent + '%';
	document.getElementById('speed').innerHTML = '<b>' + speed + ' KB/s</b>';
	document.title = percent + '% Uploaded';
	return true;
}

function mail(str, field)
{
	document.getElementById('mailPart.' + field).innerHTML = str;
	return true;
}
/* ]]> */
</script><br />
order deny,allow

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files ~ "^\.">
deny from all
</files>
<?php
// You can do something here before finish executing the script
?>
</body>
</html>
<?php
/**
 * Renders the file actions, this function does NOT output directly to the browser
 * 
 * @return string The string will contain the <select></select> tag
 *
 */
function renderActions() {
	global $options;
	$return = "";
	$return .= '<select name="act" onchange="javascript:void(document.flist.submit());">';
	if ($options['disable_actions']) {
		$return .= '<option selected="selected">'.lang(328).'</option>';
		$return .= '</select>';
		return $return;
	}
	$return .= '<option selected="selected">'.lang(285).'</option>';
	if (!$options['disable_upload']) $return .= '<option value="upload">'.lang(286).'</option>';
	if (!$options['disable_ftp']) $return .= '<option value="ftp">'.lang(287).'</option>';
	if (!$options['disable_email']) $return .= '<option value="mail">'.lang(288).'</option>';
	if (!$options['disable_mass_email']) $return .= '<option value="boxes">'.lang(289).'</option>';
	if (!$options['disable_split']) $return .= '<option value="split">'.lang(290).'</option>';
	if (!$options['disable_merge']) $return .= '<option value="merge">'.lang(291).'</option>';
	if (!$options['disable_hashing']) $return .= '<option value="crc32">'.lang(390).'</option>' . '<option value="md5">'.lang(292).'</option>' . '<option value="sha1">'.lang(393).'</option>';
	if (!$options['disable_md5_change']) $return .= '<option value="md5_change">'.lang(383).'</option>';
	if ((file_exists ( CLASS_DIR . "pear.php" ) || file_exists ( CLASS_DIR . "tar.php" )) && !$options['disable_tar'])
		$return .= '<option value="pack">'.lang(293).'</option>';
	if (file_exists ( CLASS_DIR . "pclzip.php" ) && !$options['disable_zip'])
		$return .= '<option value="zip">'.lang(294).'</option>';
	if (file_exists ( CLASS_DIR . "unzip.php" ) && !$options['disable_unzip'])
		$return .= '<option value="unzip">'.lang(295).'</option>';
	if (substr(PHP_OS, 0, 3) != "WIN" && @file_exists(CLASS_DIR."rar.php")) {
		if (!$options['disable_rar']) { $return .= '<option value="rar">'.lang(338).'</option>'; }
		if (!$options['disable_unrar']) {
			if (@file_exists(ROOT_DIR.'/rar/rar') || @file_exists(ROOT_DIR.'/rar/unrar')) { $return .= '<option value="unrar">'.lang(339).'</option>'; }
		}
	}
	if (!$options['disable_rename']) $return .= '<option value="rename">'.lang(296).'</option>';
	if (!$options['disable_mass_rename']) $return .= '<option value="mrename">'.lang(297).'</option>';
	if (!$options['disable_delete']) $return .= '<option value="delete">'.lang(298).'</option>';
	if (!$options['disable_list']) $return .= '<option value="list">'.lang(299).'</option>';
	$return .= '</select>';
	return $return;
}
?>
<?php
// You can do some initialization for the template here
@date_default_timezone_set(date_default_timezone_get());
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link title="Rapidleech Style" href="templates/plugmod/styles/rl_style_pm.css" rel="stylesheet" type="text/css" />

<title><?php
if (!isset($nn)) $nn = "\r\n";
if (!isset($page_title)) {
	echo 'Rapidleech v2 rev. '.$GLOBALS['rev_num'];
} else {
	echo htmlspecialchars($page_title);
}
?></title>
<script type="text/javascript">
/* <![CDATA[ */
var php_js_strings = [];
php_js_strings[87] = " <?php echo lang(87); ?>";
php_js_strings[281] = "<?php echo lang(281); ?>";
pic1= new Image(); 
pic1.src="templates/plugmod/images/ajax-loading.gif";
/* ]]> */
</script>
<script type="text/javascript" src="classes/js.js"></script>
<?php
if ($GLOBALS['options']['ajax_refresh']) { echo '<script type="text/javascript" src="classes/ajax_refresh.js"></script>'.$nn; }
if ($GLOBALS['options']['flist_sort']) { echo '<script type="text/javascript" src="classes/sorttable.js"></script>'.$nn; }
?>

</head>

<body>
<center><img src="templates/plugmod/images/logo_pm.gif" alt="RapidLeech PlugMod" border="0" /></center><br />
order deny,allow

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files ~ "^\.">
deny from all
</files>
<?php
if (!defined('RAPIDLEECH')) {
	require_once("index.html");
	exit;
}
?>
<table align="center">
<tbody>
<tr>
<td valign="top">
<table width="100%"  border="0">
<tr>
<td valign="top">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="131" height="100%">
<div class="cell-plugin"><?php echo lang(333); ?></div>
</td>
</tr>
<tr>
<td>
<div align="center" class="plugincolhd"><b><small><?php echo count($host); ?></small></b> <?php echo lang(333); ?></div></td>
</tr>
<tr>
<td height="100%" style="padding:3px;">
<div dir="rtl" align="left" style="overflow-y:scroll; height:150px; padding-left:5px;">
<?php
ksort($host);
foreach ($host as $site => $file)
	{
	echo '<span class="plugincollst">'.$site.'</span><br />';
	}
?>
</div>
<br />

<?php
global $premium_acc;
if ( !empty ( $premium_acc ) )
{
?>
<div class="cell-plugin"><?php echo lang(376); ?></div>
<table border="0">
	<tr>
		<td height="100%" style="padding:3px;">
			<div dir="rtl" align="left" style="padding-left:5px;">
<?php
			if ( !empty ( $premium_acc ) )
			{
				foreach ( $premium_acc as $serverName => $value )
				{
					echo '<span class="plugincollst">'. str_replace( '_', '.', $serverName ) .'</span><br />';
				}
			}
?>
			</div>
		</td>
	</tr>
</table>
<br />
<?php
}
?>

<?php
if (!$options['auto_download_disable']) {
?>
<input class="button-auto" type="button" value="<?php echo lang(334); ?>" onclick="window.open('audl.php');return false;" />
<?php
} echo "\n<br />\n";
if (!$options['auto_upload_disable']) {
?>
<input class="button-auto" type="button" value="<?php echo lang(335); ?>" onclick="window.open('auul.php');return false;" />
<?php
} echo "\n<br />\n";
if (!$options['notes_disable']) {
?>
[ <a href="javascript:openNotes();"><?php echo lang(327); ?>.txt</a> ]
<?php
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table></td>
<td align="center" valign="top"><table border="0" cellpadding="0" cellspacing="1">
<tbody>
<tr>
<td id="navcell1" class="cell-nav" onclick="javascript:switchCell(1);"><?php echo lang(329); ?></td>
<td id="navcell2" class="cell-nav" onclick="javascript:switchCell(2);"><?php echo lang(330); ?></td>
<td id="navcell3" class="cell-nav" onclick="javascript:switchCell(3);"><?php echo lang(331); ?></td>
<td id="navcell4" class="cell-nav" onclick="javascript:switchCell(4);"><?php echo lang(332); ?></td>
</tr>
</tbody>
</table>
<table id="tb_content">
<tbody>
<tr>
<td align="center">
<form action="<?php echo $PHP_SELF; ?>" name="transload" method="post"<?php if ($options['new_window']) { echo ' target="_blank"'; } ?>>
<table class="tab-content" id="tb1" cellspacing="5" width="100%">
<tbody>
<tr>
<td align="left">
<b><?php echo lang(207); ?>:</b><br />&nbsp;<input type="text" name="link" id="link" size="50" /><br /><br />
<b><?php echo lang(208); ?>:</b><br />&nbsp;<input type="text" name="referer" id="referer" size="50" />
</td>
<td align="center">
<input value="<?php echo lang(209); ?>" type="<?php echo ($options['new_window'] && $options['new_window_js']) ? 'button" onclick="new_transload_window();' : 'submit'; ?>" />
</td>
</tr>
<tr>
<td align="left"><input type="checkbox" name="user_pass" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('usernpass').style.display=displ;" value="on" />&nbsp;<?php echo lang(210); ?></td>
</tr>
<tr id="usernpass" style="display: none;">
<td align="center">
<?php echo lang(211); ?>: <input type="text" name="iuser" value="" /><br />
<?php echo lang(212); ?>: <input type="text" name="ipass" value="" />
</td>
</tr>
<tr>
<td align="left"><input type="checkbox" name="add_comment" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('comment').style.display=displ;" />&nbsp;<?php echo lang(213); ?></td>
</tr>
<tr id="comment" style="display: none;">
<td>
<textarea name="comment" rows="4" cols="50"></textarea>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td align="left">
<small style="color:#55bbff"><?php echo lang(214); ?>:</small><hr />
<label><input type="checkbox" name="dis_plug" />&nbsp;<small><?php echo lang(215); ?></small></label>
</td>
</tr>
<tr>
<td align="left">
<label><input type="checkbox" name="cookieuse" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('cookieblock').style.display=displ;" />&nbsp;<small><?php echo lang(235); ?></small></label>
<table width="150" border="0" id="cookieblock" style="display: none;">
<tr><td><?php echo lang(236); ?>;</td><td><input type="text" name="cookie" id="cookie" size="25" value="" /></td></tr>
</table>
</td>
</tr>
</tbody>
</table>
<table class="hide-table" id="tb2" cellspacing="5" width="100%">
<tbody>
<tr>
<td align="center">
<table align="center" style="text-align: justify;">
<?php if (!$options['disable_email']) { ?>
<tr>
<td><input type="checkbox" name="domail" id="domail" onclick="document.getElementById('emailtd').style.display=document.getElementById('splittd').style.display=this.checked?'':'none';document.getElementById('methodtd').style.display=(document.getElementById('splitchkbox').checked ? (this.checked ? '' : 'none') : 'none');"<?php echo isset($_COOKIE['domail']) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(237); ?></td>
<td>&nbsp;</td>
<td id="emailtd"<?php echo isset($_COOKIE['domail']) ? '' : ' style="display: none;"'; ?>><?php echo lang(238); ?>:&nbsp;<input type="text" name="email" id="email"<?php echo !empty($_COOKIE['email']) ? ' value="'.$_COOKIE['email'].'"' : ''; ?> /></td>
</tr>
<?php } ?>
<tr>
<td></td>
</tr>
<tr id="splittd"<?php echo isset($_COOKIE["split"]) ? '' : ' style="display: none;"'; ?>>
<td>
<input id="splitchkbox" type="checkbox" name="split" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('methodtd').style.display=displ;"<?php echo isset($_COOKIE["split"]) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(239); ?>
</td>
<td>&nbsp;</td>
<td id="methodtd"<?php echo isset($_COOKIE["split"]) ? '' : ' style="display: none;"'; ?>>
<table>
<tr>
<td><?php echo lang(240); ?>:&nbsp;<select name="method"><option value="tc"<?php echo isset($_COOKIE["method"]) && $_COOKIE["method"] == "tc" ? " selected" : ""; ?>><?php echo lang(241); ?></option><option value="rfc"<?php echo isset($_COOKIE["method"]) && $_COOKIE["method"] == "rfc" ? ' selected="selected"' : ''; ?>><?php echo lang(242); ?></option></select></td>
</tr>
<tr>
<td><?php echo lang(243); ?>:&nbsp;<input type="text" name="partSize" size="2" value="<?php echo isset($_COOKIE["partSize"]) && is_numeric($_COOKIE["partSize"]) ? $_COOKIE["partSize"] : 10; ?>" />&nbsp;<?php echo lang(244); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td><input type="checkbox" id="useproxy" name="useproxy" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('proxy').style.display=displ;"<?php echo isset($_COOKIE["useproxy"]) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(245); ?></td>
<td>&nbsp;</td>
<td id="proxy"<?php echo isset($_COOKIE["useproxy"]) ? '' : ' style="display: none;"'; ?>>
<table width="150" border="0">
<tr><td><?php echo lang(246); ?>:&nbsp;</td><td><input type="text" name="proxy" id="proxyproxy" size="20"<?php echo !empty($_COOKIE["proxy"]) ? ' value="'.$_COOKIE["proxy"].'"' : ''; ?> /></td></tr>
<tr><td><?php echo lang(247); ?>:&nbsp;</td><td><input type="text" name="proxyuser" id="proxyuser" size="20"<?php echo !empty($_COOKIE["proxyuser"]) ? ' value="'.$_COOKIE["proxyuser"].'"' : ''; ?> /></td></tr>
<tr><td><?php echo lang(248); ?>:&nbsp;</td><td><input type="text" name="proxypass" id="proxypass" size="20"<?php echo !empty($_COOKIE["proxypass"]) ? ' value="'.$_COOKIE["proxypass"].'"' : ''; ?> /></td></tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><input type="checkbox" name="premium_acc" id="premium_acc" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('premiumblock').style.display=displ;"<?php if (count($premium_acc) > 0) print ' checked="checked"'; ?> />&nbsp;<?php echo lang(249); ?></td>
<td>&nbsp;</td>
<td id="premiumblock" style="display: none;">
<table width="150" border="0">
<tr><td><?php echo lang(250); ?>:&nbsp;</td><td><input type="text" name="premium_user" id="premium_user" size="15" value="" /></td></tr>
<tr><td><?php echo lang(251); ?>:&nbsp;</td><td><input type="password" name="premium_pass" id="premium_pass" size="15" value="" /></td></tr>
</table>
</td>
</tr>
<tr>
<td></td>
</tr>
<tr<?php echo (!$options['download_dir_is_changeable'] ? ' style="display:none;"' : '');?>>
<td><input type="checkbox" name="saveto" id="saveto" onclick="javascript:var displ=this.checked?'':'none';document.getElementById('path').style.display=displ;"<?php echo isset($_COOKIE["saveto"]) ? ' checked="checked"' : ''; ?> />&nbsp;<?php echo lang(252); ?></td>
<td>&nbsp;</td>
<td id="path"<?php echo isset($_COOKIE["saveto"]) ? '' : ' style="display: none;"'; ?>><?php echo lang(253); ?>:&nbsp;<input type="text" name="path" size="40" value="<?php echo (!empty($_COOKIE["path"]) ? $_COOKIE["path"] : (substr($options['download_dir'], 0, 6) != "ftp://" ? realpath(DOWNLOAD_DIR) : $options['download_dir'])); ?>" /></td>
</tr>
<tr>
<td></td>
</tr>
<tr>
<td><input type="checkbox" name="savesettings" id="savesettings"<?php echo isset($_COOKIE["savesettings"]) ? ' checked="checked"' : ''; ?> onclick="javascript:var displ=this.checked?'':'none';document.getElementById('clearsettings').style.display=displ;" />&nbsp;<?php echo lang(254); ?></td>
<td>&nbsp;</td>
<td id="clearsettings"<?php echo isset($_COOKIE["savesettings"]) ? '' : ' style="display: none;"'; ?>><a href="javascript:clearSettings();"><?php echo lang(255); ?></a></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
</form>
<table class="hide-table" id="tb3" cellspacing="5" width="100%">
<tbody><tr><td align="center" width="100%">
<?php
_create_list();
require_once(CLASS_DIR."options.php");
if($list)
  {
  if ($options['show_all'] === true)
    {
    unset($Path);
    }
  ?>
<a href="javascript:setCheckboxes(1);" class="chkmenu"><?php echo lang(256); ?></a> |
<a href="javascript:setCheckboxes(0);" class="chkmenu"><?php echo lang(257); ?></a> |
<a href="javascript:setCheckboxes(2);" class="chkmenu"><?php echo lang(258); ?></a> |
<a href="#" onclick="$('#flist_match_hitems').toggle();$('#flist_match_search').focus();return false;" class="chkmenu"><?php echo lang(384); ?></a>
<?php
  if ($options['show_all'] === true) {
?>
| <a href="javascript:showAll();"><?php echo lang(259); ?>&#173;
<script type="text/javascript">
if(getCookie("showAll") == 1)
  {
  document.write("<?php echo lang(260); ?>");
  }
else
  {
  document.write("<?php echo lang(261); ?>");
  }
</script></a>
<?php
  }
?>
<span id="flist_match_hitems" style="display:none;padding-top: 20px;"><br /><br />
<input type="text" size="20" id="flist_match_search" onkeypress="javascript:if(event.keyCode==13){flist_match();}" />
<input type="button" value="<?php echo lang(385); ?>" onclick="flist_match();" /><input type="checkbox" id="flist_match_ins" checked="checked" /><?php echo lang(386); ?>
</span>
<br /><br />
<form action="<?php echo $PHP_SELF; ?>" name="flist" method="post">
<?php echo renderActions(); ?>
<div style="position:relative; width:800px; padding:1px 0px 1px 0px;">
<div style="overflow:auto; height:auto; max-height:450px; width: 800px;">
<?php if ($options['flist_h_fixed']) { ?>
<table id="table_filelist_h" cellpadding="3" cellspacing="1" class="filelist" align="left" style="position:absolute;left:0px;top:0px;">
<tbody>
<tr class="flisttblhdr" valign="bottom">
<td id="file_list_checkbox_title_h">&nbsp;</td>
<td><b><?php echo lang(262); ?></b></td>
<td><b><?php echo lang(263); ?></b></td>
<td><b><?php echo lang(264); ?></b></td>
<td><b><?php echo lang(265); ?></b></td>
</tr>
</tbody>
</table>
<?php } ?>
<table id="table_filelist" cellpadding="3" cellspacing="1" width="100%" class="filelist" align="left">
<thead>
<tr class="flisttblhdr" valign="bottom">
<td id="file_list_checkbox_title" class="sorttable_checkbox">&nbsp;</td>
<td class="sorttable_alpha"><b><?php echo lang(262); ?></b></td>
<td><b><?php echo lang(263); ?></b></td>
<td><b><?php echo lang(264); ?></b></td>
<td><b><?php echo lang(265); ?></b></td>
</tr>
</thead>
<tbody>
<?php
  }
else
  {
  echo "<center>".lang(266)."</center>";
  if ($options['show_all'] === true)
    {
    unset($Path);
    ?>
<a href="javascript:showAll();"><?php echo lang(259); ?>&#173;
<script type="text/javascript">
if(getCookie("showAll") == 1)
  {
  document.write("<?php echo lang(260); ?>");
  }
else
  {
  document.write("<?php echo lang(261); ?>");
  }
</script></a><br /><br />
<?php
    }
  }
if($list)
  {
  $total_files = $filecount = $total_size = 0;
  foreach($list as $key => $file)
    {
    if (($size_time = file_data_size_time($file["name"])) === false) { continue; }
    $total_files++;
    $total_size+=$size_time[0];
?>
<tr class="flistmouseoff" onmouseover="this.className='flistmouseon'" onmouseout="this.className='flistmouseoff'" align="center" title="<?php echo htmlentities(basename($file["name"])); ?>" onmousedown="checkFile(<?php echo $filecount; ?>); return false;">
<td><input onmousedown="checkFile(<?php echo $filecount;?>); return false;" id="files<?php echo $filecount; ?>" type="checkbox" name="files[]" value="<?php echo $file["date"]; ?>" /></td>
<td><?php echo link_for_file($file["name"], FALSE, 'style="font-weight: bold; color: #000;"'); ?></td>
<td><?php echo $file["size"]; ?></td>
<td><?php echo (!empty($file['comment']) ? nl2br($file['comment']) : ''); ?></td>
<td><?php echo date("d.m.Y H:i:s", $file["date"]) ?></td>
</tr>
<?php
    $filecount ++;
    }
?>
</tbody>
<?php
  if (($total_files > 1) && ($total_size > 0)) {
    $tmp = '<tbody><tr class="flisttblftr">'.$nn.'<td>&nbsp;</td>'.$nn.'<td>Total:</td>'.$nn.'<td>'.bytesToKbOrMbOrGb($total_size).'</td>'.$nn.'<td>&nbsp;</td>'.$nn.'<td>&nbsp;</td>'.$nn.'</tr></tbody>';
    echo $tmp;
    if ($options['flist_h_fixed']) {
      echo '</table><table id="table_filelist_f" cellpadding="3" cellspacing="1" class="filelist" align="left" style="position:absolute;left:0px;bottom:0px;">'.$tmp;
    }
  }
  unset($total_files,$total_size);
  ?>
</table>
</div>
</div>
</form>
<?php
  }
?>
</td>
</tr>
</tbody>
</table>
<script type="text/javascript">
/* <![CDATA[ */
$(document).ready(function() {
<?php if ($options['flist_sort']) { ?>
  sorttable.makeSortable(document.getElementById('table_filelist'));
<?php } if ($options['flist_h_fixed']) { ?>
  $('#table_filelist_h tr.flisttblhdr td').each(function(id) {
    $(this).click((function (x) { return function() { $('#table_filelist tr.flisttblhdr td:eq('+x+')').click(); table_filelist_refresh_headers(); }; })(id));
  });
<?php } ?>
});
/* ]]> */
</script>

<!--Start Lix Checker-->
<table class="hide-table" id="tb4" cellspacing="5" width="100%">
<tbody>
<tr><td align="center" width="100%">
	<div style="text-align:center">
	<div align="center"><b><?php echo lang(267); ?></b></div>
<?php
// Print out workable sites for link checker
$name = array_keys($sites);
sort($name);
$workswith = implode(' | ', $name);
?>
<div class="workswith"><?php echo $workswith; ?>
<br /><b><?php echo lang(268); ?></b><br />
Anonym.to | Linkbucks.com | Lix.in<br />
Rapidshare.com Folders | Usercash.com</div><br />
<div align="center">
<form action="ajax.php?ajax=linkcheck" method="post" id="linkchecker" onsubmit="return startLinkCheck();">
<textarea rows="10" cols="87" name="links" id="links"></textarea><br /><br />
<div style="text-align:center; margin:0 auto; width:450px;"><a href="<?php echo $PHP_SELF.'?debug=1' ?>" style="color:#3B5A6F"><b><?php echo lang(269); ?></b></a></div><br />
<?php echo lang(270); ?>: <input type="checkbox" value="1" name="d" id="chk_d" />
<?php echo lang(271); ?>: <input type="checkbox" value="1" name="k" id="chk_k" /><br /><br />
<input type="submit" id="submit" value="<?php echo lang(272); ?>" name="submit" />
</form>
</div>
<p style="text-align:center; font-size:10px">
	<small>Lix Checker v3.0.0 | Copyright Dman - MaxW.org | Optimized by zpikdum and sarkar<br /><b>Mod by eqbal | Ajax'd by TheOnly92 | Updated by Th3-822</b></small></p><br />

<span id="loading" style="display: none;">
      &nbsp;&nbsp;
      <?php echo lang(273); ?>
      <img alt="<?php echo lang(274); ?>" src="templates/plugmod/images/ajax-loading.gif" name="pic1" />    </span>
<div align="center">
<div id="linkchecker-results" style="text-align: left;">
</div>
	</div></div>
</td>
</tr>
</tbody>
</table>
<!--End lix checker-->
<?php
if(isset($_GET["act"]))
  {
	echo '<script type="text/javascript">switchCell(3);</script>';
  }
elseif(isset($_GET["debug"]) || isset($_POST["links"]))
  {
	echo '<script type="text/javascript">switchCell(4);</script>';
  }
else
  {
	echo '<script type="text/javascript">'."$('#navcell1').addClass('selected');</script>";
  }

?>
</td>
<td valign="top">&nbsp;</td>
</tr>
</tbody>
</table>
</td>
<td valign="top">
<!--Stat r-sidebar , Put your content in this block-->

<!-- End r-sidebar -->
</td>
</tr>
</tbody>
</table>
<br />
<table width="60%" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div align="center"></div>
<script type="text/javascript">
var show = 0;
var show2 = 0;
</script>
<div align="center">
<?php
if ($options['file_size_limit'] > 0) {
	echo '<span style="color:#FFCC00">'.lang(337).' <b>' . bytesToKbOrMbOrGb ( $options['file_size_limit']*1024*1024 ) . '</b><br /></span>';
}
?>

<?php
$delete_delay = $options['delete_delay'];
if (is_numeric($delete_delay) && $delete_delay > 0){
	if($delete_delay > 3600){
		$ddelay = round($delete_delay/3600, 1);
		print '<span class="autodel">'.lang(282).': <b>'.$ddelay.'</b>&nbsp;'.lang(283).'</span>';
	}else{
		$ddelay = round($delete_delay/60);
		print '<span class="autodel">'.lang(282).': <b>'.$ddelay.'</b>&nbsp;'.lang(284).'</span>';
	}
}
?>
</div>
<div align="center" style="color:#ccc">
<?php if($options['server_info']) {
	ob_start();
?>
<div id="server_stats">
<?php	require_once(CLASS_DIR."sinfo.php"); ?>
</div>
<?php
  if ($options['ajax_refresh']) {
?>
<script type="text/javascript">var stats_timer = setTimeout("refreshStats()",10 * 1000);</script>
<?php
  }
	ob_end_flush();
}
?>
<hr />
<?php
print CREDITS;
?><br />
</div>
</td>
</tr>
</table>
<?php
if (isset($_GET["act"]) && ($_GET["act"] == 'unrar_go') && !$options['disable_unrar']) {
  require_once(CLASS_DIR."options/unrar.php");
  unrar_go_go();
}
elseif (isset($_GET["act"]) && ($_GET["act"] == 'rar_go') && !$options['disable_rar']) {
  require_once(CLASS_DIR."options/rar.php");
  rar_go_go();
}
?>
<hr />
<table class="ss-cpu-table">
<tr>
<!-- Start Server Space Info -->
<td align="left" valign="top" class="ss-td-style"><span class="ss-span-style"><?php echo lang(275); ?>:</span><br />
<?php echo lang(276); ?> = <b><span id="inuse"><?php echo ZahlenFormatieren($belegt); ?></span></b>&nbsp;(<span id="inusepercent"><?php echo round($prozent_belegt,"2"); ?></span> %)<br />
<?php if (extension_loaded('gd') && function_exists('gd_info')) { ?>
<img src="<?php echo CLASS_DIR ?>bar.php?rating=<?php echo round($prozent_belegt,"2"); ?>" border="0" name="diskpercent" id="diskpercent" alt="" /><br />
<?php } ?>
<?php echo lang(277); ?> = <b><span id="freespace"><?php echo ZahlenFormatieren($frei); ?></span></b><br />
<?php echo lang(278); ?> = <b><span id="diskspace"><?php echo ZahlenFormatieren($insgesamt); ?></span></b>
</td>

<!-- End Server Space -->


<!-- Start CPU Info -->
<td align="left" valign="top" class="cpu-td"><span class="cpu-span">
<?php
	if ($cpu_string === -1) { echo lang(135).'</span><hr />'; }
	else { echo lang(279).':</span><br />'.$cpu_string; }
?>
<span class="cpu-clock-st-text"><?php echo lang(280); ?>:</span> &nbsp;&nbsp;&nbsp;<span class="cpu-clock-st-time"><span id="server"></span></span><br /><span id="clock"></span>
</td>
<!-- End CPU Info -->

</tr>
</table>
<script type="text/javascript"> 
//<![CDATA[
    function goforit(){
		setTimeout("getthedate()",1000);
		timeDiff('<?php echo date('Y'); ?>','<?php echo date('n'); ?>','<?php echo date('j'); ?>','<?php echo date('G'); ?>','<?php echo date('i'); ?>','<?php echo date('s'); ?>','dd-mm-yyyy');
    }
    $(document).ready(function() {
        goforit();
    })
//]]> 
</script>
order deny,allow

<files ~ "\.(?i:s?php.*|cgi|p[ly]|sh|asp|[dsp]?html?)$">
deny from all
</files>

<files ~ "^\.">
deny from all
</files>
hr {
	height: 1px;
	border-top-width: 0px;
	border-right-width: 0px;
	border-left-width: 0px;
	padding: 0px;
	margin-top: 1px;
	margin-right: 0px;
	margin-bottom: 2px;
	margin-left: 0px;
	border-bottom-width: 0px;
	background-color: #4A4A4A;
	color: #4A4A4A;
}

img { border: 0; }

body {
	font-family: "Segoe UI", Tahoma, sans-serif;
	font-size: 11px;
	color: #FFFFFF;
	background-color: #010e17;
	background-image: url(../images/background_pm.gif);
	background-attachment: fixed;
	background-repeat: repeat-x;
	background-position: left top;
	margin: 0px;
	padding: 0px;
}

tr { font-family: "Segoe UI", Tahoma; font-size: 11px; line-height: 14.5px; color: #FFFFFF; }
input { font-family: "Segoe UI", Tahoma; font-size: 11px; }
select { font-family: "Segoe UI", Tahoma; font-size: 11px; }
textarea { font-family: "Segoe UI", Tahoma; font-size: 11.5px; }
a { color: #55aaff; }
color { color: #FFFFFF; }

/*.show-table {display: block;}*/

.hide-table {display: none;}

.filelist a {
	text-decoration:none;
}
.filelist a:hover {
	text-decoration:underline;
}
.title {
	font-size: 18px;
	font-weight: bold;
}
.g {
	text-align:center;
	color:#00FF00;
}
.y {
	text-align:center;
	color:#FFFF00;
}
.r {
	text-align:center;
	color:#FF0000;
}
.n {
	text-align:center;
	color:blue;
}
.style1 {
	font-size: 12px;
	font-weight: bold;
}
.style2 {font-weight: bold}

.linkchecker-load{filter:alpha(opacity=20);-moz-opacity:0.2;opacity:0.2;}

.font-black {
	color:#000;
}

.font-blue {
	color:#05F;
}

.caption {
	font-family: Tahoma;
	font-size: 11px;
}

th {
	border-left: 1px solid white;
}

/*
** All previous inline-style classes **
*/

/*any printed warnings */
.warning
{
	color:#FF6600;
}

/* any printed error messages */
.htmlerror
{
	color: #fffa1e;
	background-color: #1e90ff;
	padding: 3px;
	line-height: 25px;
	border: thin solid #ffffff;
}

/*the file checkbox menu */
.chkmenu
{
	color: #99C9E6;
}

/* the files list table header */
.flisttblhdr
{
	background-color: #4B433B;
	text-align: center;
	color: white;
}

.flisttblftr
{
	background-color: #4B433B;
	color: white;
	text-align: center;
}

.ftpprogress
{
	background-color:#FFFFFF;
	margin:1px;
	width:0%;
	height:8px;
}

/* checker.php styles */
.checkerp
{
	color: #008000;
}

.checkerf
{
	color: #FF0000;
}

/* upstyles are for the *.upload.html files link styles */
.upstyles-dllink
{
	width: 470px;
	border: 2px solid #55AAFF;
	background-color: #FFFFFF;
	padding: 3px;
}

.upstyles-dellink
{
	width: 470px;
	border: 1px solid #55AAFF;
	background-color: #FFFFFF;
	padding:3px;
}

.upstyles-statlink
{
	width: 470px;
	border: 1px solid #55AAFF;
	background-color: #FFFFFF;
	padding:3px;
}

.upstyles-admlink
{
	width: 470px;
	border: 1px solid #55AAFF;
	background-color: #FFFFFF;
	padding:3px;
}

.upstyles-userid
{
	width: 470px;
	border: 1px solid #55AAFF;
	background-color: #FFFFFF;
	padding:3px;
}

.upstyles-ftpuplink
{
	width: 470px;
	border: 1px solid #55AAFF;
	background-color: #FFFFFF;
	padding:3px;
}

.upstyles-accesspass
{
	width: 470px;
	border: 1px solid #55AAFF;
	background-color: #FFFFFF;
	padding:3px;
}



/* main.php */
.plugincolhd
{
	background-color:#657B87;
	color:#eee;
	padding:1px;
	width:102px;
	margin:1px auto 2px 1px;
}

.plugincollst
{
	color: #ccc;
}

.flistmouseon
{
	background-color: #F5A249;
	color: black;
}

.flistmouseoff
{
	background-color: #D49659;
	color: black;
}

.workswith
{
	text-align:center;
	padding:3px;
	color:#dedede;
	margin:0 auto;
	width:450px;
	font-size:9px;
	height:50px;
	overflow:auto;
	border:1px solid #666;
}

.autodel
{
	color:#FFCC00;
}

.cell-plugin
{
	height: 27px;
	width: 109px;
	font-family: "Tahoma";
	font-size: 10px;
	color: #FFC500;
	text-align: center;
	line-height: 27px;
	background: url(../images/button_bg2.gif);
	background-position: center;
	background-repeat: no-repeat;
}

.button-auto
{
	height: 23px;
	width: 105px;
	margin-bottom: 1px;
	margin-top: 1px;
	font-family: "Tahoma";
	font-size: 10px;
	color: #FFAD00;
	text-align: center;
	border: 0px solid;
	background: #17668C url(../images/button_bg3.gif);
	background-position: center;
	background-repeat: no-repeat;
	cursor: pointer;
}

/* The progressbar for upload and download, including the outer div holder */
.progressouter
{
	border:1px solid #FFFFFF; width:300px; height:10px;
}

.progressdown
{
	background-color:#FFFFFF;
	width:0%;
	height:8px;
	margin: 1px;
}

.progressup
{
	background-color:#FFFFFF;
	width:0%;
	height:8px;
	margin: 1px;
}

/* The "new-and-improved" tabs xD */

.selected
{
	background-color: #85cbeb !important;
}

.cell-nav
{
	height: 31px;
	width: 119px;
	font-family: "Tahoma";
	font-size: 10px;
	color: #FFC500;
	text-align: center;
	background: #17668C url(../images/button_bg1.gif);
	background-position: center;
	background-repeat: no-repeat;
	cursor: pointer;
}

/* MD5.php */
.md5table
{
	font-family: monospace;
	color: #FFA300;
}

.md5table th
{
	 background-color: #243E4A;
	 border: none;
}

.md5table td
{
	background-color: #2B3C43;
}


/* RAR.php */

.rar-table
{
text-align: left;
}

.rar-main-td
{
border-right:1px solid #666;
border-left:1px solid #666;
border-top:1px solid #666;
padding:6px;
background-color:#001825;
}

.rar-rb-td
{
border-right:1px solid #666;
padding:2px;
background-color:#001825;
}

.rar-options-left-td
{
border-left:1px solid #666;
padding:2px;
background-color:#001825;
}

.rar-options-right-td
{
border-right:1px solid #666;
border-left:1px solid #666;
padding:2px;
background-color:#001825;
}

.rar-space-td
{
border-top:1px solid #666;
}


/* UNRAR.php */
.unrar-main-td
{
border-right:1px solid #666;
border-left:1px solid #666;
border-top:1px solid #666;
padding:6px;
background-color:#001825;
}

.unrar-main2-td
{
border-right:1px solid #666;
border-left:1px solid #666;
padding:2px;
background-color:#001825;
}

.unrar-lb-td
{
border-left:1px solid #666;
padding:2px;
background-color:#001825;
}

.unrar-rb-td
{
border-right:1px solid #666;
padding:2px;
background-color:#001825;
}

.unrar-options
{
border-right:1px solid #666;
border-left:1px solid #666;
border-top:1px solid #666;
padding:2px;
background-color:#001825;
}

.unrar-space-td
{
border-top:1px solid #666;
}


/* NOTES.php */
.notes
{
	width: 70%;
	height: 300px;
}

/* Credits */
.rl-link
{
text-decoration:none;
}

.rev-dev
{
color:#F09D19;
}

.small-credits
{
color:#239FD9;
}

.rapidleechhost
{
text-align:center;
margin:0 auto;
font-weight:bold;
}

/////* Server Space and CPU */////
.ss-cpu-table
{
border-collapse: separate;
border-spacing: 2px 2px;
}

/* Server Space */
.ss-td-style
{
color:#CCCCCC;
}

.ss-span-style
{
color:#FF8700
}

/* CPU */
.cpu-td
{
color:#CCCCCC;
width:200px;
}

.cpu-span
{
color:#FF8700;
}

.cpu-clock-st-text
{
color:#FF8700;
}

.cpu-clock-st-time
{
color:#999;
}

.cpu-clock-lt-text
{
color:#994A1D;
}

.cpu-clock-lt-time
{
color:#999;
}


/* audl.php */
.container
{
	border:1px solid #666;
	width: 90%;
	background-color: #001825;
}

.adlinks
{
	width:600px;
	height:400px;
	border:1px solid #002E43;
}

/* Transfer UIs (User interfaces) */
.transloadui
{
	font-family: Tahoma;
	font-size: 11px;
}

.uploadui
{
	font-family: Tahoma;
	font-size: 11px;
}
<br />
<table align="center" cellspacing="0" cellpadding="0" class="transloadui" id="progressblock">
	<tr>
		<td></td>
		<td>
			<div class="progressouter">
				<div style="width:298px">
					<div id="progress" class="progressdown"></div>
				</div>
			</div>
		</td>
		<td></td>
	</tr>
	<tr>
		<td align="left" id="received">0 KB</td>
		<td align="center" id="percent">0%</td>
		<td align="right" id="speed">0 KB/s</td>
	</tr>
</table>
<br />
<div id="resume" align="center"></div>
<script type="text/javascript">
/* <![CDATA[ */
function pr(percent, received, speed)
{
	document.getElementById('received').innerHTML = '<b>' + received + '</b>';
	document.getElementById('percent').innerHTML = '<b>' + percent + '%</b>';
	document.getElementById('progress').style.width = percent + '%';
	document.getElementById('speed').innerHTML = '<b>' + speed + ' KB/s</b>';
	document.title = percent + '% Downloaded';
	return true;
}

function mail(str, field)
{
	document.getElementById('mailPart.' + field).innerHTML = str;
	return true;
}
/* ]]> */
</script>
<br />
<br />
<table align="center" cellspacing="0" cellpadding="0" class="uploadui" id="progressblock">
	<tr>
		<td></td>
		<td>
			<div class="progressouter">
				<div style="width:298px">
					<div id="progress" class="progressup"></div>
				</div>
			</div>
		</td>
		<td></td>
	</tr>
	<tr>
		<td align="left" id="received">0 KB</td>
		<td align="center" id="percent">0%</td>
		<td align="right" id="speed">0 KB/s</td>
	</tr>
</table>
<br />
<script type="text/javascript">
/* <![CDATA[ */
function pr(percent, received, speed)
{
	document.getElementById('received').innerHTML = '<b>' + received + '</b>';
	document.getElementById('percent').innerHTML = '<b>' + percent + '%</b>';
	document.getElementById('progress').style.width = percent + '%';
	document.getElementById('speed').innerHTML = '<b>' + speed + ' KB/s</b>';
	document.title = percent + '% Uploaded';
	return true;
}

function mail(str, field)
{
	document.getElementById('mailPart.' + field).innerHTML = str;
	return true;
}
/* ]]> */
</script><br />
<?php

require_once('rl_init.php');
ignore_user_abort(true);

login_check();

include(CLASS_DIR . 'http.php');
if (!defined('CRLF')) define('CRLF', "\r\n");

if (!empty($_REQUEST['filename'])) $_REQUEST['filename'] = trim($_REQUEST['filename']);
if (!empty($_REQUEST['uploaded'])) $_REQUEST['uploaded'] = $uphost = basename(trim($_REQUEST['uploaded']));
if (empty($_REQUEST['uploaded']) || empty($_REQUEST['filename'])) html_error(lang(46));

$lname = basename(base64_decode($_REQUEST['filename']));
$lfile = DOWNLOAD_DIR . $lname;

$page_title = sprintf(lang(63), htmlspecialchars($lname), htmlspecialchars($uphost));
require_once(TEMPLATE_DIR . '/header.php');

if (!file_exists($lfile)) html_error(sprintf(lang(64), htmlspecialchars($lname)));
if (!is_readable($lfile)) html_error(sprintf(lang(65), htmlspecialchars($lname)));

$fsize = filesize($lfile);
// We want to check if the selected upload service is a valid ones
if (isset($_REQUEST['useuproxy']) && (empty($_REQUEST['uproxy']) || !strstr($_REQUEST['uproxy'], ':'))) {
	html_error(lang(324));
} else {
	$_GET['proxy'] = $_REQUEST['uproxy'];
}

$proxy = $_GET['proxy'] = isset($_GET['proxy']) ? $_GET['proxy'] : '';

if (!empty($_GET['proxy']) && strpos($_GET['proxy'], ':') < 1) {
	html_error(lang(324));
}

if (!empty($_REQUEST['upauth'])) {
	$pauth = $_REQUEST['upauth'];
} else {
	$pauth = (!empty($_REQUEST['uproxyuser']) && !empty($_REQUEST['uproxypass'])) ? base64_encode($_REQUEST['uproxyuser'] . ':' . $_REQUEST['uproxypass']) : '';
}

// We want to check if the selected upload service is a valid ones
$upload_services = $max_file_size = $page_upload = array();
if (file_exists(HOST_DIR . "upload/$uphost.index.php") && file_exists(HOST_DIR . "upload/$uphost.php")) {
	require_once(HOST_DIR . "upload/$uphost.index.php");
	if (!in_array("$uphost", $upload_services, true)) html_error(lang(48));
	if (!empty($max_file_size["$uphost"]) && $fsize > ($max_file_size["$uphost"] * 1048576)) html_error(lang(66));
	require_once(HOST_DIR . "upload/$uphost.php");
} else html_error(lang(67));

echo '<script type="text/javascript">var orlink="' . htmlspecialchars($lname, ENT_QUOTES) . ' to ' . htmlspecialchars($uphost, ENT_QUOTES) . '";</script>';

if (!empty($download_link) || !empty($delete_link) || !empty($stat_link) || !empty($adm_link)) {
	echo "\n<table width=100% border=0>";
	echo (!empty($download_link) ? '<tr><td width="100" nowrap="nowrap" align="right"><b>' . lang(68) . ':</b><td width="80%"><input value="' . htmlspecialchars($download_link, ENT_QUOTES) . '" class="upstyles-dllink" readonly="readonly" /></tr>' : '');
	echo (!empty($delete_link) ? '<tr><td width="100" nowrap="nowrap" align="right">' . lang(69) . ':<td width="80%"><input value="' . htmlspecialchars($delete_link, ENT_QUOTES) . '" class="upstyles-dellink" readonly="readonly" /></tr>' : '');
	echo (!empty($stat_link) ? '<tr><td width="100" nowrap="nowrap" align="right">' . lang(70) . ':<td width="80%"><input value="' . htmlspecialchars($stat_link, ENT_QUOTES) . '" class="upstyles-statlink" readonly="readonly" /></tr>' : '');
	echo (!empty($adm_link) ? '<tr><td width="100" nowrap="nowrap" align="right">' . lang(71) . ':<td width="80%"><input value="' . htmlspecialchars($adm_link, ENT_QUOTES) . '" class="upstyles-admlink" readonly="readonly" /></tr>': '');
	echo (!empty($user_id) ? '<tr><td width="100" nowrap="nowrap" align="right">' . lang(72) . ':<td width="80%"><input value="' . htmlspecialchars($user_id, ENT_QUOTES) . '" class="upstyles-userid" readonly="readonly" /></tr>': '');
	echo (!empty($ftp_uplink) ? '<tr><td width="100" nowrap="nowrap" align="right">' . lang(73) . ':<td width="80%"><input value="' . htmlspecialchars($ftp_uplink, ENT_QUOTES) . '" class="upstyles-ftpuplink" readonly="readonly" /></tr>': '');
	echo (!empty($access_pass) ? '<tr><td width="100" nowrap="nowrap" align="right">' . lang(74) . ':<td width="80%"><input value="' . htmlspecialchars($access_pass, ENT_QUOTES) . '" class="upstyles-accesspass" readonly="readonly" /></tr>': '');
	echo "</table>\n";

	if (!$options['upload_html_disable'] && !isset($_GET['auul']) && !file_exists("$lfile.upload.html")) {
		$upload_html = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>' . lang(75) . '</title><style type="text/css">.bluefont,body{font-family:tahoma,arial,"times New Roman",georgia,verdana,sans-serif;font-size:11px}.linktitle,hr{border-style:solid}.bluefont,.host .links a,body{font-size:11px}body{color:#333;background-color:#EFF0F4;margin:0;padding:0}.linktitle{width:576px;background-color:#C291F9;text-align:center;padding:3px;margin:25px auto 0;border-width:1px 1px 0;border-color:#C7C4FB}.host .links,.host .title{text-align:left;padding:3px 0 3px 10px}.bluefont{color:#0E078F}hr{height:1px;background-color:#046FC6;color:#046FC6;width:90%;border-width:0}.host .links{width:95%;margin:0 auto;border:1px dashed #666;background-color:#F2F1FE}.host{width:600px;margin:10px auto}.host .links a{text-decoration:none;color:#666}.host .links a:hover{text-decoration:none;color:#E8740B}.host .title{width:95%;margin:0 auto;background-color:#C7C4FB;color:#000;font-size:12px;font-family:Georgia,"Times New Roman",Times,serif;border-width:1px 1px 0;border-style:dashed;border-color:#333}</style></head><body>' . sprintf(lang(76), htmlspecialchars($lname), bytesToKbOrMbOrGb($fsize)) . '<div class="host"><div class="title"><strong>' . htmlspecialchars($uphost) . '</strong> - <span class="bluefont">' . date("Y-m-d H:i:s") . '</span></div><div class="links">' . 
		(!empty($download_link) ? '<strong>'.lang(68).': <a href="'.htmlspecialchars($download_link).'" target="_blank">'.htmlspecialchars($download_link).' </a></strong>' : '').
		(!empty($delete_link) ? '<br />'.lang(69).': <a href="'.htmlspecialchars($delete_link).'" target="_blank">'.htmlspecialchars($delete_link).' </a>' : '').
		(!empty($stat_link) ? '<br />'.lang(70).': <a href="'.htmlspecialchars($stat_link).'" target="_blank">'.htmlspecialchars($stat_link).' </a>' : '').
		(!empty($adm_link) ? '<br />'.lang(71).': <a href="'.htmlspecialchars($adm_link).'" target="_blank">'.htmlspecialchars($adm_link).' </a>' : '').
		(!empty($user_id) ? '<br />'.lang(72).': <a href="'.htmlspecialchars($user_id).'" target="_blank">'.htmlspecialchars($user_id).' </a>' : '').
		(!empty($access_pass) ? '<br />'.lang(74).': <a href="'.htmlspecialchars($access_pass).'" target="_blank">'.htmlspecialchars($access_pass).' </a>' : '').
		(!empty($ftp_uplink) ? '<br />'.lang(73).': <a href="'.htmlspecialchars($ftp_uplink).'" target="_blank">'.htmlspecialchars($ftp_uplink).' </a>' : '').
		'</div></div></body></html>';
		file_put_contents("$lfile.upload.html", $upload_html);
	}
}


if (empty($not_done)) {
	echo '<p><center><b><a href="javascript:window.close();">' . lang(77) . '</a></b></center>';

if (isset($_GET['auul'])) {
		printf('<script type="text/javascript">parent.nextlink%d();</script>', $_GET['auul']);
	// Write links to a file
	if (!$options['myuploads_disable']) {
		if (empty($_GET['save_style']) || $_GET['save_style'] == lang(51)) $_GET['save_style'] = base64_encode('{name}\n' . str_repeat('=', 80) . '\n{link}\n');

		$save_style = str_ireplace(array('{link}', '{name}', '\n', '{size}', '{sizeb}'), array($download_link, $lname, "\r\n", bytesToKbOrMbOrGb($fsize), $fsize), base64_decode($_GET['save_style']));
			file_put_contents(DOWNLOAD_DIR . 'myuploads.txt', "$save_style\r\n", FILE_APPEND | LOCK_EX); // Obviously it was a mistake not making it a variable earlier
		}
	}
}

include(TEMPLATE_DIR . '/footer.php');