Skip to content

Commit

Permalink
chore: realdebrid logging to debug level
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaisberg authored and Gaisberg committed Nov 1, 2024
1 parent 8631008 commit d426a8a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/program/downloaders/realdebrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ def get_instant_availability(self, infohashes: List[str]) -> Dict[str, list]:
Get instant availability for multiple infohashes with retry logic
Required by DownloaderBase
"""
if not self.initialized:
logger.error("Downloader not properly initialized")
return {}

for attempt in range(self.MAX_RETRIES):
try:
Expand All @@ -144,7 +141,7 @@ def get_instant_availability(self, infohashes: List[str]) -> Dict[str, list]:

# Check for empty response
if all(isinstance(data, list) for data in response.values()):
logger.warning(f"Empty response received (attempt {attempt + 1}/{self.MAX_RETRIES})")
logger.debug(f"Empty response received (attempt {attempt + 1}/{self.MAX_RETRIES})")
time.sleep(self.RETRY_DELAY)
continue

Expand All @@ -155,12 +152,12 @@ def get_instant_availability(self, infohashes: List[str]) -> Dict[str, list]:
}

except Exception as e:
logger.error(f"Failed to get instant availability (attempt {attempt + 1}/{self.MAX_RETRIES}): {e}")
logger.debug(f"Failed to get instant availability (attempt {attempt + 1}/{self.MAX_RETRIES}): {e}")
if attempt < self.MAX_RETRIES - 1:
time.sleep(self.RETRY_DELAY)
continue

logger.error("All retry attempts failed for instant availability")
logger.debug("All retry attempts failed for instant availability")
return {}

def _filter_valid_containers(self, containers: List[dict]) -> List[dict]:
Expand Down

0 comments on commit d426a8a

Please sign in to comment.