本文整理汇总了Python中resources.lib.libraries.control.item函数的典型用法代码示例。如果您正苦于以下问题:Python item函数的具体用法?Python item怎么用?Python item使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了item函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: run
def run(self, content, name, url, year, imdb, tvdb, meta):
if control.window.getProperty('PseudoTVRunning') == 'True':
return control.player.play(url, control.item(path=url))
self.getVideoInfo(content, name, year, imdb, tvdb)
if self.folderPath.startswith('plugin://') and not meta == None:
poster, thumb, meta = self.getMeta(meta)
else:
poster, thumb, meta = self.getLibraryMeta()
item = control.item(path=url, iconImage='DefaultVideo.png', thumbnailImage=thumb)
item.setInfo(type='Video', infoLabels = meta)
try: item.setArt({'poster': poster, 'tvshow.poster': poster, 'season.poster': poster})
except: pass
item.setProperty('Video', 'true')
item.setProperty('IsPlayable', 'true')
control.player.play(url, item)
for i in range(0, 240):
if self.isPlayingVideo(): break
xbmc.sleep(1000)
while self.isPlayingVideo():
try: self.totalTime = self.getTotalTime()
except: pass
try: self.currentTime = self.getTime()
except: pass
xbmc.sleep(1000)
control.window.clearProperty('script.trakt.ids')
time.sleep(5)
开发者ID:azumimuo,项目名称:family-xbmc-addon,代码行数:31,代码来源:player.py
示例2: run
def run(self, url, selectGame ,side):
if selectGame == None or side == None:
return control.resolve(int(sys.argv[1]), True, control.item(path=url))
command = ['java','-jar',jarFile,selectGame,side]
startupinfo = None
if os.name == 'nt':
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
self.process = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
startupinfo=startupinfo)
if os.name == 'posix':
success = False
success, output = FuckNeulionClient.request_proxy_hack(selectGame,side)
control.sleep(1000)
control.resolve(int(sys.argv[1]), True, control.item(path=url))
for i in range(0, 240):
if self.isPlayingVideo(): break
control.sleep(1000)
while self.isPlayingVideo():
control.sleep(1000)
control.sleep(5000)
开发者ID:AMOboxTV,项目名称:AMOBox.LegoBuild,代码行数:31,代码来源:nhlcom.py
示例3: listShows
def listShows(self, catid, page):
limatch = []
url = self.shows_link % (catid)
try: result = client.request(url)
except: pass
pageContent = ''.join(result.splitlines()).replace('\'','"')
pages = re.compile('id="a_page_(.+?)" href').findall(pageContent)
if str(page) in pages:
pageUrl = self.shows_ajax_link % (catid, str(page))
result = client.request(pageUrl)
limatch+=re.compile('<figure>(.+?)</a></li>').findall(result)
for li_content in limatch:
show = re.compile('<a href=".+?id=(.+?)"><img src="(.+?)" alt="(.+?)" w').findall(li_content)
#print show
title = show[0][2].decode('iso-8859-11')
showid = show[0][0]
image = show[0][1]
self.list.append({'name': title, 'showid': showid, 'image': image})
for show in self.list:
name = show['name'].encode('utf-8')
showid = show['showid']
image = show['image']
action = 'listEpisodes'
query = '?action=%s&name=%s&catid=%s&showid=%s&image=%s' % (action, name, catid, showid, image)
url = '%s%s' % (sysaddon, query)
item = control.item(name, iconImage=image, thumbnailImage=image)
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
item.setInfo(type="Video", infoLabels={"Title": name, "OriginalTitle": name})
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
nextPage = int(page) + 1
if nextPage <= len(pages):
if 'first' in pages:
pages.remove('first')
if 'pre' in pages:
pages.remove('pre')
if 'next' in pages:
pages.remove('next')
if 'last' in pages:
pages.remove('last')
for page in pages:
action = 'listShows'
pageNumber = int(page) + 1
query = '?action=%s&page=%d&name=%s&catid=%s' % (action, int(page), 'Page ' + str(pageNumber), catid)
url = '%s%s' % (sysaddon, query)
item = control.item('Page ' + str(pageNumber), iconImage='', thumbnailImage='')
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
item.setInfo(type="Video", infoLabels={"Title": 'Page ' + str(pageNumber), "OriginalTitle": 'Page ' + str(pageNumber)})
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
control.content(int(sys.argv[1]), 'movies')
if control.skin == 'skin.confluence': control.execute('Container.SetViewMode(500)')
control.directory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:mpie,项目名称:repo,代码行数:59,代码来源:thai.py
示例4: listEpisodes
def listEpisodes(self, catid, showid, page, image):
url = self.episodes_link % (page, showid)
try: result = client.request(url)
except: pass
link = ''.join(result.splitlines()).replace('\'','"')
link = ''.join(link.splitlines()).replace('<i class="icon-new"></i>','')
episodematch = re.compile('<table class="program-archive">(.+?)</table>').findall(link)
episodes = re.compile('<a href="(.+?)" >(.+?)</a>.+?</td>\t\t\t\t\t\t\t<td> \t\t\t\t\t\t\t\t<a href="(.+?)" ><img').findall(episodematch[0])
programMeta = re.compile('<div class="program-meta">(.+?)</div>').findall(link)
image = re.compile('<img src="(.+?)" alt').findall(programMeta[0])[0]
# episodes per page
for episode in episodes:
name = episode[1].decode('iso-8859-11')
u = 'http://www.seesantv.com/seesantv_2014/' + episode[0] + '&bitrate=high'
self.list.append({'name': name, 'url': urllib.quote_plus(u), 'image': image})
for episode in self.list:
name = episode['name'].encode('utf-8')
url = episode['url']
image = episode['image']
action = 'sourcePage'
query = '?action=%s&image=%s&url=%s&name=%s' % (action, image, url, urllib.quote_plus(name))
url = '%s%s' % (sysaddon, query)
item = control.item(name, iconImage=image, thumbnailImage=image)
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
item.setInfo(type="Video", infoLabels={"Title": name, "OriginalTitle": name})
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=False)
# Pagination
paginator = re.compile('<div class="page_list" align="center">(.+?)</ul>').findall(link)[0]
pages = re.compile('>(\d+)</a>').findall(paginator)
nextPage = int(page) + 1
if nextPage < len(pages):
action = 'listEpisodes'
query = '?action=%s&page=%d&name=%s&catid=%s&showid=%s&image=%s' % (action, nextPage, 'Next Page', catid, showid, image)
url = '%s%s' % (sysaddon, query)
item = control.item('Next Page', iconImage=image, thumbnailImage=image)
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
item.setInfo(type="Video", infoLabels={"Title": 'Next Page', "OriginalTitle": 'Next Page'})
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
control.content(int(sys.argv[1]), 'movies')
if control.skin == 'skin.confluence': control.execute('Container.SetViewMode(50)')
control.directory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:mpie,项目名称:repo,代码行数:48,代码来源:thai.py
示例5: listEpisodes
def listEpisodes(self, showid, page, image):
url = self.episodes_link % (showid)
try: result = client.request(url)
except: pass
result = re.compile('(.+?)]').findall(result)[0] + ']'
shows = json.loads(result)
self.list.append({'name': '[UPPERCASE][COLOR orange]Try again if a show does not play![/COLOR][/UPPERCASE]', 'url': '', 'image': ''})
# episodes per page
for show in shows:
if 'Not Show' == show['item_title']:
continue
name = show['date_added'] + ' ' + show['item_title']
u = self.player_link % (show['media_id'], show['media_item_id'])
self.list.append({'name': name, 'url': urllib.quote_plus(u), 'image': image})
for episode in self.list:
name = episode['name']
url = episode['url']
image = episode['image']
action = 'sourcePage2'
query = '?action=%s&image=%s&url=%s&name=%s' % (action, image, url, name)
url = '%s%s' % (sysaddon, query)
item = control.item(name, iconImage=image, thumbnailImage=image)
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
item.setInfo(type="Video", infoLabels={"Title": name, "OriginalTitle": name})
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=False)
control.content(int(sys.argv[1]), 'movies')
if control.skin == 'skin.confluence': control.execute('Container.SetViewMode(50)')
control.directory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:mpie,项目名称:repo,代码行数:33,代码来源:thai2.py
示例6: addDirectoryItem
def addDirectoryItem(name, action, thumb, image, fanart, url='0'):
if thumb == '0': thumb = image
u = '%s?action=%s&url=%s&image=%s&fanart=%s' % (sys.argv[0], str(action), urllib.quote_plus(url), urllib.quote_plus(thumb), urllib.quote_plus(fanart))
item = control.item(name, iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems([], replaceItems=False)
item.setProperty('Fanart_Image', fanart)
control.addItem(handle=int(sys.argv[1]),url=u,listitem=item,isFolder=True)
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:7,代码来源:phtoons.py
示例7: addDirectory
def addDirectory(self, items):
if items == None or len(items) == 0: return
sysaddon = sys.argv[0]
addonFanart = control.addonFanart()
addonThumb = control.addonThumb()
artPath = control.artPath()
for i in items:
try:
try: name = control.lang(i['name']).encode('utf-8')
except: name = i['name']
if not artPath == None: thumb = os.path.join(artPath, i['image'])
else: thumb = addonThumb
url = '%s?action=%s' % (sysaddon, i['action'])
try: url += '&url=%s' % urllib.quote_plus(i['url'])
except: pass
item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems([], replaceItems=False)
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
except:
pass
control.directory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:macblizzard,项目名称:aftershock-repo,代码行数:28,代码来源:episodes.py
示例8: alterSources
def alterSources(self, url, meta):
try:
setting = control.setting('autoplay')
if setting == 'false': url += '&url=direct://'
else: url += '&url=dialog://'
meta = json.loads(meta)
poster = meta['poster'] if 'poster' in meta else '0'
banner = meta['banner'] if 'banner' in meta else '0'
thumb = meta['thumb'] if 'thumb' in meta else poster
fanart = meta['fanart'] if 'fanart' in meta else '0'
if poster == '0': poster = control.addonPoster()
if banner == '0' and poster == '0': banner = control.addonBanner()
elif banner == '0': banner = poster
if thumb == '0' and fanart == '0': thumb = control.addonFanart()
elif thumb == '0': thumb = fanart
playlist = control.playlist
playlist.clear()
item = control.item(label='', iconImage=thumb, thumbnailImage=thumb)
try: item.setArt({'poster': poster, 'tvshow.poster': poster, 'season.poster': poster, 'banner': banner, 'tvshow.banner': banner, 'season.banner': banner})
except: pass
item.setInfo(type='Video', infoLabels = meta)
item.setProperty('Video', 'true')
item.setProperty('IsPlayable', 'true')
control.player.play(url, item)
except:
pass
开发者ID:gsolanoalvarez,项目名称:hdfulltv,代码行数:30,代码来源:__init__.py
示例9: addCategoryItem
def addCategoryItem(name, action, image, isFolder=True):
u = sys.argv[0]+"?action="+str(action)
image = control.addonInfo('path') + '/art/' + image
item = control.item(name, iconImage=image, thumbnailImage=image)
item.addContextMenuItems([], replaceItems=False)
item.setProperty('Fanart_Image', control.addonInfo('fanart'))
control.addItem(handle=int(sys.argv[1]),url=u,listitem=item,isFolder=isFolder)
开发者ID:smoky-jr,项目名称:lambda-addons,代码行数:7,代码来源:phstreams.py
示例10: sourcePage
def sourcePage(self, url, name, image):
cookie = 'view_server_name=%s; member_id=%d' % (self.view_server_name, self.member_id)
try: result = client.request(url, cookie=cookie)
except: pass
videoUrl = re.compile('file: "(.+?)"').findall(result)[0]
videoUrl = videoUrl.replace('us88', self.replace_server)
videoUrl = videoUrl.replace('http://.', 'http://' + self.replace_server + '.seesantv.com')
item = control.item(path=url, iconImage=image, thumbnailImage=image)
item.setInfo(type='Video', infoLabels={'title': name})
item.setProperty('Video', 'true')
item.setProperty('IsPlayable', 'true')
control.playlist.clear()
try:
connection = urllib2.urlopen(videoUrl)
connection.close()
except urllib2.HTTPError, e:
videoUrl = videoUrl.replace('gm99', 'uk88')
try:
connection = urllib2.urlopen(videoUrl)
connection.close()
except urllib2.HTTPError, e:
videoUrl = videoUrl.replace('uk88', 'as88')
开发者ID:mpie,项目名称:repo,代码行数:26,代码来源:thai.py
示例11: addDirectory
def addDirectory(self, items):
if items == None or len(items) == 0: return
sysaddon = sys.argv[0]
addonFanart = control.addonFanart()
addonThumb = control.addonThumb()
artPath = control.artPath()
for i in items:
try:
try: name = control.lang(i['name']).encode('utf-8')
except: name = i['name']
if i['image'].startswith('http://'): thumb = i['image']
elif not artPath == None: thumb = os.path.join(artPath, i['image'])
else: thumb = addonThumb
url = '%s?action=%s' % (sysaddon, i['action'])
try: url += '&url=%s' % urllib.quote_plus(i['url'])
except: pass
cm = []
#try: cm.append((control.lang(30239).encode('utf-8'), 'RunPlugin(%s?action=tvshowsToLibrary&url=%s)' % (sysaddon, urllib.quote_plus(i['context']))))
#except: pass
item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems(cm, replaceItems=False)
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=True)
except:
pass
views.setView('tvshows', {'skin.confluence': control.viewMode['mediainfo1']})
control.directory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:kevintone,项目名称:tdbaddon,代码行数:35,代码来源:tvshows.py
示例12: playLiveStream
def playLiveStream(self, name, url, thumb):
try:
from resources.lib.libraries.player import player
item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb)
player().play(url, item)
except:
pass
开发者ID:mpie,项目名称:repo,代码行数:7,代码来源:__init__.py
示例13: run
def run(self, content, name, url, year, imdb, tvdb, meta):
if control.window.getProperty('PseudoTVRunning') == 'True':
return control.player.play(url, control.item(path=url))
self.getVideoInfo(content, name, year, imdb, tvdb)
if self.folderPath.startswith('plugin://') and not meta == None:
poster, thumb, meta = self.getMeta(meta)
else:
poster, thumb, meta = self.getLibraryMeta(meta)
logger.debug(' meta %s' % (meta))
if not type(url) == list:
url = [url]
playlist = control.playlist
playlist.clear()
for i in range(0,len(url)):
if len(url) > 1:
meta['title'] = '%s Part # %s' % (name, str(i+1))
try:
iconImage = meta['iconImage']
except:
iconImage = 'DefaultVideo.png'
item = control.item(name, path=url[i], iconImage=iconImage, thumbnailImage=thumb)
item.setInfo(type='Video', infoLabels = meta)
try: item.setArt({'poster': poster, 'tvshow.poster': poster, 'season.poster': poster})
except: pass
item.setProperty('Video', 'true')
item.setProperty('IsPlayable', 'true')
playlist.add(url[i], item)
control.player.play(playlist)
for i in range(0, 240):
if self.isPlayingVideo(): break
xbmc.sleep(1000)
while self.isPlayingVideo():
try: self.totalTime = self.getTotalTime()
except: pass
try: self.currentTime = self.getTime()
except: pass
xbmc.sleep(1000)
control.window.clearProperty('script.trakt.ids')
time.sleep(5)
开发者ID:kevintone,项目名称:tdbaddon,代码行数:47,代码来源:player.py
示例14: addDirectoryItem
def addDirectoryItem(name, url, action, image, image2, fanart, content, data, tvshow='0', totalItems=0, isFolder=True):
if not str(image).lower().startswith('http'): image = control.addonInfo('icon')
if not str(image2).lower().startswith('http'): image2 = control.addonInfo('icon')
if not str(fanart).lower().startswith('http'): fanart = control.addonInfo('fanart')
if content in ['movies', 'episodes']: playable = 'true'
else: playable = 'false'
sysaddon = sys.argv[0]
if url.startswith('$base64'):
import base64 ; url = base64.b64decode(re.compile('\$base64\[(.+?)\]$').findall(url)[0])
u = '%s?name=%s&url=%s&tvdb=&imdb=&source=GVideo&provider=Mpie&content=%s&action=playItem' % (sysaddon, urllib.quote_plus(name), urllib.quote_plus(url), str(content))
cm = []
if content == 'movies':
cm.append((control.lang(30708).encode('utf-8'), 'XBMC.Action(Info)'))
elif content in ['tvshows', 'seasons']:
cm.append((control.lang(30709).encode('utf-8'), 'XBMC.Action(Info)'))
elif content == 'episodes':
cm.append((control.lang(30710).encode('utf-8'), 'XBMC.Action(Info)'))
if content == 'movies' and not isFolder == True:
downloadFile = name
try: downloadFile = '%s (%s)' % (data['title'], data['year'])
except: pass
cm.append((control.lang(30722).encode('utf-8'), 'RunPlugin(%s?action=addDownload&name=%s&url=%s&image=%s)' % (sysaddon, urllib.quote_plus(downloadFile), urllib.quote_plus(url), urllib.quote_plus(image))))
elif content == 'episodes' and not isFolder == True:
downloadFile = name
try: downloadFile = '%s S%02dE%02d' % (data['tvshowtitle'], int(data['season']), int(data['episode']))
except: pass
cm.append((control.lang(30722).encode('utf-8'), 'RunPlugin(%s?action=addDownload&name=%s&url=%s&image=%s)' % (sysaddon, urllib.quote_plus(downloadFile), urllib.quote_plus(url), urllib.quote_plus(image))))
if content == 'movies':
cm.append((control.lang(30711).encode('utf-8'), 'RunPlugin(%s?action=addView&content=movies)' % sysaddon))
elif content == 'tvshows':
cm.append((control.lang(30712).encode('utf-8'), 'RunPlugin(%s?action=addView&content=tvshows)' % sysaddon))
elif content == 'seasons':
cm.append((control.lang(30713).encode('utf-8'), 'RunPlugin(%s?action=addView&content=seasons)' % sysaddon))
elif content == 'episodes':
cm.append((control.lang(30714).encode('utf-8'), 'RunPlugin(%s?action=addView&content=episodes)' % sysaddon))
item = control.item(name, iconImage='DefaultFolder.png', thumbnailImage=image)
try: item.setArt({'poster': image2, 'tvshow.poster': image2, 'season.poster': image2, 'banner': image, 'tvshow.banner': image, 'season.banner': image})
except: pass
item.addContextMenuItems(cm, replaceItems=False)
item.setProperty('Fanart_Image', fanart)
if playable == 'true': item.setProperty('IsPlayable', 'true')
item.setInfo(type='Video', infoLabels=data)
control.addItem(handle=int(sys.argv[1]),url=u,listitem=item,totalItems=totalItems,isFolder=isFolder)
开发者ID:mpie,项目名称:repo,代码行数:58,代码来源:phstreams.py
示例15: downloader
def downloader():
thumb = control.addonThumb() ; fanart = control.addonFanart()
status = control.window.getProperty(property + '.status')
if not downloadPath == '':
item = control.item('[COLOR FF00b8ff]Downloads[/COLOR]', iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems([], replaceItems=True)
item.setProperty('fanart_image', fanart)
control.addItem(handle=int(sys.argv[1]), url=downloadPath, listitem=item, isFolder=True)
if status == 'downloading':
item = control.item('[COLOR red]Stop Downloads[/COLOR]', iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems([], replaceItems=True)
item.setProperty('fanart_image', fanart)
control.addItem(handle=int(sys.argv[1]), url=sys.argv[0]+'?mode=stopDownload', listitem=item, isFolder=True)
else:
item = control.item('[COLOR FF00b8ff]Start Downloads[/COLOR]', iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems([], replaceItems=True)
item.setProperty('fanart_image', fanart)
control.addItem(handle=int(sys.argv[1]), url=sys.argv[0]+'?mode=startDownload', listitem=item, isFolder=True)
if status == 'downloading':
item = control.item('[COLOR gold]Download Status[/COLOR]', iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems([], replaceItems=True)
item.setProperty('Fanart_Image', fanart)
control.addItem(handle=int(sys.argv[1]), url=sys.argv[0]+'?mode=statusDownload', listitem=item, isFolder=True)
def download(): return []
result = cache.get(download, 600000000, table='rel_dl')
for i in result:
try:
cm = []
cm.append(('Remove from Queue', 'RunPlugin(%s?mode=removeDownload&url=%s)' % (sys.argv[0], urllib.quote_plus(i['url']))))
item = control.item(i['name'], iconImage=i['image'], thumbnailImage=i['image'])
item.addContextMenuItems(cm, replaceItems=True)
item.setProperty('fanart_image', fanart)
item.setProperty('Video', 'true')
item.setProperty('IsPlayable', 'true')
control.addItem(handle=int(sys.argv[1]), url=i['url'], listitem=item)
except:
pass
control.directory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:8821kitkat,项目名称:officialrepo,代码行数:45,代码来源:downloader.py
示例16: channelDirectory
def channelDirectory(self, items):
if items == None or len(items) == 0: return
playbackMenu = control.lang(30292).encode('utf-8') if control.setting('autoplay') == 'true' else control.lang(30291).encode('utf-8')
addonPoster, addonBanner = control.addonPoster(), control.addonBanner()
addonFanart = control.addonFanart()
sysaddon = sys.argv[0]
for i in items:
try:
label = "[B]%s[/B] : %s" % (i['channel'].upper(), i['name'])
sysname = urllib.quote_plus(i['name'])
systitle = urllib.quote_plus(i['title'])
imdb, tmdb, year = i['imdb'], '0', i['year']
poster, banner = i['poster'], i['poster']
if poster == '0': poster = addonPoster
if banner == '0' and poster == '0': banner = addonBanner
elif banner == '0': banner = poster
meta = dict((k,v) for k, v in i.iteritems() if not v == '0')
meta.update({'trailer': '%s?action=trailer&name=%s' % (sysaddon, sysname)})
if i['duration'] == '0': meta.update({'duration': '120'})
try: meta.update({'duration': str(int(meta['duration']) * 60)})
except: pass
sysmeta = urllib.quote_plus(json.dumps(meta))
url = '%s?action=play&name=%s&title=%s&year=%s&imdb=%s&tmdb=%s&meta=%s&t=%s' % (sysaddon, sysname, systitle, year, imdb, tmdb, sysmeta, self.systime)
sysurl = urllib.quote_plus(url)
cm = []
cm.append((playbackMenu, 'RunPlugin(%s?action=alterSources&url=%s&meta=%s)' % (sysaddon, sysurl, sysmeta)))
cm.append((control.lang(30293).encode('utf-8'), 'Action(Info)'))
cm.append((control.lang(30294).encode('utf-8'), 'RunPlugin(%s?action=refresh)' % (sysaddon)))
cm.append((control.lang(30295).encode('utf-8'), 'RunPlugin(%s?action=openSettings)' % (sysaddon)))
cm.append((control.lang(30296).encode('utf-8'), 'RunPlugin(%s?action=openPlaylist)' % (sysaddon)))
item = control.item(label=label, iconImage=poster, thumbnailImage=poster)
try: item.setArt({'poster': poster, 'banner': banner})
except: pass
if not addonFanart == None:
item.setProperty('Fanart_Image', addonFanart)
item.setInfo(type='Video', infoLabels = meta)
item.setProperty('Video', 'true')
#item.setProperty('IsPlayable', 'true')
item.addContextMenuItems(cm, replaceItems=True)
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=False)
except:
pass
control.content(int(sys.argv[1]), 'movies')
control.directory(int(sys.argv[1]), cacheToDisc=True)
开发者ID:gitrazr,项目名称:filmkodi,代码行数:57,代码来源:channels.py
示例17: run
def run(self, url):
title = control.infoLabel('ListItem.Label')
image = control.infoLabel('ListItem.Icon')
item = control.item(path=url, iconImage=image, thumbnailImage=image)
item.setInfo(type='Video', infoLabels = {'title': title})
control.player.play(url, item)
for i in range(0, 240):
if self.isPlayingVideo(): break
control.sleep(1000)
开发者ID:c0ns0le,项目名称:YCBuilds,代码行数:10,代码来源:phtoons.py
示例18: play
def play(self, name, url=None):
try:
url = self.worker(name, url)
if url == None: return
item = control.item(path=url)
item.setProperty('IsPlayable', 'true')
control.player.play(url, item)
except:
pass
开发者ID:mpie,项目名称:repo,代码行数:10,代码来源:trailer.py
示例19: addDirectoryItem
def addDirectoryItem(self, name, query, thumb, icon, context=None, isAction=True, isFolder=True):
try: name = control.lang(name).encode('utf-8')
except: pass
url = '%s?action=%s' % (sysaddon, query) if isAction == True else query
thumb = os.path.join(artPath, thumb) if not artPath == None else icon
cm = []
if not context == None: cm.append((control.lang(context[0]).encode('utf-8'), 'RunPlugin(%s?action=%s)' % (sysaddon, context[1])))
item = control.item(label=name, iconImage=thumb, thumbnailImage=thumb)
item.addContextMenuItems(cm, replaceItems=False)
if not addonFanart == None: item.setProperty('Fanart_Image', addonFanart)
control.addItem(handle=int(sys.argv[1]), url=url, listitem=item, isFolder=isFolder)
开发者ID:mpie,项目名称:repo,代码行数:11,代码来源:livetv.py
示例20: resolveUrl
def resolveUrl(name, url, image, fanart, playable, content):
try:
if url.startswith('$base64'):
import base64 ; url = base64.b64decode(re.compile('\$base64\[(.+?)\]$').findall(url)[0])
label = cleantitle(name)
item = control.item(path=url, iconImage=image, thumbnailImage=image)
item.setInfo( type='Video', infoLabels = {'title': label} )
control.playlist.clear()
control.player.play(url, item)
except:
pass
开发者ID:mpie,项目名称:repo,代码行数:11,代码来源:phstreams.py
注:本文中的resources.lib.libraries.control.item函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论