[PR #916] [CLOSED] Add open_browser kwarg for prompt_for_user_token #1077

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

📋 Pull Request Information

Original PR: https://github.com/spotipy-dev/spotipy/pull/916
Author: @joshhoughton
Created: 12/7/2022
Status: Closed

Base: masterHead: master


📝 Commits (1)

  • 445c7fa Add open_browser kwarg for prompt_for_user_token

📊 Changes

1 file changed (+6 additions, -3 deletions)

View changed files

📝 spotipy/util.py (+6 -3)

📄 Description

When attempting to authenticate via spotipy.util.prompt_for_user_token() in a headless environment (where webbrowser fails), it's not currently possible to authenticate.

These small changes allow open_browser=False to be passed to instead print out the authentication URL so that it can be accessed in another environment where a browser is accessible.

First PR here, feedback appreciated!

Fixes #792


🔄 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/916 **Author:** [@joshhoughton](https://github.com/joshhoughton) **Created:** 12/7/2022 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`445c7fa`](https://github.com/spotipy-dev/spotipy/commit/445c7fa0119cc5430eba909e3f99cb87d8705dd5) Add open_browser kwarg for prompt_for_user_token ### 📊 Changes **1 file changed** (+6 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `spotipy/util.py` (+6 -3) </details> ### 📄 Description When attempting to authenticate via `spotipy.util.prompt_for_user_token()` in a headless environment (where `webbrowser` fails), it's not currently possible to authenticate. These small changes allow `open_browser=False` to be passed to instead print out the authentication URL so that it can be accessed in another environment where a browser is accessible. First PR here, feedback appreciated! Fixes #792 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-28 00:03:31 +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#1077
No description provided.