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 )
def playClip(): import xbmc title = unicode( xbmc.getInfoLabel( "ListItem.Title" ), "utf-8" ) thumb = unicode( xbmc.getInfoImage( "ListItem.Thumb" ), "utf-8" ) plot = unicode( xbmc.getInfoLabel( "ListItem.Plot" ), "utf-8" ) episode = int( xbmc.getInfoImage( "ListItem.episode" ) or "-1" ) srt = xbmc.getInfoLabel( "ListItem.Property(subtitle)" ) media = xbmc.getInfoLabel( "ListItem.Property(playpath)" ) # listitem = xbmcgui.ListItem( title, '', 'DefaultVideo.png', thumb ) infoLabels = { 'title': title, 'plot': plot, "episode": episode } infoLabels.update( b_infoLabels ) listitem.setInfo( 'video', infoLabels ) # xbmc.Player().play( media, listitem ) print "playClip(%r)" % media # 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 ) print "setSubtitles(%r)"% srt xbmc.Player().setSubtitles( srt )
def playClip(): import xbmc title = unicode(xbmc.getInfoLabel("ListItem.Title"), "utf-8") thumb = unicode(xbmc.getInfoImage("ListItem.Thumb"), "utf-8") plot = unicode(xbmc.getInfoLabel("ListItem.Plot"), "utf-8") episode = int(xbmc.getInfoImage("ListItem.episode") or "-1") srt = xbmc.getInfoLabel("ListItem.Property(subtitle)") media = xbmc.getInfoLabel("ListItem.Property(playpath)") # listitem = xbmcgui.ListItem(title, '', 'DefaultVideo.png', thumb) infoLabels = {'title': title, 'plot': plot, "episode": episode} infoLabels.update(b_infoLabels) listitem.setInfo('video', infoLabels) # xbmc.Player().play(media, listitem) print "playClip(%r)" % media # 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) print "setSubtitles(%r)" % srt xbmc.Player().setSubtitles(srt)
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)