diff options
author | Parker M <contact@pkrm.dev> | 2023-10-04 10:37:39 -0500 |
---|---|---|
committer | Parker M <contact@pkrm.dev> | 2023-10-04 10:37:39 -0500 |
commit | bdc5d1fece0b3ee2ac8805ccee07ef93787eeb3e (patch) | |
tree | 6ab89fef24b013b656fa2ab2adb2aa6a2d332ad2 | |
parent | ac8fb456373693d3574dcfc3f2f056fb2e0e1117 (diff) |
Temp fix for KeyError
-rw-r--r-- | app/messagearr.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/messagearr.py b/app/messagearr.py index 8bacd7c..6f437c7 100644 --- a/app/messagearr.py +++ b/app/messagearr.py @@ -226,6 +226,9 @@ def incoming(): # Sometimes movie downloads take a long time and include days in the time_left value # This is formated as 1.00:00:00 time_left = humanize.precisedelta(datetime.datetime.strptime(movie['timeleft'], '%d.%H:%M:%S') - datetime.datetime.strptime('00:00:00', '%H:%M:%S'), minimum_unit='seconds') + except KeyError: + time_left = 'Unknown' + message += f"📥 {movies[movie_id]} - {time_left}\n" else: message += f"{movies[movie_id]} - {str(movie['status']).upper()}\n" |