Beispiel #1
0
def ShowShortcuts():
    addons = utils.getSetting('ADDONS').split('|')
    toSort = []
    
    for addon in addons:
        try:
            if addon:
                name = xbmcaddon.Addon(addon).getAddonInfo('name')
                toSort.append([Capitalize(name), addon])
        except:
            pass

    #toSort.sort()

    for addon in toSort:
        try:
            menu = []
            name = addon[0]
            url  = addon[1]
            menu.append(('Remove %s shortcut' % Capitalize(name), '?mode=%d&url=%s' % (_REMOVESHORTCUT, urllib.quote_plus(url))))

            if url.startswith('script'):
                AddAddon(name, url, _SCRIPT, contextMenu=menu)
            else:
                AddAddon(name, url, _ADDON, contextMenu=menu)
        except:
            pass
Beispiel #2
0
def AddTVLibrary(name,
                 windowID,
                 mode,
                 icon=None,
                 fanart=None,
                 desc='',
                 contextMenu=''):
    addon = utils.getSetting('TV')

    if addon == '':
        if icon == None:
            icon = ICON

        if fanart == None:
            fanart = FANART

        AddDir(name, '', mode, icon, '', '', '', fanart, contextMenu='')

    try:
        properties = GetAddon(addon)
    except:
        return

    if not addon == '':
        icon = properties[7]

    if not addon == '':
        fanart = properties[8]

    # name = xbmcaddon.Addon(addon).getAddonInfo('name')
    menu = []
    menu.append(('Remove %s shortcut' % Capitalize(name),
                 '?mode=%d&url=%s' % (_REMOVETV, urllib.quote_plus(addon))))

    AddDir(name, '', mode, icon, '', '', '', fanart, contextMenu=menu)
Beispiel #3
0
def ShowShortcuts():
    addons = utils.getSetting('ADDONS').split('|')
    toSort = []

    for addon in addons:
        try:
            if addon:
                name = xbmcaddon.Addon(addon).getAddonInfo('name')
                toSort.append([Capitalize(name), addon])
        except:
            pass

    #toSort.sort()

    for addon in toSort:
        try:
            menu = []
            name = addon[0]
            url = addon[1]
            menu.append(
                ('Remove %s shortcut' % Capitalize(name), '?mode=%d&url=%s' %
                 (_REMOVESHORTCUT, urllib.quote_plus(url))))

            if url.startswith('script'):
                AddAddon(name, url, _SCRIPT, contextMenu=menu)
            else:
                AddAddon(name, url, _ADDON, contextMenu=menu)
        except:
            pass
Beispiel #4
0
def AddVideo(setting):
    item = utils.getSetting(setting)

    if not item == '':
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/",return)' %
                            (WINDOWID, item))
        return False

    return _AddVideoShortcut(setting)
Beispiel #5
0
def AddAddonShortcut():
    shortcuts = utils.getSetting('ADDONS').split('|')

    #don't allow sortcut to self
    shortcuts.append(ADDONID)

    names = getNames()
    addons = getAddons(names)

    option = xbmcgui.Dialog().select('Select addon', addons)

    if option < 0:
        return False

    update = utils.getSetting('ADDONS') + names[option][1] + '|'

    utils.setSetting('ADDONS', update)

    return True
Beispiel #6
0
def RemoveVideo(url, setting):
    shortcut = utils.getSetting(setting)

    if url not in shortcut:
        return False

    update = shortcut.replace(url, '')

    utils.setSetting(setting, update)

    return True
Beispiel #7
0
def RemoveShortcut(url):
    shortcuts = utils.getSetting('ADDONS')

    url += '|'

    if url not in shortcuts:
        return False

    update = shortcuts.replace(url,  '')

    utils.setSetting('ADDONS', update)

    return True
Beispiel #8
0
def RemoveShortcut(url):
    shortcuts = utils.getSetting('ADDONS')

    url += '|'

    if url not in shortcuts:
        return False

    update = shortcuts.replace(url, '')

    utils.setSetting('ADDONS', update)

    return True
Beispiel #9
0
def AddAddonShortcut():
    import glob

    path      = xbmc.translatePath(os.path.join('special://home' , 'addons', '*.*'))
    shortcuts = utils.getSetting('ADDONS').split('|')

    #don't allow sortcut to self
    shortcuts.append(ADDONID)

    names = []

    for addon in glob.glob(path):
        try:
            name = addon.lower().rsplit(os.path.sep, 1)[-1]
            if name not in shortcuts:
                realname = xbmcaddon.Addon(name).getAddonInfo('name')
                names.append([Capitalize(realname), name])
        except:
            pass

    if len(names) < 1:
        return

    names.sort()

    addons = []
    for name in names:
        addons.append(name[0])

    option = xbmcgui.Dialog().select('Select addon', addons)

    if option < 0:
        return False

    update = utils.getSetting('ADDONS') + names[option][1] + '|'

    utils.setSetting('ADDONS', update)

    return True
Beispiel #10
0
def AddAddonShortcut():
    import glob

    path = xbmc.translatePath(os.path.join('special://home', 'addons', '*.*'))
    shortcuts = utils.getSetting('ADDONS').split('|')

    #don't allow sortcut to self
    shortcuts.append(ADDONID)

    names = []

    for addon in glob.glob(path):
        try:
            name = addon.lower().rsplit(os.path.sep, 1)[-1]
            if name not in shortcuts:
                realname = xbmcaddon.Addon(name).getAddonInfo('name')
                names.append([Capitalize(realname), name])
        except:
            pass

    if len(names) < 1:
        return

    names.sort()

    addons = []
    for name in names:
        addons.append(name[0])

    option = xbmcgui.Dialog().select('Select addon', addons)

    if option < 0:
        return False

    update = utils.getSetting('ADDONS') + names[option][1] + '|'

    utils.setSetting('ADDONS', update)

    return True
Beispiel #11
0
def AddShortcut():
    ADDMORE = int(utils.getSetting('ADDMORE'))

    if ADDMORE == 0:
        return AddAddonShortcut()

    if not SF_INSTALLED:
        return AddAddonShortcut()

    if ADDMORE == 2 and utils.DialogYesNo(GETTEXT(30313), GETTEXT(30314), '', GETTEXT(30315), GETTEXT(30316)):
        return AddAddonShortcut()

    return AddSFShortcut()
Beispiel #12
0
def AddShortcut():
    ADDMORE = int(utils.getSetting('ADDMORE'))

    if ADDMORE == 0:
        return AddAddonShortcut()

    if not SF_INSTALLED:
        return AddAddonShortcut()

    if ADDMORE == 2 and utils.DialogYesNo(GETTEXT(30313), GETTEXT(30314), '',
                                          GETTEXT(30315), GETTEXT(30316)):
        return AddAddonShortcut()

    return AddSFShortcut()
    def _onSettingsChanged(self, init=False):
        relaunch = False

        for key in self.settings:
            value = utils.getSetting(key)
            if value <> self.settings[key]:
                relaunch = True
                self.settings[key] = value

        if init:
            return

        if relaunch:
            utils.Log('Settings changed - relaunching')
            self.relaunch()
