Check streamability before downloading media

This commit is contained in:
Rafael Moraes
2025-12-09 23:26:53 -03:00
parent 59f247a90f
commit f67ba37d19
+9 -5
View File
@@ -81,6 +81,15 @@ class AppleMusicDownloader:
) -> DownloadItem:
download_item = None
if not self.base_downloader.is_media_streamable(
media_metadata,
):
return DownloadItem(
media_metadata=media_metadata,
playlist_metadata=playlist_metadata,
error=NotStreamable(media_metadata["id"]),
)
if media_metadata["type"] in SONG_MEDIA_TYPE:
download_item = await self.song_downloader.get_download_item(
media_metadata,
@@ -399,11 +408,6 @@ class AppleMusicDownloader:
if self.song_downloader.synced_lyrics_only:
return
if not self.base_downloader.is_media_streamable(
download_item.media_metadata,
):
raise NotStreamable(download_item.media_metadata["id"])
if (
Path(download_item.final_path).exists()
and not self.base_downloader.overwrite