Package io.github.thoroldvix.api
Interface PlaylistsTranscriptApi
public interface PlaylistsTranscriptApi
Retrieves transcripts for all videos in a playlist, or all videos for a specific channel.
Playlists and channel videos are retrieved from the YouTube API, so you will need to have a valid api key to use this.
To get implementation for this interface see TranscriptApiFactory
-
Method Summary
Modifier and TypeMethodDescriptionlistTranscriptsForChannel
(String channelName, String apiKey, boolean continueOnError) Retrieves transcript lists for all videos for the specified channel using provided API key.listTranscriptsForChannel
(String channelName, String apiKey, String cookiesPath, boolean continueOnError) Retrieves transcript lists for all videos for the specified channel using provided API key and cookies file from a specified path.listTranscriptsForPlaylist
(String playlistId, String apiKey, boolean continueOnError) Retrieves transcript lists for all videos in the specified playlist using provided API key.listTranscriptsForPlaylist
(String playlistId, String apiKey, String cookiesPath, boolean continueOnError) Retrieves transcript lists for all videos in the specified playlist using provided API key and cookies file from a specified path.
-
Method Details
-
listTranscriptsForPlaylist
Map<String,TranscriptList> listTranscriptsForPlaylist(String playlistId, String apiKey, String cookiesPath, boolean continueOnError) throws TranscriptRetrievalException Retrieves transcript lists for all videos in the specified playlist using provided API key and cookies file from a specified path.- Parameters:
playlistId
- The ID of the playlistapiKey
- 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}continueOnError
- Whether to continue if transcript retrieval fails for a video. If true, all transcripts that could not be retrieved will be skipped, otherwise an exception will be thrown.- Returns:
- A map of video IDs to
TranscriptList
objects - Throws:
TranscriptRetrievalException
- If the retrieval of the transcript lists fails
-
listTranscriptsForPlaylist
Map<String,TranscriptList> listTranscriptsForPlaylist(String playlistId, String apiKey, boolean continueOnError) throws TranscriptRetrievalException Retrieves transcript lists for all videos in the specified playlist using provided API key.- Parameters:
playlistId
- The ID of the playlistapiKey
- API key for the YouTube V3 API (see Getting started)continueOnError
- Whether to continue if transcript retrieval fails for a video. If true, all transcripts that could not be retrieved will be skipped, otherwise an exception will be thrown.- Returns:
- A map of video IDs to
TranscriptList
objects - Throws:
TranscriptRetrievalException
- If the retrieval of the transcript lists fails
-
listTranscriptsForChannel
Map<String,TranscriptList> listTranscriptsForChannel(String channelName, String apiKey, String cookiesPath, boolean continueOnError) throws TranscriptRetrievalException Retrieves transcript lists for all videos for the specified channel using provided API key and cookies file from a specified path.- Parameters:
channelName
- The name of the channelapiKey
- 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}continueOnError
- Whether to continue if transcript retrieval fails for a video. If true, all transcripts that could not be retrieved will be skipped, otherwise an exception will be thrown.- Returns:
- A map of video IDs to
TranscriptList
objects - Throws:
TranscriptRetrievalException
- If the retrieval of the transcript lists failsTranscriptRetrievalException
- If the retrieval of the transcript lists fails
-
listTranscriptsForChannel
Map<String,TranscriptList> listTranscriptsForChannel(String channelName, String apiKey, boolean continueOnError) throws TranscriptRetrievalException Retrieves transcript lists for all videos for the specified channel using provided API key.- Parameters:
channelName
- The name of the channelapiKey
- API key for the YouTube V3 API (see Getting started)continueOnError
- Whether to continue if transcript retrieval fails for a video. If true, all transcripts that could not be retrieved will be skipped, otherwise an exception will be thrown.- Returns:
- A map of video IDs to
TranscriptList
objects - Throws:
TranscriptRetrievalException
- If the retrieval of the transcript lists fails
-