original_string: public function search($query, $params = array())
  	{
  		// Set default category to "Série TV"
  		if (!isset($params['cid']))
  			$params['cid'] = '433';
  		if (!isset($params['offset']))
  			$params['offset'] = '0';
  		if (!isset($params['limit']))
  			$params['limit'] = '200';
  
  		$request = $this->sendRequest($this->baseUrl."/torrents/search/".urlencode($query.'*').$this->queryString($params), null, 0);
  
  		$response = json_decode($request['body'], true);
  		if (array_key_exists('error', $response))
  		{
  			if ($response['code'] == 201 || $response['code'] == 202) {
  				$this->connect();
  				return $this->search($query, $params);
  			}
  			throw new \Exception('Erreur '.$response['code'].' : '.$response['error']);
  		} else {
  			$torrents = array();
  			if (intval($response['total']) > 0)
  			{
  				foreach ($response['torrents'] as $torrent){
  					$torrents[] = array_merge($torrent, array(
  						'url'             => 'http://www.t411.in/torrents/'.$torrent['rewritename'],
  						'id'              => intval($torrent['id']),
  						'seeders'         => intval($torrent['seeders']),
  						'leechers'        => intval($torrent['leechers']),
  						'comments'        => intval($torrent['comments']),
  						'size'            => intval($torrent['size']),
  						'times_completed' => intval($torrent['times_completed']),
  						'owner'           => intval($torrent['owner']),
  						'isVerified'      => (boolean) intval($torrent['isVerified']),
  					));
  				}
  			}
  
  			return $torrents;
  		}
  	}
code: public function search($query, $params = array())
  	{
  		// Set default category to "Série TV"
  		if (!isset($params['cid']))
  			$params['cid'] = '433';
  		if (!isset($params['offset']))
  			$params['offset'] = '0';
  		if (!isset($params['limit']))
  			$params['limit'] = '200';
  
  		$request = $this->sendRequest($this->baseUrl."/torrents/search/".urlencode($query.'*').$this->queryString($params), null, 0);
  
  		$response = json_decode($request['body'], true);
  		if (array_key_exists('error', $response))
  		{
  			if ($response['code'] == 201 || $response['code'] == 202) {
  				$this->connect();
  				return $this->search($query, $params);
  			}
  			throw new \Exception('Erreur '.$response['code'].' : '.$response['error']);
  		} else {
  			$torrents = array();
  			if (intval($response['total']) > 0)
  			{
  				foreach ($response['torrents'] as $torrent){
  					$torrents[] = array_merge($torrent, array(
  						'url'             => 'http://www.t411.in/torrents/'.$torrent['rewritename'],
  						'id'              => intval($torrent['id']),
  						'seeders'         => intval($torrent['seeders']),
  						'leechers'        => intval($torrent['leechers']),
  						'comments'        => intval($torrent['comments']),
  						'size'            => intval($torrent['size']),
  						'times_completed' => intval($torrent['times_completed']),
  						'owner'           => intval($torrent['owner']),
  						'isVerified'      => (boolean) intval($torrent['isVerified']),
  					));
  				}
  			}
  
  			return $torrents;
  		}
  	}
code_tokens: public function search ( $ query , $ params = array ( ) ) { // Set default category to "Série TV" if ( ! isset ( $ params [ 'cid' ] ) ) $ params [ 'cid' ] = '433' ; if ( ! isset ( $ params [ 'offset' ] ) ) $ params [ 'offset' ] = '0' ; if ( ! isset ( $ params [ 'limit' ] ) ) $ params [ 'limit' ] = '200' ; $ request = $ this -> sendRequest ( $ this -> baseUrl . "/torrents/search/" . urlencode ( $ query . '*' ) . $ this -> queryString ( $ params ) , null , 0 ) ; $ response = json_decode ( $ request [ 'body' ] , true ) ; if ( array_key_exists ( 'error' , $ response ) ) { if ( $ response [ 'code' ] == 201 || $ response [ 'code' ] == 202 ) { $ this -> connect ( ) ; return $ this -> search ( $ query , $ params ) ; } throw new \ Exception ( 'Erreur ' . $ response [ 'code' ] . ' : ' . $ response [ 'error' ] ) ; } else { $ torrents = array ( ) ; if ( intval ( $ response [ 'total' ] ) > 0 ) { foreach ( $ response [ 'torrents' ] as $ torrent ) { $ torrents [ ] = array_merge ( $ torrent , array ( 'url' => 'http://www.t411.in/torrents/' . $ torrent [ 'rewritename' ] , 'id' => intval ( $ torrent [ 'id' ] ) , 'seeders' => intval ( $ torrent [ 'seeders' ] ) , 'leechers' => intval ( $ torrent [ 'leechers' ] ) , 'comments' => intval ( $ torrent [ 'comments' ] ) , 'size' => intval ( $ torrent [ 'size' ] ) , 'times_completed' => intval ( $ torrent [ 'times_completed' ] ) , 'owner' => intval ( $ torrent [ 'owner' ] ) , 'isVerified' => ( boolean ) intval ( $ torrent [ 'isVerified' ] ) , ) ) ; } } return $ torrents ; } }
docstring: Perform a search on T411 website
  
  @param string $params GET parameters to send (filters)
  @return array
docstring_tokens: Perform a search on T411 website