本文整理汇总了Python中xbmcplugin.addDirectoryItems函数的典型用法代码示例。如果您正苦于以下问题:Python addDirectoryItems函数的具体用法?Python addDirectoryItems怎么用?Python addDirectoryItems使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addDirectoryItems函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: listEpisodes
def listEpisodes(self, items, addSortMethods=True):
directoryItems = list()
for item in items:
if 'PrimaryAsset' not in item or 'Uri' not in item['PrimaryAsset'] or not item['PrimaryAsset']['Uri']:
continue
infoLabels = {
'title': item['Title']
}
if 'Description' in item:
infoLabels['plot'] = item['Description']
if 'PrimaryBroadcastStartTime' in item and item['PrimaryBroadcastStartTime'] is not None:
broadcastTime = self.parseDate(item['PrimaryBroadcastStartTime'])
if broadcastTime:
infoLabels['date'] = broadcastTime.strftime('%d.%m.%Y')
infoLabels['aired'] = broadcastTime.strftime('%Y-%m-%d')
infoLabels['year'] = int(broadcastTime.strftime('%Y'))
iconImage = item['PrimaryImageUri']
listItem = xbmcgui.ListItem(item['Title'], iconImage=iconImage)
listItem.setInfo('video', infoLabels)
listItem.setProperty('Fanart_Image', iconImage)
url = PATH + '?playVideo=' + item['Slug']
listItem.setProperty('IsPlayable', 'true')
listItem.addContextMenuItems(self.menuItems, False)
directoryItems.append((url, listItem))
xbmcplugin.addDirectoryItems(HANDLE, directoryItems)
if addSortMethods:
xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_DATE)
xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_TITLE)
xbmcplugin.endOfDirectory(HANDLE)
开发者ID:xbmc-danish-addons,项目名称:plugin.video.drnu,代码行数:32,代码来源:addon.py
示例2: getTabs
def getTabs(gturl, gtname):
ilist = []
url = gturl.replace(' ','%20')
html = getRequest(url)
html = re.compile('<section class="category-content full">(.+?)</section', re.DOTALL).search(html).group(1)
if '<li class="active">' in html:
getShows(gturl, gtname)
return
cats = re.compile('<a href="(.+?)" aria-label="(.+?)".+?</a', re.DOTALL).findall(html)
for url,name in cats:
try:
name = cleanname(name)
plot = name
mode = 'GL'
catname = gtname
if gtname != name: catname = catname+' - '+name
u = '%s?url=%s&name=%s&mode=%s' % (sys.argv[0],qp(url), qp(catname), mode)
liz=xbmcgui.ListItem(name, '','DefaultFolder.png', icon)
liz.setInfo( 'Video', { "Title": name, "Plot": plot })
liz.setProperty('fanart_image', addonfanart)
liz.setProperty('IsPlayable', 'true')
ilist.append((u, liz, False))
except:
pass
xbmcplugin.addDirectoryItems(int(sys.argv[1]), ilist, len(ilist))
开发者ID:NEOhidra,项目名称:plugin.video.cbc,代码行数:26,代码来源:default.py
示例3: list_categories
def list_categories():
"""
Create the list of categories in the Kodi interface.
Returns:
None
"""
categories = get_categories()
listing = []
for category in categories:
# Create a list item with a text label and a thumbnail image.
list_item = xbmcgui.ListItem(label=FEEDS[category]['name'], thumbnailImage=FEEDS[category]['icon'])
# set fanart
my_addon = xbmcaddon.Addon('plugin.audio.dancarlin')
#list_item.setProperty('fanart_image', my_addon.getAddonInfo('fanart'))
list_item.setArt({'fanart': my_addon.getAddonInfo('fanart')})
# Set additional info for the list item.
list_item.setInfo('video', {'title': category, 'genre': 'news'})
list_item.setInfo('audio', {'title': category, 'genre': 'news'})
# Create a URL for the plugin recursive callback.
# e.g., plugin://plugin.audio.dancarlin/?action=listing&category=common_sense
url = '{0}?action=listing&category={1}'.format(_url, category)
# is_folder = True means that this item opens a sub-list of lower level items.
is_folder = True
# Add our item to the listing as a 3-element tuple.
listing.append((url, list_item, is_folder))
# Add our listing to Kodi.
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)
开发者ID:izilly,项目名称:plugin.audio.dancarlin,代码行数:32,代码来源:main.py
示例4: list_episodes
def list_episodes(self, episodes):
if not episodes:
self.display_error(30000)
return
items = []
for episode in episodes:
fanart = episode['image']
info_labels = {
'title': episode['title'],
'plot' : episode['description'],
'aired' : episode['broadcast_date_time'],
'genre' : episode['program']['category']['name']
}
item = xbmcgui.ListItem(episode['title'], iconImage=fanart)
item.setInfo('video', info_labels)
item.setProperty('Fanart_Image', fanart)
url = self._build_url({'play_video': episode['id']})
item.setProperty('IsPlayable', 'true')
items.append((url, item))
xbmcplugin.addDirectoryItems(HANDLE, items)
xbmcplugin.endOfDirectory(HANDLE)
开发者ID:tmelin,项目名称:plugin.video.tv4.se,代码行数:25,代码来源:addon.py
示例5: LIST
def LIST(self, url):
if Debug: self.LOG('LIST()')
json = simplejson.loads(urllib.urlopen(url).read())
for entry in json['videos']:
id = entry['id']
title = entry['title']
description = entry['description']
_duration = entry['duration']
if _duration >= 3600 * 1000:
duration = time.strftime('%H:%M:%S', time.gmtime(_duration / 1000))
else:
duration = time.strftime('%M:%S', time.gmtime(_duration / 1000))
video = entry['cdn_asset_url']
channel = entry['channel_name']
thumbnail_version = entry['thumbnail_version']
thumbnail = 'http://img1.newslook.com/images/dyn/videos/%s/%s/pad/324/231/%s.jpg' % (id, thumbnail_version, id)
listitem = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage=thumbnail)
listitem.setProperty('IsPlayable', 'true')
listitem.setProperty('mimetype', 'video/mp4')
listitem.setInfo(type='video',
infoLabels={'title' : title,
'plot' : description,
'duration': duration,
})
xbmcplugin.addDirectoryItems(int(sys.argv[1]), [(video, listitem, False)])
# Content Type
xbmcplugin.setContent(int(sys.argv[1]), 'movies')
# Sort methods
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_NONE, label2Mask='%D')
# End of directory...
xbmcplugin.endOfDirectory(int(sys.argv[1]), True)
开发者ID:queeup,项目名称:plugin.video.newslook,代码行数:32,代码来源:addon.py
示例6: listVideos
def listVideos(self, programCards):
items = list()
if 'Data' in programCards:
programCards = programCards['Data']
for programCard in programCards:
if 'ProgramCard' in programCard:
programCard = programCard['ProgramCard']
if not 'PrimaryAssetUri' in programCard:
continue
infoLabels = self.createInfoLabels(programCard)
imageAsset = self.api.getAsset('Image', programCard)
if imageAsset:
iconImage = imageAsset['Uri']
else:
iconImage = ''
item = xbmcgui.ListItem(infoLabels['title'], iconImage=iconImage)
item.setInfo('video', infoLabels)
item.setProperty('Fanart_Image', iconImage)
url = PATH + '?videoasset=' + programCard['PrimaryAssetUri'] + '&urn=' + programCard['Urn']
item.setProperty('IsPlayable', 'true')
items.append((url, item))
xbmcplugin.addDirectoryItems(HANDLE, items)
xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_DATE)
xbmcplugin.addSortMethod(HANDLE, xbmcplugin.SORT_METHOD_TITLE)
xbmcplugin.endOfDirectory(HANDLE)
开发者ID:A61273,项目名称:plugin.video.drnu,代码行数:29,代码来源:addon.py
示例7: listVideos
def listVideos(tagId):
listing = map(toListItem, loadVideoList(tagId))
xbmcplugin.addDirectoryItems(_HANDLE, listing, len(listing))
xbmcplugin.addSortMethod(_HANDLE, xbmcplugin.SORT_METHOD_DATEADDED)
xbmcplugin.addSortMethod(_HANDLE, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.endOfDirectory(_HANDLE)
开发者ID:czoller,项目名称:werderkodi,代码行数:7,代码来源:main.py
示例8: ListShows
def ListShows(self, html):
self.log(u"", xbmc.LOGDEBUG)
listItems = []
try:
soup = BeautifulSoup(html, selfClosingTags=[u'img'])
episodes = soup.findAll(u'a', u"thumbnail-programme-link")
for episode in episodes:
self.AddEpisodeToList(listItems, episode)
xbmcplugin.addDirectoryItems( handle=self.pluginHandle, items=listItems )
xbmcplugin.endOfDirectory( handle=self.pluginHandle, succeeded=True )
return True
except (Exception) as exception:
if not isinstance(exception, LoggingException):
exception = LoggingException.fromException(exception)
if html is not None:
msg = "html:\n\n%s\n\n" % html
exception.addLogMessage(msg)
# Error getting list of shows
exception.addLogMessage(self.language(30049))
# Error getting list of shows
exception.process(severity = self.logLevel(xbmc.LOGERROR))
return False
开发者ID:vmware,项目名称:workflowTools,代码行数:28,代码来源:rte.py
示例9: ListAvailable
def ListAvailable(self, html):
self.log(u"", xbmc.LOGDEBUG)
listItems = []
try:
soup = BeautifulSoup(html, selfClosingTags=[u'img'])
count = int(soup.find(u'meta', { u'name' : u"episodes_available"} )[u'content'])
availableEpisodes = soup.findAll(u'a', u"thumbnail-programme-link")
for index in range ( 0, count ):
self.AddEpisodeToList(listItems, availableEpisodes[index])
xbmcplugin.addDirectoryItems( handle=self.pluginHandle, items=listItems )
xbmcplugin.endOfDirectory( handle=self.pluginHandle, succeeded=True )
return True
except (Exception) as exception:
if not isinstance(exception, LoggingException):
exception = LoggingException.fromException(exception)
if html is not None:
msg = "html:\n\n%s\n\n" % html
exception.addLogMessage(msg)
# Error getting count of available episodes
exception.addLogMessage(self.language(30045))
exception.process(self.language(30046), self.language(30045), self.logLevel(xbmc.LOGERROR))
return False
开发者ID:vmware,项目名称:workflowTools,代码行数:29,代码来源:rte.py
示例10: GetMiroFeed
def GetMiroFeed(self, url):
if Debug: self.LOG('GetMiroFeed()')
feedHtml = fetcher.fetch(url, CACHE_TIME)
encoding = feedHtml.split('encoding="')[1].split('"')[0]
feedHtml = feedHtml.decode(encoding, 'ignore').encode('utf-8')
feed = feedparser.parse(feedHtml)
for item in feed['items']:
infoLabels = {}
if item.link.startswith('http://www.miroguide.com/feeds/'):
id = item.link.replace('http://www.miroguide.com/feeds/', '')
else:
id = re.findall('/(.+?).jpeg', item.thumbnail)[0]
title = infoLabels['title'] = item.title.replace(''', "'").replace('&', '&').replace('"', '"')
if isinstance(title, str): # BAD: Not true for Unicode strings!
try:
title = infoLabels['title'] = title.encode('utf-8', 'replace') #.encode('utf-8')
except:
continue #skip this, it likely will bork
# I put it here because above isinstance code not working well with some languages.
title = infoLabels['title'] = title.encode('utf-8', 'replace') #.encode('utf-8')
try:
infoLabels['date'] = item.updated
except:
infoLabels['date'] = ''
subtitle = infoLabels['date']
soup = self.StripTags(item.description)#, convertEntities=BSS.HTML_ENTITIES
try:
infoLabels['plot'] = soup.contents[0]
except:
infoLabels['plot'] = item.description.encode('utf-8', 'ignore')
thumb = item.thumbnail
if thumb == '':
thumb = __icon__
feedUrl = item["summary_detail"]["value"].replace('amp;', '')
feedUrl = feedUrl[feedUrl.find('url1=') + 5:]
feedUrl = feedUrl[:feedUrl.find('&trackback1')].replace('%3A', ':')
feddUrl = feedUrl.replace(' ', '%20')
listitem = xbmcgui.ListItem(title, iconImage='DefaultVideo.png', thumbnailImage=thumb)
if self._issubscripted(id):
infoLabels['overlay'] = xbmcgui.ICON_OVERLAY_WATCHED
contextmenu = [(__language__(30102), 'XBMC.RunPlugin(%s?action=unsubscribe&id=%s)' % \
(sys.argv[0], id))]
else:
infoLabels['overlay'] = xbmcgui.ICON_OVERLAY_NONE
contextmenu = [(__language__(30101), 'XBMC.RunPlugin(%s?action=subscribe&id=%s&name=%s&feedurl=%s&thumbnail_url=%s&description=%s)' % \
(sys.argv[0], id, urllib.quote_plus(title), urllib.quote_plus(feedUrl), thumb, ''))]
listitem.setInfo(type='video', infoLabels=infoLabels)
listitem.addContextMenuItems(contextmenu, replaceItems=False)
parameters = '%s?action=getfeed&url=%s' % (sys.argv[0], urllib.quote_plus(feedUrl))
xbmcplugin.addDirectoryItems(int(sys.argv[1]), [(parameters, listitem, True)])
# Sort methods and content type...
xbmcplugin.setContent(int(sys.argv[1]), 'movie')
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
if infoLabels['date']:
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_DATE)
# End of directory...
xbmcplugin.endOfDirectory(int(sys.argv[1]), True)
开发者ID:queeup,项目名称:plugin.video.miro,代码行数:60,代码来源:addon.py
示例11: START
def START(self):
if Debug: self.LOG('START()')
category = []
# If keys exist in miro.db show My Subscription directory.
if db.keys() != list():
if Debug: self.LOG('My Subscriptions directory activated.')
category += [{'title':__language__(30201), 'url':'', 'action':'mysubscriptions'}, ]
db.close()
category += [{'title':__language__(30202), 'url':'https://www.miroguide.com/api/list_categories?datatype=json', 'action':'categories', 'filter':'category'},
{'title':__language__(30203), 'url':'https://www.miroguide.com/api/list_languages?datatype=json', 'action':'categories', 'filter':'language'},
{'title':__language__(30204), 'url':'http://feeds.feedburner.com/miroguide/new', 'action':'getmirofeed'},
{'title':__language__(30205), 'url':'http://feeds.feedburner.com/miroguide/featured', 'action':'getmirofeed'},
{'title':__language__(30206), 'url':'http://feeds.feedburner.com/miroguide/popular', 'action':'getmirofeed'},
{'title':__language__(30207), 'url':'http://feeds.feedburner.com/miroguide/toprated', 'action':'getmirofeed'},
{'title':__language__(30208), 'url':'https://www.miroguide.com/rss/tags/HD', 'action':'getmirofeed'},
#{'title':__language__(30209), 'url':'https://www.miroguide.com/rss/search/', 'action':'getmirofeed'},
]
for i in category:
try:
filter = i['filter']
except:
filter = ''
listitem = xbmcgui.ListItem(i['title'], iconImage='DefaultFolder.png', thumbnailImage=__icon__)
parameters = '%s?action=%s&url=%s&filter=%s' % \
(sys.argv[0], i['action'], urllib.quote_plus(i['url']), filter)
xbmcplugin.addDirectoryItems(int(sys.argv[1]), [(parameters, listitem, True)])
# Sort methods and content type...
xbmcplugin.addSortMethod(handle=int(sys.argv[1]), sortMethod=xbmcplugin.SORT_METHOD_NONE)
# End of directory...
xbmcplugin.endOfDirectory(int(sys.argv[1]), True)
开发者ID:queeup,项目名称:plugin.video.miro,代码行数:30,代码来源:addon.py
示例12: GetSubscriptions
def GetSubscriptions(self):
if Debug: self.LOG('GetSubscriptions()')
for k, v in db.iteritems():
id = k
name = v['name']
feedUrl = v['url']
if not feedUrl: continue
try: thumb = v['thumbnail_url']
except: pass
summary = v['description']
listitem = xbmcgui.ListItem(name, iconImage='DefaultVideo.png', thumbnailImage=thumb)
listitem.setInfo(type='video',
infoLabels={'title' : name,
'plot' : summary,
})
contextmenu = [(__language__(30102), 'XBMC.RunPlugin(%s?action=unsubscribe&id=%s)' % \
(sys.argv[0], id))]
listitem.addContextMenuItems(contextmenu, replaceItems=False)
parameters = '%s?action=getfeed&url=%s' % (sys.argv[0], urllib.quote_plus(feedUrl))
xbmcplugin.addDirectoryItems(int(sys.argv[1]), [(parameters, listitem, True)])
db.close()
# Sort methods and content type...
xbmcplugin.setContent(int(sys.argv[1]), 'movies')
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_VIDEO_TITLE)
# End of directory...
xbmcplugin.endOfDirectory(int(sys.argv[1]), True)
开发者ID:queeup,项目名称:plugin.video.miro,代码行数:27,代码来源:addon.py
示例13: list_categories
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)
开发者ID:caasiu,项目名称:xbmc-addons-chinese,代码行数:25,代码来源:addon.py
示例14: list_categories
def list_categories(offset):
#f=urllib2.urlopen('http://www.douyutv.com/directory')
#rr=BeautifulSoup(f.read())
rr=BeautifulSoup(requests.get('http://www.douyutv.com/directory',headers=headers).text)
catel=rr.findAll('a',{'class':'thumb'},limit=offset+PAGE_LIMIT+1)
rrr=[(x['href'], x.p.text,x.img['data-original']) for x in catel]
offset=int(offset)
if offset+PAGE_LIMIT<len(rrr):
rrr=rrr[offset:offset+PAGE_LIMIT]
nextpageflag=True
else:
rrr=rrr[offset:]
nextpageflag=False
listing=[]
for classname,textinfo,img in rrr:
list_item=xbmcgui.ListItem(label=textinfo,thumbnailImage=img)
#list_item.setProperty('fanart_image',img)
url=u'{0}?action=listing&category={1}&offset=0'.format(_url,classname)
is_folder=True
listing.append((url,list_item,is_folder))
if nextpageflag==True:
list_item=xbmcgui.ListItem(label=NEXT_PAGE)
url=u'{0}?offset={1}'.format(_url,str(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)
开发者ID:yangqian,项目名称:plugin.video.douyutv2,代码行数:29,代码来源:addon.py
示例15: getAtoZ
def getAtoZ(gzurl):
setContent("files")
ilist = []
azheaders = defaultHeaders
azheaders["X-Requested-With"] = "XMLHttpRequest"
pg = getRequest("http://video.pbs.org/programs/list", None, azheaders)
a = json.loads(pg)
for y in gzurl:
try:
b = a[y]
for x in b:
fullname = h.unescape("%s [%s]" % (x["title"], x["video_count"])).encode(UTF8)
name = h.unescape(x["title"]).encode(UTF8)
plot = h.unescape(x["producer"]).encode(UTF8)
url = ("program/%s" % (x["slug"])).encode(UTF8)
mode = "GV"
u = "%s?url=%s&name=%s&mode=%s" % (sys.argv[0], qp(url), qp(name), mode)
liz = xbmcgui.ListItem(fullname, "", icon, None)
# liz.setInfo( 'Video', { "Title": name, "Plot": plot })
liz.setProperty("Fanart_Image", addonfanart)
ilist.append((u, liz, True))
except:
pass
xbmcplugin.addDirectoryItems(int(sys.argv[1]), ilist, len(ilist))
endView("default_view")
开发者ID:NEOhidra,项目名称:plugin.video.thinktv,代码行数:25,代码来源:default.py
示例16: _create_listing
def _create_listing(self, context):
"""
Create a virtual folder listing
@param context: context dictionary
@type context: dict
@return:
"""
self.log('Creating listing from {0}'.format(str(context)), xbmc.LOGDEBUG)
if context.get('content'):
xbmcplugin.setContent(self._handle, context['content']) # This must be at the beginning
listing = []
for item in context['listing']:
if item.get('list_item') is not None:
list_item = item['list_item']
is_folder = item.get('is_folder', True)
else:
list_item = self.create_list_item(item)
if item.get('is_playable'):
list_item.setProperty('IsPlayable', 'true')
is_folder = False
else:
is_folder = item.get('is_folder', True)
listing.append((item['url'], list_item, is_folder))
xbmcplugin.addDirectoryItems(self._handle, listing, len(listing))
if context['sort_methods'] is not None:
[xbmcplugin.addSortMethod(self._handle, method) for method in context['sort_methods']]
xbmcplugin.endOfDirectory(self._handle,
context['succeeded'],
context['update_listing'],
context['cache_to_disk'])
if context['view_mode'] is not None:
xbmc.executebuiltin('Container.SetViewMode({0})'.format(context['view_mode']))
开发者ID:golimer,项目名称:tdw,代码行数:33,代码来源:simpleplugin.py
示例17: getPBSKidsVids
def getPBSKidsVids(kvurl, kvname):
ilist = []
pg = getRequest(uqp(kvurl).replace(" ", "+").replace("&", "%26"))
pg = pg.strip("()")
a = json.loads(pg)["items"]
for b in a:
name = b["title"]
plot = b["description"]
img = b["images"]["kids-mezzannine-16x9"]["url"]
try:
captions = b["captions"]["srt"]["url"]
except:
captions = ""
try:
url = b["videos"]["flash"]["mp4-2500k"]["url"]
except:
try:
url = b["videos"]["flash"]["mp4-1200k"]["url"]
except:
url = b["videos"]["flash"]["url"]
mode = "PKP"
u = "%s?url=%s&captions=%s&mode=%s" % (sys.argv[0], qp(url), qp(captions), mode)
liz = xbmcgui.ListItem(name, plot, "DefaultFolder.png", img)
liz.setInfo("Video", {"Title": name, "Studio": kvname, "Plot": plot})
liz.setProperty("IsPlayable", "true")
ilist.append((u, liz, False))
xbmcplugin.addDirectoryItems(int(sys.argv[1]), ilist, len(ilist))
开发者ID:NEOhidra,项目名称:plugin.video.thinktv,代码行数:28,代码来源:default.py
示例18: show_series_list
def show_series_list(afv, rfv, tp, s):
# global handle, plugin, root_url, lang
# import xml.etree.cElementTree as cET
if s is None:
common.show_message(lang(30003), lang(30004))
return False
xbmc.log("Start elementtree", 4)
root = ET.fromstring(s)
xbmc.log("end elementtree", 4)
xbmc.log("Start elementtree", 4)
xbmc.log("end elementtree", 4)
sl = root.findall('fp/serieslist/item')
channel_items = []
if sl:
for serie_obj in sl:
serie_channel = get_serial_channel(tp, serie_obj)
url = sys.argv[0] + '?f=show_episodes&id=' + serie_channel['id'] + '&tp=' + tp
item = get_list_item_for_serie_channel(serie_channel, tp, afv, rfv)
channel_items.append((url, item, True,))
xbmcplugin.addDirectoryItems(handle, channel_items, len(channel_items))
xbmcplugin.addSortMethod(handle, xbmcplugin.SORT_METHOD_TITLE)
xbmcplugin.endOfDirectory(handle)
else:
common.show_message(lang(30003), lang(30005))
xbmc.log("Prepare end", 4)
return True
开发者ID:relictMarauder,项目名称:kodi,代码行数:26,代码来源:series.py
示例19: showMainMenu
def showMainMenu(self):
items = list()
# A-Z Program Series
item = xbmcgui.ListItem(ADDON.getLocalizedString(30000),
iconImage=os.path.join(ADDON.getAddonInfo('path'), 'resources', 'icons', 'all.png'))
item.setProperty('Fanart_Image', FANART_IMAGE)
items.append((PATH + '?show=listAZ', item, True))
# Most viewed
item = xbmcgui.ListItem(ADDON.getLocalizedString(30011),
iconImage=os.path.join(ADDON.getAddonInfo('path'), 'resources', 'icons', 'eye.png'))
item.setProperty('Fanart_Image', FANART_IMAGE)
items.append((PATH + '?show=mostViewed', item, True))
# # Search videos
item = xbmcgui.ListItem(ADDON.getLocalizedString(30003),
iconImage=os.path.join(ADDON.getAddonInfo('path'), 'resources', 'icons', 'search.png'))
item.setProperty('Fanart_Image', FANART_IMAGE)
items.append((PATH + '?show=search', item, True))
# Recently watched Program Series
item = xbmcgui.ListItem(ADDON.getLocalizedString(30007),
iconImage=os.path.join(ADDON.getAddonInfo('path'), 'resources', 'icons',
'eye-star.png'))
item.setProperty('Fanart_Image', FANART_IMAGE)
items.append((PATH + '?show=recentlyWatched', item, True))
# Favorite Program Series
item = xbmcgui.ListItem(ADDON.getLocalizedString(30008),
iconImage=os.path.join(ADDON.getAddonInfo('path'), 'resources', 'icons', 'plusone.png'))
item.setProperty('Fanart_Image', FANART_IMAGE)
items.append((PATH + '?show=favorites', item, True))
xbmcplugin.addDirectoryItems(HANDLE, items)
xbmcplugin.endOfDirectory(HANDLE)
开发者ID:A61273,项目名称:plugin.video.drnu,代码行数:31,代码来源:addon.py
示例20: getSources
def getSources():
ilist = []
url = 'http://www.hallmarkchanneleverywhere.com/Movies?NodeID=28'
name = 'Movies'
u = '%s?url=%s&name=%s&mode=%s' % (sys.argv[0],qp(url), qp(name), 'GM')
liz=xbmcgui.ListItem(name, '',icon, None)
liz.setProperty('fanart_image', addonfanart)
ilist.append((u, liz, True))
html = getRequest('http://www.hallmarkchanneleverywhere.com/Series?NodeID=29')
c = re.compile('<div class="imageviewitem">.+?src="(.+?)".+?class="commontitle" href="(.+?)">(.+?)<',re.DOTALL).findall(html)
for img, url, name in c:
img = HALLMARKBASE % img
name = h.unescape(name.decode(UTF8))
url = HALLMARKBASE % url.replace('&','&')
html = getRequest(url)
plot = re.compile('<div id="imageDetail">.+?</div>(.+?)<', re.DOTALL).search(html).group(1)
plot = h.unescape(plot.decode(UTF8)).strip()
infoList ={}
infoList['Title'] = name
infoList['Plot'] = plot
u = '%s?url=%s&name=%s&mode=GE' % (sys.argv[0], qp(url), qp(name))
liz=xbmcgui.ListItem(name, '',None, img)
liz.setInfo( 'Video', infoList)
liz.setProperty('fanart_image', addonfanart)
ilist.append((u, liz, True))
xbmcplugin.addDirectoryItems(int(sys.argv[1]), ilist, len(ilist))
if addon.getSetting('enable_views') == 'true':
xbmc.executebuiltin("Container.SetViewMode(%s)" % addon.getSetting('default_view'))
xbmcplugin.endOfDirectory(int(sys.argv[1]))
开发者ID:NEOhidra,项目名称:plugin.video.hallmark,代码行数:31,代码来源:default.py
注:本文中的xbmcplugin.addDirectoryItems函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论