You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用user_playlist_add_tracks添加歌曲时遇Unsupported URL/URI错误求助

问题:Spotify API 添加歌曲到播放列表时提示“Unsupported URL / URI”

我正在测试FestivalPlaylistMaker项目,目标是通过艺术家列表生成播放列表。已确认凭据和重定向URI均有效,测试了1位、多位甚至20位艺术家(受Spotify限制最多100首歌)的场景,均出现相同错误。

启动应用时的日志如下:

adding  1WsHKAuN9vDthcmimdqqaY Your Mind
adding  34I6QYP9yREZnvVZvDIo1u Legend
adding  1kMObCQiYe5opqybH7ZNPD Rave - Remix
adding  2zDCZ8jY4kjuUZbVROHaZj Your Mind - Radio Edit
adding  0I7ggM44AhOpWIZCM02HtP In From The Night - Adam Beyer & Wehbba Remix
adding song  0
Adding song failed:
http status: 400, code:-1 - Unsupported URL / URI., reason: None
adding song  1
Adding song failed:
http status: 400, code:-1 - Unsupported URL / URI., reason: None
adding song  2
Adding song failed:
http status: 400, code:-1 - Unsupported URL / URI., reason: None
adding song  3
Adding song failed:
http status: 400, code:-1 - Unsupported URL / URI., reason: None
adding song  4
Adding song failed:
http status: 400, code:-1 - Unsupported URL / URI., reason: None
Playlist Complete!

歌曲ID已正确存入数组:

['1WsHKAuN9vDthcmimdqqaY', '34I6QYP9yREZnvVZvDIo1', '1kMObCQiYe5opqybH7ZNPD', '2zDCZ8jY4kjuUZbVROHaZj', '0I7ggM44AhOpWIZCM02HtP']

问题出在调用添加歌曲的方法时:

user_playlist_add_tracks(username, playlist_id, tracks[:1], position=None)

每次执行都会触发以下错误:

http status: 400, code:-1 - Unsupported URL / URI., reason: None

求各位提供解决思路,感谢帮助!

内容的提问来源于stack exchange,提问作者PetiteFlamme31

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 02:57:32