Created
June 4, 2018 07:35
-
-
Save meetmangukiya/27d53cd64372c7fdf52958468d08e709 to your computer and use it in GitHub Desktop.
Download youtube videos as mp3 from a given playlist
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
import sys | |
import youtube_dl | |
opts = { | |
'format': 'bestaudio/best', | |
'postprocessors': [{ | |
'key': 'FFmpegExtractAudio', | |
'preferredcodec': 'mp3', | |
'preferredquality': '192', | |
}], | |
'outtmpl': '%(title)s.%(ext)s' | |
} | |
with youtube_dl.YoutubeDL(opts) as ydl: | |
ydl.download([sys.argv[-1]]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installing youtube-dl
Usage