Skip to content

Commit

Permalink
evaluate addon_handle in default.py
Browse files Browse the repository at this point in the history
  • Loading branch information
peak3d committed Apr 24, 2018
1 parent 1a0ef24 commit 5963a58
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions default.py
Expand Up @@ -11,11 +11,12 @@
import navigation as nav
import watchlist

skygo = SkyGo()
addon_handle = int(sys.argv[1])
plugin_base_url = sys.argv[0]
params = dict(urlparse.parse_qsl(sys.argv[2][1:]))

skygo = SkyGo(addon_handle)

# Router for all plugin actions
if 'action' in params:

Expand Down Expand Up @@ -79,4 +80,4 @@
nav.clearCache()

else:
nav.rootDir()
nav.rootDir()
9 changes: 4 additions & 5 deletions skygo.py
@@ -1,7 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys
import base64
import struct

Expand All @@ -28,7 +27,6 @@
'OTHER_SESSION':'T_206' }

addon = xbmcaddon.Addon()
addon_handle = int(sys.argv[1])
autoKillSession = addon.getSetting('autoKillSession')
username = addon.getSetting('email')
password = addon.getSetting('password')
Expand Down Expand Up @@ -72,12 +70,13 @@ class SkyGo:
entitlements = []


def __init__(self):
def __init__(self, addon_handle):
self.sessionId = ''
self.cookiePath = cookiePath
self.license_url = license_url
self.license_type = license_type
self.android_deviceId = android_deviceid
self.addon_handle = addon_handle

# Create session with old cookies
self.session = requests.session()
Expand Down Expand Up @@ -336,7 +335,7 @@ def play(self, manifest_url, package_code, parental_rating=0, info_tag=None, api
li.setProperty('inputstream.adaptive.license_data', init_data)
li.setProperty('inputstreamaddon', 'inputstream.adaptive')
# Start Playing
xbmcplugin.setResolvedUrl(addon_handle, True, listitem=li)
xbmcplugin.setResolvedUrl(self.addon_handle, True, listitem=li)
else:
xbmcgui.Dialog().notification('Sky Go Fehler', 'Keine Berechtigung zum Abspielen dieses Eintrags', xbmcgui.NOTIFICATION_ERROR, 2000, True)
else:
Expand All @@ -348,4 +347,4 @@ def play(self, manifest_url, package_code, parental_rating=0, info_tag=None, api
password = skygo.encode(password)
addon.setSetting('password', password)
if skygo.login(username, password, forceLogin=True, askKillSession=False):
addon.setSetting('login_acc', username)
addon.setSetting('login_acc', username)

0 comments on commit 5963a58

Please sign in to comment.