Invalid method signature supplied in radio.tune

 
  • "grant permissions via the browser" ?

    Hmm ..! could u please elaborate?

  • How to do that?

  • maybe it's a browser problem
    you could try with chrome, safari, firefox and explorer.
    my guess...

  • Hi, I have a massive question. What should I do with tracknames with spaces?
    I mean when I compose an URL I replace them with "%20".
    But what should I do when I compose an api_sig? cuz when I use the strings with "%20" I get error 13, when I use the strings with spaces, I get the same error.
    I have no problem with tracks that has no spaces in their names, but in other cases it freaks me out with error 13. please help

  • STIGGPWNZ said:
    What should I do with tracknames with spaces?

    I don't know if it's documented in the API anywhere, but generally you should use + signs instead (like site URLs). An example: http://www.last.fm/music/OK+Go/Get+Over+It

    • tburny sa...
    • Forum Moderator
    • 16 apr 2012, 06:50
    STIGGPWNZ said:
    Hi, I have a massive question. What should I do with tracknames with spaces?
    I mean when I compose an URL I replace them with "%20".
    But what should I do when I compose an api_sig?

    You have to build the api_sig from the utf-8 encoded values, without url escaping

    Combo.fm: Combine your favourite radio stations! | My Blog | scala-lastfmapi | Cache2k - A high performance Java in-memory cache
    P.S.: Do not click here
    throw new PokemonException(); //Gotta catch 'em all
    My forum post reflects my personal opinion :)
    • tvalent2 sa...
    • Användare
    • 28 jun 2012, 16:58

    What's wrong with my code

    I'm getting `Invalid method - No method with that name in this package`. Here's my Ruby code:


    artist = song.artist.encode("UTF-8")
    artist_escaped = artist.gsub(" ","+")

    sig_string = "api_key#{LAST_FM_API_KEY}" +
    "methodradio.tune" +
    "sk#{user.lastfm_session_key.token}" +
    "stationlastfm://artist/#{artist}/similarartists"

    encoded_sig_string = sig_string.encode("UTF-8")

    api_sig = Digest::MD5.hexdigest(encoded_sig_string + "#{LAST_FM_SECRET_KEY}")

    And my call:

    http://ws.audioscrobbler.com/2.0

    URL:

    Body: api_key=8LAST_FM_API_KEY&api_sig= #{api_sig}&method=radio.tune&sk=#{user.lastfm_session_key.token}&station=lastfm://artist/Kavinsky/similarartists

Anonyma användare kan inte skriva inlägg. Vänligen logga in eller skapa ett konto för att göra inlägg i forumen.