We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It'd be great to have a YouTube tool that would let you get information about youtube videos.
from typing import cast import yt_dlp from attrs import define from griptape.artifacts import AudioArtifact from griptape.structures import Pipeline from griptape.tasks import AudioTranscriptionTask, BaseTextInputTask @define class YoutubeAudioTask(BaseTextInputTask): def try_run(self) -> AudioArtifact: ydl_opts = { "outtmpl": "downloaded_audio.%(ext)s", } with yt_dlp.YoutubeDL(ydl_opts) as ydl: ydl.download([self.input.value]) with open("downloaded_audio.webm", "rb") as f: audio_data = f.read() return AudioArtifact(audio_data, format="webm") pipeline = Pipeline( tasks=[ YoutubeAudioTask(id="youtube"), AudioTranscriptionTask( lambda task: cast(AudioArtifact, task.parent_outputs["youtube"]) ), ] ) pipeline.run("https://www.youtube.com/watch?v=TQn2hJeHQbM")
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It'd be great to have a YouTube tool that would let you get information about youtube videos.
The text was updated successfully, but these errors were encountered: