From 7531d141c0259419162f695be46e679e1a892fa6 Mon Sep 17 00:00:00 2001 From: Rob Sanek Date: Sun, 15 Nov 2020 16:20:11 -0600 Subject: [PATCH] Add market argument to track info (#610) --- CHANGELOG.md | 3 ++- spotipy/client.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af8ed08..7b936fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ 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" +- 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 diff --git a/spotipy/client.py b/spotipy/client.py index 6b0d97f..232dc35 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -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