Class TranscriptRequest

java.lang.Object
io.github.thoroldvix.api.TranscriptRequest

public class TranscriptRequest extends Object
Request object for retrieving transcripts from PlaylistsTranscriptApi.

Contains API key required for the YouTube V3 API, and optionally a file path to the text file containing the authentication cookies. If cookies are not provided, the API will not be able to access age restricted videos. Also contains a flag to stop on error, or continue on error. Defaults to false if not provided.

  • Constructor Details

    • TranscriptRequest

      public TranscriptRequest(String apiKey, String cookiesPath, boolean stopOnError)
      Creates a new instance of TranscriptRequest
      Parameters:
      apiKey - API key for the YouTube V3 API (see Getting started)
      cookiesPath - The file path to the text file containing the authentication cookies. Used in the case if some videos are age restricted see {Cookies}
      stopOnError - Whether to stop if transcript retrieval fails for a video. If false, all transcripts that could not be retrieved will be skipped, * otherwise an exception will be thrown on first error.
    • TranscriptRequest

      public TranscriptRequest(String apiKey, String cookiesPath)
    • TranscriptRequest

      public TranscriptRequest(String apiKey)
    • TranscriptRequest

      public TranscriptRequest(String apiKey, boolean stopOnError)
  • Method Details

    • getApiKey

      public String getApiKey()
      Returns:
      API key for the YouTube V3 API (see Getting started)
    • getCookiesPath

      public String getCookiesPath()
      Returns:
      The file path to the text file containing the authentication cookies. Used in the case if some videos are age restricted see {Cookies}
    • isStopOnError

      public boolean isStopOnError()
      Returns:
      Whether to stop if transcript retrieval fails for a video. If false, all transcripts that could not be retrieved will be skipped, * otherwise an exception will be thrown on first error.