From bb188f14ee172b4fd08ac3305cb7757bb8cc69cf Mon Sep 17 00:00:00 2001 From: = Date: Thu, 6 Nov 2025 12:33:18 -0600 Subject: [PATCH 1/2] Remove localhost from documentation Per https://developer.spotify.com/documentation/web-api/concepts/redirect_uri#:~:text=localhost%20is%20not%20allowed%20as%20redirect%20URI., localhost is no longer allowed as a redirect URI. --- CONTRIBUTING.md | 4 ++-- TUTORIAL.md | 2 +- docs/index.rst | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 737fbba..4f9656f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,13 +9,13 @@ If you would like to contribute to spotipy follow these steps: export SPOTIPY_CLIENT_ID=client_id_here export SPOTIPY_CLIENT_SECRET=client_secret_here export SPOTIPY_CLIENT_USERNAME=client_username_here # This is actually an id not spotify display name and can be found [here](https://www.spotify.com/us/account/overview/) -export SPOTIPY_REDIRECT_URI=http://localhost:8080 # Make url is set in app you created to get your ID and SECRET +export SPOTIPY_REDIRECT_URI=http://127.0.0.1:8080 # Make url is set in app you created to get your ID and SECRET # Windows $env:SPOTIPY_CLIENT_ID="client_id_here" $env:SPOTIPY_CLIENT_SECRET="client_secret_here" $env:SPOTIPY_CLIENT_USERNAME="client_username_here" -$env:SPOTIPY_REDIRECT_URI="http://localhost:8080" +$env:SPOTIPY_REDIRECT_URI="http://127.0.0.1:8080" ``` ### Create virtual environment, install dependencies, run tests diff --git a/TUTORIAL.md b/TUTORIAL.md index f3c3e44..a377b7e 100644 --- a/TUTORIAL.md +++ b/TUTORIAL.md @@ -30,7 +30,7 @@ Spotipy relies on the Spotify API. In order to use the Spotify API, you'll need A. Visit the [Spotify developer portal](https://developer.spotify.com/dashboard/). If you already have a Spotify account, click "Log in" and enter your username and password. Otherwise, click "Sign up" and follow the steps to create an account. After you've signed in or signed up, begin by clicking on your profile name at the top right of your screen and then click “Dashboard” to go to Spotify’s Developer Dashboard. -B. Check the box "Accept the Spotify Developer Terms of Service" and then click "Accept the terms". On the next page, verify your email address if you haven't already. Click the "Create an App" button. Enter any name and description you'd like for your new app. Next, add "" (or any other port number of your choosing) to the "Redirect URI" secction. Check the box "I understand and agree with Spotify's Developer Terms of Service and Design Guidelines" and then click the "Save" button. +B. Check the box "Accept the Spotify Developer Terms of Service" and then click "Accept the terms". On the next page, verify your email address if you haven't already. Click the "Create an App" button. Enter any name and description you'd like for your new app. Next, add "" (or any other port number of your choosing) to the "Redirect URI" secction. Check the box "I understand and agree with Spotify's Developer Terms of Service and Design Guidelines" and then click the "Save" button. C. Click on "Settings". Underneath "Client ID", you'll see a "View Client Secret" link. Click the link to reveal your Client secret and copy both your Client secret and your Client ID somewhere so that you can access them later. diff --git a/docs/index.rst b/docs/index.rst index b53f448..72ff964 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -110,12 +110,12 @@ to your application at The ``redirect_uri`` argument or ``SPOTIPY_REDIRECT_URI`` environment variable must match the redirect URI added to your application in your Dashboard. The redirect URI can be any valid URI (it does not need to be accessible) -such as ``http://example.com``, ``http://localhost`` or ``http://127.0.0.1:9090``. +such as ``http://example.com`` or ``http://127.0.0.1:9090``. - .. note:: If you choose an `http`-scheme URL, and it's for `localhost` or - `127.0.0.1`, **AND** it specifies a port, then spotipy will instantiate - a server on the indicated response to receive the access token from the - response at the end of the oauth flow [see the code](https://github.com/plamere/spotipy/blob/master/spotipy/oauth2.py#L483-L490). + .. note:: If you choose an `http`-scheme URL, and it's for `127.0.0.1`, + **AND** it specifies a port, then spotipy will instantiate a server on + the indicated response to receive the access token from the response at + the end of the oauth flow [see the code](https://github.com/plamere/spotipy/blob/master/spotipy/oauth2.py#L483-L490). Client Credentials Flow @@ -309,7 +309,7 @@ Export the needed Environment variables::: export SPOTIPY_CLIENT_ID=client_id_here export SPOTIPY_CLIENT_SECRET=client_secret_here export SPOTIPY_CLIENT_USERNAME=client_username_here # This is actually an id not spotify display name - export SPOTIPY_REDIRECT_URI=http://localhost:8080 # Make url is set in app you created to get your ID and SECRET + export SPOTIPY_REDIRECT_URI=http://127.0.0.1:8080 # Make url is set in app you created to get your ID and SECRET Create virtual environment, install dependencies, run tests::: $ virtualenv --python=python3.12 env @@ -377,4 +377,4 @@ Indices and tables * :ref:`genindex` * :ref:`modindex` -* :ref:`search` \ No newline at end of file +* :ref:`search` From 824bc5c21b4bc4fd54b8aa9b5b644b1835378b7b Mon Sep 17 00:00:00 2001 From: Niko Date: Fri, 7 Nov 2025 11:36:03 +0100 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d20c47b..c8b4b28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ Rebasing master onto v3 doesn't require a changelog update. - Replaced the `set_auth` and `auth_manager` properties with standard attributes. - Replaced string concatenations and `str.format()` with f-strings - Modified docstrings to use the reStructuredText format +- Replaced `localhost` with `127.0.0.1`. ### Fixed