Changes:
- added
list_transcripts(video_id)
toYouTubeTranscriptApi
, which returns aTranscriptList
object, representing all available transcriptsTranscriptList
objects provide the methodsfind_transcript(languages)
,find_generated_transcript(languages)
andfind_manually_created_transcript(languages)
, which returnTranscript
objectsTranscript
objects represent a transcripts and provide metadata properties- by calling
transcript.fetch()
the actual transcript is fetched
- added new translation feature
- by calling
transcript.translate('de')
on aTranscript
object YouTubes translation feature can be accessed
- by calling
- added more specific exception types and thereby vastly improved error messages
TranscriptsDisabled
,NoTranscriptFound
,VideoUnavailable
,NotTranslatable
,TranslationLanguageNotAvailable
,NoTranscriptAvailable
- all exceptions are subtypes of
CouldNotRetrieveTranscript
- updated CLI to make new features accessible
- updated Documentation to explain new features and changes
- completely reworked how the module scrapes transcripts, which makes it way more solid
BREAKING:
youtube_transcript_api.YouTubeTranscriptApi.CouldNotRetrieveTranscript
has been move toyoutube_transcript_api.CouldNotRetrieveTranscript
Special thanks to @danielcliu for his contributions and time in the reviewing process!