trs-80 / WWW-Spotify

Perl wrapper for Spotify Web API
Other
5 stars 3 forks source link

WWW::Spotify in the 2020. Working? #7

Closed x09 closed 4 years ago

x09 commented 4 years ago

Hi,

Tried your module.

use strict;
use warnings;
use utf8;
use WWW::Spotify;
use Data::Dumper;

my $spotify = WWW::Spotify->new();
my $result;
#$result = $spotify->user( 'k7h7fqn1njr4h19ae6u72exbl' ); # my username
$spotify->oauth_client_id('myclient_id_1234567890');
$spotify->oauth_client_secret('my_secret_1234567890');
$result = $spotify->album('0sNOF9WDwhWunNAHPD3Baj'); # from example

print Dumper $result;

run, and get

$VAR1 = '{
  "error": {
    "status": 401,
    "message": "No token provided"
  }
}';

What I did wrong?

oalders commented 4 years ago

@x09 I've just uploaded a fix which @trs-80 has kindly put together. It should be available in a few minutes if you'd like to test it.

trs-80 commented 4 years ago

You may need to leverage the new “force_client_auth” method, several calls now require a token that previously did not. The force_client_auth should make it more flexible.

This module has not been updated in a while so there are probably endpoints that are not supported currently, let me know if you are interested in having those added.

On Thu, Sep 17, 2020 at 17:23 Olaf Alders notifications@github.com wrote:

@x09 https://github.com/x09 I've just uploaded a fix which @trs-80 https://github.com/trs-80 has kindly put together. It should be available in a few minutes if you'd like to test it.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/trs-80/WWW-Spotify/issues/7#issuecomment-694507161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA2WDWW37X7PB54HPSHCG3SGJ44LANCNFSM4RLLFQWA .

x09 commented 4 years ago

Work! Thanks!

oalders commented 4 years ago

Excellent! I will close this ticket then. 🎉