Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit 0e50d5f

Browse files
authored
Update main.py
1 parent 8b76886 commit 0e50d5f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

main.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ def read_playlist():
3737
global tracks
3838
try:
3939
items = sp.playlist_items(user_2023)["items"]
40-
print(f"{items[0]["track"]["artists"][0]["name"]} - {items[0]["track"]["name"]}") # print only one element
4140
tracks = [f"{item["track"]["artists"][0]["name"]} - {item["track"]["name"]}" for item in items]
4241
message = "Spotify weekly read"
4342
write_to_summary(f"**Step success:** {message}")
@@ -53,9 +52,9 @@ def read_playlist():
5352
user_2023 = "3pmCbJYSYPxFlisJTe8Hxw"
5453
authenticate_spotify()
5554
read_playlist()
56-
print(tracks)
5755
with open('2023.txt', 'w') as f:
58-
print(tracks, file=f)
56+
for track in tracks:
57+
print(track, file=f)
5958
except Exception as error:
6059
write_to_summary(f"## Workflow failed")
6160
print("An error occurred:", type(error).__name__, "–", error)

0 commit comments

Comments
 (0)