# File lib/youtube_g/client.rb, line 36
    def videos_by(params, options={})
      request_params = params.respond_to?(:to_hash) ? params : options
      request_params[:page] = integer_or_default(request_params[:page], 1)
      
      unless request_params[:max_results]
        request_params[:max_results] = integer_or_default(request_params[:per_page], 25)
      end
      
      unless request_params[:offset]
        request_params[:offset] = calculate_offset(request_params[:page], request_params[:max_results] )
      end
      
      if params.respond_to?(:to_hash) and not params[:user]
        request = YouTubeG::Request::VideoSearch.new(request_params)
      elsif (params.respond_to?(:to_hash) && params[:user]) || (params == :favorites)
        request = YouTubeG::Request::UserSearch.new(request_params, options)
      else
        request = YouTubeG::Request::StandardSearch.new(params, request_params)
      end
      
      logger.debug "Submitting request [url=#{request.url}]." if logger
      parser = YouTubeG::Parser::VideosFeedParser.new(request.url)
      parser.parse
    end