[PR #244] [MERGED] Use client credentials flow to fix broken non-authorized requests in test files #831

Closed
opened 2026-02-28 00:02:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/244
Author: @alisha
Created: 1/17/2018
Status: Merged
Merged: 1/16/2020
Merged by: @stephanebruckert

Base: masterHead: master


📝 Commits (4)

  • 63eebfa Use client credentials flow to fix broken non-authorized requests
  • 9b8c90d Merge branch 'master' into master
  • 83a1cb5 Fix doc and readme
  • 2ab985a Lint

📊 Changes

25 files changed (+111 additions, -418 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 README.md (+13 -6)
📝 docs/index.rst (+22 -35)
📝 examples/artist_albums.py (+2 -1)
📝 examples/artist_discography.py (+3 -1)
📝 examples/client_credentials_flow.py (+2 -2)
examples/deadmau5.gv (+0 -31)
examples/deadmau5.png (+0 -0)
examples/long_track_test.dat (+0 -283)
📝 examples/search.py (+2 -1)
📝 examples/show_album.py (+4 -6)
📝 examples/show_artist.py (+4 -6)
📝 examples/show_artist_top_tracks.py (+2 -3)
📝 examples/show_related.py (+1 -2)
📝 examples/show_track_info.py (+5 -5)
📝 examples/show_tracks.py (+3 -1)
📝 examples/show_user.py (+3 -1)
📝 examples/simple0.py (+1 -1)
📝 examples/simple1.py (+1 -1)
📝 examples/simple2.py (+1 -3)

...and 5 more files

📄 Description

Updated the files in the examples folder to use client credentials flow instead of non-authorized requests (which, as mentioned in issue #194, is no longer supported by Spotify). Also updates this in tests/tests.py so that all tests pass.

Also fixed the test_search_timeout function in tests/tests.py, which was looking for a requests.ReadTimeout exception. According to the requests docs, this should actually be requests.exceptions.Timeout.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/spotipy-dev/spotipy/pull/244 **Author:** [@alisha](https://github.com/alisha) **Created:** 1/17/2018 **Status:** ✅ Merged **Merged:** 1/16/2020 **Merged by:** [@stephanebruckert](https://github.com/stephanebruckert) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (4) - [`63eebfa`](https://github.com/spotipy-dev/spotipy/commit/63eebfa9300203e9a50d1ecd2ab3e4502639c21f) Use client credentials flow to fix broken non-authorized requests - [`9b8c90d`](https://github.com/spotipy-dev/spotipy/commit/9b8c90dbe10115885ff549af2dacf88b6e21f090) Merge branch 'master' into master - [`83a1cb5`](https://github.com/spotipy-dev/spotipy/commit/83a1cb54eff818736421c48cc6445ecba88b6419) Fix doc and readme - [`2ab985a`](https://github.com/spotipy-dev/spotipy/commit/2ab985a3c8f90b86ed7988a051e3518bc9ebc350) Lint ### 📊 Changes **25 files changed** (+111 additions, -418 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `README.md` (+13 -6) 📝 `docs/index.rst` (+22 -35) 📝 `examples/artist_albums.py` (+2 -1) 📝 `examples/artist_discography.py` (+3 -1) 📝 `examples/client_credentials_flow.py` (+2 -2) ➖ `examples/deadmau5.gv` (+0 -31) ➖ `examples/deadmau5.png` (+0 -0) ➖ `examples/long_track_test.dat` (+0 -283) 📝 `examples/search.py` (+2 -1) 📝 `examples/show_album.py` (+4 -6) 📝 `examples/show_artist.py` (+4 -6) 📝 `examples/show_artist_top_tracks.py` (+2 -3) 📝 `examples/show_related.py` (+1 -2) 📝 `examples/show_track_info.py` (+5 -5) 📝 `examples/show_tracks.py` (+3 -1) 📝 `examples/show_user.py` (+3 -1) 📝 `examples/simple0.py` (+1 -1) 📝 `examples/simple1.py` (+1 -1) 📝 `examples/simple2.py` (+1 -3) _...and 5 more files_ </details> ### 📄 Description Updated the files in the `examples` folder to use client credentials flow instead of non-authorized requests (which, as mentioned in issue #194, is no longer supported by Spotify). Also updates this in `tests/tests.py` so that all tests pass. Also fixed the `test_search_timeout` function in `tests/tests.py`, which was looking for a `requests.ReadTimeout` exception. According to the [requests docs](http://docs.python-requests.org/en/master/user/quickstart/#timeouts), this should actually be `requests.exceptions.Timeout`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:02:00 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#831
No description provided.