[PR #243] [MERGED] util.py: add local http server to serve redirects #832

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/243
Author: @csernazs
Created: 1/4/2018
Status: Merged
Merged: 4/1/2020
Merged by: @stephanebruckert

Base: masterHead: master


📝 Commits (1)

  • c500e1b oauth2.py: add local http server to serve redirects

📊 Changes

2 files changed (+103 additions, -18 deletions)

View changed files

📝 spotipy/oauth2.py (+91 -16)
📝 spotipy/util.py (+12 -2)

📄 Description

When spotify redirects the browser to localhost, serve the page with a
simple http server implemented by HTTPServer. By this way, we can obtain
the tokens the oauth service want so provide us, and no need to input the
user the redirect URL.

This method only works when the application in spotify developer dashboard
is configured to redirect the requests to localhost.


🔄 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/243 **Author:** [@csernazs](https://github.com/csernazs) **Created:** 1/4/2018 **Status:** ✅ Merged **Merged:** 4/1/2020 **Merged by:** [@stephanebruckert](https://github.com/stephanebruckert) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`c500e1b`](https://github.com/spotipy-dev/spotipy/commit/c500e1b7a09c156d4f7142d067450dba22fad3fa) oauth2.py: add local http server to serve redirects ### 📊 Changes **2 files changed** (+103 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `spotipy/oauth2.py` (+91 -16) 📝 `spotipy/util.py` (+12 -2) </details> ### 📄 Description When spotify redirects the browser to localhost, serve the page with a simple http server implemented by HTTPServer. By this way, we can obtain the tokens the oauth service want so provide us, and no need to input the user the redirect URL. This method only works when the application in spotify developer dashboard is configured to redirect the requests to localhost. --- <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#832
No description provided.