python类endOfDirectory()的实例源码

addon.py 文件源码 项目:kodi-fsgo 作者: emilsvennesson 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def list_upcoming_days():
    event_dates = fsgo.get_event_dates()
    now = datetime.now()
    date_today = now.date()

    for date in event_dates:
        if date > date_today:
            title = date.strftime('%Y-%m-%d')
            params = {
                'action': 'list_events_by_date',
                'schedule_type': 'all',
                'filter_date': date
            }

            add_item(title, params)
    xbmcplugin.endOfDirectory(_handle)
listtv.py 文件源码 项目:plugin.video.amazon65 作者: phil65 项目源码 文件源码 阅读 14 收藏 0 点赞 0 评论 0
def LIST_TVSHOWS_CATS():
    import tv as tvDB
    id_ = common.args.url
    if id_:
        asins = tvDB.lookupTVdb(id_, rvalue='asins', name='title', tbl='categories')
        epidb = tvDB.lookupTVdb('', name='asin', rvalue='asin, seasonasin', tbl='episodes', single=False)
        if not asins:
            return
        for asin in asins.split(','):
            seasonasin = None
            for epidata in epidb:
                if asin in str(epidata):
                    seasonasin = epidata[1]
                    break
            if not seasonasin:
                seasonasin = asin
            for seasondata in tvDB.loadTVSeasonsdb(seasonasin=seasonasin).fetchall():
                ADD_SEASON_ITEM(seasondata, disptitle=True)
        common.SetView('seasons')
    else:
        for title in tvDB.lookupTVdb('', name='asins', tbl='categories', single=False):
            if title:
                common.addDir(title[0], 'listtv', 'LIST_TVSHOWS_CATS', title[0])
        xbmcplugin.endOfDirectory(pluginhandle, updateListing=False)
addon.py 文件源码 项目:plugin.video.zhanqitv 作者: leeeboo 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def list_categories():

    listing=[]
    list_item = xbmcgui.ListItem(label='??', thumbnailImage='')
    url='{0}?action=game_list'.format(_url)
    is_folder=True
    listing.append((url, list_item, is_folder))

    list_item = xbmcgui.ListItem(label='Lyingman', thumbnailImage='')
    url='{0}?action=lyingman'.format(_url)
    is_folder=True
    listing.append((url, list_item, is_folder))

    xbmcplugin.addDirectoryItems(_handle,listing,len(listing))
    #xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
    # Finish creating a virtual folder.
    xbmcplugin.endOfDirectory(_handle)
addon.py 文件源码 项目:plugin.video.zhanqitv 作者: leeeboo 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def game_list():

    f = urllib2.urlopen('http://www.zhanqi.tv/api/static/game.lists/100-1.json?rand={ts}'.format(ts=time.time()))

    obj = json.loads(f.read())

    listing=[]
    for game in obj['data']['games']:
        list_item = xbmcgui.ListItem(label=game['name'], thumbnailImage=game['bpic'])
        list_item.setProperty('fanart_image', game['bpic'])
        url='{0}?action=room_list&game_id={1}'.format(_url, game['id'])

        #xbmc.log(url, 1)

        is_folder=True
        listing.append((url, list_item, is_folder))

    xbmcplugin.addDirectoryItems(_handle,listing,len(listing))
    #xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
    # Finish creating a virtual folder.
    xbmcplugin.endOfDirectory(_handle)
addon.py 文件源码 项目:plugin.video.zhanqitv 作者: leeeboo 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def room_list(game_id):

    f = urllib2.urlopen('http://www.zhanqi.tv/api/static/game.lives/{game_id}/100-1.json?rand={ts}'.format(game_id=game_id, ts=time.time()))

    obj = json.loads(f.read())

    listing=[]
    for room in obj['data']['rooms']:
        list_item = xbmcgui.ListItem(label=room['title'], thumbnailImage=room['bpic'])
        list_item.setProperty('fanart_image', room['bpic'])
        url='{0}?action=play&room_id={1}'.format(_url, room['id'])
        is_folder=False
        listing.append((url, list_item, is_folder))
    xbmcplugin.addDirectoryItems(_handle, listing, len(listing))
    #xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
    # Finish creating a virtual folder.
    xbmcplugin.endOfDirectory(_handle)
