Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion streamrip/client/deezer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ async def get_downloadable(
"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.",
Expand Down
10 changes: 8 additions & 2 deletions streamrip/media/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ async def resolve(self) -> Track | None:
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:
Expand All @@ -147,7 +147,13 @@ async def resolve(self) -> Track | None:
return None

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
if downloads_config.disc_subdirectories and self.album.disctotal > 1:
Expand Down
Loading