本文整理汇总了Python中xbmc.getInfoImage函数的典型用法代码示例。如果您正苦于以下问题:Python getInfoImage函数的具体用法?Python getInfoImage怎么用?Python getInfoImage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getInfoImage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Playvid
def Playvid(url, name, download=None):
videopage = utils.getHtml(url, '')
videourl = re.compile('video_url="([^"]+)"').findall(videopage)[0]
videourl += re.compile('video_url\+="([^"]+)"').findall(videopage)[0]
partes = videourl.split('||')
videourl = decode_url(partes[0])
videourl = re.sub('/get_file/\d+/[0-9a-z]{32}/', partes[1], videourl)
videourl += '&' if '?' in videourl else '?'
videourl += 'lip=' + partes[2] + '<=' + partes[3]
if download == 1:
utils.downloadVideo(videourl, name)
else:
iconimage = xbmc.getInfoImage("ListItem.Thumb")
listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
listitem.setProperty("IsPlayable","true")
if int(sys.argv[1]) == -1:
pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
pl.clear()
pl.add(videourl, listitem)
xbmc.Player().play(pl)
else:
iconimage = xbmc.getInfoImage("ListItem.Thumb")
listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
xbmc.Player().play(videourl, listitem)
示例2: playClip
def playClip():
import xbmc
title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
thumb = unicode( xbmc.getInfoImage( "ListItem.Thumb" ), "utf-8" )
#
listitem = xbmcgui.ListItem( title, '', 'DefaultVideo.png', thumb )
#
infoLabels = {
'title': title,
'plot': unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ),
"episode": int( xbmc.getInfoImage( "ListItem.episode" ) or "-1" ),
}
infoLabels.update( b_infoLabels )
listitem.setInfo( 'video', infoLabels )
#
if ADDON.getSetting( "full" ) == "false":
from resources.lib.scraper import getClip
srt, hd, sd = getClip( xbmc.getInfoLabel( "ListItem.Property(id)" ) )
else:
srt, hd, sd = xbmc.getInfoLabel( "ListItem.Property(srt_url)" ), xbmc.getInfoLabel( "ListItem.Property(hd_url)" ), xbmc.getInfoLabel( "ListItem.Property(sd_url)" )
#
media = ( hd, sd )[ int( ADDON.getSetting( "quality" ) ) ]
#
xbmc.Player().play( media, listitem )
#
print "playClip(%r)" % media
#
if ADDON.getSetting( "subtitle" ) == "true":
from resources.lib.scraper import getSubtitle
srt = getSubtitle( srt, os.path.splitext( os.path.basename( media ) )[ 0 ] )
if not xbmc.Player().isPlaying():
xbmc.sleep( 5000 )
xbmc.Player().setSubtitles( srt )
xbmc.Player().showSubtitles( True )
示例3: __init__
def __init__(self, nfo_path = None):
info_labels = {
'size' : unicode(xbmc.getInfoLabel( "ListItem.Size" ), 'utf-8'),
'tvshowtitle': unicode(xbmc.getInfoLabel( "ListItem.TvShowTitle" ), 'utf-8'),
'title': unicode(xbmc.getInfoLabel( "ListItem.Title" ), 'utf-8'),
'genre': unicode(xbmc.getInfoLabel( "ListItem.Genre" ), 'utf-8'),
'plot': unicode(xbmc.getInfoLabel( "ListItem.Plot" ), 'utf-8'),
'aired': unicode(xbmc.getInfoLabel( "ListItem.Premiered" ), 'utf-8'),
'mpaa': unicode(xbmc.getInfoLabel( "ListItem.MPAA" ), 'utf-8'),
'duration': unicode(xbmc.getInfoLabel( "ListItem.DUration" ), 'utf-8'),
'studio': unicode(xbmc.getInfoLabel( "ListItem.Studio" ), 'utf-8'),
'cast': unicode(xbmc.getInfoLabel( "ListItem.Cast" ), 'utf-8'),
'writer': unicode(xbmc.getInfoLabel( "ListItem.Writer" ), 'utf-8'),
'director': unicode(xbmc.getInfoLabel( "ListItem.Director" ), 'utf-8'),
'season': int(xbmc.getInfoLabel( "ListItem.Season" ) or "-1"),
'episode': int(xbmc.getInfoLabel( "ListItem.Episode" ) or "-1"),
'year': int(xbmc.getInfoLabel( "ListItem.Year" ) or "-1"),
}
# Clear empty keys
for key in info_labels.keys():
if(info_labels[key] == -1):
del info_labels[key]
try:
if (len(info_labels[key])<1):
del info_labels[key]
except:
pass
try:
info_labels['size'] = self._size_to_bytes(info_labels['size'])
except:
pass
try:
code = self._code_from_plot(info_labels['plot'])
if code:
info_labels['code'] = code
except:
pass
try:
info_labels['cast'] = info_labels['cast'].split('\n')
except:
pass
if not 'title' in info_labels:
if nfo_path:
info_labels['title'] = os.path.basename(nfo_path)
else:
info_labels['title'] = 'Unknown'
self.info_labels = info_labels
self.fanart = unicode(xbmc.getInfoImage( "Listitem.Property(Fanart_Image)" ), 'utf-8')
self.thumbnail = unicode(xbmc.getInfoImage( "ListItem.Thumb" ), 'utf-8')
self.nfo_path = nfo_path
示例4: BGPlayvid
def BGPlayvid(url, name, download=None):
videopage = utils.getHtml(url, "")
videopage = json.loads(videopage)
if not videopage["240p"] == None:
url = videopage["240p"].encode("utf8")
if not videopage["480p"] == None:
url = videopage["480p"].encode("utf8")
if not videopage["720p"] == None:
url = videopage["720p"].encode("utf8")
url = url.replace("{DATA_MARKERS}", "data=pc.DE")
if not url.startswith("http:"):
url = "https:" + url
key = re.compile("/key=(.*?)%2Cend", re.DOTALL | re.IGNORECASE).findall(url)[0]
decryptedkey = decrypt_key(key)
videourl = url.replace(key, decryptedkey)
if download == 1:
utils.downloadVideo(videourl, name)
else:
iconimage = xbmc.getInfoImage("ListItem.Thumb")
listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
listitem.setInfo("video", {"Title": name, "Genre": "Porn"})
listitem.setProperty("IsPlayable", "true")
if int(sys.argv[1]) == -1:
pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
pl.clear()
pl.add(videourl, listitem)
xbmc.Player().play(pl)
else:
listitem.setPath(str(videourl))
xbmcplugin.setResolvedUrl(utils.addon_handle, True, listitem)
示例5: __init__
def __init__( self ) :
#
# Constants
#
self.VIDEO_PAGE_URL2 = re.compile( ".*/video/(\d+)/.*" )
self.VIDEO_PAGE_URL3 = re.compile( ".*/video[s]?/.*-(\d+)" )
#
# Parse parameters...
#
params = dict(part.split('=') for part in sys.argv[ 2 ][ 1: ].split('&'))
self.video_page_url = urllib.unquote( params[ "video_page_url" ] )
self.play_hd = urllib.unquote( params[ "play_hd" ] )
# Settings
self.video_players = { "0" : xbmc.PLAYER_CORE_AUTO,
"1" : xbmc.PLAYER_CORE_DVDPLAYER,
"2" : xbmc.PLAYER_CORE_MPLAYER }
self.video_player = xbmcplugin.getSetting ("video_player")
#
# Get current item details...
#
self.video_title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
self.video_thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
self.video_studio = unicode( xbmc.getInfoLabel( "ListItem.Studio" ), "utf-8" )
self.video_plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
self.video_genre = unicode( xbmc.getInfoLabel( "ListItem.Genre" ), "utf-8" )
#
# Play video...
#
self.playVideo()
示例6: _fill_cast
def _fill_cast( self, listitem ):
xbmcgui.lock()
try:
# clear the cast list
self.getControl( self.CONTROL_INFO_CAST ).reset()
# grab the cast from the main lists listitem, we use this for actor thumbs
cast = xbmc.getInfoLabel( "Container(100).ListItem.Cast" )
# if cast exists we fill the cast list
if ( cast ):
# we set these class variables for the player
self.title = xbmc.getInfoLabel( "Container(100).ListItem.Title" )
self.genre = xbmc.getInfoLabel( "Container(100).ListItem.Genre" )
self.plot = xbmc.getInfoLabel( "Container(100).ListItem.Plot" )
self.director = xbmc.getInfoLabel( "Container(100).ListItem.Director" )
self.year = int( xbmc.getInfoLabel( "Container(100).ListItem.Year" ) )
self.trailer = xbmc.getInfoLabel( "Container(100).ListItem.Trailer" )
self.thumb = xbmc.getInfoImage( "Container(100).ListItem.Thumb" )
# we actually use the ListItem.CastAndRole infolabel to fill the list
role = xbmc.getInfoLabel( "Container(100).ListItem.CastAndRole" ).split( "\n" )
# enumerate through our cast list and set cast and role
for count, actor in enumerate( cast.split( "\n" ) ):
# create the actor cached thumb
actor_path = xbmc.translatePath( os.path.join( "P:\\Thumbnails", "Video", xbmc.getCacheThumbName( "actor" + actor )[ 0 ], xbmc.getCacheThumbName( "actor" + actor ) ) )
# if an actor thumb exists use it, else use the default thumb
actor_thumbnail = ( "DefaultActorBig.png", actor_path, )[ os.path.isfile( actor_path ) ]
# set the default icon
actor_icon = "DefaultActorBig.png"
# add the item to our cast list
self.getControl( self.CONTROL_INFO_CAST ).addItem( xbmcgui.ListItem( role[ count ], iconImage=actor_icon, thumbnailImage=actor_thumbnail ) )
# set the play trailer buttons status
self._set_trailer_button( self.trailer )
except:
pass
xbmcgui.unlock()
示例7: Playvid
def Playvid(url, name, download=None):
listhtml = utils.getHtml2(url)
listhtml = utils.unescapes(listhtml)
match480 = re.search(r'[[]480p[]]=([^"]*?)&video_vars', listhtml)
if match480: videourl = match480.group(1)
else:
match360 = re.search(r'[[]360p[]]=([^"]*?)&video_vars', listhtml)
videourl = match360.group(1)
if download == 1:
utils.downloadVideo(videourl, name)
else:
iconimage = xbmc.getInfoImage("ListItem.Thumb")
listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
listitem.setProperty("IsPlayable","true")
if int(sys.argv[1]) == -1:
pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
pl.clear()
pl.add(videourl, listitem)
xbmc.Player().play(pl)
else:
listitem.setPath(str(videourl))
xbmcplugin.setResolvedUrl(utils.addon_handle, True, listitem)
return
示例8: PlayMovie
def PlayMovie(name, url):
if 'm3u8' in url:
PlayStream(name, url)
else:
progress.create('Play video', 'Searching videofile')
progress.update( 30, "", "Loading video page", "Sending it to urlresolver" )
source = urlresolver.HostedMediaFile(url)
if source:
progress.update( 80, "", "Loading video page", "Found the video" )
streamurl = source.resolve()
if source.resolve()==False:
progress.close()
xbmc.executebuiltin("XBMC.Notification(Oh no!,Link Cannot Be Resolved,5000)")
return
else:
streamurl = url
progress.close()
iconimage = xbmc.getInfoImage("ListItem.Thumb")
ok = True
listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
listitem.setInfo(type="Video", infoLabels={ "Title": name })
ok = xbmcplugin.addDirectoryItem(addon_handle,url=streamurl,listitem=listitem)
try:
xbmc.Player().play(streamurl, listitem, False)
return ok
except: pass
示例9: LOAD_AND_PLAY_VIDEO
def LOAD_AND_PLAY_VIDEO(self, url, title, player=True):
if url == "":
d = xbmcgui.Dialog()
d.ok("Nie znaleziono streamingu", "Może to chwilowa awaria.", "Spróbuj ponownie za jakiś czas")
return False
thumbnail = xbmc.getInfoImage("ListItem.Thumb")
liz = xbmcgui.ListItem(title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail)
liz.setInfo(type="Video", infoLabels={"Title": title})
try:
if player != True:
print "custom player pCommon"
xbmcPlayer = player
else:
print "default player pCommon"
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(url, liz)
except:
d = xbmcgui.Dialog()
d.ok(
"Błąd przy przetwarzaniu, lub wyczerpany limit czasowy oglądania.",
"Zarejestruj się i opłać abonament.",
"Aby oglądać za darmo spróbuj ponownie za jakiś czas",
)
return False
return True
示例10: __LOAD_AND_PLAY
def __LOAD_AND_PLAY(self, url, title, player=True, pType='video'):
if url == '':
d = xbmcgui.Dialog()
d.ok('Nie znaleziono streamingu', 'Może to chwilowa awaria.', 'Spróbuj ponownie za jakiś czas')
return False
thumbnail = xbmc.getInfoImage("ListItem.Thumb")
liz = xbmcgui.ListItem(title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail)
liz.setInfo(type="pType", infoLabels={"Title": title})
try:
if player != True:
print "custom player pCommon"
xbmcPlayer = player
else:
print "default player pCommon"
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(url, liz)
except:
d = self.dialog()
if pType == "video":
d.ok('Wystąpił błąd!', 'Błąd przy przetwarzaniu, lub wyczerpany limit czasowy oglądania.',
'Zarejestruj się i opłać abonament.', 'Aby oglądać za darmo spróbuj ponownie za jakiś czas.')
elif pType == "music":
d.ok('Wystąpił błąd!', 'Błąd przy przetwarzaniu.', 'Aby wysłuchać spróbuj ponownie za jakiś czas.')
return False
return True
示例11: PlaySEBN
def PlaySEBN(url,name=None):
iconimage = xbmc.getInfoImage("ListItem.Thumb")
liz=xbmcgui.ListItem(name, iconImage="DefaultFolder.png", thumbnailImage=iconimage)
liz.setInfo( type="Video", infoLabels={ "Title": name } )
dp = xbmcgui.DialogProgress()
dp.create("DutchSportStreams","Please wait")
xbmc.Player().play(url, liz, False)
示例12: play
def play(self):
if Debug: self.LOG('Play Video')
# Get current list item details...
title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8")
thumbnail = xbmc.getInfoImage("ListItem.Thumb")
plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")
director = unicode(xbmc.getInfoLabel("ListItem.Director"), "utf-8")
date = unicode(xbmc.getInfoLabel("ListItem.Date"), "utf-8")
year = unicode(xbmc.getInfoLabel("ListItem.Year"), "utf-8")
studio = unicode(xbmc.getInfoLabel("ListItem.Studio"), "utf-8")
# Parse HTML results page...
html = urllib.urlopen(self.Arguments('url')).read()
# Get FLV video...
match = re.compile('so.addVariable\(\'file\'\,\'(.+?)\'\)\;').findall(html)
for _url in match:
video_url = _url
# Create video playlist...
playlist = xbmc.PlayList(1)
playlist.clear()
# only need to add label, icon and thumbnail, setInfo() and addSortMethod() takes care of label2
listitem = xbmcgui.ListItem(title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail)
# set the key information
listitem.setInfo("Video", {"Title": title,
"Label" : title,
"Director" : director,
"Plot": plot,
"PlotOutline": plot,
"Date" : date,
#"Year" : year,
"Studio" : studio })
# add item to our playlist
playlist.add(video_url, listitem)
# Play video...
xbmcPlayer = xbmc.Player()
xbmcPlayer.play(playlist)
示例13: BGPlayvid
def BGPlayvid(url, name, download=None):
videopage = utils.getHtml(url, '')
match = re.compile("'720p': '([^']+)'", re.DOTALL | re.IGNORECASE).findall(videopage)
if not match:
match = re.compile("'480p': '([^']+)'", re.DOTALL | re.IGNORECASE).findall(videopage)
if not match:
match = re.compile("'240p': '([^']+)'", re.DOTALL | re.IGNORECASE).findall(videopage)
if match:
videourl = match[0]
if download == 1:
utils.downloadVideo(videourl, name)
else:
iconimage = xbmc.getInfoImage("ListItem.Thumb")
listitem = xbmcgui.ListItem(name, iconImage="DefaultVideo.png", thumbnailImage=iconimage)
listitem.setInfo('video', {'Title': name, 'Genre': 'Porn'})
listitem.setProperty("IsPlayable","true")
if int(sys.argv[1]) == -1:
pl = xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
pl.clear()
pl.add(videourl, listitem)
xbmc.Player().play(pl)
#xbmc.Player().play(videourl, listitem)
else:
listitem.setPath(str(videourl))
xbmcplugin.setResolvedUrl(utils.addon_handle, True, listitem)
示例14: playVideo
def playVideo( self, video ) :
#
# Get current list item details...
#
title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" )
thumbnail = xbmc.getInfoImage( "ListItem.Thumb" )
studio = unicode( xbmc.getInfoLabel( "ListItem.Studio" ), "utf-8" )
plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" )
director = unicode( xbmc.getInfoLabel( "ListItem.Director"), "utf-8" )
#
# Play video...
#
playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO )
playlist.clear()
listitem = xbmcgui.ListItem( title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail )
listitem.setInfo( "video", { "Title": title, "Studio" : studio, "Plot" : plot, "Director" : director } )
playlist.add( video, listitem )
# Play video...
xbmcPlayer = xbmc.Player( self.video_players[ self.video_player ] )
xbmcPlayer.play(playlist)
#
# The End
#
示例15: play
def play(self, page, mode=''):
if Debug: self.LOG('DEBUG: _play()\nurl: %s' % page)
# Get current list item details...
title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8")
thumbnail = xbmc.getInfoImage("ListItem.Thumb")
plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8")
if mode == 'smil':
smil = BSS(self._get(page))
rtmp = smil.meta['base']
video = smil.video['src']
swfUrl = 'http://medici.tv/medici.swf'
# rtmpdump script for console use
rtmpdump = "rtmpdump -r %s --swfUrl http://medici.tv/medici.swf --tcUrl '%s' --playpath '%s' -o '%s.mp4'" % \
(rtmp, rtmp, saxutils.unescape(video), saxutils.unescape(title))
# Build rtmp url...
video_url = rtmp + ' swfUrl=' + swfUrl + ' tcUrl=' + rtmp + ' playpath=' + saxutils.unescape(video)
if Debug: self.LOG('DEBUG: rtmp link details.\n\trtmp: %s\n\tswfUrl: %s\n\ttcUrl: %s\n\tplaypath: %s\n\trtmpdump: %s' % \
(rtmp, swfUrl, rtmp, saxutils.unescape(video), rtmpdump))
elif mode == 'rtmp_daily':
video_url = page.split('&rtmp=1')[0]
if Debug: self.LOG('DEBUG: video link details.\n\turl: %s' % video_url)
else:
video_url = ''
if Debug: self.LOG('DEBUG: no video link!')
raise
# only need to add label, icon and thumbnail, setInfo() and addSortMethod() takes care of label2
listitem = xbmcgui.ListItem(title, iconImage="DefaultVideo.png", thumbnailImage=thumbnail)
# set listitem information
listitem.setInfo('video', {'title': title,
'label' : title,
'plot': plot,
'plotoutline': plot, })
# Play video...
xbmc.Player().play(video_url , listitem)