summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorexislow <exislow@users.noreply.github.com>2024-02-26 07:02:57 +0100
committerGitHub <noreply@github.com>2024-02-26 07:02:57 +0100
commit43326ec93f2b8e06caaaf81acac8114dafa1bd61 (patch)
treec44579691564263f7b22a467aba42280c38faf2a
parent34fd48aabc1d11fc09abdff46ada598c6ed19473 (diff)
parent87626d64c590a30f391e6bf1779ca39008a22ff8 (diff)
downloadtidal-dl-ng-43326ec93f2b8e06caaaf81acac8114dafa1bd61.tar.gz
Merge pull request #50 from exislow/48-401-client-error
48 401 client error (item not available anymore)
-rw-r--r--tidal_dl_ng/download.py10
-rw-r--r--tidal_dl_ng/gui.py4
2 files changed, 13 insertions, 1 deletions
diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py
index 7490753..bac9e88 100644
--- a/tidal_dl_ng/download.py
+++ b/tidal_dl_ng/download.py
@@ -190,8 +190,16 @@ class Download:
elif not media:
raise MediaMissing
+ # Check if media is available not deactivated / removed from TIDAL.
+ if not media.available:
+ self.fn_logger.info(
+ f"This track is not available for listening anymore on TIDAL. Skipping: {name_builder_item(media)}"
+ )
+
+ return False, ""
+
# If video download is not allowed end here
- if not video_download:
+ if not video_download and isinstance(media, Video):
self.fn_logger.info(
f"Video downloads are deactivated (see settings). Skipping video: {name_builder_item(media)}"
)
diff --git a/tidal_dl_ng/gui.py b/tidal_dl_ng/gui.py
index 2d2118d..6c904d7 100644
--- a/tidal_dl_ng/gui.py
+++ b/tidal_dl_ng/gui.py
@@ -357,6 +357,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
result = []
for idx, item in enumerate(items):
+ # Check if item is available on TIDAL.
+ if hasattr(item, "available") and not item.available:
+ continue
+
if isinstance(item, Track):
result_item: ResultItem = ResultItem(
position=idx,