示例#1
0
def root():
    """root menu of the addon"""
    base = "http://norestrictions.club/norestrictions.club"
    if not get_list(base + "/reloaded/mainreloaded.xml"):
        koding.Add_Dir(name="Message",
                       url="Sorry, server is down",
                       mode="message",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
        koding.Add_Dir(name="Search",
                       url="",
                       mode="Search",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
        koding.Add_Dir(name="Testings",
                       url='{"file_name":"testings.xml"}',
                       mode="Testings",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
示例#2
0
def root():
    """root menu of the addon"""
    if not get_list(root_xml_url):
        koding.Add_Dir(
            name=_("Message"),
            url=_("Sorry, server is down"),
            mode="message",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
        koding.Add_Dir(
            name=_("Search"),
            url="",
            mode="Search",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
        koding.Add_Dir(
            name=_("Testings"),
            url='{"file_name":"testings.xml"}',
            mode="Testings",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
def root():
    """root menu of the addon"""
    base = "http://163.172.46.122/files/missy/main.txt"
    if not get_list(base):
        koding.Add_Dir(
            name="Message",
            url="Sorry, server is down",
            mode="message",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
        koding.Add_Dir(
            name="Search",
            url="",
            mode="Search",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
        koding.Add_Dir(
            name="Testings",
            url='{"file_name":"testings.xml"}',
            mode="Testings",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
示例#4
0
def root():
    """root menu of the addon"""
    if enable_newswin == 'true':
        koding.Add_Dir(name='[COLORlimegreen]Latest News And Updates[/COLOR]', url='{"my_text":"Latest News[CR]!!!","my_desc":""}', mode='dialog_example', folder=False, icon=os.path.join(art_path,'news.jpg'), fanart=os.path.join(art_path,'fanart.jpg'))
    if not get_list(root_xml_url):
        koding.Add_Dir(
            name=_("Message"),
            url=_("Sorry, server is down"),
            mode="message",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
        koding.Add_Dir(
            name=_("Search"),
            url="",
            mode="Search",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
        koding.Add_Dir(
            name=_("Testings"),
            url='{"file_name":"testings.xml"}',
            mode="Testings",
            folder=True,
            icon=xbmcaddon.Addon().getAddonInfo("icon"),
            fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
            content_type="")
    if enable_installa =='true':
        koding.Add_Dir(name='Download Backgrounds', url='{"my_text":"INSTALLA[CR]!!!","my_desc":""}', mode='dialog_specific', folder=False, icon=os.path.join(art_path,'icon.png'), fanart=os.path.join(art_path,'fanart.jpg'))
示例#5
0
def search():
    """
    Open root search directory
    """
    versionspec = {"columns": {"version": "TEXT"}}
    koding.Create_Table("version", versionspec)

    search_spec = {"columns": {"term": "TEXT"}}

    koding.Create_Table("search", search_spec)
    terms = koding.Get_All_From_Table("search")
    if terms:
        koding.Add_Dir(name=_("Clear Search"),
                       mode="clear_search",
                       folder=True,
                       icon=icon,
                       fanart=fanart)
    for term in terms:
        label = term["term"]
        context_menu = [(_("Remove Search"), "RunPlugin({0})".format(
            get_addon_url(mode="remove_search", url=label)))]
        koding.Add_Dir(name=label,
                       url=label,
                       mode="do_search",
                       folder=True,
                       icon=icon,
                       fanart=fanart,
                       context_items=context_menu)

    koding.Add_Dir(name=_("Add Search"),
                   mode="add_search",
                   folder=True,
                   icon=icon,
                   fanart=fanart)
示例#6
0
def display_code(Items, content_type):
    for item in Items:
        context_items = []
        if ADDON.getSetting("settings_context") == "true":
            context_items.append(
                (_("Settings"),
                 "RunPlugin({0})".format(get_addon_url("Settings"))))
        context_items.extend(item["context"])
        name = item["label"]
        if "adult" in name.lower():
            if ADDON.getSetting("adult_menu") == "true":
                koding.Add_Dir(name=item["label"],
                               url=item["url"],
                               mode=item["mode"],
                               folder=item["folder"],
                               icon=item["icon"],
                               fanart=item["fanart"],
                               context_items=context_items,
                               content_type="video",
                               info_labels=item["info"],
                               set_property=item.get("properties", {}),
                               set_art={"poster": item["icon"]})
        else:
            koding.Add_Dir(name=item["label"],
                           url=item["url"],
                           mode=item["mode"],
                           folder=item["folder"],
                           icon=item["icon"],
                           fanart=item["fanart"],
                           context_items=context_items,
                           content_type="video",
                           info_labels=item["info"],
                           set_property=item.get("properties", {}),
                           set_art={"poster": item["icon"]})
    xbmcplugin.setContent(int(sys.argv[1]), content_type)
示例#7
0
def display_list(items, content_type):
    "display jen list in kodi"
    import xbmcplugin
    import sys
    hook_result = run_hook("display_list", items, content_type)
    if hook_result:
        return
    for item in items:
        context_items = []
        if ADDON.getSetting("settings_context") == "true":
            context_items.append(
                (_("Settings"),
                 "RunPlugin({0})".format(get_addon_url("Settings"))))
        context_items.extend(item["context"])
        koding.Add_Dir(name=item["label"],
                       url=item["url"],
                       mode=item["mode"],
                       folder=item["folder"],
                       icon=item["icon"],
                       fanart=item["fanart"],
                       context_items=context_items,
                       content_type="video",
                       info_labels=item["info"],
                       set_property=item.get("properties", {}),
                       set_art={"poster": item["icon"]})
    xbmcplugin.setContent(int(sys.argv[1]), content_type)
示例#8
0
def root():
    """root menu of the addon"""
    base = " https://raw.githubusercontent.com/LoopAddon/repository.theloop/master/home.xml"
    if not get_list(base):
        koding.Add_Dir(name="Message",
                       url="Sorry, server is down",
                       mode="message",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
        koding.Add_Dir(name="Testings",
                       url='{"file_name":"testings.xml"}',
                       mode="Testings",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
示例#9
0
def handle_login():
    try:
        """ get username and password and do login with them """
        """ also get whether to hide successful login notification """
        username = ownAddon.getSetting('username')
        password = ownAddon.getSetting('password')

        login_message_style = ownAddon.getSetting('login_message_style')
        login_welcome_msg = ownAddon.getSetting('login_welcome_msg')
        login_failed_msg = ownAddon.getSetting('login_failed_msg')
        login_required_msg = ownAddon.getSetting('login_required_msg')

        if username == '' or password == '':
            koding.Add_Dir(name=_(login_required_msg),
                           url=_(login_required_msg),
                           mode="message",
                           folder=False,
                           icon=xbmcaddon.Addon().getAddonInfo("icon"),
                           fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                           content_type="")
            return None

        true_path = koding.Physical_Path(
            ('special://home/addons/%s/' % (addon_id)))
        expiration = ownAddon.getSetting('WEBLOGIN_EXPIRES_AT')
        if time.time() > expiration or expiration == '':
            logged_in = weblogin.verify_login(true_path, username, password)
            if logged_in == True:
                login_message = login_welcome_msg
                expires_at = time.time() + 60 * 60 * int(session_length)
                expiration = expires_at
                ownAddon.setSetting("WEBLOGIN_EXPIRES_AT", str(expires_at))
                display_menu = True
            else:
                login_message = login_failed_msg
                display_menu = False

            if '%s' in login_message:
                login_message = login_message % (username)

            if 'notification' in login_message_style:
                xbmcgui.Dialog().notification(
                    'Login Update', login_message,
                    xbmcaddon.Addon().getAddonInfo("icon"), 4000)
            elif 'popup' in login_message_style:
                xbmcgui.Dialog().ok('Login Update', login_message)
        else:
            display_menu = True
    except:
        failure = traceback.format_exc()
        xbmcgui.Dialog().textviewer(
            'Handle Login Exception - Report this to the developer',
            str(failure))
        display_menu = False
    return display_menu
示例#10
0
def display_list(items, content_type):
    "display jen list in kodi"
    import xbmcplugin
    import sys
    if content_type == "seasons":
        import pickle
        context_items = []
        if ADDON.getSetting("settings_context") == "true":
            context_items.append(
                ("Settings",
                 "RunPlugin({0})".format(get_addon_url("Settings"))))
        url = []
        for item in items:
            url.append(item["url"])
        koding.Add_Dir(name="All Episodes",
                       url=pickle.dumps(url),
                       mode="all_episodes",
                       folder=True,
                       icon=ADDON.getAddonInfo("icon"),
                       fanart=ADDON.getAddonInfo("fanart"),
                       context_items=context_items,
                       content_type="video")
    for item in items:
        context_items = []
        if ADDON.getSetting("settings_context") == "true":
            context_items.append(
                ("Settings",
                 "RunPlugin({0})".format(get_addon_url("Settings"))))
        context_items.extend(item["context"])
        koding.Add_Dir(name=item["label"],
                       url=item["url"],
                       mode=item["mode"],
                       folder=item["folder"],
                       icon=item["icon"],
                       fanart=item["fanart"],
                       context_items=context_items,
                       content_type="video",
                       info_labels=item["info"],
                       set_property=item["properties"],
                       set_art={"poster": item["icon"]})
        xbmcplugin.setContent(int(sys.argv[1]), content_type)
示例#11
0
def root():
    """root menu of the addon"""
    if enable_newswin == 'true':
        koding.Add_Dir(
            name='[COLOR=yellow][B]Latest News And Updates[/B][/COLOR]',
            url='{"my_text":"Latest News[CR]!!!","my_desc":""}',
            mode='dialog_my_news',
            folder=False,
            icon=os.path.join(media_path, 'updates.png'),
            fanart=os.path.join(art_path, 'fanart.jpg'))
    if not get_list(root_xml_url):
        koding.Add_Dir(name=_("Message"),
                       url=_("Sorry, server is down"),
                       mode="message",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
        koding.Add_Dir(name=_("Search"),
                       url="",
                       mode="Search",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
        koding.Add_Dir(name=_("Testings"),
                       url='{"file_name":"testings.xml"}',
                       mode="Testings",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
    if enable_installa == 'true':
        koding.Add_Dir(name='Download Backgrounds',
                       url='{"my_text":"INSTALLA[CR]!!!","my_desc":""}',
                       mode='dialog_specific',
                       folder=False,
                       icon=os.path.join(art_path, 'icon.png'),
                       fanart=os.path.join(art_path, 'fanart.jpg'))
    koding.Add_Dir(
        name=
        '[COLOR=snow]Follow on Twitter:[/COLOR] [COLOR=springgreen]@tantrumdev[/COLOR]',
        url='line',
        mode='section_item',
        folder=False,
        icon=os.path.join(media_path, 'twitter.png'),
        fanart=os.path.join(art_path, 'fanart.jpg'))
    koding.Add_Dir(
        name=
        '[COLOR=snow]Subscribe on YouTube:[/COLOR] [COLOR=springgreen]http://youtube.tantrumtv.com[/COLOR]',
        url='line',
        mode='section_item',
        folder=False,
        icon=os.path.join(media_path, 'youtube.png'),
        fanart=os.path.join(art_path, 'fanart.jpg'))
示例#12
0
def display_data(Items):
    for item in Items:
        context_items = []
        if ADDON.getSetting("settings_context") == "true":
            context_items.append(
                (_("Settings"),
                 "RunPlugin({0})".format(get_addon_url("Settings"))))
        context_items.extend(item["context"])
        koding.Add_Dir(name=item["label"],
                       url=item["url"],
                       mode=item["mode"],
                       folder=item["folder"],
                       icon=item["icon"],
                       fanart=item["fanart"],
                       context_items=context_items,
                       content_type="video",
                       info_labels=item["info"],
                       set_property=item.get("properties", {}),
                       set_art={"poster": item["icon"]})
def LOGIN(username, password, hidesuccess):
    root_xml_url = "http://laffinatcha.stream/xml/main.xml"
    uc = username[0].upper() + username[1:]
    lc = username.lower()
    true_path = koding.Physical_Path(
        'special://home/addons/plugin.video.auryn/')
    logged_in = weblogin.doLogin(true_path, username, password)

    if logged_in == True:
        Notify('Welcome', uc + '', '4000')
        get_list(root_xml_url)
    elif logged_in == False:

        Notify('Login Failure', uc + ' could not login', '4000')
        koding.Add_Dir(name=_("You must be logged in"),
                       url=_("You are not logged in"),
                       mode="message",
                       folder=True,
                       icon=xbmcaddon.Addon().getAddonInfo("icon"),
                       fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                       content_type="")
示例#14
0
def root():
    try:
        """ check if user has enabled user-login setting """
        use_account = ownAddon.getSetting('use-account')
        display_menu = False

        if use_account == 'true':
            display_menu = handle_login()

            if display_menu == None:
                return
        else:
            display_menu = True
    except:
        failure = traceback.format_exc()
        xbmcgui.Dialog().textviewer(
            'Login Exception - Report this to the developer', str(failure))
        pass
    """root menu of the addon"""
    try:
        if display_menu == True:
            if enable_newswin == 'true':
                koding.Add_Dir(
                    name=
                    '[B]Movie Request Info[COLORyellow] CLICK HERE[/COLOR][/B]',
                    url='{"my_text":"REQUESTS[CR]!!!","my_desc":""}',
                    mode='dialog_example',
                    folder=False,
                    icon=os.path.join(art_path, 'icon.png'),
                    fanart=os.path.join(art_path, 'fanart.jpg'))
            if not get_list(root_xml_url):
                koding.Add_Dir(name=_("Message"),
                               url=_("Sorry, server is down"),
                               mode="message",
                               folder=True,
                               icon=xbmcaddon.Addon().getAddonInfo("icon"),
                               fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                               content_type="")
                koding.Add_Dir(name=_("Search"),
                               url="",
                               mode="Search",
                               folder=True,
                               icon=xbmcaddon.Addon().getAddonInfo("icon"),
                               fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                               content_type="")
                koding.Add_Dir(name=_("Testings"),
                               url='{"file_name":"testings.xml"}',
                               mode="Testings",
                               folder=True,
                               icon=xbmcaddon.Addon().getAddonInfo("icon"),
                               fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                               content_type="")
            if enable_installa == 'true':
                koding.Add_Dir(
                    name='Download Backgrounds',
                    url='{"my_text":"INSTALLA[CR]!!!","my_desc":""}',
                    mode='dialog_specific',
                    folder=False,
                    icon=os.path.join(art_path, 'icon.png'),
                    fanart=os.path.join(art_path, 'fanart.jpg'))
        else:
            koding.Add_Dir(name=_("You must be logged in"),
                           url=_("You are not logged in"),
                           mode="message",
                           folder=False,
                           icon=xbmcaddon.Addon().getAddonInfo("icon"),
                           fanart=xbmcaddon.Addon().getAddonInfo("fanart"),
                           content_type="")
    except:
        failure = traceback.format_exc()
        xbmcgui.Dialog().textviewer(
            'Main Menu Exception - Report this to the developer', str(failure))
        pass
示例#15
0
# -*- coding: utf-8 -*-
示例#16
0
文件: xml.py 项目: uguer30/Project
# -*- coding: utf-8 -*-