AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(platform): YouTube block yields only error on failure (#11980)
Ottoa077ba9f03e2
diff --git a/autogpt_platform/backend/backend/blocks/youtube.py b/autogpt_platform/backend/backend/blocks/youtube.pyindex e79be3e99b..6d81a86b4c 100644--- a/autogpt_platform/backend/backend/blocks/youtube.py+++ b/autogpt_platform/backend/backend/blocks/youtube.py@@ -165,10 +165,13 @@ class TranscribeYoutubeVideoBlock(Block):credentials: WebshareProxyCredentials,**kwargs,) -> BlockOutput:- video_id = self.extract_video_id(input_data.youtube_url)- yield "video_id", video_id-- transcript = self.get_transcript(video_id, credentials)- transcript_text = self.format_transcript(transcript=transcript)-- yield "transcript", transcript_text+ try:+ video_id = self.extract_video_id(input_data.youtube_url)+ transcript = self.get_transcript(video_id, credentials)+ transcript_text = self.format_transcript(transcript=transcript)++ # Only yield after all operations succeed+ yield "video_id", video_id+ yield "transcript", transcript_text+ except Exception as e:+ yield "error", str(e)