我使用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
引起的限制吗?
任何帮助都会很棒:)