A Python script to like all songs in a Spotify playlist in the same order as they appear. This project uses the Spotify Web API to automate the process of liking songs while preserving the playlist's original sequence.
- Fetches all songs from a Spotify playlist (supports playlists with over 100 tracks).
- Likes songs in the exact playlist order.
- Includes retry logic for failed requests.
- Logs progress to ensure transparency and ease of debugging.
-
Spotify Developer Account:
- Register at Spotify for Developers.
- Create a new app to get your
Client IDandClient Secret.
-
Python 3.8 or Later:
- Ensure you have Python installed. Download it from python.org if needed.
-
Clone the Repository:
git clone https://github.com/brittojo7n/Spotify-SequentialPlaylistLiker.git cd Spotify-SequentialPlaylistLiker -
Install Dependencies: Use
pipto install the required packages:pip install -r requirements.txt
-
Set Up Environment Variables:
- Create a
.envfile in the project directory with the following content:SPOTIFY_CLIENT_ID=your_client_id SPOTIFY_CLIENT_SECRET=your_client_secret SPOTIFY_PLAYLIST_ID=your_playlist_id SPOTIFY_REDIRECT_URI=http://localhost:8888/callback/ - Replace
your_client_idandyour_client_secretwith the credentials from your Spotify Developer account. - Replace
your_playlist_idwith the exact playlist you wish to like the songs from. If playlist URL ishttps://open.spotify.com/playlist/24kH4QpTd1ha5AyiWR3rOs?si=9ecf8ae8812b4207then playlist ID is24kH4QpTd1ha5AyiWR3rOs.
- Create a
-
Run the Script: Execute the Python script to like the songs in your playlist:
python index.py
-
Verify:
- Check your Spotify account to confirm the liked songs.
- The script logs each track as it processes them.
- Rate Limits: The script introduces a delay (
time.sleep(0.2)) between requests to avoid exceeding Spotify’s rate limits. You can adjust this delay if needed. - Unavailable Tracks: Tracks unavailable in your region or marked as local files in the playlist will be skipped.
This project is licensed under the MIT License - see the LICENSE file for details.