def play_track(track_id, album_id):
media_url = session.get_media_url(track_id, album_id=album_id)
log("Playing: %s" % media_url)
disableInputstreamAddon = False
if not media_url.startswith('http://') and not media_url.startswith('https://') and \
not 'app=' in media_url.lower() and not 'playpath=' in media_url.lower():
# Rebuild RTMP URL
if KODI_VERSION >= (17, 0):
media_url = 'rtmp://%s' % media_url
disableInputstreamAddon = True
else:
host, tail = media_url.split('/', 1)
app, playpath = tail.split('/mp4:', 1)
media_url = 'rtmp://%s app=%s playpath=mp4:%s' % (host, app, playpath)
li = ListItem(path=media_url)
if disableInputstreamAddon:
# Krypton can play RTMP Audio Streams without inputstream.rtmp Addon
li.setProperty('inputstreamaddon', '')
mimetype = 'audio/flac' if session._config.quality == Quality.lossless and session.is_logged_in else 'audio/mpeg'
li.setProperty('mimetype', mimetype)
xbmcplugin.setResolvedUrl(plugin.handle, True, li)
评论列表
文章目录