author=FloPinguin einfach austauschen.
import requests
maps = requests.get("https://trackmania.exchange/mapsearch2/search?api=on&author=FloPinguin&limit=100").json()['results']
combined_records = []
for map in maps:
print("Checking map " + map['TrackUID'] + "...")
records = requests.get("https://trackmania.io/api/leaderboard/map/" + str(map['TrackUID']) + "?length=1000", headers={'User-Agent': 'Python script checks for people who have played my maps'}).json()['tops']
if records != None:
for record in records:
combined_records.append(dict(list(record.items()) + list(map.items())))
sorted_records = sorted(combined_records, key=lambda d: d['timestamp'], reverse=True)
for sorted_record in sorted_records:
print(sorted_record['GbxMapName'] + " - " + sorted_record['player']['name'] + " - " + sorted_record['timestamp'])