本文整理汇总了Python中addon.common.addon.Addon.add_video_item方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.add_video_item方法的具体用法?Python Addon.add_video_item怎么用?Python Addon.add_video_item使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.add_video_item方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: eval
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_video_item [as 别名]
next_page = args['next'][0]
except:
next_page = None
exec "from resources.lib.sources.live_sport import %s"%site
info = eval(site+".info()")
if not info.categorized:
if next_page:
source = eval(site+".main(url=next_page)")
else:
source = eval(site+".main()")
events = source.events()
for event in events:
if not info.multilink:
browser = 'plugin://plugin.program.chrome.launcher/?url=%s&mode=showSite&stopPlayback=no'%(event[0])
context = [('Open in browser','RunPlugin(%s)'%browser)]
addon.add_video_item({'mode': 'play_special_sport', 'url': event[0], 'title':event[1], 'img': icon_path(info.icon),'site':site}, {'title': event[1]}, img=icon_path(info.icon), fanart=fanart, contextmenu_items=context)
else:
addon.add_item({'mode': 'get_sport_event','site':site, 'url': event[0], 'title':event[1], 'img': icon_path(info.icon)}, {'title': event[1]}, img=icon_path(info.icon), fanart=fanart,is_folder=True)
if (info.paginated and source.next_page()):
addon.add_item({'mode': 'open_live_sport', 'site': info.mode, 'next' : source.next_page()}, {'title': 'Next Page >>'}, img=icon_path(info.icon), fanart=fanart,is_folder=True)
else:
source = eval(site+".main()")
categories = source.categories()
for cat in categories:
addon.add_item({'mode': 'open_sport_cat', 'url': cat[0], 'site': info.mode}, {'title': cat[1]}, img=icon_path(cat[2]), fanart=fanart,is_folder=True)
addon.end_of_directory()
示例2: get_url
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_video_item [as 别名]
elif mode == 'classics':
html = get_url(url)
page = int(page_num)
if page > 1:
addon.add_directory({'mode': 'mainexit'}, {'title': '[COLOR red]Back to Main Menu[/COLOR]'}, img=icon_path + 'back_arrow.png')
if page < 4:
page = page + 1
addon.add_directory({'mode': 'classics', 'url': classic_shows_url % page, 'page_num': page}, {'title': '[COLOR blue]Next Page[/COLOR]'}, img=icon_path + 'next_arrow.png')
match = re.compile('<a Title="" href="(.+?)" target="img_m"><img border="0" src="(.+?)" style="filter:alpha\(opacity=50\); -moz-opacity:0.5" onMouseover="lightup\(this, 100\)" onMouseout="lightup\(this, 30\)" width="110" height="80"></a>(.+?)</td>').findall(html)
for link, thumb, name in match:
if not re.search('http://', thumb):
thumb = main_url + thumb
addon.add_video_item({'mode': 'channel', 'url': link}, {'title': name}, img=thumb)
elif mode == 'livetv':
html = get_url(url)
page = int(page_num)
if page > 1:
addon.add_directory({'mode': 'mainexit'}, {'title': '[COLOR red]Back to Main Menu[/COLOR]'}, img=icon_path + 'back_arrow.png')
if page < 4:
page = page + 1
addon.add_directory({'mode': 'livetv', 'url': livetv_pages % page, 'page_num': page}, {'title': '[COLOR blue]Next Page[/COLOR]'}, img=icon_path + 'next_arrow.png')
match = re.compile('<td width="100%" .+? href="(.+?)" target="img_m"><img border="0" src="(.+?)" style=.+?></a>(.+?)</td>').findall(html)
for link, thumb, name in match:
示例3: eval
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_video_item [as 别名]
if next_page:
source = eval(site + ".main(url=next_page)")
else:
source = eval(site + ".main()")
events = source.events()
for event in events:
if not info.multilink:
browser = "plugin://plugin.program.chrome.launcher/?url=%s&mode=showSite&stopPlayback=no" % (event[0])
context = [("Open in browser", "RunPlugin(%s)" % browser)]
addon.add_video_item(
{
"mode": "play_special_sport",
"url": event[0],
"title": event[1],
"img": icon_path(info.icon),
"site": site,
},
{"title": event[1]},
img=icon_path(info.icon),
fanart=fanart,
contextmenu_items=context,
)
else:
addon.add_item(
{
"mode": "get_sport_event",
"site": site,
"url": event[0],
"title": event[1],
"img": icon_path(info.icon),
},
示例4: get_http_error
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_video_item [as 别名]
addon.add_directory({'mode': 'plinkettreviews', 'url': link}, {'title': name})
elif mode == 'plinkettreviews':
url = addon.queries['url']
html = get_http_error(url)
section = re.search('<h1 class="page-title">.+?</h1>(.+?)<script type="text/javascript">', html, re.DOTALL).group(1)
match = re.compile('<a href="(.+?)"><img src="(.+?)">').findall(section)
for link, thumb in match:
name = re.search("[http://]*[a-z./-]*/(.+?)/",'/' + link).group(1).replace('-',' ').replace('/',' ').title()
if re.search('http',link):
newlink = link
else:
newlink = url + link
addon.add_video_item({'url': newlink},{'title':name},img=thumb)
elif mode == 'halfbag':
url = addon.queries['url']
html = get_http_error(url)
halfbag = re.search('<li id="menu-item-527"(.+?)</ul>', html, re.DOTALL)
if halfbag:
match = re.compile('<a href="(.+?)">(.+?)</a></li>').findall(halfbag.group(0))
for link, name in match:
addon.add_directory({'mode': 'halfbag-episodes', 'url': link}, {'title': name})
elif mode == 'halfbag-episodes':
url = addon.queries['url']
html = get_http_error(url)
示例5:
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_video_item [as 别名]
except:
dicti=urlparse.parse_qs(sys.argv[2][1:])
url=dicti['url'][0]
show=dicti['title'][0]
imdb_id=get_imdb(url)
metaget=metahandlers.MetaData()
meta=metaget.get_meta('tvshow', show, imdb_id=imdb_id)
meta['title']=meta['title'].encode('ascii','ignore')
title='%s'%(show)
meta['title']=title
if meta['cover_url']=='': meta['cover_url']=icon_path('TV_Shows.png')
if meta['backdrop_url']=='': meta['backdrop_url']=icon_path('fanart.jpg')
season = 1
episode = 1
total = 1
addon.add_video_item({'type': 'episode','url': 'http://www.watchfree.to' + url,'title': show, 'season':season, 'episode':episode}, meta, context_replace=False,img=meta['cover_url'], fanart=meta['backdrop_url'], total_items=total)
# add_tv_item('season','http://www.watchfree.to'+url,show,season,episode,meta=meta,totalitems=total)
xbmcplugin.endOfDirectory(addon_handle)
elif mode[0]=='open_season':
dicti=urlparse.parse_qs(sys.argv[2][1:])
url=dicti['url'][0]
show=dicti['show'][0]
num=dicti['num'][0]
my_addon = xbmcaddon.Addon()
meta_setting = my_addon.getSetting('tv_metadata')
imdb_id,episodes=get_episodes(url,num)
total=len(episodes)
show_title=show
for item in episodes: