This python program above will download an audio from a youtube link
import sys
from pytube import YouTube
link = sys.argv[1] if len(sys.argv) > 1 else None
if link:
try:
out_file = YouTube(link).streams.filter(only_audio=True).first().download(output_path=".")
print(f"Audio saved to {out_file}")
except Exception as e:
print("Error downloading audio:", e)
else:
print("Please provide a link as a command line argument.")
No comments:
Post a Comment