odeon.py 文件源码 项目:odeon-kodi 作者: arsat 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def list_prods(params):
    """ Arma la lista de producciones del menu principal """
    # parámetros optativos
    items = int(addon.getSetting('itemsPerPage'))
    page = int(params.get('pag', '1'))
    orden = params.get('orden')

    if 'tvod' in params['url']:
        xbmcgui.Dialog().ok(translation(30033), translation(30034))

    path = '{0}?perfil={1}&cant={2}&pag={3}'.format(params['url'], PID, items, page)
    if orden: path += '&orden={0}'.format(orden)
    prod_list = json_request(path)

    # lista todo menos temporadas, episodios y elementos de compilados
    for prod in prod_list['prods']:
        add_film_item(prod, params)

    if len(prod_list['prods']) == items:
        query = 'list_prods&url={0}&pag={1}'.format(quote(params['url']), page+1)
        if orden: query += '&orden={0}'.format(orden)
        add_directory_item(translation(30031), query, 'folder-movies.png')

    xbmcplugin.endOfDirectory(addon_handle)
addon.py 文件源码 项目:plugin.video.eyny 作者: lydian 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def main(self):
        filters = self.eyny.list_filters()
        xbmcplugin.addDirectoryItem(
                handle=self.addon_handle,
                url=self._build_url('search'),
                listitem=xbmcgui.ListItem('Search'),
                isFolder=True)

        for category in filters['categories']:
            li = xbmcgui.ListItem(category['name'])
            xbmcplugin.addDirectoryItem(
                handle=self.addon_handle,
                url=self._build_url('list', cid=category['cid']),
                listitem=li,
                isFolder=True)
        for orderby in filters['mod']:
            li = xbmcgui.ListItem(orderby['name'])
            xbmcplugin.addDirectoryItem(
                handle=self.addon_handle,
                url=self._build_url('list', orderby=orderby['orderby']),
                listitem=li,
                isFolder=True)
        xbmcplugin.endOfDirectory(addon_handle)
addon.py 文件源码 项目:plugin.video.eyny 作者: lydian 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def list_video(self, cid=None, page=1, orderby='channel'):
        try:
            result = self.eyny.list_videos(cid=cid, page=page, mod=orderby)
        except ValueError as e:
            xbmcgui.Dialog().ok(
                heading='Error',
                line1=unicode(e).encode('utf-8'))
            return

        self._add_video_items(result['videos'], result['current_url'])
        if page < int(result['last_page']):
            self._add_page_item(
                page+1,
                result['last_page'],
                'list', orderby=orderby, cid=cid)
        xbmcplugin.endOfDirectory(self.addon_handle)
addon.py 文件源码 项目:plugin.video.eyny 作者: lydian 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def search_video(self, search_string=None, page=1):
        if search_string is None:
            search_string = xbmcgui.Dialog().input(
                'Search term',
                type=xbmcgui.INPUT_ALPHANUM)
        result = self.eyny.search_video(search_string, page=page)

        self._add_video_items(result['videos'], result['current_url'])
        if page < int(result['last_page']):
            self._add_page_item(
                page + 1,
                result['last_page'],
                'search',
                search_string=search_string
            )
        xbmcplugin.endOfDirectory(self.addon_handle)
