Exemplo n.º 1
0
def play(url, name, pdialogue=None):
    from resources.root import resolvers
    import xbmcgui

    url = url.strip()

    url = resolvers.resolve(url)

    if url.endswith('m3u8'):
        from resources.root import iptv
        iptv.listm3u(url)
    else:

        liz = xbmcgui.ListItem(name,
                               iconImage=iconimage,
                               thumbnailImage=iconimage)
        liz.setInfo(type='Video', infoLabels={'Title': name})
        liz.setProperty("IsPlayable", "true")
        liz.setPath(url)

        if url.endswith('.ts'):
            url = 'plugin://plugin.video.f4mTester/?url=' + urllib.quote_plus(
                url) + '&streamtype=SIMPLE'
        elif url.endswith('.m3u8'):
            url = 'plugin://plugin.video.f4mTester/?url=' + urllib.quote_plus(
                url) + '&streamtype=HLS'
        elif url.endswith('.f4m'):
            url = 'plugin://plugin.video.f4mTester/?url=' + urllib.quote_plus(
                url)

        if url.lower().startswith('plugin') and 'youtube' not in url.lower():
            from resources.modules import CustomPlayer
            xbmc.executebuiltin('XBMC.PlayMedia(' + url + ')')
            player = CustomPlayer.MyXBMCPlayer()
            if (xbmc.Player().isPlaying() == 0):
                quit()
            try:

                if player.urlplayed:
                    print 'yes played'
                    return
                if time.time() - beforestart > 4: return False
            #xbmc.sleep(1000)
            except:
                pass

            print 'returning now'
            return False

        from resources.modules import CustomPlayer
        import time

        player = CustomPlayer.MyXBMCPlayer()
        player.pdialogue = pdialogue
        start = time.time()
        #xbmc.Player().play( liveLink,listitem)
        print 'going to play'
        import time
        beforestart = time.time()
        player.play(url, liz)
        if (xbmc.Player().isPlaying() == 0):
            quit()
        try:
            while player.is_active:
                xbmc.sleep(400)

                if player.urlplayed:
                    print 'yes played'
                    return
                if time.time() - beforestart > 4: return False
                #xbmc.sleep(1000)
        except:
            pass
        print 'not played', url
        xbmc.Player().stop()
        return
Exemplo n.º 2
0
def play(url, name, pdialogue=None):
    from resources.modules import resolvers
    import xbmcgui

    url = url.strip()

    url = resolvers.resolve(url)
    if url == 'False':
        xbmcgui.Dialog().notification('A', 'This Link is Down, Try Another')
    if url.endswith('m3u8'):
        from resources.root import iptv
        iptv.listm3u(url)
    else:

        liz = xbmcgui.ListItem(name,
                               iconImage=iconimage,
                               thumbnailImage=iconimage)
        liz.setInfo(type='Video', infoLabels={'Title': name})
        liz.setProperty("IsPlayable", "true")
        liz.setPath(url)

        if url.lower().startswith('plugin') and 'youtube' not in url.lower():
            xbmc.executebuiltin('XBMC.PlayMedia(' + url + ')')
            for i in range(8):
                xbmc.sleep(500)  ##sleep for 10 seconds, half each time
                try:
                    #print 'condi'
                    if xbmc.getCondVisibility(
                            "Player.HasMedia") and xbmc.Player().isPlaying():
                        return True
                except:
                    pass
            print 'returning now'
            return False
        elif url.endswith('.ts'):
            playf4m(url, name)
            from resources.modules import CustomPlayer
            import time

            player = CustomPlayer.MyXBMCPlayer()
            if (xbmc.Player().isPlaying() == 0):
                quit()
            try:

                if player.urlplayed:
                    print 'yes played'
                    return
                if time.time() - beforestart > 4: return False
            #xbmc.sleep(1000)
            except:
                pass

            print 'returning now'
            return False
        from resources.modules import CustomPlayer
        import time

        player = CustomPlayer.MyXBMCPlayer()
        player.pdialogue = pdialogue
        start = time.time()
        #xbmc.Player().play( liveLink,listitem)
        print 'going to play'
        import time
        beforestart = time.time()
        player.play(url, liz)
        if (xbmc.Player().isPlaying() == 0):
            quit()
        try:
            while player.is_active:
                xbmc.sleep(400)

                if player.urlplayed:
                    print 'yes played'
                    return
                if time.time() - beforestart > 4: return False
                #xbmc.sleep(1000)
        except:
            pass
        print 'not played', url
        xbmc.Player().stop()
        return
Exemplo n.º 3
0
elif mode == 2:
    from resources.root import webscrapers
    webscrapers.get(url)

elif mode == 3:
    from resources.root import iptv
    iptv.get(url)

elif mode == 4:
    from resources.root import android
    android.get(url)

elif mode == 50:
    from resources.root import iptv
    iptv.listm3u(url)

elif mode == 10:
    play(url, name)

elif mode == 1000:
    from resources.root import ukgeo
    ukgeo.cat()

elif mode == 2000:
    from resources.root import webscrapers
    webscrapers.cat()

elif mode == 3000:
    from resources.root import iptv
    iptv.cat()
Exemplo n.º 4
0
elif mode==2:
	from resources.root import webscrapers
	webscrapers.get(url)
	
	
elif mode==3:
	from resources.root import iptv
	iptv.get(url)
	
elif mode==4:
	from resources.root import android
	android.get(url)
	
elif mode==50:
	from resources.root import iptv
	iptv.listm3u(url)
	

	
elif mode==10:
	play(url,name,icon,description)
	


elif mode==1000:
	from resources.root import ukgeo
	ukgeo.cat()
	
elif mode==2000:
	from resources.root import webscrapers
	webscrapers.cat()