Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def listEpisodes(self, episodes_url):
url = streams['medium']
elif 'low' in streams and streams['low'] is not None:
url = streams['low']
elif 'msg' in streams and streams['msg'] is not None:
return
items.append((url, item))

xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_EPISODE)
Expand Down
10 changes: 9 additions & 1 deletion mtgapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import urllib2
try:
import xbmc
import xbmcgui
except:
class xbmc(object):
@staticmethod
Expand Down Expand Up @@ -59,6 +60,13 @@ def _http_request(self, url):
content = connection.read()
connection.close()
return content
except urllib2.HTTPError, e:
data = e.read()
reason = json.loads(data.decode('iso-8859-1').encode('utf-8'))
xbmcgui.Dialog().ok(("HTTP Error: " + str(e.code) + " " + e.reason),
reason['msg'])
return data

except Exception as ex:
raise JsonApiException(ex)

Expand Down Expand Up @@ -225,7 +233,7 @@ def get_streams(self, episode):
try:
return data['streams']
except:
return {}
return data

@staticmethod
def test():
Expand Down