Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track is not playable in country #90

Open
timolins opened this issue Jun 19, 2014 · 12 comments
Open

Track is not playable in country #90

timolins opened this issue Jun 19, 2014 · 12 comments

Comments

@timolins
Copy link

If a try to play a track (no matter which track it is), I receive the following error:

Error: Track is not playable in country "AT"
    at eval (../../../node_modules/spotify-web/lib/spotify.js:1041:8)
    at process._tickCallback (node.js:534:11)

I'm using nodewebkit ("classic" NodeJS worked just fine). And yes, the song is playable in my country (Tried the tracks with Desktop Client & Web Client).

@TooTallNate
Copy link
Owner

So it works with vanilla Node.js but doesn't work in node-webkit?

@timolins
Copy link
Author

timolins commented Jul 2, 2014

As far as I can tell, yes.

@TooTallNate
Copy link
Owner

/cc @rogerwang perhaps? (I'm not too experienced with node-webkit)

@tooliload
Copy link

Spotify Track 7H2fsBhT608o7R6lsfZ2gJ
Error: Track is not playable in country "DE": 7H2fsBhT608o7R6lsfZ2gJ

@liam-middlebrook
Copy link

Have there been any updates on whether or not this would work?

@liam-middlebrook
Copy link

I've tracked the bug down to spotify.js line 960. It's using the has function to compare an integer from restriction.catalogue to a string from type which is deriving from line 959.

@dralletje
Copy link

It is because of a bug in protobufjs I think: the catalogue enum is not mapped to it's string values.
I have no idea how to fix this in protobufjs so I just made a workaround, should I send a pull request? https://github.com/dralletje/node-spotify-web/commit/0907ce7aaed7819bfa2535635ff11031a6970b80

antxxxx pushed a commit to antxxxx/node-spotify-web that referenced this issue Jun 22, 2015
@antxxxx
Copy link

antxxxx commented Jun 22, 2015

@dralletje i noticed a small issue in your fix in that it kept trying to map undefined values. I have created #110 which has a fix that works for me

@ghost
Copy link

ghost commented Jun 30, 2015

@TooTallNate @antxxxx

FYI, this last fix actually broke the functionality on my machine. Rolling back fixes it.

@juanmito
Copy link

@antxxxx I've tried your fix, and didn't work for me. :(

@arnav-gudibande
Copy link

just replace this function in lib/spotify.js with this:
(this is just a quick and dirty fix)

Spotify.prototype.recurseAlternatives = function (track, country, fn) {
debug('recurseAlternatives()');
function done () {
process.nextTick(function () {
fn(null, track);
});
}
done();
};

this bypasses the buggy "check country" code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants