mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
Add market argument to track info (#610)
This commit is contained in:
parent
d920f77713
commit
7531d141c0
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user