@@ -334,10 +334,10 @@ def item(
334
334
if media_id and media_type :
335
335
# If no media instance is provided, we need to create the media instance.
336
336
media = instantiate_media (self .session , media_type , media_id )
337
- elif isinstance (media , Track ): # Check if media is available not deactivated / removed from TIDAL.
337
+ elif isinstance (media , Track ) or isinstance ( media , Video ) : # Check if media is available not deactivated / removed from TIDAL.
338
338
if not media .available :
339
339
self .fn_logger .info (
340
- f"This track is not available for listening anymore on TIDAL. Skipping: { name_builder_item (media )} "
340
+ f"This item is not available for listening anymore on TIDAL. Skipping: { name_builder_item (media )} "
341
341
)
342
342
343
343
return False , ""
@@ -714,11 +714,22 @@ def items(
714
714
quality_audio : Quality | None = None ,
715
715
quality_video : QualityVideo | None = None ,
716
716
):
717
- # If no media instance is provided, we need to create the media instance.
718
- if media_id and media_type :
719
- media = instantiate_media (self .session , media_type , media_id )
720
- elif not media :
721
- raise MediaMissing
717
+ try :
718
+ if media_id and media_type :
719
+ # If no media instance is provided, we need to create the media instance.
720
+ # Throws `tidalapi.exceptions.ObjectNotFound` if item is not available anymore.
721
+ media = instantiate_media (self .session , media_type , media_id )
722
+ elif isinstance (media , Album ): # Check if media is available not deactivated / removed from TIDAL.
723
+ if not media .available :
724
+ self .fn_logger .info (
725
+ f"This item is not available for listening anymore on TIDAL. Skipping: { name_builder_title (media )} "
726
+ )
727
+
728
+ return
729
+ elif not media :
730
+ raise MediaMissing
731
+ except :
732
+ return
722
733
723
734
# Create file name and path
724
735
file_name_relative : str = format_path_media (file_template , media , self .settings .data .album_track_num_pad_min )
0 commit comments