navigation.py 文件源码 项目:plugin.video.skygo 作者: trummerjo 项目源码 文件源码 阅读 32 收藏 0 点赞 0 评论 0
def rootDir():
    print sys.argv
    nav = getNav()
    #Livesender
    liveChannelsDir()
    #Navigation der Ipad App
    for item in nav:
        if item.attrib['hide'] == 'true' or item.tag == 'item':
            continue
        url = common.build_url({'action': 'listPage', 'id': item.attrib['id']})
        addDir(item.attrib['label'], url)
        li = xbmcgui.ListItem(item.attrib['label'])

    #Merkliste
    watchlistDir()
    #Suchfunktion
    url = common.build_url({'action': 'search'})
    addDir('Suche', url)

    xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.endOfDirectory(addon_handle, cacheToDisc=True)
navigation.py 文件源码 项目:plugin.video.skygo 作者: trummerjo 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def listSeasonsFromSeries(series_id):
    url = skygo.baseUrl + '/sg/multiplatform/web/json/details/series/' + str(series_id) + '_global.json'
    r = requests.get(url)
    data = r.json()['serieRecap']['serie']
    xbmcplugin.setContent(addon_handle, 'seasons')
    for season in data['seasons']['season']:
        url = common.build_url({'action': 'listSeason', 'id': season['id'], 'series_id': data['id']})
        label = '%s - Staffel %02d' % (data['title'], season['nr'])
        li = xbmcgui.ListItem(label=label)
        li.setProperty('IsPlayable', 'false')
        li.setArt({'poster': skygo.baseUrl + season['path'], 
                   'fanart': getHeroImage(data)})
        li.setInfo('video', {'plot': data['synopsis'].replace('\n', '').strip()})
        xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,
                                        listitem=li, isFolder=True)

    xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_NONE)
    xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_TITLE)
    xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR)   
    xbmcplugin.endOfDirectory(addon_handle, cacheToDisc=True)
navigation.py 文件源码 项目:plugin.video.skygo 作者: trummerjo 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def listPage(page_id):
    nav = getNav()
    items = getPageItems(nav, page_id)
    if len(items) == 1:
        if 'path' in items[0].attrib:
            listPath(items[0].attrib['path'])
            return
    for item in items:
        url = ''
        if item.tag == 'item':
            url = common.build_url({'action': 'listPage', 'path': item.attrib['path']})
        elif item.tag == 'section':
            url = common.build_url({'action': 'listPage', 'id': item.attrib['id']})

        addDir(item.attrib['label'], url)

    if len(items) > 0:
        xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_NONE)
        xbmcplugin.addSortMethod(handle=addon_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL)
        xbmcplugin.endOfDirectory(addon_handle, cacheToDisc=True)
