Skip to content

Commit

Permalink
Merge branch 'dev' into ntindle/secrt-962-add-user-authentication-and…
Browse files Browse the repository at this point in the history
…-authorization-check-to-all
  • Loading branch information
Torantulino authored Nov 14, 2024
2 parents ffc92ae + 05c7673 commit 5105bea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 16 additions & 1 deletion autogpt_platform/backend/backend/blocks/youtube.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,22 @@ def extract_video_id(url: str) -> str:

@staticmethod
def get_transcript(video_id: str):
return YouTubeTranscriptApi.get_transcript(video_id)
try:
transcript_list = YouTubeTranscriptApi.list_transcripts(video_id)

if not transcript_list:
raise ValueError(f"No transcripts found for the video: {video_id}")

for transcript in transcript_list:
first_transcript = transcript_list.find_transcript(
[transcript.language_code]
)
return YouTubeTranscriptApi.get_transcript(
video_id, languages=[first_transcript.language_code]
)

except Exception:
raise ValueError(f"No transcripts found for the video: {video_id}")

def run(self, input_data: Input, **kwargs) -> BlockOutput:
video_id = self.extract_video_id(input_data.youtube_url)
Expand Down
2 changes: 2 additions & 0 deletions autogpt_platform/frontend/src/app/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ export default function PrivatePage() {
"24e5d942-d9e3-4798-8151-90143ee55629", // Anthropic
"4ec22295-8f97-4dd1-b42b-2c6957a02545", // Groq
"7f7b0654-c36b-4565-8fa7-9a52575dfae2", // D-ID
"7f26de70-ba0d-494e-ba76-238e65e7b45f", // Jina
"66f20754-1b81-48e4-91d0-f4f0dd82145f", // Unreal Speech
],
[],
);
Expand Down

0 comments on commit 5105bea

Please sign in to comment.