import os import subprocess # Ask the user for the folder name folder_name = input("Enter the folder name: ") # Ask the user for the source URL source_url = input("Enter the source URL: ") # Set the base locations video_base = "V:/internet/" audio_base = "A:/AUDIO/" # Construct full paths video_output = os.path.join(video_base, folder_name) audio_output = os.path.join(audio_base, folder_name) # Create video output folder if it doesn't exist os.makedirs(video_output, exist_ok=True) # Create audio output folder if it doesn't exist os.makedirs(audio_output, exist_ok=True) # Download Video video_command = f'yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" -o "{video_output}/%(title)s.%(ext)s" {source_url}' subprocess.run(video_command, shell=True) # Download Audio audio_command = f'yt-dlp -x --audio-format mp3 --audio-quality 128K -o "{audio_output}/%(title)s.%(ext)s" {source_url}' subprocess.run(audio_command, shell=True)