Created
November 7, 2017 23:42
-
-
Save Tjorriemorrie/a7cc5cddb556fd81745cedef84ab594d to your computer and use it in GitHub Desktop.
convert youtube to mp3
This file contains hidden or 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
from __future__ import unicode_literals | |
import youtube_dl | |
ydl_opts = { | |
'format': 'bestaudio/best', | |
'postprocessors': [{ | |
'key': 'FFmpegExtractAudio', | |
'preferredcodec': 'mp3', | |
'preferredquality': '192', | |
}], | |
} | |
videos_list = [ | |
] | |
videos_urls = ['https://www.youtube.com/watch?v={}'.format(v) for v in videos_list] | |
with youtube_dl.YoutubeDL(ydl_opts) as ydl: | |
ydl.download(videos_urls) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment