我使用pylast
从Last.fm API获取信息。
当我使用以下代码时:
#!/usr/bin/env python
import pylast
API_KEY = "############################"
API_SECRET = "##############################"
###### In order to perform a write operation you need to authenticate yourself
username = "########"
password_hash = pylast.md5("###########")
network = pylast.LastFMNetwork(api_key = API_KEY, api_secret = API_SECRET, username = username, password_hash = password_hash)
## _________INIT__________
COUNTRY = "United Kingdom"
#---------------------- Get Geo Country --------------------
geo_country = network.get_country(COUNTRY)
print "The country we are digging is", geo_country
#---------------------- Get artist --------------------
top_artists_of_country = geo_country.get_top_artists(limit = 1000)
top_artists_of_country_file = open('test_artist_number.txt', 'w+')
print >> top_artists_of_country_file, top_artists_of_country
top_artists_of_country_file.close()
我发现例如,我打电话时无法获得1000条记录
geo_country.get_top_artists(limit = 1000)
我只想知道,此限制是由Last.fm的API设置还是
pylast
引起的?任何帮助都会很棒:)
最佳答案
关于python - 使用pylast程序时,Last.FM不能返回500条以上的记录,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8572696/