首页 > 解决方案 > spotipy 的 current_user_top_artists 仅适用于高级用户吗?

问题描述

我正在尝试获得几个帐户的顶级艺术家。虽然此代码有效并打印了我的艺术家,但它只打印了一个包含朋友帐户的空列表。

import spotipy
import spotipy.util as util

token = util.prompt_for_user_token(username, scope, client_id=client_id, client_secret=client_secret, redirect_uri='http://localhost')

if token:
    sp = spotipy.Spotify(auth=token)
    print(sp.current_user_top_tracks(20, 0, "medium_term"))

    artists = (sp.current_user_top_artists(limit=500, offset=0, time_range='medium_term'))['items']
    print(artists)

我怀疑这可能与我有一段时间保费有关,而她没有。一年多以来,我们都使用我们的帐户。

标签: pythonpython-3.xspotifyspotipy

解决方案


推荐阅读