jdepoix / youtube-transcript-api

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.87k stars 326 forks source link

automatically generated not support #178

Closed lengrongfu closed 1 year ago

lengrongfu commented 1 year ago

To Reproduce

Steps to reproduce the behavior:

Which Python version are you using?

Which version of youtube-transcript-api are you using?

What code / cli command are you executing?

Expected behavior

Describe what you expected to happen.

Actual behaviour

Describe what is happening instead of the Expected behavior. Add error messages if there are any.

jdepoix commented 1 year ago

@lengrongfu please properly describe what is not working as expected using the template I inserted.

lengrongfu commented 1 year ago

@jdepoix Hi, Youtube translated subtitles to be downloaded? e.g.

transcript_list = YouTubeTranscriptApi.list_transcripts(video_id="8iYCp3ZwoU8")
print(transcript_list)
For this video (8iYCp3ZwoU8) transcripts are available in the following languages:

(MANUALLY CREATED)
None

(GENERATED)
 - en ("English (auto-generated)")[TRANSLATABLE]

(TRANSLATION LANGUAGES)
 - af ("Afrikaans")
 - ak ("Akan")
 - sq ("Albanian")
 - am ("Amharic")

but transcript = YouTubeTranscriptApi.get_transcript(video_id="8iYCp3ZwoU8", languages=['af']) donot download.

jdepoix commented 1 year ago

This is correct since there is no (manually nor automatically generated) transcript in Afrikaans. There only is an automatically generated English transcript, which can be translated into Afrikaans. To do so, please have a look at the README.

I will close this now, as this seems to work as intended.