Exemple #1
0
def buildSubMenu(params):
    params2 = ""
    if "jmmserverplex" in params["url"].lower():
        params["url"] = encodeHex(params["url"])
    www = decodeHex(params["url"])
    e = xml.etree.ElementTree.XML(getHtml(www, params2))
    for atype in e.findall("Directory"):
        a1 = atype.get("title")
        a2 = atype.get("key")
        a3 = 2
        try:
            a4 = atype.get("thumb")
        except:
            a4 = "none"
        try:
            a5 = atype.get("summary")
        except:
            a5 = "none"
        a6 = "none"
        a7 = "none"
        util.addDir(a1, a2, a3, a4, a5, a6, a7)
    for atype in e.findall("Video"):
        a1 = atype.get("title")
        a2 = decodeHex(atype.get("key"))
        a3 = 3
        try:
            a4 = atype.get("thumb")
        except:
            a4 = "none"
        try:
            a5 = atype.get("summary")
        except:
            a5 = "none"
        a6 = "none"
        a7 = "none"
        u = (
            sys.argv[0]
            + "?url="
            + a2
            + "&play="
            + str(4)
            + "&name="
            + urllib.quote_plus(a1.encode("utf-8"))
            + "&thumb="
            + a4
            + "&poster="
            + a7
        )
        liz = xbmcgui.ListItem(a1.encode("utf-8"), iconImage=a4, thumbnailImage=a4)
        liz.setInfo(type="Video", infoLabels={"Title": a1.encode("utf-8"), "Plot": a5})
        # liz.setProperty("Fanart_Image", video[7])
        # liz.setProperty("Landscape_Image", video[7])
        # liz.setProperty("Poster_Image", video[6])
        ok = xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]), url=u, listitem=liz, isFolder=True)
    xbmcplugin.endOfDirectory(int(sysarg))
Exemple #2
0
def buildMainMenu():
    params2 = ""
    www = (
        "http://"
        + addon.getSetting("ipaddress")
        + ":"
        + addon.getSetting("port")
        + "/jmmserverplex/getfilters/"
        + addon.getSetting("userid")
    )
    e = xml.etree.ElementTree.XML(getHtml(www, params2))
    for atype in e.findall("Directory"):
        a1 = atype.get("title")
        a2 = atype.get("key")
        a3 = 2
        a4 = atype.get("thumb")
        a5 = "1"
        a6 = "1"
        a7 = "1"
        util.addDir(a1, a2, a3, a4, a5, a6, a7)
    util.addDir(
        "Search",
        "http://"
        + addon.getSetting("ipaddress")
        + ":"
        + addon.getSetting("port")
        + "/jmmserverplex/search/"
        + addon.getSetting("userid")
        + "/"
        + addon.getSetting("maxlimit")
        + "/",
        3,
        "1",
        "2",
        "3",
        "4",
    )
    xbmcplugin.endOfDirectory(int(sysarg))