Skip to content

Commit

Permalink
cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
dersphere committed Feb 28, 2013
1 parent 302ea2d commit 4be01ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion addon.py
Expand Up @@ -109,7 +109,6 @@ def search_by_game():
@plugin.route('/search/<search_string>/')
def show_games(search_string):
games = api.get_games(search_string)
print games
items = __format_games(games)
finish_kwargs = {}
if plugin.get_setting('force_viewmode', bool):
Expand Down
7 changes: 4 additions & 3 deletions resources/lib/api.py
Expand Up @@ -23,6 +23,7 @@
from urllib2 import urlopen, Request, HTTPError, URLError

API_URL = 'http://app.4players.de/services/app/data.php'
USER_AGENT = 'XBMC4PlayersApi'


class NetworkError(Exception):
Expand All @@ -31,7 +32,6 @@ class NetworkError(Exception):

class XBMC4PlayersApi(object):

USER_AGENT = 'XBMC4PlayersApi'
LIMIT = 50

def __init__(self):
Expand Down Expand Up @@ -161,11 +161,12 @@ def __format_duration(duration_str):
else:
return 0

def __api_call(self, method, *params):
@staticmethod
def __api_call(method, *params):
parts = [API_URL, method] + [quote(str(p)) for p in params]
url = '/'.join(parts)
req = Request(url)
req.add_header('User Agent', self.USER_AGENT)
req.add_header('User Agent', USER_AGENT)
log('Opening URL: %s' % url)
try:
response = urlopen(req).read()
Expand Down

0 comments on commit 4be01ab

Please sign in to comment.