diff options
Diffstat (limited to 'plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py')
-rw-r--r-- | plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py index f295d65..f14e5ae 100644 --- a/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py +++ b/plugin.video.vrt.nu/resources/lib/vrtplayer/urltostreamservice.py @@ -1,6 +1,4 @@ -import xbmcgui import requests -import xbmc import json import cookielib import urlparse @@ -13,16 +11,16 @@ class UrlToStreamService: _API_KEY ="3_qhEcPa5JGFROVwu5SWKqJ4mVOIkwlFNMSKwzPDAh8QZOtHqu6L4nD5Q7lk0eXOOG" _BASE_GET_STREAM_URL_PATH = "https://mediazone.vrt.be/api/v1/vrtvideo/assets/" - def __init__(self, vrt_base, vrtnu_base_url, addon): + def __init__(self, vrt_base, vrtnu_base_url, kodi_wrapper): self._vrt_base = vrt_base self._vrtnu_base_url = vrtnu_base_url - self._addon = addon + self._kodi_wrapper = kodi_wrapper self._session = requests.session() def get_stream_from_url(self, url): - cred = helperobjects.Credentials(self._addon) + cred = helperobjects.Credentials(self._kodi_wrapper) if not cred.are_filled_in(): - self._addon.openSettings() + self._kodi_wrapper.open_settings() cred.reload() url = urlparse.urljoin(self._vrt_base, url) r = self._session.post("https://accounts.eu1.gigya.com/accounts.login", @@ -55,13 +53,13 @@ class UrlToStreamService: stream_response = self._session.get(final_url) hls = self.__get_hls(stream_response.json()['targetUrls']).replace("https", "http") subtitle = None - if self._addon.getSetting("showsubtitles") == "true": + if self._kodi_wrapper.get_setting("showsubtitles") == "true": subtitle = self.__get_subtitle(stream_response.json()['subtitleUrls']) return helperobjects.StreamURLS(hls, subtitle) else: - xbmcgui.Dialog().ok(self._addon.getAddonInfo('name'), - self._addon.getLocalizedString(32051), - self._addon.getLocalizedString(32052)) + title = self._kodi_wrapper.get_localized_string(32051) + message = self._kodi_wrapper.get_localized_string(32052) + self._kodi_wrapper.show_ok_dialog(title, message) @staticmethod def __get_hls(dictionary): |