Python xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE Examples

The following are 8 code examples of xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module xbmcplugin , or try the search function .
Example #1
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 6 votes vote down vote up
def room_list(game_id):
    if game_id == 'ALL':
        apiurl = 'http://api.m.panda.tv/ajax_live_lists'
        params = 'pageno=1&pagenum=100&status=2&order=person_num&sproom=1&__version=2.0.1.1481&__plat=android&banner=1'
    else:
        apiurl = "http://api.m.panda.tv/ajax_get_live_list_by_cate"
        params = "__plat=iOS&__version=1.0.5.1098&cate={ename}&order=person_num&pageno=1&pagenum=100&status=2".format(ename=game_id)

    returndata = post(apiurl, params);

    obj = json.loads(returndata)

    listing=[]
    for room in obj['data']['items']:
        title = TITLE_PATTERN.format(topic=room['name'].encode('utf-8'), author=room['userinfo']['nickName'].encode('utf-8'), view_count=room['person_num'].encode('utf-8'))
        list_item = xbmcgui.ListItem(label=title, thumbnailImage=room['pictures']['img'])
        list_item.setProperty('fanart_image', room['pictures']['img'])
        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) 
Example #2
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 6 votes vote down vote up
def list_categories(article):
    html = get(_meijumao + article )
    soup = BeautifulSoup(html,"html5lib")
    listing = []
    for urls in  soup.find_all("a",attrs={"data-remote":"true"}):
        list_item = xbmcgui.ListItem(label=urls.div.get_text())
        url='{0}?action=list_sections&section={1}'.format(_url, urls.get("href").replace(_meijumao,""))
        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)


# get sections 
Example #3
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 6 votes vote down vote up
def list_categories():

    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) 
Example #4
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 6 votes vote down vote up
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) 
Example #5
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 5 votes vote down vote up
def list_videos(category,offset=0):
    #request=urllib2.Request('http://www.douyu.com'+category,headers=headers)
    #f=urllib2.urlopen(request)
    #f=urllib2.urlopen('http://www.douyu.com'+category)
    #r=f.read()
    #rr=BeautifulSoup(r)
    rr=BeautifulSoup(requests.get('http://www.douyu.com'+category,headers=headers).text)
    videol=rr.findAll('a',{'class':'play-list-link'},limit=offset+PAGE_LIMIT+1)
    listing=[]
    #with open('rooml.dat','w') as f:
    #  f.writelines([str(x) for x in videol])
    if offset+PAGE_LIMIT<len(videol):
      videol=videol[offset:offset+PAGE_LIMIT]
      nextpageflag=True
    else:
      videol=videol[offset:]
      nextpageflag=False
    for x in videol:
        roomid=x['href'][1:]
        img=x.img['data-original']
        title=x['title']
        nickname=x.find('span',{'class':'dy-name ellipsis fl'}).text
        view=x.find('span',{'class':'dy-num fr'}).text
        liveinfo=u'{0}:{1}:{2}'.format(nickname,title,view)
        list_item=xbmcgui.ListItem(label=liveinfo,thumbnailImage=img)
        #list_item.setProperty('fanart_image',img)
        url='{0}?action=play&video={1}'.format(_url,roomid)
        is_folder=False
        listing.append((url,list_item,is_folder))
    if nextpageflag==True:
        list_item=xbmcgui.ListItem(label=NEXT_PAGE)
        url='{0}?action=listing&category={1}&offset={2}'.format(_url,category,offset+PAGE_LIMIT)
        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) 
Example #6
Source File: main.py    From plugin.video.areena with GNU General Public License v2.0 5 votes vote down vote up
def list_categories(base_category):
    """
    Create the list of the categories in the Kodi interface.
    :param base_category: the parent category to require from all categories
    :return: None
    """
    listing = list_sub_categories(base_category)
    # Add our listing to Kodi.
    # Large lists and/or slower systems benefit from adding all items at once via addDirectoryItems
    # instead of adding one by ove via addDirectoryItem.
    xbmcplugin.addDirectoryItems(_handle, listing, len(listing))
    # Add a sort method for the virtual folder items (alphabetically, ignore articles)
    xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
    # Finish creating a virtual folder.
    xbmcplugin.endOfDirectory(_handle) 
Example #7
Source File: main.py    From plugin.video.areena with GNU General Public License v2.0 5 votes vote down vote up
def list_streams(listing, streams, offset_url, item_limit=25):
    """
    Create the list of playable streams in the Kodi interface.
    :param listing: list for the streams. Can include some fixed elements
    :param streams: json of streams to list
    :param offset_url: url that opens next page of streams
    :param item_limit: maximum number of items per page
    :return: None
    """
    # Iterate through the streams.
    for stream in streams:
        list_item = create_list_item_from_stream(stream)
        if list_item is None:
            continue
        # Create a URL for the plugin recursive callback.
        # Example: plugin://plugin.video.example/?action=play&video=http://www.vidsplay.com/vids/crab.mp4
        url = '{0}?action=play&stream={1}'.format(_url, stream['id'])
        # Add the list item to a virtual Kodi folder.
        # is_folder = False means that this item won't open any sub-list.
        is_folder = False
        # Add our item to the listing as a 3-element tuple.
        listing.append((url, list_item, is_folder))
    if len(listing) >= item_limit:
        list_item = xbmcgui.ListItem(label='[COLOR {0}]{1}[/COLOR]'.format(
            get_color('menuItemColor'), get_translation(32008)))
        listing.append((offset_url, list_item, True))
    # Add our listing to Kodi.
    # Large lists and/or slower systems benefit from adding all items at once via addDirectoryItems
    # instead of adding one by ove via addDirectoryItem.
    xbmcplugin.addDirectoryItems(_handle, listing, len(listing))
    # Add a sort method for the virtual folder items (alphabetically, ignore articles)
    # xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
    # Finish creating a virtual folder.
    xbmcplugin.endOfDirectory(_handle)
    xbmcplugin.setContent(_handle, 'movies') 
Example #8
Source File: addon.py    From xbmc-addons-chinese with GNU General Public License v2.0 4 votes vote down vote up
def list_categories():

    f = urllib2.urlopen('http://api.m.panda.tv/ajax_get_all_subcate?__version=1.0.5.1098&__plat=iOS')

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

    listing=[]

    list_item = xbmcgui.ListItem(label='全部直播')
    # list_item.setProperty('fanart_image', game['img'])
    url='{0}?action=all'.format(_url)
    listing.append((url, list_item, True))

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

        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)


# def all_list():
#     html = urllib2.urlopen('https://www.panda.tv/all').read()
# 
#     room_ids = re.findall(r'<a href="/\d+" class="video-list-item-wrap" data-id="(\d+)">', html)
#     room_infos = RE_ROOM_INFOS.findall(html, re.MULTILINE)
#     room_imgs = RE_ROOM_IMG.findall(html)
# 
#     listing=[]
#     for i, room_id in enumerate(room_ids):
#         room_name, author, view_count = room_infos[i]
#         img = room_imgs[i]
#         title = TITLE_PATTERN.format(topic=room_name, author=author, view_count=view_count)
#         list_item = xbmcgui.ListItem(label=title, thumbnailImage=img)
#         list_item.setProperty('fanart_image', img)
#         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.endOfDirectory(_handle)