default.py 文件源码 项目:plugin.video.uwc 作者: laynlow 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def INDEXT():
    utils.addDir('[COLOR hotpink]BubbaPorn[/COLOR]','http://www.bubbaporn.com/page1.html',90,os.path.join(imgDir, 'bubba.png'),'')
    utils.addDir('[COLOR hotpink]Poldertube.nl[/COLOR] [COLOR orange](Dutch)[/COLOR]','http://www.poldertube.nl/pornofilms/nieuw',100,os.path.join(imgDir, 'poldertube.png'),0)
    utils.addDir('[COLOR hotpink]Milf.nl[/COLOR] [COLOR orange](Dutch)[/COLOR]','http://www.milf.nl/videos/nieuw',100,os.path.join(imgDir, 'milfnl.png'),1)
    utils.addDir('[COLOR hotpink]Sextube.nl[/COLOR] [COLOR orange](Dutch)[/COLOR]','http://www.sextube.nl/videos/nieuw',100,os.path.join(imgDir, 'sextube.png'),2)
    utils.addDir('[COLOR hotpink]TubePornClassic[/COLOR]','http://www.tubepornclassic.com/latest-updates/',360,os.path.join(imgDir, 'tubepornclassic.png'),'')
    utils.addDir('[COLOR hotpink]HClips[/COLOR]','http://www.hclips.com/latest-updates/',380,os.path.join(imgDir, 'hclips.png'),'')
    utils.addDir('[COLOR hotpink]PornHub[/COLOR]','http://www.pornhub.com/newest.html',390,os.path.join(imgDir, 'pornhub.png'),'')
    utils.addDir('[COLOR hotpink]Porndig[/COLOR] [COLOR white]Professional[/COLOR]','http://www.porndig.com',290,os.path.join(imgDir, 'porndig.png'),'')
    utils.addDir('[COLOR hotpink]Porndig[/COLOR] [COLOR white]Amateurs[/COLOR]','http://www.porndig.com',290,os.path.join(imgDir, 'porndig.png'),'')
    utils.addDir('[COLOR hotpink]AbsoluPorn[/COLOR]','http://www.absoluporn.com/en/',300,os.path.join(imgDir, 'absoluporn.gif'),'')
    utils.addDir('[COLOR hotpink]Anybunny[/COLOR]','http://anybunny.com/',320,os.path.join(imgDir, 'anybunny.png'),'')    
    utils.addDir('[COLOR hotpink]SpankBang[/COLOR]','http://spankbang.com/new_videos/',440,os.path.join(imgDir, 'spankbang.png'),'')    
    utils.addDir('[COLOR hotpink]Amateur Cool[/COLOR]','http://www.amateurcool.com/most-recent/',490,os.path.join(imgDir, 'amateurcool.png'),'')    
    utils.addDir('[COLOR hotpink]Vporn[/COLOR]','https://www.vporn.com/newest/',500,os.path.join(imgDir, 'vporn.png'),'')
    utils.addDir('[COLOR hotpink]xHamster[/COLOR]','https://xhamster.com/',505,os.path.join(imgDir, 'xhamster.png'),'')
    xbmcplugin.endOfDirectory(utils.addon_handle, cacheToDisc=False)
addon.py 文件源码 项目:crossplatform_iptvplayer 作者: j00zek 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def getDownloaderStatus():
    for filename in os.listdir(ADDON.getSetting("config.plugins.iptvplayer.NaszaSciezka")):
        if filename.endswith('.wget'):
            myLog('Found: [%s]' % filename)
            list_item = xbmcgui.ListItem(label = filename[:-5])
            url = get_url(action='wgetRead', fileName=filename)
            is_folder = False
            last_Lines = ''
            with open(os.path.join(ADDON.getSetting("config.plugins.iptvplayer.NaszaSciezka") , filename)) as f:
                last_Lines = f.readlines()[-5:]
                f.close()
            if ''.join(last_Lines).find('100%') > 0:
                list_item.setArt({'thumb': xbmc.translatePath('special://home/addons/plugin.video.IPTVplayer/resources/icons/done.png')})
            else:
                list_item.setArt({'thumb': xbmc.translatePath('special://home/addons/plugin.video.IPTVplayer/resources/icons/progress.png')})
            xbmcplugin.addDirectoryItem(ADDON_handle, url, list_item, is_folder)
    #last but not least delete all status files        
    list_item = xbmcgui.ListItem(label = _(30434))
    url = get_url(action='wgetDelete')
    is_folder = False
    list_item.setArt({'thumb': xbmc.translatePath('special://home/addons/plugin.video.IPTVplayer/resources/icons/delete.png')})
    xbmcplugin.addDirectoryItem(ADDON_handle, url, list_item, is_folder)
    #closing directory
    xbmcplugin.endOfDirectory(ADDON_handle)
    return
