我正在尝试删除使用 None 值生成的 Spotify 访问令牌,该令牌在我的第二次连接尝试时中断。
我从这里得到了这个片段——> github thread,用于清除缓存的令牌:
import os
from json.decoder import JSONDecodeError
scope = <whatever_youwant>
try:
token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri)
except (AttributeError, JSONDecodeError):
os.remove(f".cache-{username}")
token = util.prompt_for_user_token(username, scope, client_id, client_secret, redirect_uri)
但我在这里遇到语法错误:
os.remove(f".cache-{username}")
我的令牌缓存在哪里?如何删除它以重新获得访问权限?