diff options
| author | exislow <exislow@users.noreply.github.com> | 2025-03-24 08:58:25 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-24 08:58:25 +0100 |
| commit | 1c4e669df8cf35a0cc5df7f0d8949dba0bddc94f (patch) | |
| tree | 736d822a293fac3d72335a1991641921cc60cba4 | |
| parent | b3ed18acaf21068ed0c2f7291f3ff8d455585f8d (diff) | |
| parent | efc2549ab5a2c24d7f29a318d4860621b281b36b (diff) | |
| download | tidal-dl-ng-1c4e669df8cf35a0cc5df7f0d8949dba0bddc94f.tar.gz | |
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
| -rw-r--r-- | tidal_dl_ng/download.py | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/tidal_dl_ng/download.py b/tidal_dl_ng/download.py index fae7b41..5e66f45 100644 --- a/tidal_dl_ng/download.py +++ b/tidal_dl_ng/download.py @@ -334,10 +334,10 @@ class Download: if media_id and media_type: # If no media instance is provided, we need to create the media instance. media = instantiate_media(self.session, media_type, media_id) - elif isinstance(media, Track): # Check if media is available not deactivated / removed from TIDAL. + elif isinstance(media, Track) or isinstance(media, Video): # 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)}" + f"This item is not available for listening anymore on TIDAL. Skipping: {name_builder_item(media)}" ) return False, "" @@ -714,11 +714,22 @@ class Download: quality_audio: Quality | None = None, quality_video: QualityVideo | None = None, ): - # If no media instance is provided, we need to create the media instance. - if media_id and media_type: - media = instantiate_media(self.session, media_type, media_id) - elif not media: - raise MediaMissing + try: + if media_id and media_type: + # If no media instance is provided, we need to create the media instance. + # Throws `tidalapi.exceptions.ObjectNotFound` if item is not available anymore. + media = instantiate_media(self.session, media_type, media_id) + elif isinstance(media, Album): # Check if media is available not deactivated / removed from TIDAL. + if not media.available: + self.fn_logger.info( + f"This item is not available for listening anymore on TIDAL. Skipping: {name_builder_title(media)}" + ) + + return + elif not media: + raise MediaMissing + except: + return # Create file name and path file_name_relative: str = format_path_media(file_template, media, self.settings.data.album_track_num_pad_min) |
