From fb802d11ec29791725b63c9bf3fbd8a1255f2503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sat, 21 Sep 2024 00:08:18 +0200 Subject: spitify --- skripti/spotify_publish_saved.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/skripti/spotify_publish_saved.py b/skripti/spotify_publish_saved.py index dbd1083..12f4149 100755 --- a/skripti/spotify_publish_saved.py +++ b/skripti/spotify_publish_saved.py @@ -3,6 +3,7 @@ import spotipy from spotipy.oauth2 import SpotifyOAuth import json import sys +import datetime scope = "user-library-read playlist-modify-public" sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope, client_id="1034e542fa064c27859b61a6ec5f864e", client_secret="2503172e78ce4d5e9146047db0a39077", redirect_uri="http://b.4a.si:25425/")) playlist = "7IyZWvHG2e7CiGnHGTkFBl" @@ -29,7 +30,9 @@ while len(results["items"]) != 0: offset += 50 if len(to_add) != 0: sp.playlist_add_items(playlist, to_add) - print(offset, file=sys.stderr) + # print(offset, file=sys.stderr) if len(publicized_uris) != 0: sp.playlist_remove_all_occurrences_of_items(playlist, publicized_uris) -json.dumps(saved_items) +todaystring = datetime.datetime.now().isoformat().replace("T", " ").split(".")[0] +sp.playlist_change_details(playlist, name="public mirror of my liked songs.", public=True, collaborative=False, description=f"updated {todaystring} automatically daily using http://4a.si/spotsync") +print(json.dumps(saved_items)) -- cgit v1.2.3