1

我用来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?

任何帮助都会很棒:)

4

1 回答 1

4

It is a limitation of Last.fm.

于 2011-12-20T08:44:22.260 回答