This is a python API which allows you to get the transcript/subtitles for a given YouTube video. It also works for automatically generated subtitles and it does not require an API key nor a headless browser, like other selenium based solutions do!
MIT License
2.54k
stars
279
forks
source link
Get auto-generated subtitles even when both the (manually created) and (auto-generated) subtitles exists. #248
YouTubeTranscriptApi.list_transcripts(video_id) returns this list of subtitles:
For this video (N2bXEUSAiTI&list=PLBjE6akKYpgiFB-X-WL4oOU4GyVZGYwio) transcripts are available in the following languages:
(MANUALLY CREATED)
- en ("English - Twitch Chat")[TRANSLATABLE]
(GENERATED)
- en ("English (auto-generated)")[TRANSLATABLE]
I am trying to get the subtitles of this video(ID): N2bXEUSAiTI&list=PLBjE6akKYpgiFB-X-WL4oOU4GyVZGYwio
I want to select the (GENERATED) subtitle instead of (MANUALLY CREATED) when I run the following line in python:
YouTubeTranscriptApi.list_transcripts(video_id)
returns this list of subtitles:I am trying to get the subtitles of this video(ID):
N2bXEUSAiTI&list=PLBjE6akKYpgiFB-X-WL4oOU4GyVZGYwio