我正在使用带有Oauth的python flask来检索我订阅的所有频道,但是当我尝试进入此路由$a.replace('https://www.youtube.com/watch?v=', 'id=')
https://discordapp.com/developers/docs/resources/user#get-user-dms时收到401
错误:< / p>
/users/@me/channels
我的代码: 范围
{'code': 0, 'message': '401: Unauthorized'}
index.py
scope = [
"guilds",
"email",
"identify",
"messages.read",
"guilds.join",
"gdm.join",
"connections"
]
oauth.py
@app.route('/login', methods=["GET"])
def login():
code = request.args.get('code')
print(code)
access_token = Oauth.get_access_token(code)
channels_json = Oauth.get_channels(access_token)
print(channels_json)
return str(channels_json)