I can get original captions, but cannot get translated captions.
I am sure that the reason is not in IP-address, because I tested it from different IPs.
To Reproduce
Steps to reproduce the behavior:
from youtube_transcript_api import YouTubeTranscriptApi
video_id = 'QOGxXBO_2ig'
try:
ytt_api = YouTubeTranscriptApi()
transcript_list = ytt_api.list(video_id)
transcript = transcript_list.find_transcript(['en'])
transcript_fetched = transcript.fetch()
for snippet in transcript_fetched:
print(snippet.text)
translated_transcript = transcript.translate('de')
translated_transcript_fetched = translated_transcript.fetch()
for snippet in translated_transcript_fetched:
print(snippet.text)
except Exception as e:
print(f"error: {e}")
Which Python version are you using?
Python 3.13
Which version of youtube-transcript-api are you using?
youtube-transcript-api 1.2.4
Expected behavior
Script should print texts of:
- original captions (in English language).
- translated captions (in Deutch language).
Actual behaviour
Script prints texts of original captions (in English language), but does not print texts of translated captions (in Deutch language).
Instead I receive the following error message:
Could not retrieve a transcript for the video https://www.youtube.com/watch?v=QOGxXBO_2ig! This is most likely caused by:
YouTube is blocking requests from your IP. This usually is due to one of the following reasons:
- You have done too many requests and your IP has been blocked by YouTube
- You are doing requests from an IP belonging to a cloud provider (like AWS, Google Cloud Platform, Azure, etc.). Unfortunately, most IPs from cloud providers are blocked by YouTube.
Ways to work around this are explained in the "Working around IP bans" section of the README (https://github.com/jdepoix/youtube-transcript-api?tab=readme-ov-file#working-around-ip-bans-requestblocked-or-ipblocked-exception).
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 can get original captions, but cannot get translated captions.
I am sure that the reason is not in IP-address, because I tested it from different IPs.
To Reproduce
Steps to reproduce the behavior:
Which Python version are you using?
Python 3.13
Which version of youtube-transcript-api are you using?
youtube-transcript-api 1.2.4
Expected behavior
Script should print texts of:
Actual behaviour
Script prints texts of original captions (in English language), but does not print texts of translated captions (in Deutch language).
Instead I receive the following error message: