Ejemplo n.º 1
0
						$pr_url .= '&fileid='.$m[2].'&filename='.$m[3];
						
						$curl = OC_ocDownloaderHTTP::execURL($pr_url, 'rapidshare');
						if(strlen($curl) == 0){
							OC_ocDownloaderPB::setError($l->t('Connection error ...'));
						}else{
							if(preg_match('/^ERROR.*\((.*)\)(\n){0,1}.*$/', $curl, $ma)){
								if(isset($errors[$ma[1]])){
									OC_ocDownloaderPB::setError($errors[$ma[1]]);
								}else{
									OC_ocDownloaderPB::setError($l->t('Unknown error').' ('.$ma[1].')');
								}
							}else{
								$curl = explode(',', str_replace('DL:', '', $curl));
								if($curl[2] != 0){
									OC_ocDownloaderPB::setText($l->t('Waiting for').' '.$curl[2].'s');
									sleep($curl[2]);
								}
								
								$pr_url = $m[1].'://'.$curl[0].'/cgi-bin/rsapi.cgi?sub=download&bin=1';
								if(isset($user_info['us_username']) && isset($user_info['us_password'])){
									$pr_url .= '&login='******'us_username'].'&password='******'us_password']; 
								}
								$pr_url .= '&fileid='.$m[2].'&filename='.$m[3].'&dlauth='.$curl[1];
	
								$curl = OC_ocDownloaderHTTP::execURL($pr_url, 'rapidshare');
								if(preg_match('/^ERROR.*\((.*)\)(\n){0,1}.*$/', $curl, $m)){
									if(isset($errors[$m[1]])){
										OC_ocDownloaderPB::setError($errors[$m[1]]);
									}else{
										OC_ocDownloaderPB::setError($l->t('Unknown error').' ('.$m[1].')');
Ejemplo n.º 2
0
error_reporting(6135);

?>
<html>
	<head>
		<style type="text/css">
			body{color:#555;font:0.6em "Lucida Grande",Arial,Verdana,sans-serif;font-weight:normal;text-shadow:0 1px 0 #FFF;margin:0 1px 0 0;overflow:hidden;}
		</style>
	</head>
	<body>
		<?php
		OC_ocDownloaderPB::init();
		echo '<div style="width:99%;">';
		OC_ocDownloaderPB::render();
		echo '</div>';
		OC_ocDownloaderPB::setText($l->t('Prepare download ...'));
		
		if(!OC_ocDownloaderFTP::checkFTPMod()){
			OC_ocDownloaderPB::setError($l->t('FTP mod is disabled'));
		}else{
			$url = urldecode(trim($_GET['u']));
			$ow = urldecode(trim($_GET['o']));
			
			if(strcmp(substr($url,0,6), 'ftp://') != 0 && strcmp(substr($url,0,7), 'ftps://') != 0){
				$url = 'ftp://'.$url;
			}
			
			$url = parse_url($url);
			if(!isset($url['scheme']) || !isset($url['host']) || !isset($url['user']) || !isset($url['pass']) || !isset($url['path'])){
				OC_ocDownloaderPB::setError($l->t('Wrong URL'));
			}else{