Merge pull request #159 from blha303/patch-10

Fixed!
This commit is contained in:
Luke Rogers 2013-09-13 03:28:45 -07:00
commit e5038156ea

View file

@ -1,13 +1,13 @@
from util import hook, http, web
import json
from urllib2 import HTTPError
import urllib2
def get_sound_info(game, search):
search = search.replace(" ", "+")
try:
data = http.get_json("http://p2sounds.blha303.com.au/search/%s/%s" % (game, search))
except HTTPError as e:
data = http.get_json("http://p2sounds.blha303.com.au/search/%s/%s?format=json" % (game, search))
except urllib2.HTTPError as e:
return "Error: " + json.loads(e.read())["error"]
items = []
for item in data["items"]: