Created
July 22, 2021 00:56
-
-
Save gfrn/0a3ea8f3a4a6cc0fa4c7e90b1b17ae12 to your computer and use it in GitHub Desktop.
Download all songs from a spotdl output file using youtube-dl
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 ast | |
import youtube_dl | |
ydl_opts = { | |
'format': 'bestaudio/best', | |
'postprocessors': [{ | |
'key': 'FFmpegExtractAudio', | |
'preferredcodec': 'mp3', | |
'preferredquality': '192', | |
}], | |
} | |
with open("test", 'r') as file: | |
videos = ast.literal_eval(file.read()) | |
with youtube_dl.YoutubeDL(ydl_opts) as ydl: | |
ydl.download([video["youtubeLink"] for video in videos]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment