From e77f1c75db7ead7ed2ae3995cc27502d4bcdc514 Mon Sep 17 00:00:00 2001 From: Pukabyte <120460627+Pukabyte@users.noreply.github.com> Date: Sun, 14 Jul 2024 17:55:26 +1200 Subject: [PATCH] Torbox fix --- shared/debrid.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/shared/debrid.py b/shared/debrid.py index 27dc8ed..573c571 100644 --- a/shared/debrid.py +++ b/shared/debrid.py @@ -381,7 +381,12 @@ def _getInstantAvailability(self, refresh=False): instantAvailabilities = instantAvailabilityRequest.json() self.print('instantAvailabilities:', instantAvailabilities) - self._instantAvailability = instantAvailabilities['data']['data'] if 'data' in instantAvailabilities and 'data' in instantAvailabilities['data'] and instantAvailabilities['data']['data'] is not False else None + + # Check if 'data' exists and is not None or False + if instantAvailabilities and 'data' in instantAvailabilities and instantAvailabilities['data']: + self._instantAvailability = instantAvailabilities['data'] + else: + self._instantAvailability = None return self._instantAvailability @@ -518,4 +523,4 @@ class TorboxTorrent(Torbox, Torrent): pass class TorboxMagnet(Torbox, Magnet): - pass + pass