Add market argument to track info (#610)

This commit is contained in:
Rob Sanek 2020-11-15 16:20:11 -06:00 committed by GitHub
parent d920f77713
commit 7531d141c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- moved os.remove(session_cache_path()) inside try block to avoid TypeError on app.py example file
- A warning will no longer be emitted when the cache file does not exist at the specified path
- The docs for the `auth` parameter of `Spotify.init` use the term "access token" instead of "authorization token"
- Support `market` optional parameter in `track`
## [2.16.1] - 2020-10-24

View File

@ -327,15 +327,16 @@ class Spotify(object):
else:
return None
def track(self, track_id):
def track(self, track_id, market=None):
""" returns a single track given the track's ID, URI or URL
Parameters:
- track_id - a spotify URI, URL or ID
- market - an ISO 3166-1 alpha-2 country code.
"""
trid = self._get_id("track", track_id)
return self._get("tracks/" + trid)
return self._get("tracks/" + trid, market=market)
def tracks(self, tracks, market=None):
""" returns a list of tracks given a list of track IDs, URIs, or URLs