pip install yt-dlp
from yt_dlp import YoutubeDL
def download_audio(url: str) -> None:
opts = {
"format": "bestaudio/best",
"outtmpl": "%(title)s.%(ext)s",
"quiet": True,
}
with YoutubeDL(opts) as ydl:
ydl.download([url])
if __name__ == "__main__":
download_audio("https://www.youtube.com/watch?v=VIDEO_ID")
#tipsandtricks #doc #python #soft
Please open Telegram to view this post
VIEW IN TELEGRAM
👍62🔥12❤7😱1