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 deleteFiles(): try: sfile.remove(hotkey) xbmc.executebuiltin('Action(reloadkeymaps)') dixie.DialogOK('On-Tapp.TV Hot Key successfully reset.', '', 'Thank you.') 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 CheckCredentials(): xbmc.executebuiltin('Dialog.Show(busydialog)') response = getResponse() xbmc.executebuiltin('Dialog.Close(busydialog)') if 'login not successful' in response: dixie.DialogOK('We failed to verify your credentials', '', 'Please check your settings.') else: dixie.DialogOK('Your login details are correct.', '', 'Thank you.')
def deleteFiles(): try: sfile.rmtree(ottdata) sfile.rmtree(epgdata) sfile.remove(hotkey) 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 l1l1ll111(e): l11111l1 = l1lll1(u"࠭ࡓࡰࡴࡵࡽ࠱ࠦࡡࠢࡨࡶࡷࡵࡲࠡࡱࡦࡧࡺࡸࡥࡥ࠼ࠣࡎࡘࡕࡎࠡࡇࡵࡶࡴࡸ࠺ࠡࠧࡶࠫࣆ") % e l11111ll = l1lll1(u"ࠧࡑࡨࡥࡸࠠࡳࡧ࠰ࡰࡴࠡࡶࡸࠦࡣࡩࡣࡱࡲࡪࡲࠠࡢࡰࡧࠤࡹࡸࡹࠡࡣࡪࡥࡴࠨࣇ") l1111l11 = l1lll1(u"ࠨࡗࡶࡩࠦࡃࡰࡰࡷࡩࡽࡺࠠࡎࡧࡱࡹࠥࡃ࠾ࠡࡔࡨࡱࡴࡼࡥࠡࡕࡷࡶࡪࡧࠨࣈ") dixie.log(e) dixie.DialogOK(l11111l1, l11111ll, l1111l11)
def l1l1ll111(e): l11111l1 = l1lll1(u"࡙ࠬࡳࡴࡼ࠰ࠥࡧࠡࡧࡵࡶࡴࡸࠠࡰࡥࡦࡹࡷࡤ࠻ࠢࡍࡗࡔࡔࠠࡆࡴࡵࡳࡷࡀࠠࠦࡵࠪࢰ") % e l11111ll = l1lll1(u"࠭ࡐࡧࡤࡷࡪࠦࡲࡦࡳࡱࠠࡵࡪࡷࠥࡩࡨࡢࡰࡱࡩࡱࠦࡡࡦࠣࡸࡷࡿࠠࡢࡩࡤࡳ࠴ࠧࢱ") l1111l11 = l1lll1(u"ࠧࡖࡵࡨ࠾ࠥࡉࡶࡨࡼࡹࠦࡍࡦࡰࡸࠤࡂࡄࠠࡓࡧࡰࡳࡻࠠࡔࡶࡵࡩࡦࡳࠧࢲ") dixie.log(e) dixie.DialogOK(l11111l1, l11111ll, l1111l11) 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 record(name, start, end, streamURL, showResult=True): output = 'Attempting to set recording for %s start:%s end:%s stream:%s' % (name, start, end, streamURL) dixie.log(output) if not verifyLogin(): dixie.log('Failed to verify login') return False global SessionID channel = getChannel(streamURL) if not channel: dixie.log('not channel') dixie.DialogOK('No valid channel found in stream.', 'Please edit stream and try again.') return False program = getProgram(channel, start) if not program: dixie.log('not program') dixie.DialogOK('Program not found in Filmon guide.') return False url = RECORD_URL % (SessionID, channel, program, convertToUnixTS(start)) record = getHTML(url) success = False dixie.log('record task url : %s' % url) dixie.log('response %s' % record) try: jsn = json.loads(record) dixie.log('As JSON') dixie.log(jsn) if 'success' in jsn: success = jsn['success'] except Exception, e: error = record.split(':')[-1].strip() dixie.log('Exception in record %s' % str(e)) dixie.log(error) if not showResult: return False dixie.DialogOK(name, 'Failed to schedule recording.', error) return False
def l1lll1lll(e): l1111ll1 = l1l1l(u"ࠫࡘࡵࡲࡳࡻࠤࡦࡴࠠࡦࡴࡵࡳࡷࠦࡤࡥࡸࡶࡪࡪ࠺ࠡࡌࡖࡓࡓࠦࡅࡳࡴࡲࡶࠦࠥࡴࠩࡾ") % e l1111lll = l1l1l(u"ࠬࡖࡦࡣࡶࡩࠥࡩࡶࡤࡧࡹࠦࡵࡴࠢࡲࡲࠥࡺࡨࡦࠢࡩࡳࡷࡻࠩࡿ") l111l111 = l1l1l( u"࠭ࡕࡱࡲࡥࡩࠦࡡࠡࡲࠥࡼࡩࡢࠢࡷࡪࠦࡡࡥࡦࡲࡲࠥࡹࡥࡵࡶࡲࡹࠠࡢࡰࡧࠤࡵࡵࡳࡵࠢࡷࡪࠦࡪࡰ࠲ࠬࢀ") dixie.log(e) dixie.DialogOK(l1111ll1, l1111lll, l111l111) dixie.SetSetting(SETTING, l1l1l(u"ࠧࠨࢁ"))
def doBackup(): CUSTOM = '1' chanType = dixie.GetSetting('chan.type') logoType = dixie.GetSetting('logo.type') try: dixie.log('Backup Type: %s' % str(sys.argv[1])) except: pass dixie.log('Backup: Channel setting is %s' % chanType) dixie.log('Backup: Logo setting is %s' % logoType) if (chanType == CUSTOM) or (logoType == CUSTOM): dixie.DialogOK('It appears you are using a custom location', 'for your channels or logos (Home Networking).', 'Please back-up TV Portal manually.') return try: folder = getFolder('Please select backup folder location') if not folder: return False filename = os.path.join(folder, FILENAME) dp = dixie.Progress(LINE1, LINE2) success = doZipfile(filename, dp) dp.close() if success: dixie.DialogOK('Backup successfully created') else: dixie.DeleteFile(filename) return True except Exception, e: dixie.log(e)
def l1l1lllll(e): l11111l1 = l1lll1 (u"ࠨࡕࡲࡶࡷࡿࠬࠡࡣࡱࠤࡪࡸࡲࡰࡴࠣࡳࡨࡩࡵࡳࡧࡧ࠾ࠥࡐࡓࡐࡐࠣࡉࡷࡸࡳ࠼ࠣࠩࡸ࠭ࣁ") %e l11111ll = l1lll1 (u"ࠩࡓࡰࡪࡧࡳࡦࠢࡵࡩ࠲ࡲࡩࠣࡸࡳࠡࡥࡥࡳࡴࡥࠢࡤࡲࡩࠦࡴࡳࡻࠣࡥࡧࡩ࠰ࠪࣂ") l1111l11 = l1lll1 (u"࡙ࠪࡸ࠺ࠡࡅࡲࡲࡹࡸࡵࠢࡐࡩࡳࡻࠠ࠾ࡀࠣࡖࡪࡳࡷࡧࠣࡗࡹࡸࡥࡢࠪࣃ") dixie.log(e) dixie.DialogOK(l11111l1, l11111ll, l1111l11)
def checkForUpdate(silent = 1): # silent = 0 xbmcgui.Window(10000).setProperty('OTT_UPDATING', 'True') silent = int(silent) == 1 response = getResponse(silent) if 'Error' in response: if not silent: dixie.DialogOK('Oops! An error has occured: ', response['Error'], 'Please check your account at www.on-tapp.tv') allDone(silent) return False isValid = len(response) > 0 if not isValid: if not silent: dixie.DialogOK('', 'No EPG update available.', 'Please try again later.') allDone(silent) return False try: if updateAvailable(response['Date']): dixie.log ('EPG Update Available - %s' % response['Date']) getUpdate(response, silent) else: # do restore to ensure not malformed # restoreFromZip() if not silent: dixie.DialogOK('EPG is up-to-date.') except: pass allDone(silent) return True
def main(): key = recordKey() if key < 1: return start = 'key id="%d"' % key end = 'key' if dixie.WriteFSKeymap(start, end): dixie.log('OTTV HotKey assigned: %s' % key) dixie.DialogOK('On-Tapp.TV Hot Key successfully set up.', '', 'Thank you.') xbmc.sleep(1000) xbmc.executebuiltin('Action(reloadkeymaps)')
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 verifyLogin(): dixie.log('Entering VerifyLogin') try: global LoggedIn if not LoggedIn: dixie.log('Attempting to Login') login() if not LoggedIn: dixie.log('Failed to Login') dixie.DialogOK('Not logged into Filmon.', 'Please check details and try again.') return False return True except Exception, e: dixie.log('Exception in VerifyLogin %s' % str(e))
def resetAddon(): if OTEPGURL == 'OTHER': ottv.setSetting('ottv.url', 'other') ottv.setSetting('SKIN', 'OTT-Skin') if OTTVURL == 'OTHER': dixie.SetSetting('dixie.url', 'Other') dixie.SetSetting('dixie.skin', 'EPG-Skin') try: sfile.rmtree(dixie.PROFILE) sfile.rmtree(ottvskin) sfile.remove(settings) ottv.setSetting('FIRSTRUN', 'false') dixie.SetSetting('logo.type', '0') dixie.SetSetting('dixie.logo.folder', 'None') except: pass dixie.DialogOK('On-Tapp.TV successfully reset.', 'It will be re-created next time', 'you start the guide')
def doRestore(): try: filename = getFile('Please select backup file', 'zip') if not filename: return False dp = dixie.Progress(LINE1, LINE2, hide=True) success = extractAll(filename, dp) dp.close() if success: dixie.DialogOK('Backup successfully restored') return True except Exception, e: dixie.log(e)
def detectStream(self, channel): result = self.streamingService.detectStream(channel) if type(result) == str: self.setCustomStreamUrl(channel, result) return result if len(result) < 1: dixie.DialogOK('Sorry, we could not detect a stream.', '', 'Please allocate a stream for this channel.') return None import detect d = detect.StreamAddonDialog(result) d.doModal() if not d.stream: return None if not IGNORESTRM: self.setCustomStreamUrl(channel, d.stream) return d.stream
dixie.log('Exception in record %s' % str(e)) dixie.log(error) if not showResult: return False dixie.DialogOK(name, 'Failed to schedule recording.', error) return False if not showResult: return program #move to GUI - remove end param if success: if end < datetime.datetime.today(): dixie.DialogOK(name, 'Has been recorded.') else: dixie.DialogOK(name, 'Has been scheduled to be recorded.') else: dixie.DialogOK('Failed to schedule recording.') return program def getRecording(name, start): if not verifyLogin(): return False global SessionID url = RECORDINGS_URL % SessionID
dixie.log('Deleting database...PASSED') else: dixie.log('Deleting database...FAILED') return passed except Exception, e: dixie.log('Deleting database...EXCEPTION %s' % str(e)) return False def delete_file(filename): tries = 10 while os.path.exists(filename) and tries > 0: settings.set('ChannelsUpdated', 0, settingsFile) try: os.remove(filename) break except: tries -= 1 if __name__ == '__main__': xbmc.executebuiltin('Dialog.Show(busydialog)') if deleteDB(): xbmc.executebuiltin('Dialog.Close(busydialog)') dixie.DialogOK('EPG successfully reset.', 'It will be re-created next time', 'you start the guide') else: xbmc.executebuiltin('Dialog.Close(busydialog)') d = xbmcgui.Dialog() dixie.DialogOK('Failed to reset EPG.', 'Database may be locked,', 'please restart Kodi and try again')
# Copyright (C) 2014 Sean Poyser and Richard Dean ([email protected]) # # This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This Program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with XBMC; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # http://www.gnu.org/copyleft/gpl.html # import dixie def ResetMessage(): dixie.SetSetting('messageID', '0.0') if __name__ == '__main__': dixie.DialogOK('Click OK to reset system messages', '', 'The last message will be shown again on restart of On-Tapp.TV') ResetMessage() #dixie.DialogOK('All done.', '', 'Thank you.') dixie.openSettings(focus='0.18')
def deleteCookie(): try: return delete_file(cookieFile) except: return False def delete_file(filename): tries = 10 while os.path.exists(filename) and tries > 0: try: os.remove(filename) break except: tries -= 1 return not os.path.exists(filename) if __name__ == '__main__': if deleteCookie(): os.rmdir(cookiePath) dixie.DialogOK('Cookie file successfully deleted.', 'It will be re-created next time', 'you start the guide') else: dixie.DialogOK('Failed to delete cookie file.', 'The file may be locked,', 'please restart Kodi and try again')
ftv = 'nongeo.ini' path = os.path.join(datapath, ftv) try: url = dixie.GetExtraUrl() + 'resources/' + ftv urllib.urlretrieve(url, path) except: pass AVAILABLE = False if not AVAILABLE: try: addon = xbmcaddon.Addon('plugin.video.F.T.V') if FTVINI == 'Non-Geolocked UK Links': BASE = addon.setSetting('root_channel', '3092') AVAILABLE = BASE else: BASE = addon.setSetting('root_channel', '689') AVAILABLE = BASE except: AVAILABLE = False if __name__ == '__main__': getIni() dixie.DialogOK('Built-in Addon links updated.', 'Always manually update your channel links', 'via "Choose Stream" if they are not working.') ftvIni()
return passed except Exception, e: dixie.log('Installing Mini-Guide Plugin...EXCEPTION %s' % str(e)) return False def install_file(filename): ottv = dixie.HOME src = os.path.join(ottv, 'resources', filename) if not os.path.exists(path): sfile.makedirs(path) sfile.copy(src, file) if __name__ == '__main__': xbmc.executebuiltin('Dialog.Show(busydialog)') if miniGuide(): xbmc.executebuiltin('Dialog.Close(busydialog)') dixie.DialogOK('On-Tapp.TV Mini-Guide installed ', 'into the Super Favourites Gobal Menu', 'Thank you.') else: xbmc.executebuiltin('Dialog.Close(busydialog)') dixie.DialogOK('On-Tapp.TV Mini-Guide failed to install.', 'Ensure you have Super Favourites installed.', 'Thank you.')
datapath = dixie.GetChannelFolder() def restoreChannels(): src = os.path.join(datapath, 'channels-backup') dst = os.path.join(datapath, 'channels') if not sfile.exists(src): return False try: current, dirs, files = sfile.walk(src) for file in files: full = os.path.join(current, file) sfile.copy(full, dst) except Exception, e: print str(e) return False return True if __name__ == '__main__': if restoreChannels(): dixie.DialogOK('Your channels have been successfully restored.', 'This should bring back any customisations', 'that you may have lost.') else: dixie.DialogOK('Sorry, we failed to restore your channels.', '', 'Please restart TV Portal and try again.')
# This Program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This Program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with XBMC; see the file COPYING. If not, write to # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. # http://www.gnu.org/copyleft/gpl.html # import dixie def ResetMessage(): dixie.SetSetting('messageID', '0.0') if __name__ == '__main__': dixie.DialogOK( 'Click OK to reset system messages', '', 'The last message will be shown again on restart of TV Portal') ResetMessage() #dixie.DialogOK('All done.', '', 'Thank you.') dixie.openSettings(focus='0.18')
def delete_file(filename): dixie.SetSetting('epg.date', '2000-01-01') tries = 10 while os.path.exists(filename) and tries > 0: settings.set('ChannelsUpdated', 0, settingsFile) try: os.remove(filename) break except: tries -= 1 try: if sys.argv[1] == 'cookies': try: shutil.rmtree(cookiepath) dixie.DialogOK('Cookies successfully removed','','Your cookies have been successfully removes, please try logging in again') except: dixie.DialogOK('No cookies present','','No cookies could be found on the system, please check your login info in the settings.') if sys.argv[1] == 'resetDB': dixie.ShowBusy() if deleteDB(): dixie.CloseBusy() dixie.DialogOK('EPG successfully reset.', 'It will be re-created next time', 'you start the guide') else: dixie.CloseBusy() d = xbmcgui.Dialog() dixie.DialogOK('Failed to reset EPG.', 'Database may be locked,', 'please restart Kodi and try again') except: