Ejemplo n.º 1
0
def addLink(name, url, iconimage):
    liz = xbmcgui.ListItem(name,
                           iconImage="DefaultVideo.png",
                           thumbnailImage=iconimage)
    liz.setInfo(type="Video", infoLabels={"Title": name})
    liz.setProperty('fanart_image',
                    "%s/fanart.jpg" % selfAddon.getAddonInfo("path"))
    try:
        if re.search('HD', name) or re.search('1080P', name) or re.search(
                '720P', name):
            liz.addStreamInfo('video', {
                'Codec': 'h264',
                'width': 1280,
                'height': 720
            })
        else:
            liz.addStreamInfo('video', {
                'Codec': 'h264',
                'width': 600,
                'height': 300
            })
    except:
        pass
    return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                       url=url,
                                       listitem=liz)
Ejemplo n.º 2
0
def addLink(name,url,iconimage):
    liz=xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
    liz.setInfo( type="Video", infoLabels={ "Title": name } )
    liz.setProperty('fanart_image', "%s/fanart.jpg"%selfAddon.getAddonInfo("path"))
    try:
        if re.search('HD',name) or re.search('1080P',name) or re.search('720P',name):liz.addStreamInfo( 'video', { 'Codec': 'h264', 'width': 1280, 'height': 720 } )
        else: liz.addStreamInfo( 'video', { 'Codec': 'h264', 'width': 600, 'height': 300 } )
    except: pass
    return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=url,listitem=liz)
Ejemplo n.º 3
0
def addCanal(name,url,mode,iconimage,total,descricao):
    cm=[]
    u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)#+"&thumb="+urllib.quote_plus(iconimage)
    liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
    liz.setInfo( type="Video", infoLabels={ "Title": name, "overlay":6 ,"plot":descricao} )
    liz.setProperty('fanart_image', "%s/fanart.jpg"%selfAddon.getAddonInfo("path"))
    try:
        if re.search('HD',name) or re.search('1080P',name) or re.search('720P',name):liz.addStreamInfo( 'video', { 'Codec': 'h264', 'width': 1280, 'height': 720 } )
        else: liz.addStreamInfo( 'video', { 'Codec': 'h264', 'width': 600, 'height': 300 } )
    except: pass
    cm.append(('Gravar canal', "XBMC.RunPlugin(%s?mode=%s&name=%s&url=%s)"%(sys.argv[0],30,name,url)))
    cm.append(('Ver programação', "XBMC.RunPlugin(%s?mode=%s&name=%s&url=%s)"%(sys.argv[0],31,name,url)))
    liz.addContextMenuItems(cm, replaceItems=False)
    return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=False,totalItems=total)
Ejemplo n.º 4
0
def addDir(name, url, mode, iconimage, total, descricao, pasta):
    u = sys.argv[0] + "?url=" + urllib.quote_plus(url) + "&mode=" + str(
        mode) + "&name=" + urllib.quote_plus(name)
    liz = xbmcgui.ListItem(name,
                           iconImage="DefaultFolder.png",
                           thumbnailImage=iconimage)
    liz.setInfo(type="Video",
                infoLabels={
                    "Title": name,
                    "overlay": 6,
                    "plot": descricao
                })
    liz.setProperty('fanart_image',
                    "%s/fanart.jpg" % selfAddon.getAddonInfo("path"))
    return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                       url=u,
                                       listitem=liz,
                                       isFolder=pasta,
                                       totalItems=total)
Ejemplo n.º 5
0
def addCanal(name, url, mode, iconimage, total, descricao):
    cm = []
    u = sys.argv[0] + "?url=" + urllib.quote_plus(url) + "&mode=" + str(
        mode) + "&name=" + urllib.quote_plus(
            name)  #+"&thumb="+urllib.quote_plus(iconimage)
    liz = xbmcgui.ListItem(name,
                           iconImage="DefaultFolder.png",
                           thumbnailImage=iconimage)
    liz.setInfo(type="Video",
                infoLabels={
                    "Title": name,
                    "overlay": 6,
                    "plot": descricao
                })
    liz.setProperty('fanart_image',
                    "%s/fanart.jpg" % selfAddon.getAddonInfo("path"))
    try:
        if re.search('HD', name) or re.search('1080P', name) or re.search(
                '720P', name):
            liz.addStreamInfo('video', {
                'Codec': 'h264',
                'width': 1280,
                'height': 720
            })
        else:
            liz.addStreamInfo('video', {
                'Codec': 'h264',
                'width': 600,
                'height': 300
            })
    except:
        pass
    cm.append(('Gravar canal', "XBMC.RunPlugin(%s?mode=%s&name=%s&url=%s)" %
               (sys.argv[0], 30, name, url)))
    cm.append(('Ver programação', "XBMC.RunPlugin(%s?mode=%s&name=%s&url=%s)" %
               (sys.argv[0], 31, name, url)))
    liz.addContextMenuItems(cm, replaceItems=False)
    return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),
                                       url=u,
                                       listitem=liz,
                                       isFolder=False,
                                       totalItems=total)
Ejemplo n.º 6
0
def addDir(name,url,mode,iconimage,total,descricao,pasta):
    u=sys.argv[0]+"?url="+urllib.quote_plus(url)+"&mode="+str(mode)+"&name="+urllib.quote_plus(name)
    liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
    liz.setInfo( type="Video", infoLabels={ "Title": name, "overlay":6 ,"plot":descricao} )
    liz.setProperty('fanart_image', "%s/fanart.jpg"%selfAddon.getAddonInfo("path"))
    return xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=liz,isFolder=pasta,totalItems=total)