diff options
Diffstat (limited to 'lastfm.py')
| -rw-r--r-- | lastfm.py | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -1,8 +1,6 @@ -from __future__ import with_statement import requests import sys -import simplejson as json from time import sleep from collections import deque from types import * @@ -25,7 +23,7 @@ def make_request(method, payload): r = requests.get(URL, params=params, headers=user_agent) try: - answer = json.loads(r.text) + answer = r.json() except ValueError: # request failed for some reason, retrying i = 0 while r.status_code == 503 and i < 3: @@ -33,7 +31,7 @@ def make_request(method, payload): r = requests.get(URL, params=params, headers=user_agent) i += 1 try: - answer = json.loads(r.text) + answer = r.json() except ValueError: # giving up answer = None |
