⚙️ Установка:
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
