Created
December 28, 2019 00:44
-
-
Save dylan-chong/60a87729a913ecd27487ca914c735bb0 to your computer and use it in GitHub Desktop.
Download a list of songs by name
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
# Requires spotdl and youtube-dl to installed with python3 | |
# Should be a list of search query text for spotify (e.g. `Song Name Artist Name`) | |
SONG_LIST_FILE = '/Users/Dylan/Desktop/songs.txt'.freeze | |
OUTPUT_FOLDER = '/Users/Dylan/Desktop/songs'.freeze | |
File.foreach(SONG_LIST_FILE) do |line| | |
command = [ | |
'spotdl', | |
'--song', | |
line.delete("\n"), | |
'--output-ext', | |
'.m4a', | |
'--search-format', | |
'{artist} - {track_name}', | |
'--folder', | |
OUTPUT_FOLDER, | |
] | |
puts | |
puts command.inspect | |
system(*command) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: you have to be on the lookout for warnings like
in which case manually search for <SONG_NAME> on youtube and download it using
There is another warning
which means the song will still probably get downloaded from youtube but the downloaded track won't have the spotify metadata attached to it