Ejemplo n.º 1
0
def play(url, windowed, name=None):
    handled = False

    getIdle = int(ADDON.getSetting('idle').replace('Never', '0'))
    maxIdle = getIdle * 60 * 60

    dixie.SetSetting('streamURL', url)

    if 'tv/play_by_name_only_guide/' in url or 'movies/play_by_name_guide' in url or 'tv/play_by_name_guide/' in url:
        dixie.removeKepmap()
        xbmc.executebuiltin('XBMC.ActivateWindow(10025,%s)' % url)
        #        while not xbmc.Player().isPlaying():
        #            xbmc.sleep(1000)
        CheckIdle(maxIdle)
#        xbmc.sleep(2000)
#        wait(maxIdle)
#        dixie.loadKepmap()

    else:
        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('IPLAY'):
            import iplayer
            stream = iplayer.getURL(url)
            playAndWait(stream, windowed, maxIdle)
            return

        if url.startswith('IPTV:'):
            import iptv
            url = iptv.getURL(url)
            dixie.log(url)
            xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url)
            return

        if url.startswith('UKTV'):
            import uktv
            stream = uktv.getURL(url)
            dixie.log(stream)
            playAndWait(stream, windowed, maxIdle)
            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 not checkForAlternateStreaming(url):
            playAndWait(url, windowed, maxIdle)

            xbmc.sleep(3000)
            if not xbmc.Player().isPlaying():
                # dixie.CloseBusy()
                xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url)
                wait(maxIdle)
Ejemplo n.º 2
0
def play(url, windowed, name=None):
    handled = False

    getIdle = int(ADDON.getSetting('idle').replace('Never', '0'))
    maxIdle = getIdle * 60 * 60

    dixie.SetSetting('streamURL', url)

    if 'tv/play_by_name_only_guide/' in url or 'movies/play_by_name_guide' in url or 'tv/play_by_name_guide/' in url:
        dixie.removeKepmap()
        xbmc.executebuiltin('XBMC.ActivateWindow(10025,%s)' % url)
        CheckIdle(maxIdle)

    else:
        dixie.loadKepmap()

        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('IPLAY'):
            import iplayer
            stream = iplayer.getURL(url)
            playAndWait(stream, windowed, maxIdle)
            return

        if url.startswith('IPTV:'):
            import iptv
            url = iptv.getURL(url)
            dixie.log(url)
            xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url)
            return

        if url.startswith('UKTV'):
            import uktv
            stream = uktv.getURL(url)
            dixie.log(stream)
            playAndWait(stream, windowed, maxIdle)
            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 not checkForAlternateStreaming(url):
            my_playback = koding.Play_Video(url)
            if not my_playback:
                if CLEAN_STREAMS == 'true':
                    clean_ini(url)
            koding.Notify(title='PLAYBACK FAILED',
                          message='Please try another link',
                          duration=5000)
Ejemplo n.º 3
0
        for file in files:
            if len(file) > 0:
                dixie.SetSetting('INI_%d'   % index, file)
                dixie.SetSetting('INI_%d_E' % index, 'true')
                index += 1

        for i in range(index, 10):
            dixie.SetSetting('INI_%d'   % i, '')
            dixie.SetSetting('INI_%d_E' % index, 'false')


######################################################################
#Functionality

dixie.removeKepmap()
dixie.patchSkins()

if not os.path.exists(cookiepath):
    os.makedirs(cookiepath)


#legacy tidying up
dst = os.path.join(xbmc.translatePath('special://userdata/keymaps'), 'zOTT.xml')
if os.path.exists(dst):
   os.remove(dst)
   xbmc.sleep(1000)
   xbmc.executebuiltin('Action(reloadkeymaps)')


import update
Ejemplo n.º 4
0
def play(url, windowed, name=None):
    handled = False
    
    getIdle = int(ADDON.getSetting('idle').replace('Never', '0'))
    maxIdle = getIdle * 60 * 60

    dixie.SetSetting('streamURL', url)
 
    if 'tv/play_by_name_only/' in url or 'movies/play_by_name' in url:
        dixie.removeKepmap()
        xbmc.executebuiltin('XBMC.ActivateWindow(10025,%s)' % url)
#        while not xbmc.Player().isPlaying():
#            xbmc.sleep(1000)
        CheckIdle(maxIdle)
#        xbmc.sleep(2000)
#        wait(maxIdle)
#        dixie.loadKepmap()

    else:
        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('IPLAY'):
            import iplayer
            stream = iplayer.getURL(url)
            playAndWait(stream, windowed, maxIdle)
            return

        if url.startswith('IPTV:'):
            import iptv
            url = iptv.getURL(url)
            dixie.log(url)
            xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url)
            return

        if url.startswith('UKTV'):
            import uktv
            stream = uktv.getURL(url)
            dixie.log(stream)
            playAndWait(stream, windowed, maxIdle)
            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 not checkForAlternateStreaming(url):
            playAndWait(url, windowed, maxIdle)

            xbmc.sleep(3000)
            if not xbmc.Player().isPlaying():
                # dixie.CloseBusy()
                xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url)
                wait(maxIdle)
Ejemplo n.º 5
0
        for file in files:
            if len(file) > 0:
                dixie.SetSetting('INI_%d' % index, file)
                dixie.SetSetting('INI_%d_E' % index, 'true')
                index += 1

        for i in range(index, 10):
            dixie.SetSetting('INI_%d' % i, '')
            dixie.SetSetting('INI_%d_E' % index, 'false')


######################################################################
#Functionality

dixie.removeKepmap()
dixie.patchSkins()

if not os.path.exists(cookiepath):
    os.makedirs(cookiepath)

#legacy tidying up
dst = os.path.join(xbmc.translatePath('special://userdata/keymaps'),
                   'zOTT.xml')
if os.path.exists(dst):
    os.remove(dst)
    xbmc.sleep(1000)
    xbmc.executebuiltin('Action(reloadkeymaps)')

import update
update.checkForUpdate(silent=True)