foo_enhanced_playcount icon indicating copy to clipboard operation
foo_enhanced_playcount copied to clipboard

Last.fm scrobbles are not retrieved correctly

Open quickparser opened this issue 1 year ago • 2 comments

I noticed in the foobar2000 console that the number of scrobbles retrieved from last.fm for all the songs is 0, even thought the scrobbles are there.

For example from the console:

Querying last.fm: http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=q-parser&artist=Blush&track=In %26 Out (Rocco Remix)&limit=200&format=json&page=1
Found 0 scrobbles in last.fm of "In & Out (Rocco Remix)"

My curl attempt using the URL from the console:

$ curl -s --raw "http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=q-parser&artist=Blush&track=In %26 Out (Rocco Remix)&limit=200&format=json&page=1" | jq '.trackscrobbles.track | length'
parse error: Invalid numeric literal at line 3, column 0
$

My curl attempt without jq parsing:

$ curl -s --raw "http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=q-parser&artist=Blush&track=In %26 Out (Rocco Remix)&limit=200&format=json&page=1"

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>400 Bad Request</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Bad Request</h1>
<h2>Your client has issued a malformed or illegal request.</h2>
<h2></h2>
</body></html>
$

My 2nd curl attempt replacing the whitespaces with %20 in the URL:

$ curl -s --raw "http://ws.audioscrobbler.com/2.0/?method=user.getTrackScrobbles&api_key=a1685abe5265b93cf2be4a70d181bf6b&user=q-parser&artist=Blush&track=In%20%26%20Out%20(Rocco%20Remix)&limit=200&format=json&page=1" | jq '.trackscrobbles.track | length'
74
$

quickparser avatar Jun 08 '23 11:06 quickparser