Skip to content

Commit 1c4e669

Browse files
authoredMar 24, 2025··
Merge pull request #390 from exislow/277-bug-downloads-stopcrashes-on-downloading-large-list-from-artist-on-window-11-24h2-using-gui-all-in-one-app
👷 Check if albums and videos are available or not due to regional restrictions. Fixes #277
2 parents b3ed18a + efc2549 commit 1c4e669

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed
 

‎tidal_dl_ng/download.py

+18-7
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ def item(
334334
if media_id and media_type:
335335
# If no media instance is provided, we need to create the media instance.
336336
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.
338338
if not media.available:
339339
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)}"
341341
)
342342

343343
return False, ""
@@ -714,11 +714,22 @@ def items(
714714
quality_audio: Quality | None = None,
715715
quality_video: QualityVideo | None = None,
716716
):
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
722733

723734
# Create file name and path
724735
file_name_relative: str = format_path_media(file_template, media, self.settings.data.album_track_num_pad_min)

0 commit comments

Comments
 (0)
Please sign in to comment.