How to extract audio from a YouTube video and upload it to the /tmp folder or a cloud service for ChatGPT Transcription?

This topic was automatically generated from Slack. You can find the original thread here.

Hello guys, I’m trying to do this:
I want to transcribe my YouTube videos using Whisper/ChatGPT. Pipedream offers ChatGPT Transcription, but you can only reference an audio file, not a video.
How to download audio from specific YouTube video and upload to /tmp folder or some cloud service?
Can anyone help with this workflow?

That is a really good question. The first thing that I would try is using something like ffmpeg to convert the video into audio.

But at this time we don’t have the ffmpeg binary within the Bash steps.

Maybe there’s an API that can do this for you?

Maybe you can use a service like AWS MediaConvert to convert the video files into audio files for Whisper:

This content can’t be displayed.

hm, maybe possible to do with python?
And using pytube — pytube 12.1.2 documentation

Shoot, bot beat me to it :laughing:

But yes if the Python package doesn’t rely on pre-installed binaries than it should work with Pipedream. There are some exceptions for modules that include pre-built binaries for non-Lambda compatible environments.

Thanks Mario, appreciate that

Testing this, seems there are errors…

so seems there are many apis to get youtube to mp3, but then GPT transcription doesn’t work :grinning: here is e.g. file url https://beta.123tokyo.xyz/dl.php?id=hOfZHU5aKSM&c=cdn1&u=https%3A%2F%2Fmalpha.123toky[…]FRjQ&s=1678905042&n=How%20to%20get%20hints%20in%20NGL%20app_