Skip to content

Instantly share code, notes, and snippets.

import os
import assemblyai as aai
from pytube import YouTube
aai.settings.api_key = "INSERT YOUR API KEY HERE"
youtube_url = "https://www.youtube.com/watch?v=f94wKh70cOY"
# Let's download the YouTube video
youtube = YouTube(youtube_url)
audio = youtube.streams.filter(only_audio=True).first()