From 6c49edf3ae368e62ccd65e564beb437381ef0af5 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Fri, 14 Aug 2020 00:00:36 +1200 Subject: [PATCH] Fix past text conversion for past streams --- index.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/index.py b/index.py index 9448b7b..df6eca1 100644 --- a/index.py +++ b/index.py @@ -170,8 +170,14 @@ def uncompress_counter(text): def past_text_to_time(text): words = text.split(" ") - assert len(words) == 3, "3 words" - assert words[2] == "ago", 'ends with "ago"' + if words[0] == "Streamed": + words = words[1:] + if len(words) != 3: + print(words) + raise Exception("Past text is not 3 words") + if words[2] != "ago": + print(words) + raise Exception('Past text does not end with "ago"') number = int(words[0]) unit = words[1][:2] multiplier = 1