From 90d59aff509d6909786aaad823ac7b819a49240e Mon Sep 17 00:00:00 2001 From: iou1name Date: Wed, 26 Feb 2020 11:33:29 -0500 Subject: [PATCH] bandaid to fix coinlib's api --- modules/crypto.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/crypto.py b/modules/crypto.py index 7216760..98a7019 100755 --- a/modules/crypto.py +++ b/modules/crypto.py @@ -10,6 +10,7 @@ import config from module import commands, example, require_admin URI = "https://coinlib.io/api/v1" +HEADERS = {'cookie': "SESSIONID=91049a9e2e89f6a39f827378dd10184f;"} @commands("crypto", "coin") @example(".crypto btc", @@ -28,7 +29,7 @@ def crypto(bot, trigger): symbol = trigger.args[1] if symbol: params["symbol"] = symbol - res = requests.get(URI + "/coin", params=params) + res = requests.get(URI + "/coin", params=params, headers=HEADERS) if res.status_code in [400, 401]: return bot.msg(f"Error: {res.json()['error']}") res.raise_for_status()