Spotipy:搜索具有非英语名称的曲目

发布于 2025-02-12 21:28:17 字数 832 浏览 1 评论 0原文

我目前正在跟踪根据歌曲和艺术家名称查找曲目的ID。我正在使用API​​和Spotify库(可以在此处找到: https://pypi.org/project/ Spotify/)。

这是一个例子:

  • 我想搜索这首歌。这首歌的名称称为gee,由소녀시대演唱。请注意,艺术家的名字是韩语,但用英语为女子,被称为女孩的一代。

当我使用术语“ gee소녀시대”一词在Spotify上搜索此内容时,以下结果按预期弹出。

但是,如果我使用以下代码在Python上搜索此信息,则会弹出以下错误。

sp.search(q='artist:' + '소녀시대' + ' track:' + 'Gee', type='track')

无论如何我是否有搜索以使结果按预期显示?

I am currently tracking to look up a track's ID based on the song and artist name. I am using the api and spotify library (which can be found here: https://pypi.org/project/spotify/).

Here is an example:

  • I want to search for this song. The name of this song is called Gee and is sung by 소녀시대. Notice the artist name is in Korean, but in English they are known as Girl's Generation.

When I search for this on spotify using the term "Gee 소녀시대", the following results pop up as expected.

enter image description here

However, If i were to use the following code to search for this on python, the following error pops up.

sp.search(q='artist:' + '소녀시대' + ' track:' + 'Gee', type='track')

enter image description here

Is there anyway for me to search such that the result shows up as expected?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

国粹 2025-02-19 21:28:17

播放代码,实际上只需要一个非常简单的解决方案

sp.search(q='Gee 소녀시대', type='track')

Played around with the code and it actually just requires a very simple solution

sp.search(q='Gee 소녀시대', type='track')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文