def CheckChanXML(): chanpath = os.path.join(datapath, 'chan.xml') if not os.path.exists(chanpath): try: shutil.copy(channel_xml, datapath) except: dixie.log('Error in CheckChanXML()')
def metalliq_play(args): run = 0 windowopen = 0 dixie.log('### metalliq play args: %s' % args) channel, repository, plugin, playertype, channel_orig, itemname = args.split('|') dixie.log('### %s' % channel) dixie.log('### %s' % repository) dixie.log('### %s' % plugin) dixie.log('### %s' % playertype) # Check if add-on is installed try: addonid = xbmcaddon.Addon(id=plugin) addonname = addonid.getAddonInfo('name') # If not then install the relevant addon except: koding.Addon_Install(addon_id=addonid,confirm=True,silent=0,repo_install=0) # Update enabled metalliq players xbmc.executebuiltin('RunPlugin(plugin://plugin.video.metalliq/settings/channelers)') updateicon = Addon_Info('icon') xbmc.executebuiltin("XBMC.Notification(Please Wait...,Searching for [COLOR=dodgerblue]"+channel+"[/COLOR] ,5000,"+updateicon+")") my_playback = koding.Play_Video('plugin://plugin.video.metalliq/live_guide/%s/None/en/%s' % (channel, playertype)) if not my_playback: if dialog.yesno('Edit Search Term?','Would you like to edit the channel name? It may be this add-on has a slightly different spelling of [COLOR=dodgerblue]%s[/COLOR]' % channel): Edit_Search(channel, repository, plugin, playertype, channel_orig, itemname) else: Edit_SF_Name('bad', playertype, channel_orig, itemname) else: Edit_SF_Name('good', playertype, channel_orig, itemname)
def resetChannels(): AddonID = 'script.trtv' dialog = xbmcgui.Dialog() path = dixie.GetChannelFolder() chan = os.path.join(path, 'channels') chanchk = xbmc.translatePath(os.path.join('special://profile/addon_data/',AddonID,'chan.xml')) catsxml = xbmc.translatePath(os.path.join('special://profile/addon_data/',AddonID,'cats.xml')) success = 0 try: os.remove(chanchk) except: dixie.log("### IMPORTANT ### Failed to remove the chanchk file in addon_data, please manually remove if it's still there") if sfile.exists(chan): xbmc.executebuiltin('Dialog.Show(busydialog)') sfile.rmtree(chan) xbmc.executebuiltin('Dialog.Close(busydialog)') success = 1 if success == 1: dialog.ok('TRTV - Reset Channels', 'TRTV Channels successfully reset.', 'They will be re-created next time', 'you start the guide') if success == 0: dialog.ok('TRTV - Reset Channels', 'There was nothing to reset, please try running the add-on again so it can repopulate your channels.') if os.path.exists(catsxml): choice = dialog.yesno('Do You Need To Reset Categories?','It\'s highly unlikely you\'ll need to use this but if your main categories list has become corrupt it can cause problems. Would you like to reset the categories to the defaults?') if choice == 1: try: os.remove(catsxml) dialog.ok('TRTV - Reset Categories', 'TRTV Categories successfully reset to addon defaults. Any customisations you previously had are now lost.') except: dialog.ok('TRTV - Reset Categories', 'There was nothing to reset, please try running the add-on again so it can repopulate your categories.') dixie.log("### IMPORTANT ### Unable to remove the cats.xml file in your addon_data folder. Please manually delete")
def getDataFromExternal(self, date, progress_callback=None): categoryPath = os.path.join(datapath, 'cats.xml') channels = os.path.join(datapath, 'chan.xml') categories = dixie.getCategoryList(categoryPath) xml = None try: if sfile.exists(channels): xml = sfile.read(channels) except: dixie.log('Error reading chan.xml') if not xml: return [] if not self.xml: self.xml = xml io = StringIO.StringIO(self.xml) context = ElementTree.iterparse(io, events=("start", "end")) return parseXMLTV(context, io, len(self.xml), progress_callback, self.offset, categories)
def play(url, windowed, name=None): handled = False getIdle = int(ADDON.getSetting('idle').replace('Never', '0')) maxIdle = getIdle * 60 * 60 dixie.loadKepmap() # dixie.ShowBusy() if url.startswith('HDTV'): import hdtv delay = 5 stream = hdtv.getURL(url) if not playAndWait(stream, windowed, maxIdle, delay=delay): dixie.SetSetting('LOGIN_HDTV', '2001-01-01 00:00:00') stream = hdtv.getURL(url) playAndWait(stream, windowed, maxIdle, delay=delay) return if url.startswith('IPTV:'): import iptv url = iptv.getURL(url) dixie.log(url) xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url) return if url.isdigit(): command = ('{"jsonrpc": "2.0", "id":"1", "method": "Player.Open","params":{"item":{"channelid":%s}}}' % url) xbmc.executeJSONRPC(command) return if (url.startswith('__SF__')) or ('plugin://plugin.program.super.favourites' in url.lower()): handled, url = playSF(url) if handled: return if url.lower().startswith('plugin://plugin.video.skygo'): xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url) return if url.lower().startswith('dsf'): if playDSF(url, windowed): wait(maxIdle) return dixie.SetSetting('streamURL', url) if not checkForAlternateStreaming(url): playAndWait(url, windowed, maxIdle) print '***** ottv is playing *****', url xbmc.sleep(3000) if not xbmc.Player().isPlaying(): # dixie.CloseBusy() xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url) print '***** ottv RunPlugin *****', url wait(maxIdle)
def deleteFiles(): try: sfile.remove(settings) sfile.remove(hotkey) for item in os.listdir(epgdata): if item != 'extras': item = os.path.join(epgdata, item) try: shutil.rmtree(item) xbmc.log('### Successfully removed directory: %s' % item) except: try: os.remove(item) xbmc.log('### Successfully removed file: %s' % item) except: xbmc.log('### Failed to remove %s' % item) if os.path.exists(extras): for item in os.listdir(extras): item = os.path.join(extras, item) try: os.remove(item) xbmc.log('### Successfully removed: %s' % item) except: xbmc.log('### Failed to remove: %s' % item) dixie.DialogOK('TRTV successfully reset.', 'It will be recreated next time', 'you start the guide.') except Exception, e: error = str(e) dixie.log('%s :: Error resetting TRTV' % error) dixie.DialogOK('TRTV failed to reset.', error, 'Please restart Kodi and try again.')
def Import_CSV(mode): with open(csvfile,'rb') as fin: dr = csv.DictReader(fin) # comma is default delimiter to_db = [(i['channel'], i['title'],i['start_date'], i['end_date'], i['description'],i['image_large'], i['image_small'], i['source'], i['subTitle'], i['season'], i['episode'], i['is_movie'], i['language']) for i in dr] DB_Open() cur.executemany("INSERT INTO programs (channel,title,start_date,end_date,description,image_large,image_small,source,subTitle," "season, episode, is_movie, language) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);", to_db) con.commit() cur.execute("DELETE FROM programs WHERE RowID NOT IN (SELECT MIN(RowID) FROM programs GROUP BY channel,start_date,end_date);") con.commit() cur.close() con.close() # Insert relevant records into the updates table, if we don't do this we can't move forward in time in the EPG Get_Dates() if os.path.exists(csvfile): try: os.remove(csvfile) except: dixie.log("Unable to remove csv file, must be in use still") if os.path.exists(tempxml): try: os.remove(tempxml) except: dixie.log("Unable to remove temp xml file, must be in use still")
def getCategories(self): cat = dict() path = os.path.join(datapath, 'cats.xml') dixie.log("Checking for category XML path at: "+path) try: if sfile.exists(path): xml = sfile.read(path) except: dixie.log("### cats.xml does not exist") # xml = xml.replace('&', '&') xml = StringIO.StringIO(xml) xml = ElementTree.iterparse(xml, events=("start", "end")) for event, elem in xml: try: if event == 'end': if elem.tag == 'cats': channel = elem.findtext('channel') category = elem.findtext('category') if channel != '' and category != '': cat[channel] = category except: pass return cat
def getRecording(name, start): if not verifyLogin(): return False global SessionID url = RECORDINGS_URL % SessionID recordings = getHTML(url) recordings = json.loads(recordings) recordings = recordings['recordings'] startTS = convertToUnixTS(start) name = name.lower() for recording in recordings: try: title = recording['title'].lower() start = int(recording['time_start']) if (start == startTS): # and (title == name): #do we really need to check title?? dixie.log('Download URL = %s' % recording['download_url']) return recording['download_url'] except Exception, e: dixie.log('Exception thrown in getRecording %s' % str(e))
def l1l1ll111(e): l11111l1 = l1lll1(u"࠭ࡓࡰࡴࡵࡽ࠱ࠦࡡࠢࡨࡶࡷࡵࡲࠡࡱࡦࡧࡺࡸࡥࡥ࠼ࠣࡎࡘࡕࡎࠡࡇࡵࡶࡴࡸ࠺ࠡࠧࡶࠫࣆ") % e l11111ll = l1lll1(u"ࠧࡑࡨࡥࡸࠠࡳࡧ࠰ࡰࡴࠡࡶࡸࠦࡣࡩࡣࡱࡲࡪࡲࠠࡢࡰࡧࠤࡹࡸࡹࠡࡣࡪࡥࡴࠨࣇ") l1111l11 = l1lll1(u"ࠨࡗࡶࡩࠦࡃࡰࡰࡷࡩࡽࡺࠠࡎࡧࡱࡹࠥࡃ࠾ࠡࡔࡨࡱࡴࡼࡥࠡࡕࡷࡶࡪࡧࠨࣈ") dixie.log(e) dixie.DialogOK(l11111l1, l11111ll, l1111l11)
def logout(): killTimer() global LoggedIn, SessionID if not LoggedIn: return id = SessionID LoggedIn = False SessionID = 0 try: url = LOGOUT_URL % id logout = getHTML(url) jsn = json.loads(logout) if 'success' in jsn: LoggedIn = not jsn['success'] if LoggedIn: dixie.log('Failed to Logout of Filmon') else: dixie.log('Logged out of Filmon') except: pass
def login(): dixie.log('Entering login') global TheTimer, LoggedIn, SessionID LoggedIn = False if SessionID == 0: initialise() url = LOGIN_URL % (SessionID, USERNAME, PASSWORD) login = getHTML(url) LoggedIn = 'ERROR' not in login.upper() if LoggedIn: message = 'Logged into Filmon' else: message = 'Failed to Log into Filmon' dixie.log(message) notify(message) if LoggedIn: TheTimer = Timer(INTERVAL, logout) TheTimer.start()
def setChannel(self, text): dixie.log('Setting changer channel to %s' % text) channel = self.getChannel(text) if not channel: xbmcgui.Window(10000).setProperty('OTT_CH_LOGO', '') xbmcgui.Window(10000).setProperty('OTT_CH_TITLE', '') xbmcgui.Window(10000).setProperty('OTT_CH_NUMBER', '') self.channel = '' else: if channel.title.endswith(')') and channel.title[-4] == '(': test_title = channel.title[:-5].replace('_', ' ').replace(' PLUS1', ' +1').replace(' STAR', '*').replace('PLUS1', '+1').replace( '&', '&').replace('>', ' ') else: test_title = channel.title.replace('_', ' ').replace(' PLUS1', ' +1').replace(' STAR', '*').replace( 'PLUS1', '+1').replace('&', '&').replace('>', ' ') if not 'default.png' in channel.logo: test_logo = channel.logo else: test_logo = os.path.join(logofolder, test_title.replace(' ', '_') + '.png') xbmcgui.Window(10000).setProperty('OTT_CH_LOGO', test_logo) xbmcgui.Window(10000).setProperty('OTT_CH_TITLE', test_title) xbmcgui.Window(10000).setProperty('OTT_CH_NUMBER', text) self.updateProgramInfo(channel)
def _pbhook(numblocks, blocksize, filesize, dp, start, range, url=None): try: percent = min(start+((numblocks*blocksize*range)/filesize), start+range) dp.update(int(percent)) except Exception, e: dixie.log('%s Error Downloading Update' % str(e)) percent = 100 dp.update(int(percent))
def l1l1llll1(e): l111111l = l1lll1(u"࡙ࠬࡳࡴࡼ࠰ࠥࡧࠡࡧࡵࡶࡴࡸࠠࡰࡥࡦࡹࡷࡤ࠻ࠢࡍࡗࡔࡔࠠࡆࡴࡵࡳࡷࡀࠠࠦࡵࠪࢰ") % e l11111l1 = l1lll1(u"࠭ࡐࡧࡤࡷࡪࠦࡲࡦࡳࡱࠠࡵࡪࡷࠥࡩࡨࡢࡰࡱࡩࡱࠦࡡࡦࠣࡸࡷࡿࠠࡢࡩࡤࡳ࠴ࠧࢱ") l11111ll = l1lll1(u"ࠧࡖࡵࡨ࠾ࠥࡉࡶࡨࡼࡹࠦࡍࡦࡰࡸࠤࡂࡄࠠࡓࡧࡰࡳࡻࠠࡔࡶࡵࡩࡦࡳࠧࢲ") dixie.log(e) dixie.DialogOK(l111111l, l11111l1, l11111ll) dixie.SetSetting(SETTING, l1lll1(u"ࠨࠩࢳ"))
def l1l1llll1(e): l111111l = l1lll1(u"ࠨࡕࡲࡶࡷࡿࠬࠡࡣࡱࠤࡪࡸࡲࡰࡴࠣࡳࡨࡩࡵࡳࡧࡧ࠾ࠥࡐࡓࡐࡐࠣࡉࡷࡸࡳ࠼ࠣࠩࡸ࠭ࣈ") % e l11111l1 = l1lll1(u"ࠩࡓࡰࡪࡧࡳࡦࠢࡵࡩ࠲ࡲࡩࠣࡸࡳࠡࡥࡥࡳࡴࡥࠢࡤࡲࡩࠦࡴࡳࡻࠣࡥࡧࡩ࠰ࠪࣉ") l11111ll = l1lll1(u"࡙ࠪࡸ࠺ࠡࡅࡲࡲࡹࡸࡵࠢࡐࡩࡳࡻࠠ࠾ࡀࠣࡖࡪࡳࡷࡧࠣࡗࡹࡸࡥࡢࠪ࣊") dixie.log(e) dixie.DialogOK(l111111l, l11111l1, l11111ll) dixie.SetSetting(SETTING, l1lll1(u"ࠫࠬ࣋"))
def getAllChannels(self): channels = [] try: current, dirs, files = sfile.walk(channelPath) except Exception, e: dixie.log('Error in getAllChannels' % str(e)) return channels
def sf_check(channels,weight): sfchans = [] newchans = [] # Grab a list of all the SF folders with a favourites.xml dixie.log('Checking for new SF folders') try: current, dirs, files = sfile.walk(SF_CHANNELS) except Exception, e: dixie.log('Error in getAllChannels - SF List: %s' % str(e))
def l1llll111(e, l1lll1lll): l1111lll = l1l1l(u"ࠪࡗࡴࡸࡲࡺࠣࡥࡳࠦࡥࡳࡴࡲࡶࠥࡵࡣࡤࡷࡵࡩࡩࡀࠠࡋࡕࡒࡒࠥࡋࡲࡳࡱࡵ࠾ࠥࠫࡳ࠭ࠢࠨࡷࠬࢄ") % ( e, l1lll1lll) l111l111 = l1l1l(u"ࠫࡕࡲࡥࡢࡵࡨࠤࡨࡵࡵࡣࡦࡸࠥࡻࡳࠡࡱࡱࠤࡹࡥࠡࡨࡲࡶࡺࡳࠨࢅ") l111l11l = l1l1l( u"࡛ࠬࡰࡱࡤࡨࠥࡧࠠࡱࡪࠤࡻࡡࠡࡶࡩࠥࡧࡤࡥࡱࡱࠤࡸࡴࡵࡱࡸࠦࡡࡦࠣࡴࡴࡹࡴࠡࡶࡩࠥࡲࡩ࠱ࠫࢆ") dixie.log(l1lll1lll) dixie.log(e)
def getPlaylist(): import requests l1llllll1 = [ l1l1l(u"࠭ࡨࡵࡶࡳ࠾࠴࠵ࡸࡥࡲ࠳ࡩࡨࡣࡩ࠲࠴ࠫࢇ"), l1l1l(u"ࠧࡩࡶࡷࡴ࠵ࡱࡧ࠳ࡩࡣࡦ࠱ࡴ࠭࢈"), l1l1l(u"ࠨࡪࡷࡸࡵࡀ࠰ࡣࡳ࠳ࡩࡣࡱࡸࡨࡹࡼࡰࡴࡪ࠳ࡰࡵࡤࡪࠩࢉ"), l1l1l(u"ࠩࡸࡹࡶ࠺࠰࠱ࡪࡳ࠷ࡲࡪࡰ࠳ࡰࡵࡤࡪࠩࢊ") ] l1lll11l1 = l1l1l(u"ࠪࠧࡊ࡞ࡔࡎ࠵ࡘࠫࢋ") for url in l1llllll1: dixie.log(url) try: l1lll111l = requests.get(url) l111ll11 = l1lll111l.text except: pass if l1lll11l1 in l111ll11: path = os.path.join(dixie.PROFILE, l1l1l(u"ࠫࡵࡲࡡࡺࡷࡹ࠴࠴ࡷࠪࢌ")) with open(path, l1l1l(u"ࠬࡽࠧࢍ")) as f: f.write(l111ll11) import urllib l111l1ll = os.path.join(PATH, l1l1l(u"࠭ࡴࡦࡳࠫࢎ")) l1111111 = os.path.join(PATH, l1l1l(u"ࠧࡪࡰ࠶࠳ࡪࠩ")) l1llllll1 = l1l1l( u"ࠨࡪࡷࡸࡵࡹ࠺࠰࠱ࡵࡥࡼ࠴ࡧࡪࡶࡹࡧࡻࡳࡦࡴࡦࡳࡳࡺࡥࡶ࠱ࡧࡴࡳࡓࡧࡱࡩࡧࡤࡦࡵࡗ࡚࠴ࡸࡥࡱࡱࡶࡹࡵࡲࡺ࠰ࡵࡩࡳࡧࡢࡦࡨࡷࡹࡼࡣࡶࡸࡪࡸࡢࡦࡧࡳࡳࡹ࠲ࡱࠬ" ) urllib.urlretrieve(l1llllll1, l111l1ll) l1lll1l11 = open(l111l1ll) l111llll = open(l1111111, l1l1l(u"ࠩࡺࡸࠬ")) for line in l1lll1l11: l111llll.write( line.replace( l1l1l(u"ࠪࡵࡲࡵࡨࡱ࠲ࡻࡤࡦࡱ࠱ࡨࡪࡾࠨ"), l1l1l(u"ࠫࡠࡶࡶࡩࡲ࠳ࡼࡩࡥࡧࡲ࠲ࡽࡾࡸ࡞ࠩ")).replace( l1l1l(u"ࠬࡡࡰࡷࡪࡳ࠴ࡶࡪࡦࡨࡳ࠳ࡩࡥࡖࡱࡪࡣࠨ"), l1l1l(u"࡛࠭ࡱࡸࡴࡷࡧࡩࡴ࠴ࡸࡹࡺࡠࠫ")).replace( l1l1l(u"ࠧࡲࡹࡸࡨࡪࡵࡇ࠰ࡗ࠲࡛ࡣࠧ"), l1l1l(u"ࠨࡳࡰࡺࡩ࠰ࡹࡩࡺࡻࡼࡢ࠭")).replace( l1l1l(u"ࠩ࡞ࡴࡱࡻࡧࡪࡰ࠱ࡺࡪࡥࡰ࠰ࡴࡱࡧࡹࡦࡴࡺࡻࡼࡣࠧ࢘"), l1l1l(u"ࠪࡵࡲࡵࡨࡱ࠲ࡻࡤࡦࡱ࠱ࡼࡽࡾࠨ࢙")).replace( l1l1l(u"ࠫࡠࡶࡶࡩࡲ࠳ࡼࡩࡥࡧࡲ࠲ࡺࡶ࡞࢚ࠩ"), l1l1l(u"ࠬࡡࡰࡷࡪࡳ࠴ࡶࡪࡦࡨࡳ࠳ࡾࡸࡹ࢛ࠪ")).replace( l1l1l(u"࡛࠭ࡱࡸࡴࡷࡧࡩࡴ࠴ࡢࡣࡥࡴࡱࡧࡹࡦࡴࡠࠫ࢜"), l1l1l(u"ࠧࡲࡹࡸࡨࡪࡵࡹࡺࡻࡡࠬ࢝"))) l1lll1l11.close() l111llll.close() os.remove(l111l1ll)
def populateChannels(self, alphaSort = False): channels = [] channelarray = [] SFchannelarray = [] try: current, dirs, files = sfile.walk(OTT_CHANNELS) except Exception, e: dixie.log('### Failed to scan master channel list: %s' % str(e)) return channelarray
def metalliq_play(args): run = 0 windowopen = 0 dixie.log('### metalliq play args: %s' % args) channel, repository, plugin, playertype, channel_orig, itemname = args.split('|') dixie.log('### %s' % channel) dixie.log('### %s' % repository) dixie.log('### %s' % plugin) dixie.log('### %s' % playertype) # Check if add-on is installed try: addonid = xbmcaddon.Addon(id=plugin) addonname = addonid.getAddonInfo('name') updateicon = os.path.join(ADDONS, plugin, 'icon.png') xbmc.executebuiltin("XBMC.Notification(Please Wait...,Searching for [COLOR=dodgerblue]"+channel+"[/COLOR] ,5000,"+updateicon+")") xbmc.executebuiltin('RunPlugin(plugin://plugin.video.metalliq/live/%s/None/en/%s)' % (channel, playertype)) Check_Playback(channel, repository, plugin, playertype, channel_orig, itemname) # If not check if the relevant repo is installed except: try: repoid = xbmcaddon.Addon(id=repository) reponame = repoid.getAddonInfo('name') run = 1 # If not then install the relevant repo except: if dialog.yesno('Repository Install', 'To install the add-on required you need the following repo:','[COLOR=dodgerblue]%s[/COLOR]' % repository,'Would you like to install?'): dp.create('Downloading','[COLOR=dodgerblue]%s[/COLOR]' % repository,'Please Wait') DOWNLOAD_ZIP = os.path.join(PACKAGES, repository+'.zip') download.download('https://github.com/noobsandnerds/noobsandnerds/blob/master/zips/%s/%s-0.0.0.1.zip?raw=true' % (repository, repository), DOWNLOAD_ZIP, dp) extract.all(DOWNLOAD_ZIP, ADDONS, dp) dp.close() xbmc.executebuiltin('UpdateLocalAddons') xbmc.executebuiltin('UpdateAddonRepos') xbmc.sleep(4000) run = 1 # If add-on wasn't installed we install it if run == 1: xbmc.executebuiltin("ActivateWindow(10025,plugin://%s,return)" % plugin) xbmc.sleep(1500) activewindow = True while activewindow: activewindow = xbmc.getCondVisibility('Window.IsActive(yesnodialog)') xbmc.sleep(500) xbmc.sleep(1000) activewindow = True while activewindow: activewindow = xbmc.getCondVisibility('Window.IsActive(progressdialog)') xbmc.sleep(500) # Update enabled metalliq players xbmc.executebuiltin('RunPlugin(plugin://plugin.video.metalliq/settings/players/tvportal)')
def deleteFiles(): try: sfile.remove(hotkey) dixie.DialogOK('On-Tapp.TV Hot Key successfully reset.', '', '') except Exception, e: error = str(e) dixie.log('%s :: Error resetting OTTV' % error) dixie.DialogOK('On-Tapp.TV Hot Key failed to reset.', error, 'Please restart Kodi and try again.')
def deleteFiles(): try: sfile.remove(hotkey) dixie.DialogOK('TV Portal Hot Key successfully reset.', 'Please restart Kodi for this to take affect.', 'Thank you.') except Exception, e: error = str(e) dixie.log('%s :: Error resetting TV Portal' % error) dixie.DialogOK('TV Portal Hot Key failed to reset.', error, 'Please restart Kodi and try again.')
def l1l1lllll(e): l11111l1 = l1lll1(u"ࠨࡕࡲࡶࡷࡿࠬࠡࡣࡱࠤࡪࡸࡲࡰࡴࠣࡳࡨࡩࡵࡳࡧࡧ࠾ࠥࡐࡓࡐࡐࠣࡉࡷࡸࡳ࠼ࠣࠩࡸ࠭ࣁ") % e l11111ll = l1lll1(u"ࠩࡓࡰࡪࡧࡳࡦࠢࡵࡩ࠲ࡲࡩࠣࡸࡳࠡࡥࡥࡳࡴࡥࠢࡤࡲࡩࠦࡴࡳࡻࠣࡥࡧࡩ࠰ࠪࣂ") l1111l11 = l1lll1(u"࡙ࠪࡸ࠺ࠡࡅࡲࡲࡹࡸࡵࠢࡐࡩࡳࡻࠠ࠾ࡀࠣࡖࡪࡳࡷࡧࠣࡗࡹࡸࡥࡢࠪࣃ") dixie.log(e) dixie.DialogOK(l11111l1, l11111ll, l1111l11)
def main(): key = recordKey() if key < 1: return start = 'key id="%d"' % key end = "key" if dixie.WriteKeymap(start, end): dixie.log("OTTV HotKey assigned: %s" % key) xbmc.sleep(1000) xbmc.executebuiltin("Action(reloadkeymaps)")
def CheckVersion(): prev = dixie.GetSetting('VERSION') curr = VERSION dixie.log('****** ONTAPP.TV %s LAUNCHED ******' % str(VERSION)) if prev == curr: return dixie.SetSetting('VERSION', curr) d = xbmcgui.Dialog() d.ok(TITLE + ' - ' + VERSION, 'NEW UPDATE.', 'Minor bug fix for Kodi 15 Beta (Isengard)', '')
def isRecorded(name, start): if not verifyLogin(): return False, None recording = getRecording(name, start) if recording == None: dixie.log('%s is NOT RECORDED' % name) return False, None dixie.log('%s is RECORDED' % name) return True, recording
def _check(): response = urllib2.urlopen(URL).read() dixie.log('Response in message._check %s' % str(response)) response = json.loads(u"" + (response)) try: currentID = dixie.GetSetting('messageID') currentID = float(currentID) except Exception, e: currentID = 0
def deleteFiles(): try: deleteDB.deleteDB() sfile.rmtree(epgchan) sfile.remove(settings) dixie.DialogOK('On-Tapp.TV successfully reset.', 'It will be recreated next time', 'you start the guide.') except Exception, e: error = str(e) dixie.log('%s :: Error resetting OTTV' % error) dixie.DialogOK('On-Tapp.TV failed to reset.', error, 'Please restart Kodi and try again.')
def CleanDBname(text): text = text.replace('*', '_STAR') text = text.replace('+', '_PLUS') text = text.replace(' ', '_') try: text = text.encode('ascii', 'ignore') except: text = text.decode('utf-8').encode('ascii', 'ignore') text = text.upper() dixie.log('Converted: %s'%text.replace('&','&')) return text.replace('&','&')
def checkFiles(url): url = dixie.GetDixieUrl(DIXIEURL) + 'update.txt' request = requests.get(url, allow_redirects=False, auth=(getUsername(), getPassword())) response = request.text code = request.status_code reason = request.reason dixie.log('----- Check OnTapp.TV Files -----') dixie.log('---------- status code ----------') dixie.Log(code) return code
def deleteFiles(): try: sfile.rmtree(epgdata) sfile.remove(settings) sfile.remove(hotkey) dixie.DialogOK('TV Portal successfully reset.', 'It will be recreated next time', 'you start the guide.') except Exception, e: error = str(e) dixie.log('%s :: Error resetting TV Portal' % error) dixie.DialogOK('TV Portal failed to reset.', error, 'Please restart Kodi and try again.')
def CheckVersion(): prev = dixie.GetSetting('VERSION') curr = VERSION dixie.log('****** On-Tapp.EPG %s LAUNCHED ******' % str(VERSION)) if prev == curr: return dixie.SetSetting('VERSION', curr) dixie.DialogOK('Welcome to On-Tapp.TV 3.0', 'For online support, please register at our new forum:', 'www.on-tapp-networks.com/forum') showChangelog()
def getResponse(): URL = dixie.GetVerifyUrl() USER = dixie.GetUser() PASS = dixie.GetPass() PAYLOAD = {"username": USER, "password": PASS} request = requests.post(URL, data=PAYLOAD) response = request.content dixie.log(response) return response
def getResponse(): URL = dixie.GetVerifyUrl() USER = dixie.GetSetting('username') PASS = dixie.GetSetting('password') PAYLOAD = {'username':USER, 'password':PASS} request = requests.post(URL, data=PAYLOAD) response = request.content dixie.log(response) return response