コード例 #1
0
ファイル: main.py プロジェクト: donald73/kodi
def getLinks(ex_link):
    links = cdaonline.getVideoLinks(ex_link)
    stream_url=''
    print '$'*4
    print links
    t = [ x.get('title') for x in links]
    u = [ x.get('url') for x in links]
    h = [ x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Sources", t)
    if selection>-1:
        if 'cda' in h[selection]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(u[selection])
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url = cdaresolver.getVideoUrls(stream_url[selection][1])
                else:
                    stream_url=''
        else: 
            #print 'urlresolver'
            stream_url = urlresolver.resolve(u[selection])
    #print 'resolved'
    #print stream_url
    if stream_url:
        xbmcplugin.setResolvedUrl(addon_handle, True, xbmcgui.ListItem(path=stream_url))
    else:
        xbmcplugin.setResolvedUrl(addon_handle, False, xbmcgui.ListItem(path=stream_url))
コード例 #2
0
ファイル: main.py プロジェクト: pyro999/kodi
def getLinks(ex_link):
    linksL = segos.getVideoLinks(ex_link)
    stream_url = ''
    print '#######', linksL
    if len(linksL):
        if len(linksL) > 1:
            lables = [x.get('host') for x in linksL]
            s = xbmcgui.Dialog().select('Linki', lables)
        else:
            s = 0

        link = linksL[s].get('href') if s > -1 else ''
        host = linksL[s].get('host') if s > -1 else ''
        if 'cda.pl' in host:
            print 'CDA'
            print link
            stream_url = cdaresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select("Wybierz jakość",
                                                    qualityList)
                if selection > -1:
                    stream_url = cdaresolver.getVideoUrls(
                        stream_url[selection][1])
                else:
                    stream_url = ''
        elif link:
            try:
                stream_url = urlresolver.resolve(link)
            except Exception, e:
                stream_url = ''
                s = xbmcgui.Dialog().ok('[COLOR red]Problem[/COLOR]', str(e))
コード例 #3
0
ファイル: addon.py プロジェクト: Swir/kodi
def ChooseAndPlay(ex_link,kat=''):
    data = nk.get_movie_links(ex_link)
    if len(data.keys())==1:
        hosts,links = nk.host_link(data.values()[0])
    elif kat and kat in data.keys():
        hosts,links = nk.host_link(data[kat])
    else:
        dialog = xbmcgui.Dialog()
        selection = dialog.select('Odcinki:', data.keys())
        if selection>-1: 
            hosts,links = nk.host_link(data[data.keys()[selection]])
        else:
            return False
            
    dialog = xbmcgui.Dialog()
    ret = dialog.select('Choose a source', hosts)
    if ret>-1:
        if 'cda' in hosts[ret]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(links[ret])
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url = cdaresolver.getVideoUrls(stream_url[selection][1])
                else:
                    stream_url=''
        else:        
            stream_url = urlresolver.resolve(links[ret])
        
        if stream_url:
            xbmcplugin.setResolvedUrl(addon_handle, True, xbmcgui.ListItem(path=stream_url))
        else:
            xbmcplugin.setResolvedUrl(addon_handle, False, xbmcgui.ListItem(path=stream_url))
コード例 #4
0
ファイル: main.py プロジェクト: Swir/kodi
def getLinks(ex_link):
    links = cdaonline.getVideoLinks(ex_link)
    stream_url=''
    print '$'*4
    print links
    t = [ x.get('title') for x in links]
    u = [ x.get('url') for x in links]
    h = [ x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Sources", t)
    if selection>-1:
        print '^^S unshorten.unshorten'
        link = unshorten.unshorten(u[selection])
        print link
        print '^^E unshorten.unshorten'
        if 'cda' in h[selection]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url = cdaresolver.getVideoUrls(stream_url[selection][1])
                else:
                    stream_url=''
        elif 'playernaut' in h[selection]:
            print 'playernaut'
            print link
            stream_url = playernautresolver.getVideoUrls(link)
            print 'playernaut'
            print stream_url
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                hrefs = [x[1] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url=hrefs[selection]
                else:
                    stream_url=''
                
        else: 
            print '!!!urlresolver'
            print link
            stream_url = urlresolver.resolve(link)
            if stream_url:
                pass
            else:
                stream_url=''
                xbmcgui.Dialog().ok('[COLOR red] Problem [/COLOR]', 'Może inny link będzie działał?')
    
    print stream_url
    if stream_url:
        xbmcplugin.setResolvedUrl(addon_handle, True, xbmcgui.ListItem(path=stream_url))
    else:
        xbmcplugin.setResolvedUrl(addon_handle, False, xbmcgui.ListItem(path=stream_url))
コード例 #5
0
ファイル: main.py プロジェクト: kemir71/kodi-1
def getLinks(ex_link):
    links = cdaonline.getVideoLinks(ex_link)
    stream_url=''
    print '$'*4
    print links
    t = [ x.get('title') for x in links]
    u = [ x.get('url') for x in links]
    h = [ x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Sources", t)
    if selection>-1:
        print '^^S unshorten.unshorten'
        link = unshorten.unshorten(u[selection])
        print link
        print '^^E unshorten.unshorten'
        if 'cda' in h[selection]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url = cdaresolver.getVideoUrls(stream_url[selection][1])
                else:
                    stream_url=''
        elif 'playernaut' in h[selection]:
            print 'playernaut'
            print link
            stream_url = playernautresolver.getVideoUrls(link)
            print 'playernaut'
            print stream_url
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                hrefs = [x[1] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url=hrefs[selection]
                else:
                    stream_url=''
                
        else: 
            print '!!!urlresolver'
            print link
            stream_url = urlresolver.resolve(link)
            if stream_url:
                pass
            else:
                stream_url=''
                xbmcgui.Dialog().ok('[COLOR red] Problem [/COLOR]', 'Może inny link będzie działał?')
    
    print stream_url
    if stream_url:
        xbmcplugin.setResolvedUrl(addon_handle, True, xbmcgui.ListItem(path=stream_url))
    else:
        xbmcplugin.setResolvedUrl(addon_handle, False, xbmcgui.ListItem(path=stream_url))
コード例 #6
0
ファイル: main.py プロジェクト: pyro999/kodi
def getLinks(ex_link):
    links = cdaonline.getVideoLinks(ex_link)
    stream_url = ''
    print '$' * 4
    print links
    t = [x.get('title') for x in links]
    u = [x.get('url') for x in links]
    h = [x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Sources", t)
    if selection > -1:
        print '^^S unshorten.unshorten'
        link = unshorten.unshorten(u[selection])
        print link
        print '^^E unshorten.unshorten'
        if 'cda' in h[selection]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select(
                    "Quality [can be set default]", qualityList)
                if selection > -1:
                    stream_url = cdaresolver.getVideoUrls(
                        stream_url[selection][1])
                else:
                    stream_url = ''
        elif 'playernaut' in h[selection]:
            print 'playernaut'
            print link
            stream_url = playernautresolver.getVideoUrls(link)
            print 'playernaut'
            print stream_url
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                hrefs = [x[1] for x in stream_url]
                selection = xbmcgui.Dialog().select(
                    "Quality [can be set default]", qualityList)
                if selection > -1:
                    stream_url = hrefs[selection]
                else:
                    stream_url = ''

        else:
            print '!!!urlresolver'
            print link
            try:
                stream_url = urlresolver.resolve(link)
            except Exception, e:
                stream_url = ''
                s = xbmcgui.Dialog().ok('[COLOR red]Problem[/COLOR]',
                                        'Może inny link będzie działał?',
                                        'ERROR: %s' % str(e))
コード例 #7
0
def getLinks(ex_link):
    links = alltube.getVideoLinks(ex_link)
    # if links:
    #     links = sorted(links, key=lambda elem: "%s%d" % (elem.get('wersja',''), 100-elem.get('rate',100)))
    stream_url = ''
    #print '$'*4
    #print links
    t = [x.get('title') for x in links]
    u = [x.get('url') for x in links]
    h = [x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Wersja | Ocena | [Host] ", t)
    if selection > -1:
        link = u[selection]
        #print link
        if 'cda' in h[selection]:
            #print 'CDA'
            stream_url = cdaresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select(
                    "Quality [can be set default]", qualityList)
                if selection > -1:
                    stream_url = cdaresolver.getVideoUrls(
                        stream_url[selection][1])
                else:
                    stream_url = ''
        elif 'playernaut' in h[selection]:
            stream_url = playernautresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                hrefs = [x[1] for x in stream_url]
                selection = xbmcgui.Dialog().select(
                    "Quality [can be set default]", qualityList)
                if selection > -1:
                    stream_url = hrefs[selection]
                else:
                    stream_url = ''

        else:
            #xbmcgui.Dialog().ok('link',link)
            try:
                stream_url = urlresolver.resolve(link)
                # print '$$urlresolver',stream_url
                # xbmcgui.Dialog().ok('resolved!!',stream_url)
            except Exception, e:
                stream_url = ''
                s = xbmcgui.Dialog().ok('[COLOR red]Problem[/COLOR]',
                                        'Może inny link będzie działał?',
                                        'UTRresolver ERROR: [%s]' % str(e))
コード例 #8
0
ファイル: main.py プロジェクト: noirrak/kodi
def getLinks(ex_link):
    links = alltube.getVideoLinks(ex_link)
    # if links:
    #     links = sorted(links, key=lambda elem: "%s%d" % (elem.get('wersja',''), 100-elem.get('rate',100)))
    stream_url=''
    #print '$'*4
    #print links
    t = [ x.get('title') for x in links]
    u = [ x.get('url') for x in links]
    h = [ x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Wersja | Ocena | [Host] ", t)
    if selection>-1:
        link = u[selection]
        #print link
        if 'cda' in h[selection]:
            #print 'CDA'
            stream_url = cdaresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url = cdaresolver.getVideoUrls(stream_url[selection][1])
                else:
                    stream_url=''
        elif 'playernaut' in h[selection]:
            stream_url = playernautresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                hrefs = [x[1] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url=hrefs[selection]
                else:
                    stream_url=''
                
        else: 
            #xbmcgui.Dialog().ok('link',link)
            try:
                stream_url = urlresolver.resolve(link)
                # print '$$urlresolver',stream_url
                # xbmcgui.Dialog().ok('resolved!!',stream_url)
            except Exception,e:
                stream_url=''
                s = xbmcgui.Dialog().ok('[COLOR red]Problem[/COLOR]','Może inny link będzie działał?','UTRresolver ERROR: [%s]'%str(e))
コード例 #9
0
ファイル: main.py プロジェクト: KING-TV/kodi-1
def getLinks(ex_link):
    links = cdaonline.getVideoLinks(ex_link)
    stream_url=''
    print '$'*4
    print links
    t = [ x.get('title') for x in links]
    u = [ x.get('url') for x in links]
    h = [ x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Sources", t)
    if selection>-1:
        if 'cda' in h[selection]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(u[selection])
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url = cdaresolver.getVideoUrls(stream_url[selection][1])
                else:
                    stream_url=''
        elif 'playernaut' in h[selection]:
            print 'playernaut'
            print u[selection]
            stream_url = playernautresolver.getVideoUrls(u[selection])
            print 'playernaut'
            print stream_url
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                hrefs = [x[1] for x in stream_url]
                selection = xbmcgui.Dialog().select("Quality [can be set default]", qualityList)
                if selection>-1:
                    stream_url=hrefs[selection]
                else:
                    stream_url=''
                
        else: 
            #print 'urlresolver'
            stream_url = urlresolver.resolve(u[selection])
    print 'resolved'
    print stream_url
    if stream_url:
        xbmcplugin.setResolvedUrl(addon_handle, True, xbmcgui.ListItem(path=stream_url))
    else:
        xbmcplugin.setResolvedUrl(addon_handle, False, xbmcgui.ListItem(path=stream_url))
コード例 #10
0
ファイル: main.py プロジェクト: pyro999/kodi
def getLinks(ex_link):
    links = kinoseriale.getVideoLinks(ex_link)
    stream_url = ''
    print '$' * 4
    print links
    t = [x.get('title') for x in links]
    u = [x.get('url') for x in links]
    h = [x.get('host') for x in links]
    selection = xbmcgui.Dialog().select("Sources", t)
    if selection > -1:
        link = u[selection]
        if 'offcard.net' in h[selection]:
            stream_url = link
            #item = xbmcgui.ListItem('title')
            #item.setProperty("SWFPlayer", "http://offcard.net/static/player/flowplayer-3.2.8.swf")
            # play won't accept unicode strings, so convert
            #xbmc.Player(xbmc.PLAYER_CORE_DVDPLAYER).play(str(stream_url), item)
        elif 'cda' in h[selection]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(link)
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select(
                    "Quality [can be set default]", qualityList)
                if selection > -1:
                    stream_url = cdaresolver.getVideoUrls(
                        stream_url[selection][1])
                else:
                    stream_url = ''

        elif link:
            print '!!!urlresolver'
            print link
            try:
                stream_url = urlresolver.resolve(link)
            except Exception, e:
                stream_url = ''
                s = xbmcgui.Dialog().ok('[COLOR red]Problem[/COLOR]',
                                        'Może inny link będzie działał?',
                                        'ERROR: %s' % str(e))
コード例 #11
0
ファイル: addon.py プロジェクト: kemir71/kodi-1
def ChooseAndPlay(ex_link, kat=''):
    data = nk.get_movie_links(ex_link)
    if len(data.keys()) == 1:
        hosts, links = nk.host_link(data.values()[0])
    elif kat and kat in data.keys():
        hosts, links = nk.host_link(data[kat])
    else:
        dialog = xbmcgui.Dialog()
        selection = dialog.select('Odcinki:', data.keys())
        if selection > -1:
            hosts, links = nk.host_link(data[data.keys()[selection]])
        else:
            return False

    dialog = xbmcgui.Dialog()
    ret = dialog.select('Choose a source', hosts)
    if ret > -1:
        if 'cda' in hosts[ret]:
            print 'CDA'
            stream_url = cdaresolver.getVideoUrls(links[ret])
            if type(stream_url) is list:
                qualityList = [x[0] for x in stream_url]
                selection = xbmcgui.Dialog().select(
                    "Quality [can be set default]", qualityList)
                if selection > -1:
                    stream_url = cdaresolver.getVideoUrls(
                        stream_url[selection][1])
                else:
                    stream_url = ''
        else:
            stream_url = urlresolver.resolve(links[ret])

        if stream_url:
            xbmcplugin.setResolvedUrl(addon_handle, True,
                                      xbmcgui.ListItem(path=stream_url))
        else:
            xbmcplugin.setResolvedUrl(addon_handle, False,
                                      xbmcgui.ListItem(path=stream_url))