最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

youtube api - Searching for exact album match using ytmusicapi - Stack Overflow

programmeradmin3浏览0评论

I'm looking for a way to reliably find an album given the artist name and album title using ytmusicapi. Per the documentation, I use a query string as '"<ARTIST_NAME>" "<ALBUM_TITLE>"' and this returns the correct value most of the time but there are cases where it returns items that don't match the query at all even though the same search finds it when executed from directly from the YT web page, e.g. a search for '"Adria Duch" "You Make Me Feel"' returns titles like 'The Phantom Of The Opera' by a completely different artist, regardless of the 'ignore_spelling' switch. I am using the following code for my search:

   yt = YTMusic()
   search_key = '"' + artist + '" "' + title + '"'
   search_results = yt.search(search_key, filter="albums", ignore_spelling=False)

Any tips on how to get this to consistently return the album item would be much appreciated.

TIA,

Eric G.

发布评论

评论列表(0)

  1. 暂无评论