def json(url=nil, bu=true)
        if url.nil?
          uri       = URI(@url)
        else
          uri       = URI(url)
        end

        path       = uri.to_s.gsub(DOMAINS[:api],'')
        time_stamp =  Time.now.to_i.to_s
        key = Digest::MD5.hexdigest(path + time_stamp + DOMAINS[:salt])
        begin
          print "[GET] -> " + uri.to_s
          get_time = Time.now

          http              = Net::HTTP.new(uri.host, uri.port)
          http.read_timeout = 10
          if uri.scheme == "https"
            http.use_ssl = true
          end

          headers = {
            "Android-Api-Version"   => "19",
            "X-SIGNATURE"           => key,
            "device"                => "android",
            "X-TIMESTAMP"           => time_stamp,
            "User-Agent"            => "Android client (4.4 / api19), ru.kinopoisk/4.2.0 (55)",
          }

          response = http.get(uri.request_uri, headers)

          print " <- [#{(Time.now-get_time).round 3}s] [#{response.code}]\n"

          if KpApi::valid_json?(response.body)
            j = JSON.parse(response.body)
            if j['resultCode'] == 0
              j['data']
            else
              j
            end
          else

            {:resultCode => -1, :message=> "Error method require", :data => { :code => response.code, :body => response.body} }
          end
        rescue StandardError => e
          print "\n[Err] -> " + uri.to_s
          raise KpApi::ApiError.new(0, e)
        end

      end
def json(url=nil, bu=true)
        if url.nil?
          uri       = URI(@url)
        else
          uri       = URI(url)
        end

        path       = uri.to_s.gsub(DOMAINS[:api],'')
        time_stamp =  Time.now.to_i.to_s
        key = Digest::MD5.hexdigest(path + time_stamp + DOMAINS[:salt])
        begin
          print "[GET] -> " + uri.to_s
          get_time = Time.now

          http              = Net::HTTP.new(uri.host, uri.port)
          http.read_timeout = 10
          if uri.scheme == "https"
            http.use_ssl = true
          end

          headers = {
            "Android-Api-Version"   => "19",
            "X-SIGNATURE"           => key,
            "device"                => "android",
            "X-TIMESTAMP"           => time_stamp,
            "User-Agent"            => "Android client (4.4 / api19), ru.kinopoisk/4.2.0 (55)",
          }

          response = http.get(uri.request_uri, headers)

          print " <- [#{(Time.now-get_time).round 3}s] [#{response.code}]\n"

          if KpApi::valid_json?(response.body)
            j = JSON.parse(response.body)
            if j['resultCode'] == 0
              j['data']
            else
              j
            end
          else

            {:resultCode => -1, :message=> "Error method require", :data => { :code => response.code, :body => response.body} }
          end
        rescue StandardError => e
          print "\n[Err] -> " + uri.to_s
          raise KpApi::ApiError.new(0, e)
        end

      end
private