Last active
June 26, 2018 05:05
-
-
Save csimpi/ddbc124c722dea366bdd99014443dee7 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python3 | |
# -*- coding: UTF-8 -*- | |
import re | |
import subprocess | |
with open("playlists.txt", "r") as ins: | |
for url in ins: | |
print(url.strip()) | |
cmd="./spotdl.py --playlist "+url | |
process=subprocess.Popen(cmd, shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE) | |
output = process.stdout.read().decode('utf-8') | |
#print("OUT: "+output) | |
matches=re.search("Writing (.*?) tracks to (.*?).txt",output); | |
playlist_slug=matches.group(2) | |
playlist_file=playlist_slug+".txt" | |
playlist_title=playlist_slug.replace("-", " ").strip().title() | |
print(playlist_title); | |
print(playlist_file); | |
cmd="./spotdl.py --list="+playlist_file+" --overwrite skip -f /home/vagrant/Music/'"+playlist_title+"'" | |
process=subprocess.Popen(cmd, shell=True) | |
print(); | |
#break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a playlist synchronizer script for 'ritiek/spotify-downloader': https://github.com/ritiek/spotify-downloader
Create
playlist.txt
Put your playlists' URLs into the
playlist.txt
file.Run the script with python.
The script will download each track from each playlist from the playlist.txt and put the files into
/home/vagrant/Music/{playlist title}
folderDON'T FORGET CHANGE THE DESTINATION DIRECTORY!