Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nathom committed Jun 11, 2024
1 parent 5f18c51 commit 55036c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions streamrip/client/downloadable.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,14 @@ def __init__(self, session: aiohttp.ClientSession, info: dict):
self.session = session
self.url = info["url"]
self.source: str = "deezer"
try:
max_quality_available = max(
i for i, size in enumerate(info["quality_to_size"]) if size > 0
)
except:
qualities_available = [
i for i, size in enumerate(info["quality_to_size"]) if size > 0
]
if len(qualities_available) == 0:
raise NonStreamableError(
"Missing download info. Skipping.",
)
max_quality_available = max(qualities_available)
self.quality = min(info["quality"], max_quality_available)
self._size = info["quality_to_size"][self.quality]
if self.quality <= 1:
Expand Down
2 changes: 1 addition & 1 deletion streamrip/media/playlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def resolve(self) -> Track | None:
self.client.get_downloadable(self.id, quality),
)
except NonStreamableError as e:
logger.error(f"Error fetching download info for track {self.id}: %s", e)
logger.error(f"Error fetching download info for track {self.id}: {e}")
self.db.set_failed(self.client.source, "track", self.id)
return None

Expand Down

0 comments on commit 55036c3

Please sign in to comment.