本文整理汇总了Python中addon.common.addon.Addon.add_directory方法的典型用法代码示例。如果您正苦于以下问题:Python Addon.add_directory方法的具体用法?Python Addon.add_directory怎么用?Python Addon.add_directory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类addon.common.addon.Addon
的用法示例。
在下文中一共展示了Addon.add_directory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sys_exit
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_directory [as 别名]
elif mode == 'mainexit':
sys_exit()
mainmenu()
elif mode == 'tvchannels':
tvchannels()
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)
示例2: int
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_directory [as 别名]
for section, nothing in sections:
thumb = ''
blip_link = re.search('<iframe src="(.+?)"', section)
if blip_link:
blip_html = net.http_GET(blip_link.group(1)).content
icon=re.search('config.video.thumbnail = "(.+?)"', blip_html)
if icon:
thumb='http:' + icon.group(1).replace("THUMB_WIDTH", "630").replace("THUMB_HEIGHT", "350")
entry = re.search('<h2 class="post-title"><a href="(.+?)"[ rel="bookmark"]* title=".+?">(.+?)</a></h2>', section)
addon.add_video_item({'url': entry.group(1)},{'title':entry.group(2)},img=thumb)
if re.search('>Next Page', html):
page = int(page) + 1
addon.add_directory({'mode': 'main_next_page', 'page_num': page}, {'title': 'Next Page(%s)' % page}, img=IconPath + 'next.png')
if mode == 'main':
addon.add_directory({'mode': 'plinkett', 'url': MainUrl}, {'title': 'Plinkett Reviews'}, img=IconPath + 'plinkett.jpg')
addon.add_directory({'mode': 'halfbag', 'url': MainUrl + 'half-in-the-bag/'}, {'title': 'Half in the Bag'}, img=IconPath + 'halfbag.jpg')
addon.add_directory({'mode': 'bestworst', 'url': MainUrl + 'best-of-the-worst/'}, {'title': 'Best of the Worst'}, img=IconPath + 'botw-title.jpg')
addon.add_directory({'mode': 'featurefilms', 'url': MainUrl + 'films/'}, {'title': 'Feature Films'})
addon.add_directory({'mode': 'shortfilms', 'url': MainUrl + 'shorts/'}, {'title': 'Short Films'})
mainpage_links(page=1)
elif mode == 'main_next_page':
mainpage_links(page_num)
elif mode == 'plinkett':
url = addon.queries['url']
html = get_url(url)
r = re.search('MR. PLINKETT</a>.+?<ul class="sub-menu">(.+?)</ul>', html, re.DOTALL)
if r:
示例3: LoadCategories
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_directory [as 别名]
addon.add_directory({'mode': 'GetLinks', 'section': section, 'url': BASE_URL + epurl}, {'title': epnbr + ' - ' + title + ' (' + numOfLinks.strip() + ')'}, img= img)
addon.end_of_directory()
if play:
try:
import urlresolver
except:
addon.log_error("Failed to import script.module.urlresolver")
xbmcgui.Dialog().ok("Solar Movie Import Failure", "Failed to import URLResolver", "A component needed by PFTV is missing on your system", "Please visit www.xbmchub.com for support")
if mode == 'main':
addon.log('in main menu')
addon.add_directory({'mode': 'LoadCategories', 'section': 'movies'}, {'title': 'Movies'})
addon.add_directory({'mode': 'LoadCategories', 'section': 'tv'}, {'title': 'TV Shows'})
addon.add_directory({'mode': 'ResolverSettings'}, {'title': 'Resolver Settings'})
addon.end_of_directory()
elif mode == 'LoadCategories':
LoadCategories(section)
elif mode == 'BrowseAtoZ':
BrowseAtoZ(section)
elif mode == 'BrowseYear':
BrowseYear(section)
elif mode == 'BrowseGenre':
BrowseGenre(section)
elif mode == 'BrowseLatest':
BrowseLatest(section)
示例4: setView
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_directory [as 别名]
media = urlresolver.HostedMediaFile(host=host, media_id=linkid, title=vidname + ' - ' + host + ' - ' + load + ' - ' + working)
sources.append(media)
source = urlresolver.choose_source(sources)
if source:
stream_url = source.resolve()
else:
stream_url = False
#Play the stream
if stream_url:
addon.resolve_url(stream_url)
if mode == 'main':
addon.add_directory({'mode': 'movies', 'section': 'movies'}, {'title': 'Movies'}, img=icon_path('Movies.png'))
addon.add_directory({'mode': 'tv', 'section': 'tv'}, {'title': 'TV Shows'}, img=icon_path('TV_Shows.png'))
addon.add_directory({'mode': 'search', 'section': SearchAll}, {'title': 'Search All'}, img=icon_path('Search.png'))
addon.add_directory({'mode': 'resolver_settings'}, {'title': 'Resolver Settings'}, is_folder=False, img=icon_path('Settings.png'))
setView(None, 'default-view')
elif mode == 'movies':
addon.add_directory({'mode': 'favourites', 'video_type': VideoType_Movies}, {'title': 'Favourites'}, img=icon_path("Favourites.png"))
addon.add_directory({'mode': 'movieslatest', 'section': 'movieslatest'}, {'title': 'Latest Added Links'}, img=icon_path("Latest_Added.png"))
addon.add_directory({'mode': 'moviesaz', 'section': 'moviesaz'}, {'title': 'A-Z'}, img=icon_path("AZ.png"))
addon.add_directory({'mode': 'moviesgenre', 'section': 'moviesgenre'}, {'title': 'Genre'}, img=icon_path('Genre.png'))
addon.add_directory({'mode': 'moviesyear', 'section': 'moviesyear'}, {'title': 'Year'}, img=icon_path('Year.png'))
addon.add_directory({'mode': 'search', 'section': SearchMovies}, {'title': 'Search'}, img=icon_path('Search.png'))
setView(None, 'default-view')
示例5: and
# 需要导入模块: from addon.common.addon import Addon [as 别名]
# 或者: from addon.common.addon.Addon import add_directory [as 别名]
metaget=metahandlers.MetaData()
meta=metaget.get_meta('tvshow', show_title,imdb_id=imdb_id, year=show_year)
meta['title']=meta['title'].encode('ascii','ignore')
title='%s (%s)'%(show_title,show_year)
meta['title']=title
if meta==None:
meta={}
title='%s (%s)'%(show_title,show_year)
meta['title']=title
meta['name']=title
meta['tvshowtitle']=show_title
meta['cover_url']=icon_path('TV_Shows.png')
meta['backdrop_url']=None
if meta['cover_url']=='':
meta['cover_url']=icon_path('TV_Shows.png')
addon.add_directory({'mode': 'open_show', 'url': url,'title': show_title, }, meta, contextmenu_items=context, context_replace=False, img=meta['cover_url'], fanart=meta['backdrop_url'], total_items=total-first)
if meta_setting!='false' and (total+1)<len(shows):
url = build_url({'mode': 'popular_today', 'foldername': 'shows', 'page': page+1})
li = xbmcgui.ListItem('Next Page >>', iconImage=icon_path('Next.png'))
li.setArt({ 'fanart':icon_path('fanart.jpg')})
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url,
listitem=li, isFolder=True)
xbmcplugin.endOfDirectory(addon_handle)
elif mode[0]=='popular_today_movies':
shows=popular_today_mov()
dicti=urlparse.parse_qs(sys.argv[2][1:])
page=int(dicti['page'][0])
my_addon = xbmcaddon.Addon()
meta_setting = my_addon.getSetting('tv_metadata')