From 6d1e9c975f063dbc69a37aeb6a6578fab6eb31a5 Mon Sep 17 00:00:00 2001 From: oskvr37 Date: Tue, 14 Jan 2025 16:44:36 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20#66?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tiddl/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tiddl/__init__.py b/tiddl/__init__.py index edb23a8..7f76146 100644 --- a/tiddl/__init__.py +++ b/tiddl/__init__.py @@ -143,6 +143,11 @@ def downloadTrack( if track.get("status") == 404: raise ValueError(track) + if not track["allowStreaming"]: + logger.warning( + f"The track is not streamable: {track["title"]} ({track["id"]})" + ) + file_dir, file_name = formatFilename(file_template, track, playlist) file_path = f"{download_path}/{file_dir}/{file_name}" @@ -191,7 +196,7 @@ def downloadTrack( with open(file_path, "wb+") as f: f.write(track_data) - if not cover_data: + if not cover_data and track["album"]["cover"]: cover = Cover(track["album"]["cover"]) cover_data = cover.content