Beispiel #14
0
def ShowTV():
    sfave = favourite.getFavourites(SFTV) if SFTV else []
    addon = utils.getSetting('TV')

    if utils.getSetting('UseKodiLib') == 'true':
        AddLibrary('TV Shows',
                   '',
                   _TV,
                   icon=os.path.join(IMAGES, 'OTTV-TV_Shows.png'))

    elif (len(sfave) == 0) and (addon == ''):
        AddLibrary('TV Shows',
                   '',
                   _TVOPTIONS,
                   icon=os.path.join(IMAGES, 'OTTV-TV_Shows.png'))

    elif not addon == '':
        AddTVLibrary('TV Shows',
                     '',
                     _TVADDON,
                     icon=os.path.join(IMAGES, 'OTTV-TV_Shows.png'))

    else:
        ShowSFShortcuts(SFTV, _REMOVESFTV)
Beispiel #15
0
def ShowMovie():
    sfave = favourite.getFavourites(SFMOV) if SFMOV else []
    addon = utils.getSetting('MOVIE')

    if utils.getSetting('UseKodiLib') == 'true':
        AddLibrary('Movies',
                   '',
                   _MOVIE,
                   icon=os.path.join(IMAGES, 'OTTV-Movies.png'))

    elif (len(sfave) == 0) and (addon == ''):
        AddLibrary('Movies',
                   '',
                   _MOVIEOPTIONS,
                   icon=os.path.join(IMAGES, 'OTTV-Movies.png'))

    elif not addon == '':
        AddMovieLibrary('Movies',
                        '',
                        _MOVIEADDON,
                        icon=os.path.join(IMAGES, 'OTTV-Movies.png'))

    else:
        ShowSFShortcuts(SFMOV, _REMOVESFMOVIE)
    def _onSettingsChanged(self, init=False):
        relaunch = False

        for key in self.settings:
            value = utils.getSetting(key)
            if value <> self.settings[key]:
                relaunch           = True
                self.settings[key] = value

        if init:
            return

        if relaunch:
            utils.Log('Settings changed - relaunching')
            self.relaunch()
    def __init__(self, addonID):        
        super(Application, self).__init__()
        self.ADDONID         = addonID
        self.skin            = utils.getSetting('SKIN')
        self.properties      = {}        
        self.lists           = []
        self.start           = None        
        self.context         = False
        self.busy            = None
        self.showBack        = False
        self.timer           = None
        self.faves           = str(favourites.getFavourites())
        #self.relaunch        = False
        self.counter         = 0
        self.listSize        = -1

        self.setProperty('LB_FOOTER',  'Powered by SWIFT')
        self.setProperty('LB_TITLE',    GETTEXT(30000))
        self.setProperty('LB_MAINDESC', GETTEXT(30002))
Beispiel #18
0
    def __init__(self, addonID):
        super(Application, self).__init__()
        self.ADDONID = addonID
        self.skin = utils.getSetting('SKIN')
        self.properties = {}
        self.lists = []
        self.start = None
        self.context = False
        self.busy = None
        self.showBack = False
        self.timer = None
        self.faves = str(favourites.getFavourites())
        #self.relaunch        = False
        self.counter = 0
        self.listSize = -1

        self.setProperty('LB_FOOTER', 'Powered by SWIFT')
        self.setProperty('LB_TITLE', GETTEXT(30000))
        self.setProperty('LB_MAINDESC', GETTEXT(30002))
Beispiel #19
0
def PlayYT(id):
    xbmc.executebuiltin('Dialog.Show(busydialog)')

    video, links = yt.GetVideoInformation(id)

    xbmc.executebuiltin('Dialog.Close(busydialog)')

    if 'best' not in video:
        return False

    url   = video['best']          
    title = video['title']
    image = video['thumbnail']

    liz = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image)

    liz.setInfo( type="Video", infoLabels={ "Title": title} )

    windowed = utils.getSetting('PLAYBACK') == '1'

    APPLICATION.setResolvedUrl(url, success=True, listItem=liz, windowed=windowed)
Beispiel #20
0
def PlayYT(id):
    xbmc.executebuiltin('Dialog.Show(busydialog)')

    video, links = yt.GetVideoInformation(id)

    xbmc.executebuiltin('Dialog.Close(busydialog)')

    if 'best' not in video:
        return False

    url = video['best']
    title = video['title']
    image = video['thumbnail']

    liz = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image)

    liz.setInfo(type="Video", infoLabels={"Title": title})

    windowed = utils.getSetting('PLAYBACK') == '1'

    APPLICATION.setResolvedUrl(url,
                               success=True,
                               listItem=liz,
                               windowed=windowed)
Beispiel #21
0
    import chooser
    import favourite

    SFFILE = os.path.join(PROFILE, 'favourites.xml')
    SFMOV = os.path.join(PROFILE, 'movie.xml')
    SFTV = os.path.join(PROFILE, 'tv.xml')

    LABEL_NUMERIC = sfAddon.getSetting('LABEL_NUMERIC') == 'true'

except:
    SF_INSTALLED = False
    LABEL_NUMERIC = False

IMAGES = os.path.join(HOME, 'resources', 'images')

AUTOSTREAM = utils.getSetting('AUTOSTREAM') == 'true'
KIOSKMODE = utils.getSetting('KIOSKMODE') == 'true'

KODILIB = utils.getSetting('UseKodiLib')
MOVIES = utils.getSetting('MOVIE')
TV = utils.getSetting('TV')

utils.Log('LIBRARY SETTING:\t%s' % KODILIB)
utils.Log('MOVIE SETTING:\t%s' % MOVIES)
utils.Log('TV SETTING:\t%s' % TV)

GETTEXT = utils.GETTEXT

global APPLICATION

