Skip to content
Open
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
8 changes: 4 additions & 4 deletions streamrip/client/deezer.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ async def get_downloadable(
# TODO: optimize such that all of the ids are requested at once
dl_info: dict = {"quality": quality, "id": item_id}

track_info = self.client.gw.get_track(item_id)
track_info = await asyncio.to_thread(self.client.gw.get_track, item_id)

fallback_id = track_info.get("FALLBACK", {}).get("SNG_ID")

Expand All @@ -161,7 +161,7 @@ async def get_downloadable(
int(track_info.get(f"FILESIZE_{format}", 0)) for _, format in quality_map
]
dl_info["quality_to_size"] = size_map

# Check if requested quality is available
if size_map[quality] == 0:
if self.config.lower_quality_if_not_available:
Expand All @@ -178,7 +178,7 @@ async def get_downloadable(
raise NonStreamableError(
f"The requested quality {quality} is not available and fallback is disabled."
)

# Update the quality in dl_info to reflect the final quality used
dl_info["quality"] = quality

Expand All @@ -187,7 +187,7 @@ async def get_downloadable(
token = track_info["TRACK_TOKEN"]
try:
logger.debug("Fetching deezer url with token %s", token)
url = self.client.get_track_url(token, format_str)
url = await asyncio.to_thread(self.client.get_track_url, token, format_str)
except deezer.WrongLicense:
raise NonStreamableError(
"The requested quality is not available with your subscription. "
Expand Down
Loading