Skip to content

Commit 3b1fd2a

Browse files
committed
Merge branch 'master' into v3_rebase_rebase
# Conflicts: # setup.py
2 parents 5c16cc2 + 645ed6d commit 3b1fd2a

File tree

5 files changed

+54
-70
lines changed

5 files changed

+54
-70
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## Unreleased
99
Add your changes below.
1010

11+
### Added
12+
13+
### Fixed
14+
15+
### Removed
16+
17+
## [2.25.0] - 2025-03-01
18+
1119
### Added
1220
- Added unit tests for queue functions
1321
- Added detailed function docstrings to 'util.py', including descriptions and special sections that lists arguments, returns, and raises.
@@ -19,6 +27,14 @@ Add your changes below.
1927
- Added `personalized_playlist.py`, `track_recommendations.py`, and `audio_features_analysis.py` to `/examples`.
2028
- Discord badge in README
2129
- Added `SpotifyBaseException` and moved all exceptions to `exceptions.py`
30+
- Marked the following methods as deprecated:
31+
- artist_related_artists
32+
- recommendations
33+
- audio_features
34+
- audio_analysis
35+
- featured_playlists
36+
- category_playlists
37+
- Added FAQ entry for inaccessible playlists
2238

2339
### Fixed
2440
- Audiobook integration tests

