Playlist name in txt output (#140)

This commit is contained in:
Alex Camilleri
2025-10-20 09:36:04 +02:00
committed by GitHub
parent d90c5bac41
commit 9ff181ae6e
2 changed files with 3 additions and 0 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@ config.yml
config.yaml config.yaml
.cache* .cache*
.session.yml .session.yml
songs not found.txt
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/

View File

@@ -281,7 +281,9 @@ async def search_new_tracks_on_tidal(tidal_session: tidalapi.Session, spotify_tr
color = ('\033[91m', '\033[0m') color = ('\033[91m', '\033[0m')
print(color[0] + "Could not find the track " + song404[-1] + color[1]) print(color[0] + "Could not find the track " + song404[-1] + color[1])
file_name = "songs not found.txt" file_name = "songs not found.txt"
header = f"==========================\nPlaylist: {playlist_name}\n==========================\n"
with open(file_name, "a", encoding="utf-8") as file: with open(file_name, "a", encoding="utf-8") as file:
file.write(header)
for song in song404: for song in song404:
file.write(f"{song}\n") file.write(f"{song}\n")