python - 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)
我怀疑这可能与我有一段时间保费有关,而她没有。一年多以来,我们都使用我们的帐户。
解决方案
推荐阅读
- android - AndroidX 多个 Preferences 实例
- mongodb - 如何使用 mongodb 解决打字稿问题
- f# - F# VS 2019 语法颜色编码
- kubernetes - 如何在 dnsConfig 中将节点 ip 设置为名称服务器?
- java - 如何在 Java Spring 中合并两个列表
- swift - Xcode:持续消息。文档存在已发现并修复的问题
- c++ - 如何避免在模板类中重新定义 typedef?
- sql - SQL 命令同时从两个表中选择
- android - 媒体播放器创建方法似乎不适用于我的项目,导致我的应用程序在启动第一个活动时崩溃。有人帮我请
- react-native - React Native 可能出现未处理的 Promise Rejections 错误