appears to be working

This commit is contained in:
Johan Hjorth 2025-06-23 09:23:58 +00:00
parent f20aa9b0d8
commit a51cb7410b
3 changed files with 32 additions and 5 deletions

View file

@ -4,6 +4,10 @@ from collections import defaultdict
from datetime import datetime, timedelta
def lf_request(method, **params):
# Fixa 'from_' → 'from' och 'to_' → 'to' (Last.fm accepterar inte Python-säkra namn)
for alt, real in (("from_", "from"), ("to_", "to")):
if alt in params:
params[real] = params.pop(alt)
url = "https://ws.audioscrobbler.com/2.0/"
params.update({
"method": method,