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.54k stars 279 forks source link

How about YouTube Shorts? #292

Closed brycewang2018 closed 3 weeks ago

brycewang2018 commented 3 weeks ago

When I tried to download the transcripts from a YouTube short video, I met this bug:

""" TranscriptsDisabled: Could not retrieve a transcript for the video https://www.youtube.com/watch?v=IsAwf3qrSw0S2MhN! This is most likely caused by:

Subtitles are disabled for this video

If you are sure that the described cause is not responsible for this error and that a transcript should be retrievable, please create an issue at https://github.com/jdepoix/youtube-transcript-api/issues. Please add which version of youtube_transcript_api you are using and provide the information needed to replicate the error. Also make sure that there are no open issues which already describe your problem! """

I think it might be not hard to add some new codes to support the short video URL.

Thanks!

jdepoix commented 3 weeks ago

Hi @brycewang2018, shorts work for me. However, when I open the link you posted it says that the "video is no longer available", which most likely is the cause for this error.

brycewang2018 commented 2 weeks ago

You are right. Thank you for your response.