Merge pull request #50 from exislow/48-401-client-error

48 401 client error (item not available anymore)
This commit is contained in:
exislow
2024-02-26 07:02:57 +01:00
committed by GitHub
2 changed files with 13 additions and 1 deletions
+9 -1
View File
@@ -190,8 +190,16 @@ class Download:
elif not media: elif not media:
raise MediaMissing 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 video download is not allowed end here
if not video_download: if not video_download and isinstance(media, Video):
self.fn_logger.info( self.fn_logger.info(
f"Video downloads are deactivated (see settings). Skipping video: {name_builder_item(media)}" f"Video downloads are deactivated (see settings). Skipping video: {name_builder_item(media)}"
) )
+4
View File
@@ -357,6 +357,10 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
result = [] result = []
for idx, item in enumerate(items): 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): if isinstance(item, Track):
result_item: ResultItem = ResultItem( result_item: ResultItem = ResultItem(
position=idx, position=idx,