PW Akshay

Generation

generate functionSun, 04 Dec 2022

import subprocess def tube(video_id): cmd = ['youtube-dl', '--no-playlist', '--no-warnings', '--quiet', '-f', 'mp4', 'https://www.youtube.com/watch?v={}'.format(video_id) ] subprocess.run(cmd) #convert the above code into youtube_dl python

youtube_dl.YoutubeDL({'format': 'mp4', 'outtmpl': '{}.mp4'.format(video_id)}).download(['https://www.youtube.com/watch?v={}'.format(video_id)])

Questions about programming?Chat with your personal AI assistant