FAQ.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,9 @@ sp = spotipy.Spotify(
7474
)
7575
```
7676
The error raised is a `spotipy.exceptions.SpotifyException`
77+
78+
### I get a 404 when trying to access a Spotify-owned playlist
79+
80+
Spotify has begun restricting access to algorithmic and Spotify-owned editorial playlists.
81+
Only applications with an existing extended mode will still have access to these playlists.
82+
Read more about this change here: [Introducing some changes to our Web API](https://developer.spotify.com/blog/2024-11-27-changes-to-the-web-api)

spotipy/client.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,11 @@ def artist_related_artists(self, artist_id):
443443
Parameters:
444444
- artist_id - the artist ID, URI or URL
445445
"""
446+
warnings.warn(
447+
"You're using `artist_related_artists(...)`, "
448+
"which is marked as deprecated by Spotify.",
449+
DeprecationWarning
450+
)
446451
trid = self._get_id("artist", artist_id)
447452
return self._get("artists/" + trid + "/related-artists")
448453

@@ -1268,6 +1273,11 @@ def featured_playlists(
12681273
(the first object). Use with limit to get the next set of
12691274
items.
12701275
"""
1276+
warnings.warn(
1277+
"You're using `featured_playlists(...)`, "
1278+
"which is marked as deprecated by Spotify.",
1279+
DeprecationWarning,
1280+
)
12711281
return self._get(
12721282
"browse/featured-playlists",
12731283
locale=locale,
@@ -1352,6 +1362,11 @@ def category_playlists(
13521362
(the first object). Use with limit to get the next set of
13531363
items.
13541364
"""
1365+
warnings.warn(
1366+
"You're using `category_playlists(...)`, "
1367+
"which is marked as deprecated by Spotify.",
1368+
DeprecationWarning,
1369+
)
13551370
return self._get(
13561371
"browse/categories/" + category_id + "/playlists",
13571372
country=country,
@@ -1389,6 +1404,12 @@ def recommendations(
13891404
attributes listed in the documentation, these values
13901405
provide filters and targeting on results.
13911406
"""
1407+
warnings.warn(
1408+
"You're using `recommendations(...)`, "
1409+
"which is marked as deprecated by Spotify.",
1410+
DeprecationWarning,
1411+
)
1412+
13921413
params = dict(limit=limit)
13931414
if seed_artists:
13941415
params["seed_artists"] = ",".join(
@@ -1435,6 +1456,11 @@ def audio_analysis(self, track_id):
14351456
Parameters:
14361457
- track_id - a track URI, URL or ID
14371458
"""
1459+
warnings.warn(
1460+
"You're using `audio_analysis(...)`, "
1461+
"which is marked as deprecated by Spotify.",
1462+
DeprecationWarning,
1463+
)
14381464
trid = self._get_id("track", track_id)
14391465
return self._get("audio-analysis/" + trid)
14401466

@@ -1443,6 +1469,12 @@ def audio_features(self, tracks=[]):
14431469
Parameters:
14441470
- tracks - a list of track URIs, URLs or IDs, maximum: 100 ids
14451471
"""
1472+
warnings.warn(
1473+
"You're using `audio_features(...)`, "
1474+
"which is marked as deprecated by Spotify.",
1475+
DeprecationWarning,
1476+
)
1477+
14461478
if isinstance(tracks, str):
14471479
trackid = self._get_id("track", tracks)
14481480
results = self._get("audio-features/?ids=" + trackid)

tests/integration/non_user_endpoints/test.py

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -74,34 +74,6 @@ def setUpClass(self):
7474
)
7575
self.spotify.trace = False
7676

77-
def test_audio_analysis(self):
78-
result = self.spotify.audio_analysis(self.four_tracks[0])
79-
assert ('beats' in result)
80-
81-
def test_audio_features(self):
82-
results = self.spotify.audio_features(self.four_tracks)
83-
self.assertTrue(len(results) == len(self.four_tracks))
84-
for track in results:
85-
assert ('speechiness' in track)
86-
87-
def test_audio_features_with_bad_track(self):
88-
bad_tracks = ['spotify:track:bad']
89-
input = self.four_tracks + bad_tracks
90-
results = self.spotify.audio_features(input)
91-
self.assertTrue(len(results) == len(input))
92-
for track in results[:-1]:
93-
if track is not None:
94-
assert ('speechiness' in track)
95-
self.assertTrue(results[-1] is None)
96-
97-
def test_recommendations(self):
98-
results = self.spotify.recommendations(
99-
seed_tracks=self.four_tracks,
100-
min_danceability=0,
101-
max_loudness=0,
102-
target_popularity=50)
103-
self.assertTrue(len(results['tracks']) == 20)
104-
10577
def test_artist_urn(self):
10678
artist = self.spotify.artist(self.radiohead_urn)
10779
self.assertTrue(artist['name'] == 'Radiohead')
@@ -180,17 +152,6 @@ def test_artist_top_tracks(self):
180152
self.assertTrue('tracks' in results)
181153
self.assertTrue(len(results['tracks']) == 10)
182154

183-
def test_artist_related_artists(self):
184-
results = self.spotify.artist_related_artists(self.weezer_urn)
185-
self.assertTrue('artists' in results)
186-
self.assertTrue(len(results['artists']) == 20)
187-
188-
found = False
189-
for artist in results['artists']:
190-
if artist['name'] == 'Jimmy Eat World':
191-
found = True
192-
self.assertTrue(found)
193-
194155
def test_artist_search(self):
195156
results = self.spotify.search(q='weezer', type='artist')
196157
self.assertTrue('artists' in results)

tests/integration/user_endpoints/test.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -391,33 +391,6 @@ def test_categories_limit_high(self):
391391
response = self.spotify.categories(limit=50)
392392
self.assertLessEqual(len(response['categories']['items']), 50)
393393

394-
def test_category_playlists(self):
395-
response = self.spotify.categories()
396-
category = 'rock'
397-
for cat in response['categories']['items']:
398-
cat_id = cat['id']
399-
if cat_id == category:
400-
response = self.spotify.category_playlists(category_id=cat_id)
401-
self.assertGreater(len(response['playlists']["items"]), 0)
402-
403-
def test_category_playlists_limit_low(self):
404-
response = self.spotify.categories()
405-
category = 'rock'
406-
for cat in response['categories']['items']:
407-
cat_id = cat['id']
408-
if cat_id == category:
409-
response = self.spotify.category_playlists(category_id=cat_id, limit=1)
410-
self.assertEqual(len(response['categories']['items']), 1)
411-
412-
def test_category_playlists_limit_high(self):
413-
response = self.spotify.categories()
414-
category = 'rock'
415-
for cat in response['categories']['items']:
416-
cat_id = cat['id']
417-
if cat_id == category:
418-
response = self.spotify.category_playlists(category_id=cat_id, limit=50)
419-
self.assertLessEqual(len(response['categories']['items']), 50)
420-
421394
def test_new_releases(self):
422395
response = self.spotify.new_releases()
423396
self.assertGreater(len(response['albums']['items']), 0)
@@ -430,10 +403,6 @@ def test_new_releases_limit_high(self):
430403
response = self.spotify.new_releases(limit=50)
431404
self.assertLessEqual(len(response['albums']['items']), 50)
432405

433-
def test_featured_releases(self):
434-
response = self.spotify.featured_playlists()
435-
self.assertGreater(len(response['playlists']), 0)
436-
437406

438407
class SpotipyFollowApiTests(unittest.TestCase):
439408
@classmethod

0 commit comments

Comments
 (0)