Skipping tracks on any NonStreamableError when getting downloadable info (#645) (#707)

This commit is contained in:
Roman 2024-07-07 17:09:49 +02:00 committed by GitHub
parent 5c6e452679
commit 006605ccb3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -173,7 +173,7 @@ class DeezerClient(Client):
"quality allowed is 1.",
)
except deezer.WrongGeolocation:
if not is_retry:
if not is_retry and fallback_id:
return await self.get_downloadable(fallback_id, quality, is_retry=True)
raise NonStreamableError(
"The requested track is not available. This may be due to your country/location.",

View file

@ -138,7 +138,7 @@ class PendingTrack(Pending):
try:
meta = TrackMetadata.from_resp(self.album, source, resp)
except Exception as e:
logger.error(f"Error building track metadata for {id=}: {e}")
logger.error(f"Error building track metadata for {self.id}: {e}")
return None
if meta is None:
@ -147,7 +147,13 @@ class PendingTrack(Pending):
return None
quality = self.config.session.get_source(source).quality
try:
downloadable = await self.client.get_downloadable(self.id, quality)
except NonStreamableError as e:
logger.error(
f"Error getting downloadable data for track {meta.tracknumber} [{self.id}]: {e}"
)
return None
downloads_config = self.config.session.downloads
if downloads_config.disc_subdirectories and self.album.disctotal > 1: