使用pylast程序时,Last.FM不能返回超过500条记录

时间:2011-12-20 08:38:20

标签: python last.fm

我使用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引起的限制吗?

任何帮助都会很棒:)

1 个答案:

答案 0 :(得分:4)