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

1 投票
1 回答
565 浏览
提问于 2025-04-17 08:41

我在使用 pylast 这个工具来从 Last.fm 的接口获取信息。

当我使用下面的代码时:

#!/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 的接口设置造成的,还是因为 pylast 的问题呢?

任何帮助都会很棒的 :)

1 个回答

4

这是一个关于Last.fm的限制

撰写回答