本文整理汇总了Python中xbmc.getCacheThumbName函数的典型用法代码示例。如果您正苦于以下问题:Python getCacheThumbName函数的具体用法?Python getCacheThumbName怎么用?Python getCacheThumbName使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCacheThumbName函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: _shuffle_trailers
def _shuffle_trailers( self ):
# randomize the groups and create our play list
shuffle( self.tmp_trailers )
# reset counter
count = 0
# now create our final playlist
for trailer in self.tmp_trailers:
# user preference to skip watch trailers
if ( self.settings[ "trailer_unwatched_only" ] and xbmc.getCacheThumbName( trailer[ 0 ] ) in self.watched ):
##print "SKIPPED:", repr(trailer[ 0 ])
continue
# set all info
tmp_trailer = self._set_trailer_info( trailer )
# convert mpaa if necessary
if ( self.mpaa_conversion is not None ):
tmp_trailer[ 6 ] = self.mpaa_conversion.get( tmp_trailer[ 6 ], "NR" )
# do we need to skip this one
if ( self.mpaa_ratings.get( self.mpaa, self.settings[ "unrated_rating_index" ] ) < self.mpaa_ratings.get( tmp_trailer[ 6 ], self.settings[ "unrated_rating_index" ] ) ):
##LOG( "Skipping trailer: %s - Movie: %s, Unrated: %s, Trailer: %s" % ( repr( tmp_trailer[ 1 ] ), self.mpaa, ("G","PG","PG-13","R","NC-17",)[ self.settings[ "mpaa_rating" ] ], tmp_trailer[ 6 ], ) )
continue
# add id to watched file
if ( self.settings[ "trailer_unwatched_only" ] ):
self.watched += [ xbmc.getCacheThumbName( trailer[ 0 ] ) ]
# add trailer to our final list
self.trailers += [ tmp_trailer ]
# increment counter
count += 1
# if we have enough exit
if ( count == self.settings[ "trailer_count" ] ):
break
开发者ID:nuka1195,项目名称:script.cinema_experience,代码行数:30,代码来源:scraper.py
示例2: _shuffle_slides
def _shuffle_slides( tmp_slides, watched ):
utils.log( "Sorting Watched/Unwatched and Shuffing Slides ", xbmc.LOGNOTICE )
slide_playlist = []
# randomize the groups and create our play list
count = 0
while count <6:
shuffle( tmp_slides, random )
count += 1
# now create our final playlist
# loop thru slide groups and skip already watched groups
for slides in tmp_slides:
# has this group been watched
if ( not slide_settings[ "trivia_unwatched_only" ] or ( slides[ 0 ] and xbmc.getCacheThumbName( slides[ 0 ] ) not in watched ) or
( slides[ 1 ] and xbmc.getCacheThumbName( slides[ 1 ] ) not in watched ) or
( slides[ 2 ] and xbmc.getCacheThumbName( slides[ 2 ] ) not in watched ) ):
# loop thru slide group only include non blank slides
for slide in slides:
# only add if non blank
if ( slide ):
# add slide
slide_playlist += [ slide ]
utils.log( "-------- Unwatched -------- included - %s, %s, %s" % ( os.path.basename( slides[ 0 ] ), os.path.basename( slides[ 1 ] ), os.path.basename( slides[ 2 ] ), ) )
else:
utils.log( "-------- Watched -------- skipped - %s, %s, %s" % ( os.path.basename( slides[ 0 ] ), os.path.basename( slides[ 1 ] ), os.path.basename( slides[ 2 ] ), ) )
utils.log( "-----------------------------" )
utils.log( "Total slides selected: %d" % len( slide_playlist ), xbmc.LOGNOTICE )
# reset watched automatically if no slides are left
if ( len( slide_playlist ) == 0 and slide_settings[ "trivia_unwatched_only" ] and len( watched ) > 0 ):
watched = _reset_watched()
#attempt to load our playlist again
_shuffle_slides( tmp_slides, watched )
return slide_playlist
开发者ID:Giftie,项目名称:script.cinema.experience,代码行数:35,代码来源:slides.py
示例3: _shuffle_trailers
def _shuffle_trailers( self ):
# randomize the groups and create our play list
utils.log( "Shuffling Trailers", xbmc.LOGNOTICE )
shuffle( self.tmp_trailers )
count = 0
# now create our final playlist
for trailer in self.tmp_trailers:
# user preference to skip watch trailers
if ( self.settings[ "trailer_unwatched_only" ] and xbmc.getCacheThumbName( trailer ) in self.watched ):
continue
# add trailer to our final list
trailer_info = _set_trailer_info( trailer )
trailer_genre = trailer_info[ 9 ].split(" / ")
trailer_rating = trailer_info[ 6 ].replace("Rated ", "")
if self.settings[ "trailer_limit_genre" ]:
if len( set( trailer_genre ).intersection( self.genre ) ) < 1:
utils.log("Genre Not Matched - Skipping Trailer: %s != %s" % (trailer_genre, self.genre) )
continue
if self.settings[ "trailer_limit_mpaa" ]:
trailer_mpaa = self.mpaa_ratings.index( trailer_rating )
if trailer_mpaa > self.mpaa:
utils.log("MPAA too high - Skipping Trailer: %s > %s" % ( trailer_rating, self.mpaa_ratings[ self.mpaa ] ) )
continue
self.trailers += [ trailer_info ]
# add id to watched file TODO: maybe don't add if not user preference
self.watched += [ xbmc.getCacheThumbName( trailer ) ]
# increment counter
count += 1
# if we have enough exit
if ( count == self.settings[ "trailer_count" ] ):
break
if ( len( self.trailers ) == 0 and self.settings[ "trailer_unwatched_only" ] and len( self.watched ) > 0 ):
self._reset_watched()
#attempt to load our playlist again
self._shuffle_trailers()
开发者ID:Giftie,项目名称:script.cinema.experience,代码行数:35,代码来源:scraper.py
示例4: _shuffle_trailers
def _shuffle_trailers( self ):
# randomize the groups and create our play list
log( "%s - Shuffling Trailers" % logmessage, xbmc.LOGNOTICE )
shuffle( self.tmp_trailers )
# reset counter
count = 0
# now create our final playlist
for trailer in self.tmp_trailers:
# user preference to skip watch trailers
if ( self.settings[ "trailer_unwatched_only" ] and xbmc.getCacheThumbName( trailer ) in self.watched ):
continue
# add trailer to our final list
trailer_info = _set_trailer_info( trailer )
trailer_genre = trailer_info[ 9 ].split(" / ")
trailer_rating = trailer_info[ 6 ].replace("Rated ", "")
if self.settings[ "trailer_limit_genre" ] and ( not list(set(trailer_genre) & set(self.genre) ) ):
log( "%s - Genre Not Matched - Skipping Trailer" % logmessage )
continue
if self.settings[ "trailer_limit_mpaa" ] and ( not trailer_rating or not trailer_rating == self.mpaa ):
log( "%s - MPAA Not Matched - Skipping Trailer" % logmessage )
continue
self.trailers += [ trailer_info ]
# add id to watched file TODO: maybe don't add if not user preference
self.watched += [ xbmc.getCacheThumbName( trailer ) ]
# increment counter
count += 1
# if we have enough exit
if ( count == self.settings[ "trailer_count" ] ):
break
if ( len(self.trailers) == 0 and self.settings[ "trailer_unwatched_only" ] and len( self.watched ) > 0 ):
self._reset_watched()
#attempt to load our playlist again
self._shuffle_trailers()
开发者ID:h0tw1r3,项目名称:script.cinema.experience,代码行数:33,代码来源:scraper.py
示例5: getCachedThumb
def getCachedThumb(file):
if file[0:8] == 'stack://':
commaPos = file.find(' , ')
file = xbmc.getCacheThumbName(file[8:commaPos].strip())
crc = xbmc.getCacheThumbName(file.lower())
return xbmc.translatePath('special://profile/Thumbnails/Video/%s/%s' % (crc[0], crc))
开发者ID:htpc-tac,项目名称:script.sneak,代码行数:7,代码来源:addon.py
示例6: _shuffle_slides
def _shuffle_slides( self ):
# randomize the groups and create our play list
shuffle( self.tmp_slides )
# now create our final playlist
print "-----------------------------------------"
# loop thru slide groups and skip already watched groups
for slides in self.tmp_slides:
# has this group been watched
if ( not self.settings[ "trivia_unwatched_only" ] or ( slides[ 0 ] and xbmc.getCacheThumbName( slides[ 0 ] ) not in self.watched ) or
( slides[ 1 ] and xbmc.getCacheThumbName( slides[ 1 ] ) not in self.watched ) or
( slides[ 2 ] and xbmc.getCacheThumbName( slides[ 2 ] ) not in self.watched ) ):
# loop thru slide group only include non blank slides
for slide in slides:
# only add if non blank
if ( slide ):
# add slide
self.slide_playlist += [ slide ]
print "included - %s, %s, %s" % ( os.path.basename( slides[ 0 ] ), os.path.basename( slides[ 1 ] ), os.path.basename( slides[ 2 ] ), )
else:
print "----------------------------------------------------"
print "skipped - %s, %s, %s" % ( os.path.basename( slides[ 0 ] ), os.path.basename( slides[ 1 ] ), os.path.basename( slides[ 2 ] ), )
print "----------------------------------------------------"
print
print "total slides selected: %d" % len( self.slide_playlist )
print
开发者ID:ackbarr,项目名称:script.cinema.experience,代码行数:26,代码来源:xbmcscript_trivia.py
示例7: getCacheThumb
def getCacheThumb( self, path, file ):
play_path = fanart_path = thumb_path = path + file
if ( file.startswith( "stack://" ) ):
play_path = fanart_path = file
thumb_path = file[ 8 : ].split( " , " )[ 0 ]
if ( file.startswith( "rar://" ) or file.startswith( "zip://" ) ):
play_path = fanart_path = thumb_path = file
return xbmc.getCacheThumbName( thumb_path ), xbmc.getCacheThumbName( fanart_path ), play_path
开发者ID:xbs08,项目名称:Confluence_Lite,代码行数:8,代码来源:content.search.py
示例8: PrepareCacheDirs
def PrepareCacheDirs(self, item):
chandirname = xbmc.getCacheThumbName(item.channel.link).replace(".tbn","")
tpath = xbmc.translatePath('special://masterprofile/Thumbnails/RSS/%s' % chandirname)
checkDir(tpath)
itemdirname = xbmc.getCacheThumbName(item.link).replace(".tbn","")
tpath = os.path.join(tpath, itemdirname)
checkDir(tpath)
item.multiimagepath = tpath
开发者ID:Black09,项目名称:pieh-xbmc-addons,代码行数:10,代码来源:rss.py
示例9: _fetch_music_info
def _fetch_music_info( self ):
# Current Working Directory
# sql statement
if ( self.ALBUMS ):
sql_music = "select * from albumview order by RANDOM() limit %d" % ( self.LIMIT, )
# query the database for recently added albums
music_xml = xbmc.executehttpapi( "QueryMusicDatabase(%s)" % quote_plus( sql_music ), )
# separate the records
items = re.findall( "<record>(.+?)</record>", music_xml, re.DOTALL )
# enumerate thru our records and set our properties
for count, item in enumerate( items ):
# separate individual fields
fields = re.findall( "<field>(.*?)</field>", item, re.DOTALL )
# set properties
self.WINDOW.setProperty( "RandomSong.%d.Title" % ( count + 1, ), fields[ 1 ] )
self.WINDOW.setProperty( "RandomSong.%d.Year" % ( count + 1, ), fields[ 8 ] )
self.WINDOW.setProperty( "RandomSong.%d.Artist" % ( count + 1, ), fields[ 6 ] )
self.WINDOW.setProperty( "RandomSong.%d.Rating" % ( count + 1, ), fields[ 18 ] )
# Album Path (ID)
path = 'XBMC.RunScript(script.randomitems,albumid=' + fields[ 0 ] + ')'
self.WINDOW.setProperty( "RandomSong.%d.Path" % ( count + 1, ), path )
# get cache name of path to use for fanart
cache_name = xbmc.getCacheThumbName( fields[ 6 ] )
self.WINDOW.setProperty( "RandomSong.%d.Fanart" % ( count + 1, ), "special://profile/Thumbnails/Music/%s/%s" % ( "Fanart", cache_name, ) )
self.WINDOW.setProperty( "RandomSong.%d.Thumb" % ( count + 1, ), fields[ 9 ] )
else:
# set our unplayed query
unplayed = ( "", "where lastplayed is null ", )[ self.UNPLAYED ]
# sql statement
sql_music = "select * from songview %sorder by RANDOM() limit %d" % ( unplayed, self.LIMIT, )
# query the database
music_xml = xbmc.executehttpapi( "QueryMusicDatabase(%s)" % quote_plus( sql_music ), )
# separate the records
items = re.findall( "<record>(.+?)</record>", music_xml, re.DOTALL )
# enumerate thru our records and set our properties
for count, item in enumerate( items ):
# separate individual fields
fields = re.findall( "<field>(.*?)</field>", item, re.DOTALL )
# set properties
self.WINDOW.setProperty( "RandomSong.%d.Title" % ( count + 1, ), fields[ 3 ] )
self.WINDOW.setProperty( "RandomSong.%d.Year" % ( count + 1, ), fields[ 6 ] )
self.WINDOW.setProperty( "RandomSong.%d.Artist" % ( count + 1, ), fields[ 24 ] )
self.WINDOW.setProperty( "RandomSong.%d.Album" % ( count + 1, ), fields[ 21 ] )
self.WINDOW.setProperty( "RandomSong.%d.Rating" % ( count + 1, ), fields[ 18 ] )
path = fields[ 22 ]
# don't add song for albums list TODO: figure out how toplay albums
##if ( not self.ALBUMS ):
path += fields[ 8 ]
self.WINDOW.setProperty( "RandomSong.%d.Path" % ( count + 1, ), path )
# get cache name of path to use for fanart
cache_name = xbmc.getCacheThumbName( fields[ 24 ] )
self.WINDOW.setProperty( "RandomSong.%d.Fanart" % ( count + 1, ), "special://profile/Thumbnails/Music/%s/%s" % ( "Fanart", cache_name, ) )
self.WINDOW.setProperty( "RandomSong.%d.Thumb" % ( count + 1, ), fields[ 27 ] )
开发者ID:070499,项目名称:repo-scripts,代码行数:53,代码来源:RandomItems.py
示例10: _get_media
def _get_media( self, path, file ):
# set default values
play_path = fanart_path = thumb_path = path + file
# we handle stack:// media special
if ( file.startswith( "stack://" ) ):
play_path = fanart_path = file
thumb_path = file[ 8 : ].split( " , " )[ 0 ]
# we handle rar:// and zip:// media special
if ( file.startswith( "rar://" ) or file.startswith( "zip://" ) ):
play_path = fanart_path = thumb_path = file
# strip username/password
return xbmc.getCacheThumbName( re.sub( "//[email protected]", "//", thumb_path ) ), xbmc.getCacheThumbName( re.sub( "//[email protected]", "//", fanart_path ) ), play_path
开发者ID:420smiles,项目名称:MediaStream_Redux_Mod,代码行数:12,代码来源:RecentlyAdded.py
示例11: _get_media
def _get_media( self, path, file ):
# set default values
play_path = fanart_path = thumb_path = path + file
# we handle stack:// media special
if ( file.startswith( "stack://" ) ):
play_path = fanart_path = file
thumb_path = file[ 8 : ].split( " , " )[ 0 ]
# we handle rar:// and zip:// media special
if ( file.startswith( "rar://" ) or file.startswith( "zip://" ) ):
play_path = fanart_path = thumb_path = file
# return media info
return xbmc.getCacheThumbName( thumb_path ), xbmc.getCacheThumbName( fanart_path ), play_path
开发者ID:AllisterFiend,项目名称:aeon,代码行数:12,代码来源:extras.py
示例12: get_cached_thumb
def get_cached_thumb(self, filename):
if filename.startswith("stack://"):
filename = strPath[ 8 : ].split(" , ")[ 0 ]
if filename.endswith("folder.jpg"):
cachedthumb = xbmc.getCacheThumbName(filename)
thumbpath = os.path.join( THUMBS_CACHE_PATH, cachedthumb[0], cachedthumb ).replace( "/Video" , "")
else:
cachedthumb = xbmc.getCacheThumbName(filename)
if ".jpg" in filename:
cachedthumb = cachedthumb.replace("tbn" ,"jpg")
elif ".png" in filename:
cachedthumb = cachedthumb.replace("tbn" ,"png")
thumbpath = os.path.join( THUMBS_CACHE_PATH, cachedthumb[0], cachedthumb ).replace( "/Video" , "")
return thumbpath
开发者ID:BiTeMeNoW,项目名称:script.artwork.downloader,代码行数:14,代码来源:fileops.py
示例13: get_path
def get_path( self, pack_type, icon ):
if ( pack_type == "scripts" ):
path = xbmc.translatePath( os.path.join( "Q:\\%s" % pack_type, icon + "\\" ) )
cached_thumbnail = xbmc.getCacheThumbName( os.path.join( path, "default.py" ) )
if ( os.path.isdir( path ) ):
return path, cached_thumbnail, None
else:
for source in ( "video", "music", "pictures", "programs", ):
path = xbmc.translatePath( os.path.join( "Q:\\%s" % pack_type, source, icon + "\\" ) )
cached_thumbnail = xbmc.getCacheThumbName( path )
root_cached_thumbnail = xbmc.getCacheThumbName( "plugin://video/" + icon + "/" )
if ( os.path.isdir( path ) ):
return path, cached_thumbnail, root_cached_thumbnail
return None, None, None
开发者ID:amitca71,项目名称:xbmc-scripting,代码行数:14,代码来源:default.py
示例14: move_movie
def move_movie(self, movie, old_path, new_path):
## Update file with new id
# Create query
query = "UPDATE files \
SET idPath=? \
WHERE idFile=?"
# Create values
value = new_path.meta, movie.meta
# Create a cursor
c = self.db.create_cursor()
# Launch query
c.execute(query, value)
### Move file
## Get filename
# Create query
query = "SELECT f.strFilename \
FROM files f \
WHERE f.idFile = ?"
# Create values
value = (movie.meta,)
# Launch query
c.execute(query, value)
# Build result
mfile = unicode(c.fetchone()[0])
# mfile = unicode( c.fetchone()[0] )
## Deal with stacked files
if mfile.startswith("stack://"):
logging.dbg("Dealing with stacked files")
# Update db file with new values
query = "UPDATE files \
SET strFilename=? WHERE idFile=?"
# Create values
strfn = mfile.replace(old_path, new_path)
value = strfn, movie.meta
# Launch query
c.execute(query, value)
# Get fanart cache filename and move it
srcfn = xbmc.translatePath("special://thumbnails/Video") + "/Fanart/" + xbmc.getCacheThumbName(mfile)
dstfn = xbmc.translatePath("special://thumbnails/Video") + "/Fanart/" + xbmc.getCacheThumbName(strfn)
try:
shutil.move(srcfn, dstfn)
logging.dbg("move %s %s" % (srcfn, dstfn))
except IOError, e:
logging.err("Error moving %s %s: %s" % (srcfn, dstfn, e))
pass
# Create file list with removed whites spaces arround names
mfiles = map(lambda x: x.strip(), mfile[8:].split(","))
开发者ID:albertfc,项目名称:XBMC-Library-Manager,代码行数:49,代码来源:movies.py
示例15: run
def run(self):
cachedthumb = xbmc.getCacheThumbName(self.url)
xbmc_cache_file = os.path.join(xbmc.translatePath("special://profile/Thumbnails/Video"), cachedthumb[0], cachedthumb)
if xbmcvfs.exists(xbmc_cache_file):
log("Cached Image: " + self.url)
return xbmc_cache_file
else:
try:
log("Download: " + self.url)
request = urllib2.Request(self.url)
request.add_header('Accept-encoding', 'gzip')
response = urllib2.urlopen(request)
data = response.read()
response.close()
log('image downloaded')
except:
log('image download failed')
return ""
if data != '':
try:
tmpfile = open(xbmc_cache_file, 'wb')
tmpfile.write(data)
tmpfile.close()
return xbmc_cache_file
except:
log('failed to save image')
return ""
else:
return ""
开发者ID:paradix,项目名称:script.extendedinfo,代码行数:29,代码来源:Utils.py
示例16: itemHashwithPath
def itemHashwithPath(item, thepath):
if isXBMC:
thumb = xbmc.getCacheThumbName(item).replace('.tbn', '')
else:
thumb = hashlib.md5( item.encode() ).hexdigest()
thumbpath = os.path.join( thepath, thumb.encode( 'utf-8' ) )
return thumbpath
开发者ID:pkscout,项目名称:script.speedfaninfo,代码行数:7,代码来源:transforms.py
示例17: _next_slide
def _next_slide( self, slide=1, final_slide=False ):
# cancel timer if it's running
if self.slide_timer is not None:
self.slide_timer.cancel()
# increment/decrement count
self.image_count += slide
# check for invalid count, TODO: make sure you don't want to reset timer
# check to see if playlist has come to an end
if not xbmc.Player().isPlayingAudio() and int(self.settings[ "trivia_music" ]) > 0:
#build_music_playlist()
xbmc.Player().play( self.music_playlist )
else:
pass
if self.image_count < 0:
self.image_count = 0
# if no more slides, exit
if self.image_count > len( self.slide_playlist ) -1:
self._exit_trivia()
else:
# set the property the image control uses
xbmcgui.Window( xbmcgui.getCurrentWindowId() ).setProperty( "Slide", self.slide_playlist[ self.image_count ] )
# add id to watched file TODO: maybe don't add if not user preference
self.watched += [ xbmc.getCacheThumbName( self.slide_playlist[ self.image_count ] ) ]
# start slide timer
self._get_slide_timer()
开发者ID:selrahc13,项目名称:script.cinema.experience,代码行数:25,代码来源:xbmcscript_trivia.py
示例18: _fetch_music_info
def _fetch_music_info( self ):
# sql statement
if ( self.RANDOM_ORDER ):
sql_music = "select * from albumview order by RANDOM() limit %d" % ( self.LIMIT, )
else:
sql_music = "select * from albumview order by idAlbum desc limit %d" % ( self.LIMIT, )
# query the database for recently added albums
music_xml = xbmc.executehttpapi( "QueryMusicDatabase(%s)" % quote_plus( sql_music ), )
# separate the records
items = re.findall( "<record>(.+?)</record>", music_xml, re.DOTALL )
# enumerate thru our records and set our properties
for count, item in enumerate( items ):
# separate individual fields
fields = re.findall( "<field>(.*?)</field>", item, re.DOTALL )
#print item
# set properties
self.WINDOW.setProperty( "LatestSong.%d.Genre" % ( count + 1, ), fields[ 7 ] )
self.WINDOW.setProperty( "LatestSong.%d.Year" % ( count + 1, ), fields[ 8 ] )
self.WINDOW.setProperty( "LatestSong.%d.Artist" % ( count + 1, ), fields[ 6 ] )
self.WINDOW.setProperty( "LatestSong.%d.Album" % ( count + 1, ), fields[ 1 ] )
self.WINDOW.setProperty( "LatestSong.%d.Review" % ( count + 1, ), fields[ 14 ] )
# Album Path (ID)
path = 'XBMC.RunScript(' + CWD + 'extras.py,albumid=' + fields[ 0 ] + ')'
self.WINDOW.setProperty( "LatestSong.%d.Path" % ( count + 1, ), path )
# get cache name of path to use for fanart
cache_name = xbmc.getCacheThumbName( fields[ 6 ] )
self.WINDOW.setProperty( "LatestSong.%d.Fanart" % ( count + 1, ), "special://profile/Thumbnails/Music/%s/%s" % ( "Fanart", cache_name, ) )
self.WINDOW.setProperty( "LatestSong.%d.Thumb" % ( count + 1, ), fields[ 9 ] )
开发者ID:Sleepo,项目名称:aeon,代码行数:28,代码来源:extras.py
示例19: get_thumbnail
def get_thumbnail( thumbnail_url, fanart=0, default='DefaultTouTv.png' ):
global badthumbs, STRBADTHUMBS
default = ( default, "" )[ fanart ]
if thumbnail_url and thumbnail_url not in STRBADTHUMBS:
try:
filename = xbmc.getCacheThumbName( thumbnail_url )
if fanart:
filename = filename.replace( ".tbn", os.path.splitext( thumbnail_url )[ 1 ] )
basedir = os.path.dirname( BASE_CACHE_PATH )
else:
basedir = BASE_CACHE_PATH
filepath = os.path.join( BASE_CACHE_PATH, filename[ 0 ], filename )
if not os.path.exists( filepath ):
if not os.path.exists( os.path.dirname( filepath ) ):
os.makedirs( os.path.dirname( filepath ) )
fp, h = urllib.urlretrieve( thumbnail_url, filepath )
if h[ "Content-Type" ] == "text/html":
print "bad thumb: %r" % thumbnail_url
print fp, str( h ).replace( "\r", "" )
try: os.remove( fp )
except: pass
filepath = ""
STRBADTHUMBS += thumbnail_url + "\n"
badthumbs.write( thumbnail_url + "\n" )
thumbnail_url = filepath
except:
print_exc()
elif thumbnail_url and thumbnail_url in STRBADTHUMBS:
thumbnail_url = ""
return thumbnail_url or default
开发者ID:bmaupin,项目名称:kodi-xmbc-toutv,代码行数:32,代码来源:GuiView.py
示例20: _get_tags
def _get_tags(self):
# get track tags
artist = self.getMusicInfoTag().getArtist().decode("utf-8")
album = self.getMusicInfoTag().getAlbum().decode("utf-8")
title = self.getMusicInfoTag().getTitle().decode("utf-8")
duration = str(self.getMusicInfoTag().getDuration())
# get duration from xbmc.Player if the MusicInfoTag duration is invalid
if int(duration) <= 0:
duration = str(int(self.getTotalTime()))
track = str(self.getMusicInfoTag().getTrack())
path = self.getPlayingFile().decode("utf-8")
thumb = xbmc.getCacheThumbName(path)
#log('artist: ' + artist)
#log('title: ' + title)
#log('album: ' + album)
#log('track: ' + str(track))
#log('duration: ' + str(duration))
#log('path: ' + path)
#log('local path: ' + user)
#log('thumb: ' + thumb)
#log('cover art: ' + str(xbmc.getInfoLabel('MusicPlayer.Cover')))
#log('thumb art: ' + str(xbmc.getInfoLabel('Player.Art(thumb)')))
#log('fan art: ' + str(xbmc.getInfoLabel('MusicPlayer.Property(Fanart_Image)')))
return [artist, title]
开发者ID:wkia,项目名称:kodi-addon-repo,代码行数:26,代码来源:player.py
注:本文中的xbmc.getCacheThumbName函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论