_SCRIPT = 100
def checkUpdate():
    if utils.isDSF():
        import dsf
        dsf.checkUpdate()
        return
    
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL()
        utils.DialogOK('Welcome to On-Tapp.TV 3.0', 'We will now install some needed files.', 'This may take a few minutes, so please be patient.')
        utils.doBackup()
        utils.downloadDefaults(BASEURL)
        return
    
    response   = getResponse()
    ottskin    = response['OTTSkin']
    epgskin    = response['EPGSkin']
    logocolour = response['LogoColour']
    logowhite  = response['LogoWhite']
    ottupdate  = response['OTTUpdate']
    epgupdate  = response['EPGUpdate']


    curr = ottskin
    prev = utils.getSetting('OTTSKIN')

    if not prev == curr:
        url     = utils.getBaseURL() + response['OTT Skin Link']
        path    = xbmc.translatePath(PROFILE) 
        path    = os.path.join(path, 'skins')
        zipfile = os.path.join(path, 'skin-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.downloadSkins(url, path, zipfile)
        utils.setSetting('OTTSKIN', curr)


    curr = epgskin
    prev = utils.getSetting('EPGSKIN')

    if not prev == curr:
        url     = utils.getBaseURL() + response['EPG Skin Link']
        path    = os.path.join(extras, 'skins')
        zipfile = os.path.join(path,   'skin-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.downloadSkins(url, path, zipfile)
        utils.setSetting('EPGSKIN', curr)


    curr = logocolour
    prev = utils.getSetting('LOGOCOLOUR')

    if not prev == curr:
        url     = utils.getBaseURL() + response['Logo Colour']
        path    = os.path.join(logos, 'Colour Logo Pack')
        zipfile = os.path.join(path,  'logo-colour-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.downloadLogos(url, path, zipfile)
        utils.setSetting('LOGOCOLOUR', curr)


    curr = logowhite
    prev = utils.getSetting('LOGOWHITE')

    if not prev == curr:
        url     = utils.getBaseURL() + response['Logo White']
        path    = os.path.join(logos, 'White Logo Pack')
        zipfile = os.path.join(path,  'logo-white-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.downloadLogos(url, path, zipfile)
        utils.setSetting('LOGOWHITE', curr)


    curr = ottupdate
    prev = utils.getSetting('OTTUPDATE')

    if not prev == curr:
        url     = utils.getBaseURL() + response['OTT Update']
        path    = xbmc.translatePath(HOME)
        zipfile = os.path.join(path, 'python-update.zip')
        
        utils.doOTTUpdate(url, path, zipfile, ottupdate)
        utils.setSetting('OTTUPDATE', curr)


    curr = epgupdate
    prev = utils.getSetting('EPGUPDATE')

    if not prev == curr:
        url     = utils.getBaseURL() + response['EPG Update']
        path    = xbmc.translatePath(epghome)
        zipfile = os.path.join(path, 'python-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.doEPGUpdate(url, path, zipfile, epgupdate)
        utils.setSetting('EPGUPDATE', curr)
    return
Beispiel #23
0
    import sys
    sfAddon = xbmcaddon.Addon(id = SUPERFAVES)
    sfPath  = sfAddon.getAddonInfo('path')
    sys.path.insert(0, sfPath)

    import chooser
    import favourite

    SFFILE = os.path.join(PROFILE, 'favourites.xml')
except:
    SF_INSTALLED = False


IMAGES = os.path.join(HOME, 'resources', 'images')

AUTOSTREAM = utils.getSetting('AUTOSTREAM') == 'true'
KIOSKMODE  = utils.getSetting('KIOSKMODE')  == 'true'

GETTEXT = utils.GETTEXT


global APPLICATION


_SCRIPT          = 100
_ADDON           = 200
_SETTINGS        = 300
_YOUTUBE         = 400
_CATCHUP         = 500
_TVSHOWS         = 600
_MOVIES          = 700
#  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 xbmc
import utilsOTT as utils
import update

NOHOME = utils.getSetting('NOHOME') == 'true'

update.checkUpdate()

if __name__ == '__main__':
    
    if NOHOME:
        xbmc.executebuiltin('RunScript(script.tvguidedixie)')

    else:
        param = None

        if len(sys.argv) > 1:
            param = sys.argv[1]

        xbmc.executebuiltin('Dialog.Close(busydialog)')
Beispiel #25
0
def checkUpdate():
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL()
        utils.DialogOK(
            'Bienvenido a GVAX',
            'Ahora vamos a hacer una copia de seguridad de alguno de',
            'los archivos existentes antes de la instalación.')
        doBackup()

        Addon.setSetting('dixie.skin', 'EPG-Skin')
        utils.setSetting('SKIN', 'OTT-Skin')

        downloadDefaults(BASEURL)
        return

    response = getResponse()
    ottskin = response['DSFOTTSkin']
    epgskin = response['DSFEPGSkin']
    logocolour = response['DSFLogos']
    ottupdate = response['DSFOTTUpdate']
    epgupdate = response['DSFEPGUpdate']
    dsfupdate = response['DSFUpdate']
    kodiskin = response['DSFKodiSkin']

    curr = ottskin
    prev = utils.getSetting('DSFOTTSKIN')

    if not prev == curr:
        url = BASEURL + response['DSF OTT Skin']
        path = xbmc.translatePath(PROFILE)
        path = os.path.join(path, 'skins')
        zipfile = os.path.join(path, 'dsf-skin-update.zip')

        if not sfile.exists(path):
            sfile.makedirs(path)

        downloadSkins(url, path, zipfile)
        utils.setSetting('DSFOTTSKIN', curr)

    curr = epgskin
    prev = utils.getSetting('DSFEPGSKIN')

    if not prev == curr:
        url = BASEURL + response['DSF EPG Skin']
        path = os.path.join(extras, 'skins')
        zipfile = os.path.join(path, 'dsf-skin-update.zip')

        if not sfile.exists(path):
            sfile.makedirs(path)

        downloadSkins(url, path, zipfile)
        utils.setSetting('DSFEPGSKIN', curr)

    curr = logocolour
    prev = utils.getSetting('DSFLOGOS')

    if not prev == curr:
        url = BASEURL + response['DSF Logos']
        path = os.path.join(logos, 'Colour Logo Pack')
        zipfile = os.path.join(path, 'dsf-logos-update.zip')

        if not sfile.exists(path):
            sfile.makedirs(path)

        downloadLogos(url, path, zipfile)
        utils.setSetting('DSFLOGOS', curr)

    curr = ottupdate
    prev = utils.getSetting('DSFOTTUPDATE')

    if not prev == curr:
        url = BASEURL + response['DSF OTT Update']
        path = xbmc.translatePath(HOME)
        zipfile = os.path.join(path, 'dsf-ott-python.zip')

        doOTTUpdate(url, path, zipfile, ottupdate)
        utils.setSetting('DSFOTTUPDATE', curr)

    curr = epgupdate
    prev = utils.getSetting('DSFEPGUPDATE')

    if not prev == curr:
        url = BASEURL + response['DSF EPG Update']
        path = xbmc.translatePath(epghome)
        zipfile = os.path.join(path, 'dsf-epg-python.zip')

        if not sfile.exists(path):
            sfile.makedirs(path)

        doEPGUpdate(url, path, zipfile, epgupdate)
        utils.setSetting('DSFEPGUPDATE', curr)

    curr = dsfupdate
    prev = utils.getSetting('DSFUPDATE')

    if not prev == curr:
        url = BASEURL + response['DSF Update']
        path = xbmc.translatePath(home)
        zipfile = os.path.join(path, 'dsf-update.zip')

        if not sfile.exists(path):
            sfile.makedirs(path)

        doDSFUpdate(url, path, zipfile, dsfupdate)
        utils.setSetting('DSFUPDATE', curr)

    curr = kodiskin
    prev = utils.getSetting('DSFKODISKIN')

    if not prev == curr:
        url = BASEURL + response['DSF Kodi Skin']
        path = xbmc.translatePath(skinhome)
        zipfile = os.path.join(path, 'dsf-kodi-skin.zip')

        if not sfile.exists(path):
            sfile.makedirs(path)

        doDSFUpdate(url, path, zipfile, kodiskin)
        utils.setSetting('DSFKODISKIN', curr)

    return
Beispiel #26
0
try:
    import sys
    sfAddon = xbmcaddon.Addon(id=SUPERFAVES)
    sfPath = sfAddon.getAddonInfo('path')
    sys.path.insert(0, sfPath)

    import chooser
    import favourite

    SFFILE = os.path.join(PROFILE, 'favourites.xml')
except:
    SF_INSTALLED = False

IMAGES = os.path.join(HOME, 'resources', 'images')

AUTOSTREAM = utils.getSetting('AUTOSTREAM') == 'true'
KIOSKMODE = utils.getSetting('KIOSKMODE') == 'true'

GETTEXT = utils.GETTEXT

global APPLICATION

_SCRIPT = 100
_ADDON = 200
_SETTINGS = 300
_YOUTUBE = 400
_CATCHUP = 500
_TVSHOWS = 600
_MOVIES = 700
_SHOWSHORTCUTS = 800
_ADDSHORTCUT = 900
def checkUpdate():
    if utils.isDSF():
        import dsf
        try:    dsf.checkUpdate()
        except: pass
        return
    
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL()
        utils.doBackup()
        utils.downloadDefaults(BASEURL)
        return

    response   = getResponse()
    ottskin    = response['OTTSkin']
    epgskin    = response['EPGSkin']
    logocolour = response['LogoColour']
    logowhite  = response['LogoWhite']
    ottupdate  = response['OTTUpdate']
    epgupdate  = response['EPGUpdate']


    curr = ottskin
    prev = utils.getSetting('OTTSKIN')

    if not prev == curr:
        url     = utils.getBaseURL() + response['OTT Skin Link']
        path    = xbmc.translatePath(PROFILE) 
        path    = os.path.join(path, 'skins')
        zipfile = os.path.join(path, 'skin-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.downloadSkins(url, path, zipfile)
        utils.setSetting('OTTSKIN', curr)


    curr = epgskin
    prev = utils.getSetting('EPGSKIN')

    if not prev == curr:
        url     = utils.getBaseURL() + response['EPG Skin Link']
        path    = os.path.join(extras, 'skins')
        zipfile = os.path.join(path,   'skin-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.downloadSkins(url, path, zipfile)
        utils.setSetting('EPGSKIN', curr)


    curr = logocolour
    prev = utils.getSetting('LOGOCOLOUR')

    if not prev == curr:
        url     = utils.getBaseURL() + response['Logo Colour']
        path    = os.path.join(logos, 'Colour Logo Pack')
        zipfile = os.path.join(path,  'logo-colour-update.zip')

        if not sfile.exists(path):
            sfile.makedirs(path)

        utils.downloadLogos(url, path, zipfile)
        utils.setSetting('LOGOCOLOUR', curr)


    curr = logowhite
    prev = utils.getSetting('LOGOWHITE')

    if not prev == curr:
        url     = utils.getBaseURL() + response['Logo White']
        path    = os.path.join(logos, 'White Logo Pack')
        zipfile = os.path.join(path,  'logo-white-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.downloadLogos(url, path, zipfile)
        utils.setSetting('LOGOWHITE', curr)


    curr = ottupdate
    prev = utils.getSetting('OTTUPDATE')

    if not prev == curr:
        url     = utils.getBaseURL() + response['OTT Update']
        path    = xbmc.translatePath(HOME)
        zipfile = os.path.join(path, 'python-update.zip')
        
        utils.doOTTUpdate(url, path, zipfile, ottupdate)
        utils.setSetting('OTTUPDATE', curr)


    curr = epgupdate
    prev = utils.getSetting('EPGUPDATE')

    if not prev == curr:
        url     = utils.getBaseURL() + response['EPG Update']
        path    = xbmc.translatePath(epghome)
        zipfile = os.path.join(path, 'python-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        utils.doEPGUpdate(url, path, zipfile, epgupdate)
        utils.setSetting('EPGUPDATE', curr)
    return
Beispiel #28
0
AddonID = utils.AddonID
Addon = utils.Addon
epghome = utils.epghome
epgpath = utils.epgpath
extras = utils.extras
logos = utils.logos

DSFID = utils.DSFID
DSF = utils.DSF
DSFVER = utils.DSFVER
home = utils.home
profile = utils.profile

URL = utils.getBaseURL() + 'dsf-update.txt'
FIRSTRUN = utils.getSetting('FIRSTRUN') == 'true'

SkinID = 'skin.bello-dsf'
Skin = xbmcaddon.Addon(SkinID)  # forked bello version: 3.0.8
skinhome = Skin.getAddonInfo('path')


def checkUpdate():
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL()
        utils.DialogOK(
            'Bienvenido a GVAX',
            'Ahora vamos a hacer una copia de seguridad de alguno de',
            'los archivos existentes antes de la instalación.')
        doBackup()
    def onAction(self, action):
        #see here https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h for the full list

        actionId = action.getId()
        buttonId = action.getButtonCode()

        if actionId != 107:
            utils.Log('onAction actionID %d' % actionId)
            utils.Log('onAction buttonID %d' % buttonId)

        if actionId in [ACTION_CONTEXT, ACTION_RCLICK]:
            return self.onContextMenu()
            
        if actionId in [ACTION_PARENT_DIR, ACTION_BACK] or buttonId in [ESC]:
            return self.onBack()        

        try:    id = self.getFocus().getId()         
        except: id = 0

        select = (actionId == ACTION_SELECT) or (actionId == ACTION_LCLICK)

        if select and id == MAINLIST:   
            liz        = self.getSelectedItem()
            param      = liz.getProperty('Param')
            image      = liz.getProperty('Image')
            mode       = int(liz.getProperty('Mode'))
            isFolder   = liz.getProperty('IsFolder')   == 'true'
            isPlayable = liz.getProperty('IsPlayable') == 'true'

            if mode == LISTBACK:
                return self.onBack()

            if param:
                self.stopTimer()
                self.onParams(param, isFolder)
                self.resetTimer()

        if select and id == CATEGORIES:
            categoriesList = categories.getSetting('categories').split('|')
            if categoriesList[0] == '':
                categoriesList = []
               
            functionality.ShowCategories(categoriesList)

        if select and id == SETTINGS:
            if utils.isDSF():
                addonID = utils.dsf
            else:
                addonID = 'script.tvguidedixie'

            functionality.ShowSettings(addonID)

        
        if select and id == TOOLS:
            functionality.OpenTools()
        
        if select and id == TOOLS:
            functionality.OpenTools()
        
        if select and id == TVGUIDE:
            if xbmcgui.Window(10000).getProperty('VPNICITY_CONNECTED') == 'True':
                xbmc.executebuiltin('RunScript(special://home/addons/plugin.program.vpnicity/netkill.py,return)')
            xbmc.executebuiltin('RunScript(script.tvguidedixie)')
        

        if select and id == MOVIES:
            if utils.getSetting('KodiLib') == 'true':
                xbmc.executebuiltin('ActivateWindow(10501,plugin://plugin.video.genesis/?action=movieNavigator,return)')
            else:
                xbmc.executebuiltin('ActivateWindow(10025,videodb://1/2,return)')
        
        if select and id == TVSHOWS:
            if utils.getSetting('KodiLib') == 'true':
                xbmc.executebuiltin('ActivateWindow(10501,plugin://plugin.video.genesis/?action=tvNavigator,return)')
            else:
                xbmc.executebuiltin('ActivateWindow(10025,videodb://2/2,return)')
        
        if select and id == NETFLIX:
            xbmc.executebuiltin('RunScript(special://home/addons/plugin.program.vpnicity/netcon.py,return)')
        
        if select and id == MOVIEANDTV:
            xbmc.executebuiltin('XBMC.RunAddon(plugin.video.genesis)')
        
        if select and id == WORLDTV:
            xbmc.executebuiltin('XBMC.RunAddon(plugin.video.alluc.api)')
        
        if select and id == ANDROID:
            xbmc.executebuiltin('ActivateWindow(10025,androidapp://sources/apps,return)')
        
        if select and id == ADULT:
            xbmc.executebuiltin('ActivateWindow(10501,plugin://plugin.program.super.favourites/?label=Adult&mode=400&path=special://userdata/addon_data/plugin.program.super.favourites/Super Favourites/Adult/,return)')
        
        if select and id == VPN:
            xbmc.executebuiltin('RunScript(special://home/addons/plugin.program.vpnicity/manual.py,return)')

        if select and id == VIDEOWINDOW:   
            xbmc.executebuiltin('Action(fullscreen)')  
Beispiel #30
0
def onParams(application, _params):
    global APPLICATION
    APPLICATION = application

    params = get_params(_params)
    mode = None

    try:
        mode = int(urllib.unquote_plus(params['mode']))
    except:
        pass

    try:
        url = urllib.unquote_plus(params['url'])
    except:
        url = None

    if mode == _SCRIPT:
        cmd = 'RunScript(%s)' % url
        xbmc.executebuiltin(cmd)

    elif mode == _ADDON:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/",return)' %
                            (WINDOWID, url))

    elif mode == _SUPERFAVE:
        xbmc.executebuiltin(url)

    elif mode == _REMOVESUPERFAVE:
        if RemoveSFShortcut(url):
            APPLICATION.containerRefresh()

    elif mode == _MOVIES:
        if utils.getSetting('KodiLib') == 'true':
            xbmc.executebuiltin(
                'ActivateWindow(10501,plugin://plugin.video.genesis/?action=movieNavigator,return)'
            )
        else:
            xbmc.executebuiltin('ActivateWindow(10025,videodb://1/2,return)')

    elif mode == _TVSHOWS:
        if utils.getSetting('KodiLib') == 'true':
            xbmc.executebuiltin(
                'ActivateWindow(10025,plugin://plugin.video.genesis/??action=tvNavigator,return)'
            )
        else:
            xbmc.executebuiltin('ActivateWindow(10025,videodb://2/2,return)')

    elif mode == _CATEGORIES:
        ShowCategories(categoriesList)

    elif mode == _SETTINGS:
        ShowSettings()

    elif mode == _INI:
        cmd = 'XBMC.RunScript(special://home/addons/script.tvguidedixie/getIni.py)'
        xbmc.executebuiltin(cmd)

    elif mode == _CHANNELS:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/?mode=%d")' %
                            (WINDOWID, TOOLS, 1900))

    elif mode == _SKINS:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/?mode=%d")' %
                            (WINDOWID, TOOLS, 2000))

    elif mode == _LOGOS:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/?mode=%d")' %
                            (WINDOWID, TOOLS, 2100))

    elif mode == _TOOLS:
        ShowTools()

    elif mode == _YOUTUBE:
        PlayYT(url)

    elif mode == _VPNICITY:
        SelectVPNicity(url)

    elif mode == _CATCHUP:
        ShowCatchup()

    elif mode == _SUPERSEARCH:
        SelectSuperSearch(url)

    elif mode == _SHOWSHORTCUTS:
        ShowShortcuts()

    elif mode == _ADDSHORTCUT:
        if AddShortcut():
            APPLICATION.containerRefresh()

    elif mode == _REMOVESHORTCUT:
        if RemoveShortcut(url):
            APPLICATION.containerRefresh()

    else:
        Main()
Beispiel #31
0
    def onAction(self, action):
        #see here https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h for the full list

        actionId = action.getId()
        buttonId = action.getButtonCode()

        if actionId != 107:
            utils.Log('onAction actionID %d' % actionId)
            utils.Log('onAction buttonID %d' % buttonId)

        if actionId in [ACTION_CONTEXT, ACTION_RCLICK]:
            return self.onContextMenu()

        if actionId in [ACTION_PARENT_DIR, ACTION_BACK] or buttonId in [ESC]:
            return self.onBack()

        try:
            id = self.getFocus().getId()
        except:
            id = 0

        select = (actionId == ACTION_SELECT) or (actionId == ACTION_LCLICK)

        if select and id == MAINLIST:
            liz = self.getSelectedItem()
            param = liz.getProperty('Param')
            image = liz.getProperty('Image')
            mode = int(liz.getProperty('Mode'))
            isFolder = liz.getProperty('IsFolder') == 'true'
            isPlayable = liz.getProperty('IsPlayable') == 'true'

            if mode == LISTBACK:
                return self.onBack()

            if param:
                self.stopTimer()
                self.onParams(param, isFolder)
                self.resetTimer()

        if select and id == CATEGORIES:
            categoriesList = categories.getSetting('categories').split('|')
            if categoriesList[0] == '':
                categoriesList = []

            functionality.ShowCategories(categoriesList)

        if select and id == SETTINGS:
            if utils.getSetting('SKIN') == 'GVAx':
                addonID = 'plugin.video.gvax.tv'
            else:
                addonID = 'script.tvguidedixie'

            functionality.ShowSettings(addonID)

        if select and id == TOOLS:
            functionality.OpenTools()

        if select and id == TOOLS:
            functionality.OpenTools()

        if select and id == TVGUIDE:
            xbmc.executebuiltin('RunScript(script.tvguidedixie)')

        if select and id == MOVIES:
            if utils.getSetting('KodiLib') == 'true':
                xbmc.executebuiltin(
                    'ActivateWindow(10501,plugin://plugin.video.genesis/?action=movieNavigator,return)'
                )
            else:
                xbmc.executebuiltin(
                    'ActivateWindow(10025,videodb://1/2,return)')

        if select and id == TVSHOWS:
            if utils.getSetting('KodiLib') == 'true':
                xbmc.executebuiltin(
                    'ActivateWindow(10501,plugin://plugin.video.genesis/?action=tvNavigator,return)'
                )

            else:
                xbmc.executebuiltin(
                    'ActivateWindow(10025,videodb://2/2,return)')

        if select and id == NETFLIX:
            xbmc.executebuiltin(
                'StartAndroidActivity("com.netflix.mediaclient"),return')

        if select and id == MOVIEANDTV:
            xbmc.executebuiltin('XBMC.RunAddon(plugin.video.genesis)')

        if select and id == WORLDTV:
            xbmc.executebuiltin('XBMC.RunAddon(plugin.video.alluc.api)')

        if select and id == ANDROID:
            xbmc.executebuiltin(
                'ActivateWindow(10025,androidapp://sources/apps,return)')

        if select and id == ADULT:
            xbmc.executebuiltin(
                'ActivateWindow(10501,plugin://plugin.program.super.favourites/?label=Adult&mode=400&path=special://userdata/addon_data/plugin.program.super.favourites/Super Favourites/Adult/,return)'
            )

        if select and id == VPN:
            xbmc.executebuiltin(
                'RunScript(special://home/addons/plugin.program.vpnicity/manual.py,return)'
            )

        if select and id == VIDEOWINDOW:
            xbmc.executebuiltin('Action(fullscreen)')
Beispiel #32
0
VPN = 2003
TVGUIDE = 3000
MOVIES = 3001
TVSHOWS = 3002
NETFLIX = 3003
MOVIEANDTV = 3004
WORLDTV = 3005
ANDROID = 3006
ADULT = 3007
VIDEOWINDOW = 3010

LISTBACK = -999

GETTEXT = utils.GETTEXT
FRODO = utils.FRODO
SKIN = utils.getSetting('SKIN')

datapath = utils.PROFILE
skinfolder = os.path.join(datapath, 'skins')
skinpath = os.path.join(skinfolder, SKIN)

PATH = skinpath

xml_file = os.path.join('main.xml')
if os.path.join(SKIN, 'skins', 'Default', '720p', xml_file):
    XML = xml_file


class Application(xbmcgui.WindowXML):
    def __new__(cls, addonID):
        return super(Application, cls).__new__(cls, XML, PATH)
def checkUpdate():
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL(OTTURL)
        utils.DialogOK('Welcome to On-Tapp.TV 3.0', 'We will now do a back-up of any', 'existing files before installation.')
        utils.doBackup()
        
        if OTTURL == 'OTHER':
            Addon.setSetting('dixie.url', 'Other')
            Addon.setSetting('dixie.skin', 'EPG-Skin')
            utils.setSetting('SKIN', 'OTT-Skin')
        
        utils.downloadDefaults(BASEURL)
    
    else:
        response   = getResponse()
        ottskin    = response['OTTSkin']
        epgskin    = response['EPGSkin']
        logocolour = response['LogoColour']
        logowhite  = response['LogoWhite']
        ottupdate  = response['OTTUpdate']
        epgupdate  = response['EPGUpdate']


        curr = ottskin
        prev = utils.getSetting('OTTSKIN')

        if not prev == curr:
            url     = utils.getBaseURL(OTTURL) + response['OTT Skin Link']
            path    = xbmc.translatePath(PROFILE) 
            path    = os.path.join(path, 'skins')
            zipfile = os.path.join(path, 'skin-update.zip')
            
            if not sfile.exists(path):
                sfile.makedirs(path)
            
            utils.downloadSkins(url, path, zipfile)
            utils.setSetting('OTTSKIN', curr)


        curr = epgskin
        prev = utils.getSetting('EPGSKIN')

        if not prev == curr:
            url     = utils.getBaseURL(OTTURL) + response['EPG Skin Link']
            path    = os.path.join(extras, 'skins')
            zipfile = os.path.join(path,   'skin-update.zip')
            
            if not sfile.exists(path):
                sfile.makedirs(path)
            
            utils.downloadSkins(url, path, zipfile)
            utils.setSetting('EPGSKIN', curr)

    
        curr = logocolour
        prev = utils.getSetting('LOGOCOLOUR')

        if not prev == curr:
            url     = utils.getBaseURL(OTTURL) + response['Logo Colour']
            path    = os.path.join(logos, 'Colour Logo Pack')
            zipfile = os.path.join(path,  'logo-colour-update.zip')
            
            if not sfile.exists(path):
                sfile.makedirs(path)
            
            utils.downloadLogos(url, path, zipfile)
            utils.setSetting('LOGOCOLOUR', curr)
    

        curr = logowhite
        prev = utils.getSetting('LOGOWHITE')

        if not prev == curr:
            url     = utils.getBaseURL(OTTURL) + response['Logo White']
            path    = os.path.join(logos, 'White Logo Pack')
            zipfile = os.path.join(path,  'logo-white-update.zip')
            
            if not sfile.exists(path):
                sfile.makedirs(path)
            
            utils.downloadLogos(url, path, zipfile)
            utils.setSetting('LOGOWHITE', curr)


        curr = ottupdate
        prev = utils.getSetting('OTTUPDATE')

        if not prev == curr:
            url     = utils.getBaseURL(OTTURL) + response['OTT Update']
            path    = xbmc.translatePath(HOME)
            zipfile = os.path.join(path, 'python-update.zip')
            
            utils.doOTTUpdate(url, path, zipfile, ottupdate)
            utils.setSetting('OTTUPDATE', curr)


        curr = epgupdate
        prev = utils.getSetting('EPGUPDATE')

        if not prev == curr:
            url     = utils.getBaseURL(OTTURL) + response['EPG Update']
            path    = xbmc.translatePath(epghome)
            zipfile = os.path.join(path, 'python-update.zip')
            
            if not sfile.exists(path):
                sfile.makedirs(path)
            
            utils.doEPGUpdate(url, path, zipfile, epgupdate)
            utils.setSetting('EPGUPDATE', curr)
def checkUpdate():
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL(OTTURL)
        utils.DialogOK('Welcome to On-Tapp.TV 3.0',
                       'We will now do a back-up of any',
                       'existing files before installation.')
        utils.doBackup()

        if OTTURL == 'OTHER':
            Addon.setSetting('dixie.url', 'Other')
            Addon.setSetting('dixie.skin', 'EPG-Skin')
            utils.setSetting('SKIN', 'OTT-Skin')

        utils.downloadDefaults(BASEURL)

    else:
        response = getResponse()
        ottskin = response['OTTSkin']
        epgskin = response['EPGSkin']
        logocolour = response['LogoColour']
        logowhite = response['LogoWhite']
        ottupdate = response['OTTUpdate']
        epgupdate = response['EPGUpdate']

        curr = ottskin
        prev = utils.getSetting('OTTSKIN')

        if not prev == curr:
            url = utils.getBaseURL(OTTURL) + response['OTT Skin Link']
            path = xbmc.translatePath(PROFILE)
            path = os.path.join(path, 'skins')
            zipfile = os.path.join(path, 'skin-update.zip')

            if not sfile.exists(path):
                sfile.makedirs(path)

            utils.downloadSkins(url, path, zipfile)
            utils.setSetting('OTTSKIN', curr)

        curr = epgskin
        prev = utils.getSetting('EPGSKIN')

        if not prev == curr:
            url = utils.getBaseURL(OTTURL) + response['EPG Skin Link']
            path = os.path.join(extras, 'skins')
            zipfile = os.path.join(path, 'skin-update.zip')

            if not sfile.exists(path):
                sfile.makedirs(path)

            utils.downloadSkins(url, path, zipfile)
            utils.setSetting('EPGSKIN', curr)

        curr = logocolour
        prev = utils.getSetting('LOGOCOLOUR')

        if not prev == curr:
            url = utils.getBaseURL(OTTURL) + response['Logo Colour']
            path = os.path.join(logos, 'Colour Logo Pack')
            zipfile = os.path.join(path, 'logo-colour-update.zip')

            if not sfile.exists(path):
                sfile.makedirs(path)

            utils.downloadLogos(url, path, zipfile)
            utils.setSetting('LOGOCOLOUR', curr)

        curr = logowhite
        prev = utils.getSetting('LOGOWHITE')

        if not prev == curr:
            url = utils.getBaseURL(OTTURL) + response['Logo White']
            path = os.path.join(logos, 'White Logo Pack')
            zipfile = os.path.join(path, 'logo-white-update.zip')

            if not sfile.exists(path):
                sfile.makedirs(path)

            utils.downloadLogos(url, path, zipfile)
            utils.setSetting('LOGOWHITE', curr)

        curr = ottupdate
        prev = utils.getSetting('OTTUPDATE')

        if not prev == curr:
            url = utils.getBaseURL(OTTURL) + response['OTT Update']
            path = xbmc.translatePath(HOME)
            zipfile = os.path.join(path, 'python-update.zip')

            utils.doOTTUpdate(url, path, zipfile, ottupdate)
            utils.setSetting('OTTUPDATE', curr)

        curr = epgupdate
        prev = utils.getSetting('EPGUPDATE')

        if not prev == curr:
            url = utils.getBaseURL(OTTURL) + response['EPG Update']
            path = xbmc.translatePath(epghome)
            zipfile = os.path.join(path, 'python-update.zip')

            if not sfile.exists(path):
                sfile.makedirs(path)

            utils.doEPGUpdate(url, path, zipfile, epgupdate)
            utils.setSetting('EPGUPDATE', curr)
Beispiel #35
0
DSFID   = 'plugin.video.gvax'
DSF     =  xbmcaddon.Addon(DSFID)
home    =  DSF.getAddonInfo('path')
profile =  xbmc.translatePath(DSF.getAddonInfo('profile'))

AddonID = 'script.tvguidedixie'
Addon   =  xbmcaddon.Addon(AddonID)
epghome =  Addon.getAddonInfo('path')
epgpath =  xbmc.translatePath(Addon.getAddonInfo('profile'))
extras  =  os.path.join(epgpath, 'extras')
logos   =  os.path.join(extras, 'logos')

BASEURL  = 'https://www.on-tapp.tv/wp-content/uploads/resources/other/'
URL      =  BASEURL + 'dsf-update.txt'
FIRSTRUN =  utils.getSetting('FIRSTRUN') == 'true'


def checkUpdate():
    if not FIRSTRUN:
        utils.DialogOK('Bienvenido a GVAX', 'Ahora vamos a hacer una copia de seguridad de alguno de', 'los archivos existentes antes de la instalación.') 
        doBackup()
        
        Addon.setSetting('dixie.skin', 'EPG-Skin')
        utils.setSetting('SKIN', 'OTT-Skin')

        downloadDefaults(BASEURL)
        return
    
    response   = getResponse()
    
VPN         = 2003
TVGUIDE     = 3000
MOVIES      = 3001
TVSHOWS     = 3002
NETFLIX     = 3003
MOVIEANDTV  = 3004
WORLDTV     = 3005
ANDROID     = 3006
ADULT       = 3007
VIDEOWINDOW = 3010

LISTBACK  = -999

GETTEXT = utils.GETTEXT
FRODO   = utils.FRODO
SKIN    = utils.getSetting('SKIN')

datapath    = utils.PROFILE
skinfolder  = os.path.join(datapath, 'skins')
skinpath    = os.path.join(skinfolder, SKIN)

PATH = skinpath

xml_file = os.path.join('main.xml')
if os.path.join(SKIN, 'skins', 'Default', '720p', xml_file):
    XML  = xml_file
  

class Application(xbmcgui.WindowXML):
    def __new__(cls, addonID):
        return super(Application, cls).__new__(cls, XML, PATH)
Beispiel #37
0
def onParams(application, _params):
    global APPLICATION
    APPLICATION = application

    params = get_params(_params)
    mode   = None

    try:    mode = int(urllib.unquote_plus(params['mode']))
    except: pass

    try:    url = urllib.unquote_plus(params['url'])
    except: url = None
    

    if mode == _SCRIPT:
        cmd = 'RunScript(%s)' % url
        xbmc.executebuiltin(cmd)


    elif mode == _ADDON:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/",return)' % (WINDOWID, url))


    elif mode == _SUPERFAVE:
        xbmc.executebuiltin(url)


    elif mode == _REMOVESUPERFAVE:
        if RemoveSFShortcut(url):
            APPLICATION.containerRefresh()
        
    elif mode == _MOVIES:
        if utils.getSetting('KodiLib') == 'true':
            xbmc.executebuiltin('ActivateWindow(10501,plugin://plugin.video.genesis/?action=movieNavigator,return)')
        else:
            xbmc.executebuiltin('ActivateWindow(10025,videodb://1/2,return)')


    elif mode == _TVSHOWS:
        if utils.getSetting('KodiLib') == 'true':
            xbmc.executebuiltin('ActivateWindow(10025,plugin://plugin.video.genesis/??action=tvNavigator,return)')
        else:
            xbmc.executebuiltin('ActivateWindow(10025,videodb://2/2,return)')


    elif mode == _CATEGORIES:
        ShowCategories(categoriesList)


    elif mode == _SETTINGS:
        ShowSettings()


    elif mode == _INI:
        cmd = 'XBMC.RunScript(special://home/addons/script.tvguidedixie/getIni.py)'
        xbmc.executebuiltin(cmd)
        


    elif mode == _CHANNELS:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/?mode=%d")' % (WINDOWID, TOOLS, 1900))


    elif mode == _SKINS:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/?mode=%d")' % (WINDOWID, TOOLS, 2000))


    elif mode == _LOGOS:
        xbmc.executebuiltin('ActivateWindow(%d,"plugin://%s/?mode=%d")' % (WINDOWID, TOOLS, 2100))


    elif mode == _TOOLS:
        ShowTools()


    elif mode == _YOUTUBE:
        PlayYT(url)


    elif mode == _VPNICITY:
        SelectVPNicity(url)


    elif mode == _CATCHUP:
        ShowCatchup() 


    elif mode == _SUPERSEARCH:
        SelectSuperSearch(url)


    elif mode == _SHOWSHORTCUTS:
        ShowShortcuts()


    elif mode == _ADDSHORTCUT:
        if AddShortcut():
            APPLICATION.containerRefresh()


    elif mode == _REMOVESHORTCUT:
        if RemoveShortcut(url):
            APPLICATION.containerRefresh()

    else:
        Main()
Beispiel #38
0
#  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 xbmc
import utilsOTT as utils
import update

NOHOME = utils.getSetting('NOHOME') == 'true'

update.checkUpdate()

if __name__ == '__main__':
    if NOHOME:
        xbmc.executebuiltin('RunScript(script.tvguidedixie)')

    else:
        param = None

        if len(sys.argv) > 1:
            param = sys.argv[1]

        xbmc.executebuiltin('Dialog.Close(busydialog)')
        utils.Launch(param)
import utilsOTT as utils


ADDON   =  utils.ADDON
HOME    =  utils.HOME
PROFILE =  utils.PROFILE


AddonID = 'script.tvguidedixie'
Addon   =  xbmcaddon.Addon(AddonID)
epghome =  Addon.getAddonInfo('path')
epgpath =  xbmc.translatePath(Addon.getAddonInfo('profile'))
extras  =  os.path.join(epgpath, 'extras')
logos   =  os.path.join(extras, 'logos')

OTTURL   = utils.getSetting('ottv.url').upper()
URL      = utils.getBaseURL(OTTURL) + '/ott-update.txt'
FIRSTRUN = utils.getSetting('FIRSTRUN') == 'true'


def checkUpdate():
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL(OTTURL)
        utils.DialogOK('Welcome to On-Tapp.TV 3.0', 'We will now do a back-up of any', 'existing files before installation.')
        utils.doBackup()
        
        if OTTURL == 'OTHER':
            Addon.setSetting('dixie.url', 'Other')
            Addon.setSetting('dixie.skin', 'EPG-Skin')
            utils.setSetting('SKIN', 'OTT-Skin')
        
Beispiel #40
0
def checkUpdate():
    if not FIRSTRUN:
        utils.DialogOK('Bienvenido a GVAX', 'Ahora vamos a hacer una copia de seguridad de alguno de', 'los archivos existentes antes de la instalación.') 
        doBackup()
        
        Addon.setSetting('dixie.skin', 'EPG-Skin')
        utils.setSetting('SKIN', 'OTT-Skin')

        downloadDefaults(BASEURL)
        return
    
    response   = getResponse()
    
    ottskin    = response['DSFOTTSkin']
    epgskin    = response['DSFEPGSkin']
    logocolour = response['DSFLogos']
    ottupdate  = response['DSFOTTUpdate']
    epgupdate  = response['DSFEPGUpdate']
    dsfupdate  = response['DSFUpdate']


    curr = ottskin
    prev = utils.getSetting('DSFOTTSKIN')

    if not prev == curr:
        url     = BASEURL + response['DSF OTT Skin']
        path    = xbmc.translatePath(PROFILE) 
        path    = os.path.join(path, 'skins')
        zipfile = os.path.join(path, 'dsf-skin-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        downloadSkins(url, path, zipfile)
        utils.setSetting('DSFOTTSKIN', curr)


    curr = epgskin
    prev = utils.getSetting('DSFEPGSKIN')

    if not prev == curr:
        url     = BASEURL + response['DSF EPG Skin']
        path    = os.path.join(extras, 'skins')
        zipfile = os.path.join(path,   'dsf-skin-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        downloadSkins(url, path, zipfile)
        utils.setSetting('DSFEPGSKIN', curr)


    curr = logocolour
    prev = utils.getSetting('DSFLOGOS')

    if not prev == curr:
        url     = BASEURL + response['DSF Logos']
        path    = os.path.join(logos, 'Colour Logo Pack')
        zipfile = os.path.join(path,  'dsf-logos-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        downloadLogos(url, path, zipfile)
        utils.setSetting('DSFLOGOS', curr)


    curr = ottupdate
    prev = utils.getSetting('DSFOTTUPDATE')

    if not prev == curr:
        url     = BASEURL + response['DSF OTT Update']
        path    = xbmc.translatePath(HOME)
        zipfile = os.path.join(path, 'dsf-ott-python.zip')
        
        doOTTUpdate(url, path, zipfile, ottupdate)
        utils.setSetting('DSFOTTUPDATE', curr)


    curr = epgupdate
    prev = utils.getSetting('DSFEPGUPDATE')

    if not prev == curr:
        url     = BASEURL + response['DSF EPG Update']
        path    = xbmc.translatePath(epghome)
        zipfile = os.path.join(path, 'dsf-epg-python.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        doEPGUpdate(url, path, zipfile, epgupdate)
        utils.setSetting('DSFEPGUPDATE', curr)
    
    
    curr = dsfupdate
    prev = utils.getSetting('DSFUPDATE')

    if not prev == curr:
        url     = BASEURL + response['DSF Update']
        path    = xbmc.translatePath(home)
        zipfile = os.path.join(path, 'dsf-update.zip')
        
        if not sfile.exists(path):
            sfile.makedirs(path)
        
        doDSFUpdate(url, path, zipfile, dsfupdate)
        utils.setSetting('DSFUPDATE', curr)
    
    return
import sfile
import utilsOTT as utils

ADDON = utils.ADDON
HOME = utils.HOME
PROFILE = utils.PROFILE

AddonID = 'script.tvguidedixie'
Addon = xbmcaddon.Addon(AddonID)
epghome = Addon.getAddonInfo('path')
epgpath = xbmc.translatePath(Addon.getAddonInfo('profile'))
extras = os.path.join(epgpath, 'extras')
logos = os.path.join(extras, 'logos')

OTTURL = utils.getSetting('ottv.url').upper()
URL = utils.getBaseURL(OTTURL) + '/ott-update.txt'
FIRSTRUN = utils.getSetting('FIRSTRUN') == 'true'


def checkUpdate():
    if not FIRSTRUN:
        BASEURL = utils.getBaseURL(OTTURL)
        utils.DialogOK('Welcome to On-Tapp.TV 3.0',
                       'We will now do a back-up of any',
                       'existing files before installation.')
        utils.doBackup()

        if OTTURL == 'OTHER':
            Addon.setSetting('dixie.url', 'Other')
            Addon.setSetting('dixie.skin', 'EPG-Skin')