Add all files
This commit is contained in:
18
download_youtube.py
Normal file
18
download_youtube.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from __future__ import unicode_literals
|
||||
import yt_dlp
|
||||
import sys
|
||||
|
||||
ydl_opts = {
|
||||
'format': 'bestaudio/best',
|
||||
'postprocessors': [{
|
||||
'key': 'FFmpegExtractAudio',
|
||||
'preferredcodec': 'mp3',
|
||||
'preferredquality': '0', # 0 = best quality
|
||||
}],
|
||||
}
|
||||
|
||||
url = sys.argv[1]
|
||||
print("Downloading youtube song " + url)
|
||||
|
||||
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
|
||||
ydl.download([url])
|
||||
Reference in New Issue
Block a user