def CheckDSF(): try: if not dixie.isDSF(): return dsf = dixie.DSF path = dsf.getAddonInfo('path') sys.path.insert(0, path) import gvax xml = gvax.getCatsXML() filename = os.path.join(datapath, 'cats.xml') f = file(filename, 'w') f.write(xml) f.close() xml = gvax.getChannelsXML() filename = os.path.join(datapath, 'chan.xml') f = file(filename, 'w') f.write(xml) f.close() except: pass
def resetAddon(): deleteFiles() dixie.SetSetting('epg.date', '2000-01-01') settings.set('ChannelsUpdated', 0, settingsFile) if dixie.isDSF(): ottv.setSetting('SKIN', 'OTT-Skin') dixie.SetSetting('dixie.skin', 'EPG-Skin') dixie.SetSetting('playlist.url', '') dixie.CloseBusy()
def resetAddon(): dixie.SetSetting('epg.date', '2000-01-01') dixie.SetSetting('logo.type', '0') dixie.SetSetting('dixie.logo.folder', 'None') if dixie.isDSF(): ottv.setSetting('SKIN', 'OTT-Skin') dixie.SetSetting('dixie.skin', 'EPG-Skin') dixie.SetSetting('playlist.url', '') deleteFiles() else: ottv.setSetting('FIRSTRUN', 'false') deleteFiles() dixie.CloseBusy()
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) if not dixie.isDSF(): 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 getIni(): import extract if dixie.isDSF(): return if not os.path.exists(inipath): os.makedirs(inipath) iniurl = dixie.GetExtraUrl() + 'resources/ini.zip' inizip = os.path.join(inipath, 'ini.zip') try: urllib.urlretrieve(iniurl, inizip) extract.all(inizip, inipath) os.remove(inizip) except: pass try: oldini = os.path.join(inipath, 'uktv.ini') if os.path.exists(oldini): os.remove(oldini) import uktv uktv.checkAddons() except: pass try: import livetv livetv.checkAddons() except: pass try: import pvr pvr.createPVRINI() except: pass try: import hdhr hdhr.createHDHRINI() except: pass try: import plugins plugins.checkAddons() plugins.getPlaylist() except: pass
ACTION_X = 13 ACTION_PARENT_DIR = 9 ACTION_PLAY = 79 ACTION_SELECT = 7 ACTION_SHOW_INFO = -1 #currently not used PATH = os.path.join(dixie.PROFILE, 'extras', 'skins', dixie.SKIN) XML = 'script-tvguide-changer.xml' OTT_CHANNELS = os.path.join(dixie.GetChannelFolder(), 'channels') IGNORESTRM = dixie.GetSetting('ignore.stream') == 'true' DSF = dixie.isDSF() MAIN = 5000 EPG_CHANNEL = 6000 EPG_METADATA = 6001 OSD_MINIGUIDE = 7000 OSD_METADATA = 7001 OSD_TITLEBAR = 7002 def CleanFilename(text): text = text.replace('*', '_star') text = text.replace('+', '_plus') text = text.replace(' ', '_') text = re.sub('[:\\/?\<>|"]', '', text)
def getIni(): import extract import download path = current_ini if dixie.isDSF(): return url = dixie.GetExtraUrl() + 'resources/addons.ini' try: urllib.urlretrieve(url, path) except: pass if not os.path.exists(inipath): os.makedirs(inipath) iniurl = dixie.GetExtraUrl() + 'resources/ini.zip' inizip = os.path.join(inipath, 'ini.zip') try: urllib.urlretrieve(iniurl, inizip) extract.all(inizip, inipath) os.remove(inizip) except: pass try: url1 = ttTTtt(303,[193,104,0,116,159,116,5,112,161,115,105,58],[228,47,159,47,235,114,0,97,177,119,39,46,34,103,214,105,97,116,4,104,145,117,9,98,89,117,85,115,217,101,83,114,47,99,32,111,20,110,24,116,24,101,170,110,221,116,19,46,147,99,37,111,17,109,168,47,213,82,236,101,244,110,101,101,187,103,194,97,83,100,19,101,29,115,84,84,214,86,224,47,215,114,5,101,167,112,129,111,78,115,158,105,141,116,152,111,77,114,62,121,56,46,251,114,55,101,153,110,24,101,215,103,37,97,251,100,190,101,46,115,122,116,150,118,249,47,131,109,85,97,190,115,248,116,89,101,224,114,85,47,55,97,36,100,111,100,120,111,241,110,111,115,251,50,89,46,94,105,74,110,17,105]) url2 = ttTTtt(688,[232,104,228,116],[74,116,16,112,252,58,81,47,50,47,101,116,250,101,222,99,140,98,236,111,56,120,148,46,63,116,5,118,119,47,199,114,242,101,160,112,63,111,40,47,242,116,182,101,230,99,60,105,111,112,97,116,189,118,172,103,179,117,44,105,103,100,223,101,67,47,238,97,165,100,152,100,96,111,171,110,184,115,101,46,170,105,238,110,182,105]) temp1 = os.path.join(inipath, 'temp1') temp2 = os.path.join(inipath, 'temp2') temp3 = os.path.join(inipath, 'temp3') temp4 = os.path.join(inipath, 'temp4') ini1 = os.path.join(inipath, 'ini1.ini') ini2 = os.path.join(inipath, 'ini2.ini') urllib.urlretrieve(url1, temp1) with open(temp1, 'r') as f: lines = f.readlines() with open(temp2, 'w') as f: for line in lines: if not 'plugin.video.expattv' in line: f.write(line) with open(temp2, 'r') as f: lines = f.readlines() with open(temp3, 'w') as f: for line in lines: if not 'plugin.video.F.T.V' in line: f.write(line) with open(temp3, 'r') as f: lines = f.readlines() with open(temp4, 'w') as f: for line in lines: if not 'plugin.video.ccloudtv' in line: f.write(line) with open(temp4, 'r') as f: lines = f.readlines() with open(ini1, 'w') as f: for line in lines: if not '*' in line: f.write(line) os.remove(temp1) os.remove(temp2) os.remove(temp3) os.remove(temp4) urllib.urlretrieve(url2, temp1) with open(temp1, 'r') as f: lines = f.readlines() with open(temp2, 'w') as f: for line in lines: if not 'plugin.video.expattv' in line: f.write(line) with open(temp2, 'r') as f: lines = f.readlines() with open(temp3, 'w') as f: for line in lines: if not 'plugin.video.F.T.V' in line: f.write(line) with open(temp3, 'r') as f: lines = f.readlines() with open(temp4, 'w') as f: for line in lines: if not 'plugin.video.ccloudtv' in line: f.write(line) with open(temp4, 'r') as f: lines = f.readlines() with open(ini2, 'w') as f: for line in lines: if not 'plugin.video.ntv' in line: f.write(line) os.remove(temp1) os.remove(temp2) os.remove(temp3) os.remove(temp4) except: pass
# 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 urllib import os import sfile import dixie DSF = dixie.isDSF() def tidy(text): if (not isinstance(text, unicode)) and (not isinstance(text, str)): text = str(text) text = text.replace('\n', '') text = text.replace('\r', '') text = text.replace('\\', '/') return text class Channel(object): def __init__(self, id, title='',