def _fetch(self):
log_msg("Spotify radio track buffer invoking recommendations() via spotipy", xbmc.LOGDEBUG)
try:
auth_token = xbmc.getInfoLabel("Window(Home).Property(spotify-token)").decode("utf-8")
client = spotipy.Spotify(auth_token)
tracks = client.recommendations(
seed_tracks=[t["id"] for t in self._buffer[0: 5]],
limit=self.FETCH_SIZE)["tracks"]
log_msg("Spotify radio track buffer got %d results back" % len(tracks))
return tracks
except Exception:
log_exception("SpotifyRadioTrackBuffer", "Failed to fetch recommendations, returning empty result")
return []
plugin_content.py 文件源码
python
阅读 19
收藏 0
点赞 0
评论 0
评论列表
文章目录