addon.py 文件源码 项目:crossplatform_iptvplayer 作者: j00zek 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def SelectHost():
    for host in HostsList:
            if ADDON.getSetting(host[0]) == 'true':
                hostName = host[1].replace("https:",'').replace("http:",'').replace("/",'').replace("www.",'')
                hostImage = '%s/icons/%s.png' % (ADDON.getSetting("kodiIPTVpath"), host[0])
                list_item = xbmcgui.ListItem(label = hostName)
                list_item.setArt({'thumb': hostImage,})
                list_item.setInfo('video', {'title': hostName, 'genre': hostName})
                url = get_url(action='startHost', host=host[0])
                myLog(url)
                is_folder = True
                # Add our item to the Kodi virtual folder listing.
                xbmcplugin.addDirectoryItem(ADDON_handle, url, list_item, is_folder)
    # Add a sort method for the virtual folder items (alphabetically, ignore articles)
    xbmcplugin.addSortMethod(ADDON_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
    # Finish creating a virtual folder.
    xbmcplugin.endOfDirectory(ADDON_handle)
    return
default.py 文件源码 项目:nuodtayo.tv 作者: benaranguren 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def showSubCategories(url, category_id):
    """Show sub category

    Under Shows category, typically this is a list
    - All Shows
    - Drama
    - Subtitled Show
    - etc
    """

    html = callServiceApi(url)
    main_nav = common.parseDOM(html, "div",
                               attrs={'id': 'main_nav_desk'})[0]
    sub_categories = \
        common.parseDOM(main_nav, 'li', attrs={'class': 'has_children'})

    for sc in sub_categories:
        a = common.parseDOM(sc, 'a', attrs={'data-id': str(category_id)})
        if len(a) > 0:
            ul = common.parseDOM(sc, 'ul', attrs={'class': 'menu_item'})[0]
            for li in common.parseDOM(ul, 'li'):
                url = common.parseDOM(li, 'a', ret='href')[0]
                name = common.parseDOM(li, 'a')[0]
                addDir(common.replaceHTMLCodes(name), url,
                       Mode.SHOW_LIST, 'menu_logo.png')
            break

    xbmcplugin.endOfDirectory(thisPlugin)
default.py 文件源码 项目:cmik.xbmc 作者: cmik 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def showMainMenu():
    checkAccountChange()
    # cleanCookies(False)

    # if not logged in, ask to log in
    if isLoggedIn() == False:
        if (confirm(lang(57007), line1=lang(57008) % setting('emailAddress'))):
            (account, logged) = checkAccountChange(True)
            if logged == True:
                user = getUserInfo()
                showNotification(lang(57009) % user.get('FirstName', 'back to TFC'), title='')
            else:
                showNotification(lang(50205), title=lang(50204))

    # if setting('displayMostLovedShows') == 'true':
        # addDir('Most Loved Shows', '/', 5, 'icon.png')

    if setting('displayWebsiteSections') == 'true':
        addDir('By Category', '/', 10, 'icon.png')
    else:
        showCategories()

    if setting('displayWebsiteSections') == 'true':
        sections = getWebsiteHomeSections()
        for s in sections:
            addDir(s['name'].title(), str(s['id']), 11, 'icon.png')

    if setting('displayMyAccountMenu') == 'true':    
        addDir('My Account', '/', 12, 'icon.png')

    if setting('displayTools') == 'true':
        addDir('Tools', '/', 50, 'icon.png')

    xbmcplugin.endOfDirectory(thisPlugin)
default.py 文件源码 项目:cmik.xbmc 作者: cmik 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def showCategories():   
    categories = lCacheFunction(getCategories)
    for c in categories:
        addDir(c['name'], str(c['id']), 1, 'icon.png')

    if setting('displayWebsiteSections') == 'true':
        xbmcplugin.endOfDirectory(thisPlugin)
default.py 文件源码 项目:cmik.xbmc 作者: cmik 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def showTools():
    addDir('Reload Catalog Cache', '/', 51, 'icon.png')
    addDir('Clean cookies file', '/', 52, 'icon.png')
    xbmcplugin.endOfDirectory(thisPlugin)
default.py 文件源码 项目:cmik.xbmc 作者: cmik 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def showSubCategories(categoryId):
    subCategories = lCacheFunction(getSubCategories, categoryId)
    for s in subCategories:
        addDir(s['name'], str(s['id']), 2, 'menu_logo.png')
    xbmcplugin.endOfDirectory(thisPlugin)


问题


面经


文章

微信
公众号

扫码关注公众号