1
0
Fork 0
mirror of https://github.com/nathom/streamrip.git synced 2025-05-23 19:47:08 -04:00

Skipping tracks on any NonStreamableError when getting downloadable info () ()

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
streamrip

View file

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

View file

@ -138,7 +138,7 @@ class PendingTrack(Pending):
try: try:
meta = TrackMetadata.from_resp(self.album, source, resp) meta = TrackMetadata.from_resp(self.album, source, resp)
except Exception as e: 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 return None
if meta is None: if meta is None:
@ -147,7 +147,13 @@ class PendingTrack(Pending):
return None return None
quality = self.config.session.get_source(source).quality quality = self.config.session.get_source(source).quality
downloadable = await self.client.get_downloadable(self.id, 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 downloads_config = self.config.session.downloads
if downloads_config.disc_subdirectories and self.album.disctotal > 1: if downloads_config.disc_subdirectories and self.album.disctotal > 1: