Ejemplo n.º 1
0
def addDirectoryItem(handle, url, listitem, totalItems=40, isFolder=True):
    plug = xbmcaddon.getaddonpath_params("addon_id")
    if os.path.exists("/etc/debugxb"):
        try:
            pass  #print "xbmcplugin addDirectoryItem plug =", plug
            pass  #print "xbmcplugin addDirectoryItem url =", url
        except:
            pass
    if "plugin://plugin.video.youtube" in url:
        plug = "plugin.video.youtube"
    if plug in url:
        print "xbmcplugin addDirectoryItem plug in url"
        url = "/usr/lib/enigma2/python/Plugins/Extensions/KodiLite/" + ADDONCAT + "/" + plug + "/default.py?" + url
    pass  #print "xbmcplugin addDirectoryItem url B =", url
    url = url.replace("&", "AxNxD")
    url = url.replace("=", "ExQ")
    data = "&url=" + url

    if os.path.exists("/etc/debugxb"):
        try:
            pass  #print "xbmcplugin addDirectoryItem data =", data
        except:
            pass
    file = open("/tmp/data.txt", "a")
    data1 = getdata(listitem)
    pass  #print "xbmcplugin addDirectoryItem data1 =", data1
    data = "&" + data1 + data
    data = data.replace("\n", "")
    data = data.replace("\r", "")
    data = data + "\n"
    print "xbmcplugin addDirectoryItem 1"
    print "xbmcplugin addDirectoryItem data B =", data
Ejemplo n.º 2
0
def addDirectoryItemsX(handle, items, totalItems=40):
    """Callback function to pass directory contents back to XBMC as a list."""
    #       plug = xbmcaddon.getaddonpath_params("addon_id")
    pass  #print "xbmcplugin addDirectoryItems items A=", items
    pass  #print "xbmcplugin addDirectoryItems totalItems=", totalItems
    f = open("/tmp/kodiplug.txt", "r")
    icount = 0
    for line in f.readlines():
        plug = line[:-1]
        if icount == 0:
            break

    if os.path.exists("/etc/debugxb"):
        try:
            pass  #print "xbmcplugin addDirectoryItem plug =", plug
            pass  #print "xbmcplugin addDirectoryItems handle =", handle
            pass  #print "xbmcplugin addDirectoryItems items =", items
            pass  #print "xbmcplugin addDirectoryItems totalItems =", totalItems
        except:
            psss
    file = open("/tmp/data.txt", "w")
    i = 0
    while i < totalItems:
        plug = xbmcaddon.getaddonpath_params("addon_id")
        pass  #print "xbmcplugin addDirectoryItems plug =", plug
        url = items[i][0]
        url = url.replace("&", "AxNxD")
        url = url.replace("=", "ExQ")
        url = "/usr/lib/enigma2/python/Plugins/Extensions/KodiLite/" + ADDONCAT + "/" + plug + "/default.py?" + url
        #               log("\nxbmcplugin addDirectoryItems url =%s" %url)
        pass  #print "xbmcplugin addDirectoryItems url =", url
        name = items[i][1].getLabel()
        pass  #print "xbmcplugin addDirectoryItems name =", name
        data = "&name=" + name + "&url=" + url + "\n"
        try:
            print "xbmcplugin addDirectoryItems 1"
            print "In xbmcplugin addDirectoryItems data B=", data
        except:
            pass
#               file.write(data)
#               listitem = items[i][1]
        i = i + 1


#               addDirectoryItem(handle, url, listitem, totalItems=40, isFolder=True)

    file.close()
    return True