Interface YoutubeClient


public interface YoutubeClient
Responsible for sending GET requests to YouTube.
  • Method Details

    • get

      Sends a GET request to the specified URL and returns the response body.
      Parameters:
      url - The URL to which the GET request is made.
      headers - A map of additional headers to include in the request.
      Returns:
      The body of the response as a String.
      Throws:
      TranscriptRetrievalException - If the request to YouTube fails.
    • get

      Sends a GET request to the specified endpoint and returns the response body.
      Parameters:
      endpoint - The endpoint to which the GET request is made.
      params - A map of parameters to include in the request.
      Returns:
      The body of the response as a String.
      Throws:
      TranscriptRetrievalException - If the request to YouTube fails.
    • createParamsString

      default String createParamsString(Map<String,String> params)
      Creates a string representation of the specified parameters.
      Parameters:
      params - A map of parameters to include in the request.
      Returns:
      A string representation of the specified parameters.