本文整理汇总了Python中xbmcplugin.setContent函数的典型用法代码示例。如果您正苦于以下问题:Python setContent函数的具体用法?Python setContent怎么用?Python setContent使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setContent函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setView
def setView(content, viewType):
if content:
xbmcplugin.setContent(int(sys.argv[1]), content)
if addon.get_setting('auto-view') == 'true':
print addon.get_setting(viewType)
if addon.get_setting(viewType) == 'Info':
VT = '504'
elif addon.get_setting(viewType) == 'Info2':
VT = '503'
elif addon.get_setting(viewType) == 'Info3':
VT = '515'
elif addon.get_setting(viewType) == 'Fanart':
VT = '508'
elif addon.get_setting(viewType) == 'Poster Wrap':
VT = '501'
elif addon.get_setting(viewType) == 'Big List':
VT = '51'
elif viewType == 'default-view':
VT = addon.get_setting(viewType)
print viewType
print VT
xbmc.executebuiltin("Container.SetViewMode(%s)" % ( int(VT) ) )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_UNSORTED )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_LABEL )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RATING )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_DATE )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_PROGRAM_COUNT )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RUNTIME )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_GENRE )
xbmcplugin.addSortMethod( handle=int( sys.argv[ 1 ] ), sortMethod=xbmcplugin.SORT_METHOD_MPAA_RATING )
开发者ID:sangerhitesh,项目名称:tdbaddon,代码行数:35,代码来源:default.py
示例2: CATEGORIES
def CATEGORIES():
contentType, page = getData('http://vod.walla.co.il/')
topMenuBloc = re.compile('<nav class="fc main-nav"(.*?)</nav>').findall(page)
bottomGroupBloc = re.compile('<nav class="fc footer-logos".*?</nav>').findall(page)
items = re.compile('<li><a href="(.*?)">(.*?)<').findall(topMenuBloc[0])
i = 1
for url, title in items:
if i >= 4:
break
module = '00000' + str(i)
iconImage = xbmc.translatePath(os.path.join(__PLUGIN_PATH__, 'cache', 'images', 'wallaBase', module + '.png'))
addDir('UTF-8', title, 'http://vod.walla.co.il' + url, 1, iconImage, module)
i=i+1
bottomItems = re.compile('<td.*?<a href="(.*?)"><img src="(.*?)" alt="(.*?)"').findall(bottomGroupBloc[0])
for url, img, title in bottomItems:
iconImage = getImage(img, 'wallaBase')
if url.startswith('http'):
elementId = re.compile("http://(.*?)\.").findall(url)
addDir('UTF-8', title, url, 1, iconImage, elementId[0])
print 'url='+url
print 'eid='+elementId[0]
else :
elementId = url #re.compile("channel/(.*?)/").findall(url)
addDir('UTF-8', title, 'http://vod.walla.co.il' + url, 1, iconImage, elementId[0])
xbmcplugin.setContent(int(sys.argv[1]), 'tvshows')
开发者ID:yossimav123,项目名称:XbmcAddons,代码行数:30,代码来源:walla.py
示例3: listA
def listA(name, type, url, thumb):
link = GetHttpData(url)
match1 = re.compile("<!-- 剧集列表 start -->(.+?)<!-- 剧集列表 end -->", re.DOTALL).findall(link)
match2 = re.compile('<div class="left">(.+?)</div>', re.DOTALL).findall(match1[0])
if match2:
match = re.compile(r"'videoListCon', '(.+?)'", re.DOTALL).findall(match2[0])
if match:
FindItems(type, match1[0])
for url in match:
link = GetHttpData("http://www.juchang.com" + url)
link = link.decode("gbk").encode("utf8")
FindItems(type, link)
match2 = re.compile('<a href="#" class="one"(.+?)<a class="two"', re.DOTALL).findall(link)
if match2:
match3 = re.compile(r"'videoListCon','(.+?)'", re.DOTALL).findall(match2[0])
for urla in match3:
link = GetHttpData("http://www.juchang.com" + urla)
link = link.decode("gbk").encode("utf8")
FindItems(type, link)
else:
FindItems(type, match1[0])
else:
FindItems(type, match1[0])
xbmcplugin.setContent(int(sys.argv[1]), "movies")
xbmcplugin.endOfDirectory(int(sys.argv[1]))
开发者ID:hugcoday,项目名称:xbmc-addons-chinese,代码行数:26,代码来源:default.py
示例4: TVIndex
def TVIndex(url): ################# TV Index #################
link=main.OPEN_URL(url)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('\\','')
match = re.findall('<img class="img-preview spec-border" src="([^"]*?)" alt=" " style="background.+?<a class="link" href="([^"]*?)" title=".+?">([^"]*?)</a>.+?</h5><p class="left">([^"]*?)</p>',link)
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until Show list is cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = 'Latest Episodes Loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
for thumb,url,name,season in match:
name=name.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('\\','').replace('\xe2\x80\x99',"'").replace('\xe2\x80\x93','-').replace('\xe2\x80\x94','').replace('&-','-')
#main.addInfo(name+ ' ' + season,url,75,thumb,'','')
main.addDirTE(name+ ' ' + season,url,75,thumb,'','','','','')
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = 'Latest Episodes Loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if (dialogWait.iscanceled()):
return False
dialogWait.close()
del dialogWait
nextpage=re.compile('><a href="([^"]*?)">»</a></li> </ul> </div> <div class="show_all_btn"><ul class="pagination"><li>').findall(link)
for url in nextpage:
main.addDir('[COLOR blue]Next Page -> [/COLOR]',url,1,art+'/next.png')
xbmcplugin.setContent(int(sys.argv[1]), 'Tv-Shows')
开发者ID:ArchUser,项目名称:Kasiks-Repo,代码行数:27,代码来源:daretv.py
示例5: TVIndex3
def TVIndex3(url,name): ################# TV Genre Index #################
link=main.OPENURL(url)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','')
match = re.findall('<div class="view_img">.+?<a href="([^"]*?)" class="spec-border-ie" title="">.+?<img class="img-preview spec-border show-thumbnail" src="([^"]*?)" alt=.+?class="link" href=".+?" title=".+?">([^"]*?)</a>',link)
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until Show list is cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = 'Tv Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
for url,thumb,name in match:
name=name.replace('\r','').replace('\n','').replace('\t','').replace(' ','').replace('\\','').replace('\xe2\x80\x99',"'").replace('\xe2\x80\x93','-').replace('\xe2\x80\x94','').replace('&-','-')
#main.addInfo(name,url,7,thumb,'','')
main.addDirTE(name,url,7,thumb,'','','','','')
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = 'Tv Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if (dialogWait.iscanceled()):
return False
dialogWait.close()
del dialogWait
nextpage=re.compile('<a href="([^"]*?)">»</a></li> </ul> </div> <form method="post"').findall(link)
for url in nextpage:
main.addDir('[COLOR blue]Next Page -> [/COLOR]',url,5,art+'/next.png')
xbmcplugin.setContent(int(sys.argv[1]), 'Tv-Shows')
开发者ID:ArchUser,项目名称:Kasiks-Repo,代码行数:27,代码来源:daretv.py
示例6: YEARB
def YEARB(murl):
link=main.OPENURL(murl)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','')
match=re.compile('<div class="movie_pic"><a href="(.+?)" target=".+?"> <img src="(.+?)" width=".+?" height=".+?" /> </a></div> <div class=".+?"> <div class=".+?"> <h1><a href=".+?" target=".+?"> (.+?) </a></h1> <div class=".+?">Genre: <a href=".+?" target=\'.+?\'>(.+?)</a>.+?Release:.+?Views: <span> (.+?) </span>.+?<span id=RateCount.+?> (.+?) </span> votes.+?<div id=".+?">score:<span id=Rate_.+?>(.+?)</span>').findall(link)
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until Movie list is cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
for url,thumb,name,genre,views,votes,rating in match:
name=name.replace('-','').replace('&','').replace('acute;','')
furl= 'http://movie25.com/'+url
main.addInfo(name+'[COLOR blue] Views: '+views+'[/COLOR] [COLOR red]Votes: '+votes+'[/COLOR] [COLOR green]Rating: '+rating+'[/COLOR]',furl,3,thumb,genre,'')
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if (dialogWait.iscanceled()):
return False
dialogWait.close()
del dialogWait
ye = murl[39:44]
r = re.findall("Next</a><a href='search.php.?page=.+?year=.+?'>Last</a>",link)
if r:
main.addDir('[COLOR red]Enter Page #[/COLOR]',murl,208,art+'/gotopage.png')
main.addDir('[COLOR blue]Page 2[/COLOR]','http://www.movie25.com/search.php?page=2&year='+str(ye),9,art+'/next2.png')
xbmcplugin.setContent(int(sys.argv[1]), 'Movies')
main.VIEWS()
开发者ID:rollysalvana,项目名称:pampereo-xbmc-plugins,代码行数:30,代码来源:movie25.py
示例7: LISTEPISODES
def LISTEPISODES(tvshowname,url):
link=main.OPENURL(url)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','')
match = re.findall('<a class=".+?" href="(.+?)" id=".+?">(.+?)</a>',link)
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until ['+tvshowname+'] Episodes are cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = 'Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
xbmc.executebuiltin("XBMC.Dialog.Close(busydialog,true)")
for url,name in match:
if "Online" not in name: continue
name=name.replace(tvshowname,'').replace('Watch Online','')
name=main.removeNonASCII(name)
main.addTVInfo(name,MainUrl+url,39,'','','')
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = 'Episodes loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if dialogWait.iscanceled(): return False
match=re.findall('<div id="above_threadlist" class="above_threadlist">(.+?)</div>',link)
for string in match:
match1=re.findall('<a href="(.+?)" title="(.+?)">[0-9]+</a>', string)
for url, page in match1:
main.addTVInfo(page,MainUrl+url,38,'','','')
dialogWait.close()
del dialogWait
xbmcplugin.setContent(int(sys.argv[1]), 'TV Shows')
main.VIEWS()
开发者ID:cmdnath,项目名称:innovate-dev,代码行数:30,代码来源:desitv.py
示例8: r_sub2_genres
def r_sub2_genres(url):
next_url = url
xbmc.log('Next_URL: ' + str(next_url))
r = requests.get(url)
print r.cookies
kookie1 = r.cookies
print ' Kookie1= ' + str(kookie1)
print 'Kookie= ' + str(r.cookies)[54:-72]
kookie = str(r.cookies)[54:-72]
opener = urllib2.build_opener()
opener.addheaders.append(('Cookie', kookie))
f = opener.open(url)
page = f.read()
match = re.compile('href="(.+?)" rel="internal"><img class="radioCover" src="(.+?)" alt="(.+?)" ').findall(page)
for url,image,title in match:
url = str(url).replace('/en/radio', 'http://listen.radionomy.com').replace('/index', '.m3u')
h = HTMLParser.HTMLParser()
try: title = h.unescape(title)
except UnicodeDecodeError:
continue
try: add_directory3(title,url,140, defaultfanart ,image,plot='')
except KeyError:
continue
xbmcplugin.setContent(pluginhandle, 'songs')
plot = 1
add_directory2('Next Page>>', next_url, 133, defaultfanart, defaultimage, plot)
xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[6])+")")
#xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[0])+")")
xbmcplugin.endOfDirectory(addon_handle)
开发者ID:MetalChris,项目名称:repository.metalchris,代码行数:29,代码来源:addon.py
示例9: end_call
def end_call(self,movies=False) :
if movies :
xbmcplugin.setContent(int(sys.argv[1]),'movies')
xbmcplugin.setPluginCategory(handle=int(sys.argv[1]),category=__language__(30000))
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_UNSORTED)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_DURATION)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_EPISODE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_FILE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_GENRE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_LABEL_IGNORE_THE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_MPAA_RATING)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_NONE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_PLAYLIST_ORDER)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_PRODUCTIONCODE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_PROGRAM_COUNT)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_SIZE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_SONG_RATING)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_STUDIO)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_STUDIO_IGNORE_THE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_TITLE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_TITLE_IGNORE_THE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_TRACKNUM)
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)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RUNTIME)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_VIDEO_TITLE)
xbmcplugin.addSortMethod(handle=int(sys.argv[ 1 ]),sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
开发者ID:JUL1EN094,项目名称:JUL1EN094-xbmc-addons,代码行数:30,代码来源:default.py
示例10: PlayVideo1
def PlayVideo1(url, listitem):
addon_handle = int(sys.argv[1])
xbmcplugin.setContent(addon_handle, 'video')
li = xbmcgui.ListItem('[COLOR dodgerblue][B]PLAY STREAM[/B][/COLOR] >> ', iconImage='http://maps.synthicity.com/activemaps/images/button_black_play.png', thumbnailImage= 'http://maps.synthicity.com/activemaps/images/button_black_play.png')
li.setProperty('fanart_image', 'https://raw.githubusercontent.com/TheYid/My-Repo/master/repository.TheYid/fanart.jpg')
xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li)
xbmcplugin.endOfDirectory(addon_handle)
开发者ID:PunjabiPindu,项目名称:EntertainmentREPO,代码行数:7,代码来源:default.py
示例11: r_next_page
def r_next_page(url,plot):
next_url = url
data = {'scrollOffset':plot}
session = Session()
session.head('http://www.radionomy.com')
response = session.post(
url =url,
data=data,
headers=headers)
plot = plot + 1
match = re.compile('href="(.+?)" rel="internal"><img class="radioCover" src="(.+?)" alt="(.+?)" ').findall(str(response.text))
for url,image,title in match:
url = str(url).replace('/en/radio', 'http://listen.radionomy.com').replace('/index', '.m3u')
h = HTMLParser.HTMLParser()
try: title = h.unescape(title)
except UnicodeDecodeError:
continue
image = image.replace('s67.jpg', 's400.jpg')
try: add_directory3(title,url,140, defaultfanart ,image,plot='')
except KeyError:
continue
xbmcplugin.setContent(pluginhandle, 'songs')
add_directory2('Next Page>>', next_url, 133, defaultfanart, defaultimage, plot)
xbmc.executebuiltin("Container.SetViewMode("+str(confluence_views[6])+")")
xbmcplugin.endOfDirectory(addon_handle)
开发者ID:MetalChris,项目名称:repository.metalchris,代码行数:25,代码来源:addon.py
示例12: videos
def videos(url, video_type, offset, run_as_widget=False):
if '' == offset:
page = 0
else:
page = int(offset)
loading_progress = show_loading_progress(run_as_widget)
xbmcplugin.setContent(plugin_handle, 'movies')
list_id = None
genre_id = None
if 'genre' in url:
genre_id = url.split('?')[1]
elif 'list?' in url:
data = url.split('?')[1]
if 'mylist' in data:
root_list = lolomos.get_root_list()
list_id = lolomos.get_mylist(root_list)[0]
else:
list_id = data
video_metadata = None
if list_id:
video_metadata = get.videos_in_list(list_id, page)
elif genre_id:
video_metadata = get.videos_in_genre(genre_id, page)
if video_metadata:
add_videos_to_directory(loading_progress, run_as_widget, video_metadata, video_type, page, url)
if generic_utility.get_setting('force_view') == 'true' and not run_as_widget:
xbmc.executebuiltin('Container.SetViewMode(' + generic_utility.get_setting('view_id_videos') + ')')
xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:33,代码来源:list.py
示例13: seasons
def seasons(series_name, series_id, thumb):
xbmcplugin.setContent(plugin_handle, 'seasons')
seasons = get.seasons_data(series_id)
for season in seasons:
add.season(season)
xbmcplugin.addSortMethod(plugin_handle, xbmcplugin.SORT_METHOD_LABEL)
xbmcplugin.endOfDirectory(plugin_handle)
开发者ID:logi85,项目名称:plugin.video.flix2kodi,代码行数:7,代码来源:list.py
示例14: videoList
def videoList(self, videoList):
if videoList == None or len(videoList) == 0: return
total = len(videoList)
for i in videoList:
try:
name, url, image, date, genre, plot, title, show = i['name'], i['url'], i['image'], i['date'], i['genre'], i['plot'], i['title'], i['show']
try: fanart = i['fanart']
except: fanart = '0'
meta = {'name': name, 'title': title, 'studio': show, 'premiered': date, 'genre': genre, 'plot': plot, 'image': image, 'fanart': fanart}
sysmeta = urllib.quote_plus(json.dumps(meta))
sysurl = urllib.quote_plus(url)
if fanart == '0': fanart = addonFanart
if image == '0': image = addonFanart
if show == '0': meta.update({'studio': addonName})
if plot == '0': meta.update({'plot': addonDesc})
meta = dict((k,v) for k, v in meta.iteritems() if not v == '0')
u = '%s?action=videos_parts&url=%s&meta=%s' % (sys.argv[0], sysurl, sysmeta)
cm = []
cm.append((language(30401).encode("utf-8"), 'RunPlugin(%s?action=item_play)' % (sys.argv[0])))
cm.append((language(30403).encode("utf-8"), 'RunPlugin(%s?action=item_queue)' % (sys.argv[0])))
cm.append((language(30404).encode("utf-8"), 'RunPlugin(%s?action=playlist_open)' % (sys.argv[0])))
cm.append((language(30406).encode("utf-8"), 'RunPlugin(%s?action=view_videos)' % (sys.argv[0])))
cm.append((language(30405).encode("utf-8"), 'RunPlugin(%s?action=settings_open)' % (sys.argv[0])))
item = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=image)
item.setProperty("Fanart_Image", fanart)
item.setInfo(type="Video", infoLabels = meta)
item.setProperty("Video", "true")
item.setProperty("IsPlayable", "true")
item.addContextMenuItems(cm, replaceItems=True)
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=item,totalItems=total,isFolder=True)
except:
pass
try:
next = videoList[0]['next']
if next == '': raise Exception()
name, url, image = language(30361).encode("utf-8"), next, addonNext
u = '%s?action=videos&url=%s' % (sys.argv[0], urllib.quote_plus(url))
item = xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=image)
item.setInfo( type="Video", infoLabels={"title": name, "plot": addonDesc})
item.setProperty("Fanart_Image", addonFanart)
item.addContextMenuItems([], replaceItems=False)
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=item,isFolder=True)
except:
pass
xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True)
for i in range(0, 200):
if xbmc.getCondVisibility('Container.Content(episodes)'):
return index().container_view('videos', {'skin.confluence' : 504})
xbmc.sleep(100)
开发者ID:aviadavi,项目名称:lambda-addons,代码行数:60,代码来源:default.py
示例15: __init__
def __init__(self):
self._parse_argv()
self.tokens = {}
sortLetterList = list()
# 0 if false, 1 if true
hasParentItem = xbmc.getCondVisibility('System.GetBool(filelists.showparentdiritems)')
ignoreArticles = xbmc.getCondVisibility('System.GetBool(filelists.ignorethewhensorting)')
wid = xbmcgui.getCurrentWindowId()
currentWindow = xbmcgui.Window(wid)
# get sort tokens from advancedsettings.xml
f = xbmcvfs.File(xbmc.translatePath('special://userdata/advancedsettings.xml'))
advancedsettings = f.read()
f.close()
if advancedsettings:
root = ET.fromstring(advancedsettings)
sorttokens = root.find('sorttokens')
# user specified tokens, proceed to create dictionary
if sorttokens is not None:
self.tokens = { token.text.encode('utf-8') : u'' for token in sorttokens.findall('token') }
if self.TYPE == "scroll":
xbmcplugin.setResolvedUrl(handle=self.handle, succeeded=False, listitem=xbmcgui.ListItem())
containerId = self._get_view_mode()
targetList = currentWindow.getControl(containerId)
targetList.selectItem(int(self.pos))
currentWindow.setFocus(targetList)
elif self.path:
xbmcplugin.setContent(self.handle, 'files')
self._parse_files(sortLetterList, hasParentItem, ignoreArticles)
xbmcplugin.addDirectoryItems(self.handle, sortLetterList)
xbmcplugin.endOfDirectory(handle=self.handle)
return
开发者ID:toolpunk,项目名称:plugin.tegamiscroll,代码行数:35,代码来源:default.py
示例16: LISTFMA
def LISTFMA(murl):
link=main.OPENURL(murl)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','')
match=re.compile('<img class=\'.+?\' src=\'(.+?)\' alt=\'.+?\' />.+?<a class=\'.+?\' href=\'/(.+?)\'>(.+?)</a>.+?<a href=\'/movies/year/.+?\'>(.+?)</a>.+?<a href=\'/movies/genre/.+?\'>(.+?)</a>.+?</span><span class=".+?">(.+?)</span>').findall(link)
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until Movie list is cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0,'[B]Will load instantly from now on[/B]',remaining_display)
for thumb,url,name, year, gen, desc in match:
main.addPlayM(name,'http://www.freemoviesaddict.com/'+url,569,thumb,desc,'','',gen,year)
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = 'Movies loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if (dialogWait.iscanceled()):
return False
dialogWait.close()
del dialogWait
paginate = re.compile('<span class="pagination_next"><a class="pagination_link" href="(.+?)">').findall(link)
if len(paginate)>0:
main.addDir('Next','http://www.freemoviesaddict.com/'+paginate[0],568,art+'/next2.png')
main.GA("FMA","list")
xbmcplugin.setContent(int(sys.argv[1]), 'Movies')
main.VIEWS()
开发者ID:rollysalvana,项目名称:pampereo-xbmc-plugins,代码行数:26,代码来源:fma.py
示例17: list_episodes
def list_episodes(self, movie_id):
xbmcplugin.setContent(int(sys.argv[1]), 'episodes')
query_params = {'movieid': movie_id}
m = self.__request__('movie', query_params)['r']
_id = m['MovieID']
name = m['MovieName']
aka = m['KnownAs']
trailer = m['Trailer']
poster = m['Poster']
if 'Poster214x321' in m:
poster = m['Poster214x321']
runtime = m['Runtime']
plot = m['PlotVI']
rating = m['ImdbRating']
country = m['Country']
release_date = m['ReleaseDate']
backdrop = m['Backdrop']
banner = m['Banner']
num_episodes = m['Episode']
thumbs = sorted(m['Thumbs'].keys(), key=lambda x: int(x))
for thumb in thumbs:
t = unicode.join(u'',[u'Tập', ' ', thumb])
item = xbmcgui.ListItem(t)
item.setInfo(type="Video", infoLabels={"Label": name, "Title": t, "Plot": plot, 'Year': release_date})
epThumb = m['Thumbs'][thumb]
item.setArt({'poster': epThumb, 'thumb': epThumb})
item.setProperty("Fanart_Image", backdrop)
u = self.__build_url__({'action': 'play_movie', 'movie_id': _id, 'episode': thumb})
xbmcplugin.addDirectoryItem(handle=int(sys.argv[1]),url=u,listitem=item,isFolder=False)
xbmcplugin.endOfDirectory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:minhtuancn,项目名称:kodi-vietkeynet,代码行数:30,代码来源:default.py
示例18: __init__
def __init__(self):
global action
params = {}
splitparams = sys.argv[2][sys.argv[2].find('?') + 1:].split('&')
for param in splitparams:
if (len(param) > 0):
splitparam = param.split('=')
key = splitparam[0]
try: value = splitparam[1].encode("utf-8")
except: value = splitparam[1]
params[key] = value
try: action = urllib.unquote_plus(params["action"])
except: action = None
try: channel = urllib.unquote_plus(params["channel"])
except: channel = None
if action == None: channels().get()
elif action == 'dialog': channels().dialog()
elif action == 'epg_menu': contextMenu().epg(channel)
elif action == 'refresh': index().container_refresh()
elif action == 'play': resolver().run(channel)
xbmcplugin.setContent(int(sys.argv[1]), 'Episodes')
xbmcplugin.setPluginFanart(int(sys.argv[1]), addonFanart)
xbmcplugin.endOfDirectory(int(sys.argv[1]))
return
开发者ID:1c0n,项目名称:lambda-xbmc-addons,代码行数:27,代码来源:default.py
示例19: LISTSHOWS
def LISTSHOWS(murl,channel,index=False):
link=main.OPENURL(murl)
link=link.replace('\r','').replace('\n','').replace('\t','').replace(' ','')
match = re.findall('<div class="titleline"><h2 class="forumtitle"><a href="(.+?)">(.+?)</a></h2></div>',link)
label='TV Shows'
if not len(match) > 0:
match = re.findall('<h3 class="threadtitle">.+?<a class=".+?" href="(.+?)" id=".+?">(.+?)</a></h3>', link)
label = 'Movies'
dialogWait = xbmcgui.DialogProgress()
ret = dialogWait.create('Please wait until ' + label + ' Show list is cached.')
totalLinks = len(match)
loadedLinks = 0
remaining_display = label + ' loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(0, '[B]Will load instantly from now on[/B]',remaining_display)
xbmc.executebuiltin("XBMC.Dialog.Close(busydialog,true)")
for url,name in match:
if "color" in name:
name=name.replace('<b><font color=red>','[COLOR red]').replace('</font></b>','[/COLOR]')
name=name.replace('<b><font color="red">','[COLOR red]').replace('</font></b>','[/COLOR]')
if label == 'Movies':
main.addDirX(name, MainUrl+url,39,'',searchMeta=True, metaType='Movies')
else:
main.addTVInfo(name,MainUrl+url,38,getShowImage(channel,name),'','')
loadedLinks = loadedLinks + 1
percent = (loadedLinks * 100)/totalLinks
remaining_display = label + ' loaded :: [B]'+str(loadedLinks)+' / '+str(totalLinks)+'[/B].'
dialogWait.update(percent,'[B]Will load instantly from now on[/B]',remaining_display)
if dialogWait.iscanceled(): return False
dialogWait.close()
del dialogWait
xbmcplugin.setContent(int(sys.argv[1]), label)
main.VIEWS()
开发者ID:cmdnath,项目名称:innovate-dev,代码行数:32,代码来源:desitv.py
示例20: listVideos
def listVideos(url):
if not singleProfile:
setProfile()
xbmcplugin.setContent(pluginhandle, "movies")
content = opener.open(url).read()
if not 'id="page-LOGIN"' in content:
if singleProfile and 'id="page-ProfilesGate"' in content:
forceChooseProfile()
else:
if '<div id="queue"' in content:
content = content[content.find('<div id="queue"'):]
content = content.replace("\\t","").replace("\\n", "").replace("\\", "")
match1 = re.compile('<span id="dbs(.+?)_.+?alt=".+?" src="(.+?)"', re.DOTALL).findall(content)
match2 = re.compile('<span class="title "><a id="b(.+?)_', re.DOTALL).findall(content)
if match1:
for videoID, thumbUrl in match1:
listVideo(videoID, "", thumbUrl, False, False)
elif match2:
for videoID in match2:
listVideo(videoID, "", "", False, False)
match = re.compile('&pn=(.+?)&', re.DOTALL).findall(url)
if match:
currentPage = match[0]
nextPage = str(int(currentPage)+1)
addDir(translation(30001), url.replace("&pn="+currentPage+"&", "&pn="+nextPage+"&"), 'listVideos', "")
if forceView:
xbmc.executebuiltin('Container.SetViewMode('+viewIdVideos+')')
xbmcplugin.endOfDirectory(pluginhandle)
else:
deleteCookies()
xbmc.executebuiltin('XBMC.Notification(Info:,'+str(translation(30127))+',10000)')
开发者ID:jomuji,项目名称:plugin.video.netflixbmc,代码行数:31,代码来源:default.py
注:本文中的xbmcplugin.setContent函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论