Created
November 29, 2022 03:55
-
-
Save vishalbandre/ad090798d6c238334ad5a77afd81c78f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download YouTube video as MP3 | |
import subprocess | |
def download_youtube_video_as_mp3(url, output_file): | |
cmd = 'youtube-dl -x --audio-format mp3 ' + url + ' -o ' + output_file | |
subprocess.call(cmd, shell=True) | |
download_youtube_video_as_mp3('https://www.youtube.com/watch?v=srVPLrmlBJY', 'output.mp3') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment