A music player that can play songs from Spotify built using Python only.
To use the Spotify API, we need the "Client ID" and "Client Secret" that the Spotify API provides. We'll also need to add a redirect URL on which we want to land once the user grants us the required permissions.
Creating an app:
- Go to the Spotify registration page and create your Spotify account.
- Once the account has been created, go to the Developers Dashboard. The Spotify Developer Terms of Service will appear. When we accept these terms, we'll be redirected to the Developers Dashboard.
- Click the "CREATE AN APP" button. A dialog box requesting the app's name and description will pop up.
- Fill in this information and click the "CREATE" button. We'll be redirected to the app overview page.
Fetch the "Client ID" and "Client Secret":
- Click the "SHOW CLIENT SECRET" button to reveal the "Client Secret" key.
- Copy the "Client ID" and "Client Secret" keys.
- Assign the values of "Client ID" and "Client Secret" to client_id and client_secret keys respectively.
The official documentation of spotify API is here.
Github:
$ git clone https://github.com/aneeshkp246/spotify_player_python.git
Python Packages:
pip install -r requirements.txt
Or just:
pip install spotipy
To start the bot you simply need to launch, either your terminal (Linux, Mac & Windows), or your Command Prompt ( Windows) .`
After that you can start it with
python spotify_music_player.py
You can choose the appropriate option and enter the query and then Spotify will open and play the song.
You can pull any requests if you find any error or if there is any scope of improvement.
MIT © aneeshkp246