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)
Exemple #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)
        #        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)
Exemple #3
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)
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)
def play(url, windowed, name=None):
    dixie.SetSetting('streamURL', url)
    handled = False

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

    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('IPLAYD'):
        import iplayer
        stream = iplayer.getURL(url)
        dixie.log(stream)
        xbmc.executebuiltin('XBMC.RunPlugin(%s)' % stream)
        return

    if url.startswith('IPLAY'):
        import iplayer
        stream = iplayer.getURL(url)
        playAndWait(stream, windowed, maxIdle)
        return

    if url.startswith('LIVETV'):
        import livetv
        stream = livetv.getLIVETV(url)
        dixie.log(stream)
        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.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('dsf'):
        if playDSF(url, windowed):
            wait(maxIdle)
        return

    # if url.lower().startswith('upnp:'):
    #     playAndWait(url, windowed, maxIdle)
    #     return

    if not checkForAlternateStreaming(url):
        playAndWait(url, windowed, maxIdle)

        xbmc.sleep(3000)
        if not xbmc.Player().isPlaying():
            xbmc.executebuiltin('XBMC.RunPlugin(%s)' % url)
            wait(maxIdle)