我需要使用pylast(python last.fm api包装器)的library.add_相册功能的帮助
我正在尝试访问pylast的library类,但一定是做错了什么。我可以让大多数其他功能正常工作。下面是一个代码示例,它仅以标准工作示例为例,添加了我认为正确的方法,可以将相册添加到我的last.fm库中:我需要使用pylast(python last.fm api包装器)的library.add_相册功能的帮助,python,api,last.fm,Python,Api,Last.fm,我正在尝试访问pylast的library类,但一定是做错了什么。我可以让大多数其他功能正常工作。下面是一个代码示例,它仅以标准工作示例为例,添加了我认为正确的方法,可以将相册添加到我的last.fm库中: import pylast # You have to have your own unique two values for API_KEY and API_SECRET # Obtain yours from http://www.last.fm/api/account for Las
import pylast
# You have to have your own unique two values for API_KEY and API_SECRET
# Obtain yours from http://www.last.fm/api/account for Last.fm
API_KEY = "80a1c765efb52869575821c03d93a30e" # this is a sample key
API_SECRET = "2ba567f5b0d74c6cc6a8d07ef2cbc2d"
# In order to perform a write operation you need to authenticate yourself
username = "astroid0"
password_hash = pylast.md5("xxx")
network = pylast.LastFMNetwork(api_key = API_KEY, api_secret =
API_SECRET, username = username, password_hash = password_hash)
# now you can use that object every where
artist = network.get_artist("System of a Down")
artist.shout("<3")
track = network.get_track("Iron Maiden", "The Nomad")
track.love()
track.add_tags(("awesome", "favorite"))
## This is the area causing trouble
library1 = pylast.Library(user = "astroid0", network = "LastFM")
album1 = network.get_album("The Rolling Stones", "Sticky Fingers")
library1.add_album(album1)
library1 = pylast.Library(user = "astroid0", network = "LastFM")
album1 = network.get_album("The Rolling Stones", "Sticky Fingers")
library1.add_album(album1)
我是python新手,如果这是显而易见的,我很抱歉,我已经被困了好几天了,决定问一下。这是pylast中的一个bug
线路1957(从行李箱)应为:
params["artist"] = album.get_artist().get_name()
而不是:
params["artist"] = album.get_artist.get_name()
你可以向作者报告这个问题。这是pylast中的一个bug
线路1957(从行李箱)应为:
params["artist"] = album.get_artist().get_name()
而不是:
params["artist"] = album.get_artist.get_name()
您可以向作者报告该问题。显示了该错误,并且该错误已经存在
不幸的是,几年来没有更新,所以我在我的电脑中修复了这个问题。显示了错误,它已经被修复了
不幸的是,几年来没有更新,所以我已在我的中修复了此问题。非常感谢!这是我一直感兴趣的pylast的一个功能,它让我疯狂!万分感谢!非常感谢你!这是我一直感兴趣的pylast的一个功能,它让我疯狂!万分感谢!