本文整理汇总了Python中t0mm0.common.addon.Addon.add_item方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.add_item方法的具体用法?Python Addon.add_item怎么用?Python Addon.add_item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类t0mm0.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.add_item方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import add_item [as 别名]
test = addon.save_favorite()
if test is False:
addon.show_small_popup(msg='Unable to save favorite')
else:
addon.show_small_popup(msg='Favorite saved')
elif mode == 'deletefavorite':
addon.del_favorite()
elif mode == 'showfavorites':
favorites = addon.show_favorites( {'movies' : 'Movies', 'tv' : 'TV Shows' } )
if favorites:
cm.add_favorite('Delete favorite',{ 'mode' : 'deletefavorite'},
'deletefavorite', addon.queries['favtype'] )
for data in favorites:
if data['callback'] == 'play':
addon.add_item(data['url'], { 'title' : data['title']},
item_type=data['item_type'], cm=cm)
else:
addon.add_directory(data['queries'], data['title'], cm=cm)
if not play:
addon.end_of_directory()
示例2: int
# 需要导入模块: from t0mm0.common.addon import Addon [as 别名]
# 或者: from t0mm0.common.addon.Addon import add_item [as 别名]
url = addon.queries['url']
html = net.http_GET(url).content
r = "<h1>(.+?) \((\d+)\)</h1>.+<b>IMDB:</b>.+<span>tt(\d+)</span>"
meta = re.findall(r, html, re.DOTALL)
r = "<a.+?href=\"javascript:show\('(\w+?)','(.+?)', '(.+?)'.+?<b>(\d+)% said work.+?<\/b>"
regex = re.finditer(r, html, re.DOTALL)
for s in regex:
id, title, host, quality = s.groups()
addon.add_item({'host': host, 'media_id' : id},
{'title': u'%s (%s)' % (meta[0][0] , host),
'date': int(meta[0][1]),
'code': int(meta[0][2]),
'rating': float(quality),
'studio': host},
img=addon.queries['imageurl'],
is_folder=False,
item_type='video')
xbmcplugin.setContent( int( sys.argv[ 1 ] ), 'movies')
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_LABEL )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_STUDIO )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_UNSORTED )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RATING )
elif mode == 'main':
# addon.show_small_popup('t0mm0 test addon', 'Is now loaded enjoy', 6000, logo)
addon.add_directory({'mode': 'tv'}, {'title': 'TUBE+ TV'})
addon.add_directory({'mode': 'movies'}, {'title': 'TUBE+ Movies'})
addon.add_directory({'mode': 'movies', 'browse': 'latest'}, {'title': 'TUBE+ Movies (Latest Releases)'})