From 8285ff324fcd03c97ee6a077b05cd5a4430e9712 Mon Sep 17 00:00:00 2001 From: Sascha Rommelfangen Date: Tue, 13 Nov 2018 15:30:06 +0100 Subject: [PATCH] API changes reflected --- misp_modules/modules/expansion/btc_steroids.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/misp_modules/modules/expansion/btc_steroids.py b/misp_modules/modules/expansion/btc_steroids.py index c4edaa32..b6cb2cc7 100755 --- a/misp_modules/modules/expansion/btc_steroids.py +++ b/misp_modules/modules/expansion/btc_steroids.py @@ -24,10 +24,15 @@ start_time = 0 conversion_rates = {} def get_consumption(output=False): - req = requests.get(converter_rls) - jreq = req.json() - minute = str(jreq['Minute']['CallsLeft']['Histo']) - hour = str(jreq['Hour']['CallsLeft']['Histo']) + try: + req = requests.get(converter_rls) + jreq = req.json() + minute = str(jreq['Data']['calls_left']['minute']) + hour = str(jreq['Data']['calls_left']['hour']) + except Exception as e: + print(e) + minute = str(-1) + hour = str(-1) # Debug out for the console print("Calls left this minute / hour: " + minute + " / " + hour) return minute, hour