Exemplo n.º 1
0
	function Transfer($url){
		$url = trim($url);
		if(!$this->watermark){
			return parent::Transfer($url);
		}
		else{
			//Leech image to host
			$filePath = $this->tempfolder . $this->sitename . basename($url);
			$data 		= fopen($url, "rb");
			$newfile 	= fopen($filePath, "w");
			flush();
			while ($buff = fread($data, 1024*8))
				fwrite($newfile, $buff);
			fclose($data);
			fclose($newfile);			
			//Leech complete
			$this->Watermark($filePath, $this->watermark_file);
			return parent::Upload($filePath);
		}	
	}
Exemplo n.º 2
0
	public function Transfer($url){
		if(!$this->watermark){
			return parent::Transfer($url, $this->cookie);
		}
		else{
			//Leech image to host
			$url 		= trim($url);
			$data 		= fopen($url, "rb");
			$filename 	= $this->sitename . end(explode('/',$url));
			$newfile 	= fopen($this->folder . $filename, "w");
			flush();
			while ($buff = fread($data, 1024*8))
				fwrite($newfile, $buff);
			fclose($data);
			fclose($newfile);			
			//Leech complete
			$this->Watermark($this->folder . $filename, $this->watermark_file);
			$data	  = file_get_contents($this->folder . $filename);
			return parent::Upload($data, $this->sitename . $filename, $this->cookie);
		}	
	}