diff options
Diffstat (limited to 'skripti')
-rwxr-xr-x | skripti/spotify_publish_saved.py | 7 |
1 files 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)) |