Add all files

This commit is contained in:
2025-09-29 13:52:46 +00:00
parent 137b5f2b51
commit 8edfb40df3
11 changed files with 1756 additions and 0 deletions

26
download_spotify.py Executable file
View File

@@ -0,0 +1,26 @@
import sys
from subprocess import call
import re
url_pattern = "^https?:\\/\\/(?:www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b(?:[-a-zA-Z0-9()@:%_\\+.~#?&\\/=]*)$"
def main():
if (len(sys.argv) != 2):
print("Wrong parameters!")
sys.exit(-1)
url = sys.argv[1].strip()
print("passing link " + str(url))
if (re.match(url_pattern,url) == None):
print("Url has to be a valid link!")
sys.exit(-1)
if ("spotify" not in url or "https://" not in url):
print("Url has to be a spotify link!")
sys.exit(-1)
print("executing command")
call("cd \"/home/sem/TODO MUSIC\"", shell=True)
call("spotdl download " + url, shell=True, user="sem")
# call("./download-spotify.sh " + url, shell=True, user="sem") # run as user sem to have the SPOTIPY_CLIENT_ID and SPOTIPY_CLIENT_SECRET environment variables set
if __name__ == "__main__":
main()