From b427151b771fd0ace2740a753b41a5cf2d56953f Mon Sep 17 00:00:00 2001 From: Hashir Date: Tue, 1 Mar 2016 13:14:12 +0800 Subject: [PATCH] Fix JSON load error issue #25 and #31 --- fbchat/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbchat/utils.py b/fbchat/utils.py index 1a3285a..260a658 100644 --- a/fbchat/utils.py +++ b/fbchat/utils.py @@ -15,7 +15,7 @@ def now(): return int(time()*1000) def get_json(text): - return json.loads(re.sub(r"for.*(.*;.*;.*).*;", '', text.encode('utf-8').decode("unicode-escape"), 1)) + return json.loads(re.sub(r"^[^{]*", '', text, 1)) def digit_to_char(digit): if digit < 10: