Created
March 25, 2020 07:46
-
-
Save ibrahimokdadov/480ad18d4ca4dad5ba348ab8d803ecaa to your computer and use it in GitHub Desktop.
youtube to mp3
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
#prerequisites: | |
#ffmpeg and youtube-dl | |
#python youtube_mp3.py <youtube_url> | |
import youtube_dl | |
import sys | |
params ={ | |
'format': 'bestaudio/best', | |
'postprocessors':[{ | |
'key': 'FFmpegExtractAudio', | |
'preferredcodec': 'mp3', | |
'preferredquality': '192', | |
}], | |
} | |
youtube= youtube_dl.YoutubeDL(params) | |
youtube.download(sys.argv[1:]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment