diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2024-09-21 00:08:18 +0200 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2024-09-21 00:08:18 +0200 |
commit | fb802d11ec29791725b63c9bf3fbd8a1255f2503 (patch) | |
tree | 94341acc6f4c857a6bc63d427aa0b3d4669e10a8 | |
parent | spotify publish saved (diff) | |
download | r-fb802d11ec29791725b63c9bf3fbd8a1255f2503.tar r-fb802d11ec29791725b63c9bf3fbd8a1255f2503.tar.gz r-fb802d11ec29791725b63c9bf3fbd8a1255f2503.tar.bz2 r-fb802d11ec29791725b63c9bf3fbd8a1255f2503.tar.lz r-fb802d11ec29791725b63c9bf3fbd8a1255f2503.tar.xz r-fb802d11ec29791725b63c9bf3fbd8a1255f2503.tar.zst r-fb802d11ec29791725b63c9bf3fbd8a1255f2503.zip |
-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)) |