def zapiSession(self): zapiSession = ZapiSession(xbmc.translatePath(__addon__.getAddonInfo('profile')).decode('utf-8')) PROVIDER = __addon__.getSetting('provider') if PROVIDER == "0": ZAPIUrl = "https://zattoo.com" elif PROVIDER == "1": ZAPIUrl = "https://www.netplus.tv" elif PROVIDER == "2": ZAPIUrl = "https://mobiltv.quickline.com" elif PROVIDER == "3": ZAPIUrl = "https://tvplus.m-net.de" elif PROVIDER == "4": ZAPIUrl = "https://player.waly.tv" elif PROVIDER == "5": ZAPIUrl = "https://www.meinewelt.cc" elif PROVIDER == "6": ZAPIUrl = "https://www.bbv-tv.net" elif PROVIDER == "7": ZAPIUrl = "https://www.vtxtv.ch" elif PROVIDER == "8": ZAPIUrl = "https://www.myvisiontv.ch" elif PROVIDER == "9": ZAPIUrl = "https://iptv.glattvision.ch" elif PROVIDER == "10": ZAPIUrl = "https://www.saktv.ch" elif PROVIDER == "11": ZAPIUrl = "https://nettv.netcologne.de" elif PROVIDER == "12": ZAPIUrl = "https://tvonline.ewe.de" elif PROVIDER == "13": ZapiUrl = "https://www.quantum-tv.com" if zapiSession.init_session(__addon__.getSetting('username'), __addon__.getSetting('password'), ZAPIUrl): return zapiSession else: # show home window, zattooHiQ settings and quit xbmc.executebuiltin('ActivateWindow(10000)') xbmcgui.Dialog().ok(__addon__.getAddonInfo('name'), __addon__.getLocalizedString(31902)) __addon__.openSettings() zapiSession.renew_session() xbmcgui.Dialog().ok(__addon__.getAddonInfo('name'), local(24074)) import sys sys.exit()
def zapiSession(self): zapiSession = ZapiSession(xbmc.translatePath(__addon__.getAddonInfo('profile')).decode('utf-8')) if zapiSession.init_session(__addon__.getSetting('username'), __addon__.getSetting('password')): return zapiSession else: # show home window, zattoobox settings and quit xbmc.executebuiltin('ActivateWindow(10000)') xbmcgui.Dialog().ok(__addon__.getAddonInfo('name'), __addon__.getLocalizedString(31902)) __addon__.openSettings() zapiSession.renew_session() sys.exit()
def zapiSession(self): zapiSession = ZapiSession(xbmc.translatePath(__addon__.getAddonInfo('profile')).decode('utf-8')) if zapiSession.init_session(__addon__.getSetting('username'), __addon__.getSetting('password')): return zapiSession else: # show home window, zattooHiQ settings and quit xbmc.executebuiltin('ActivateWindow(10000)') xbmcgui.Dialog().ok(__addon__.getAddonInfo('name'), __addon__.getLocalizedString(31902)) __addon__.openSettings() zapiSession.renew_session() import sys sys.exit()
class Main(object): z = None ZattooUser = '' ZattooPass = '' ChannelList = None def __init__(self): self.config_init(); self.z = ZapiSession('/tmp/') self.z.init_session(self.ZattooUser, self.ZattooPass) def config_init(self): config = ConfigParser.ConfigParser() config.read('zattooCmd.cfg') self.ZattooPass = config.get('General', 'password') self.ZattooUser = config.get('General', 'username') def login(self): if self.z.login(): print ("Login ok \n") else: print ("Login not ok... \n") sys.exit(0) self.z.announce() ChannelList = self.retrieve_channels() def retrieve_channels(self): api = '/zapi/v2/cached/channels/%s?details=False' % self.z.AccountData['account']['power_guide_hash'] channelsData = self.z.exec_zapiCall(api, None) if channelsData is not None: return channelsData return None def get_allChannels(self, flag_favorites=False): channelsData = self.retrieve_channels() if channelsData is None: return None if flag_favorites: api = '/zapi/channels/favorites' favoritesData = self.z.exec_zapiCall(api, None) if favoritesData is None: return None allChannels = [] for group in channelsData['channel_groups']: for channel in group['channels']: allChannels.append({ 'id': channel['id'], 'title': channel['title'], 'recommend': 1 if channel['recommendations'] == True else 0, 'favorite': 1 if flag_favorites and channel['id'] in favoritesData['favorites'] else 0}) return allChannels def watch(self, args): params = {'cid': args['id'], 'stream_type': 'hls'} resultData = self.z.exec_zapiCall('/zapi/watch', params) if resultData is not None: url = resultData['stream']['watch_urls'][0]['url'] return resultData
def __init__(self): self.config_init(); self.z = ZapiSession('/tmp/') self.z.init_session(self.ZattooUser, self.ZattooPass)
class Main(object): z = None ZattooUser = '' ZattooPass = '' ChannelList = None def __init__(self): self.config_init() self.z = ZapiSession('/tmp/') self.z.init_session(self.ZattooUser, self.ZattooPass) def config_init(self): config = ConfigParser.ConfigParser() config.read('zattooCmd.cfg') self.ZattooPass = config.get('General', 'password') self.ZattooUser = config.get('General', 'username') def login(self): if self.z.login(): print("Login ok \n") else: print("Login not ok... \n") sys.exit(0) self.z.announce() ChannelList = self.retrieve_channels() def retrieve_channels(self): api = '/zapi/v2/cached/channels/%s?details=False' % self.z.AccountData[ 'account']['power_guide_hash'] channelsData = self.z.exec_zapiCall(api, None) if channelsData is not None: return channelsData return None def get_allChannels(self, flag_favorites=False): channelsData = self.retrieve_channels() if channelsData is None: return None if flag_favorites: api = '/zapi/channels/favorites' favoritesData = self.z.exec_zapiCall(api, None) if favoritesData is None: return None allChannels = [] for group in channelsData['channel_groups']: for channel in group['channels']: allChannels.append({ 'id': channel['id'], 'title': channel['title'], 'recommend': 1 if channel['recommendations'] == True else 0, 'favorite': 1 if flag_favorites and channel['id'] in favoritesData['favorites'] else 0 }) return allChannels def watch(self, args): params = {'cid': args['id'], 'stream_type': 'hls'} resultData = self.z.exec_zapiCall('/zapi/watch', params) if resultData is not None: url = resultData['stream']['watch_urls'][0]['url'] return resultData
def __init__(self): self.config_init() self.z = ZapiSession('/tmp/') self.z.init_session(self.ZattooUser, self.ZattooPass)