View your Spotify Top Tracks in a Playlist, Top Played Artists, & More!
- Generate Top Tracks Playlist that auto-updates!
- Generate List of Top Played Artists
Generate Reccomended Tracks Playlists(API Endpoint Depreciated)- Optional Apprise Alerts/Notifications
- Docker Support
- Google Sheets Compatiable.
- Keep_Alive Flask Server
To run this project, you will need to add the following environment variables to your .env file (see .env.example for a reference):
Environment Variable | Description |
---|---|
CLIENT_ID |
Found on Spotify Developer Dashboard. |
SECRET_CLIENT_ID |
Found on Spotify Developer Dashboard. |
REDIRECT_URL |
The Redirect URL you added when creating the App on Spotify's Developer Dashboard. Check .env.example for reference. |
USERNAME |
Your Spotify account username (can be found in Spotify account settings). |
Environment Variable | Description | Default Value |
---|---|---|
MINUTES |
The number of minutes to wait before updating the Top Tracks playlist. | 360 (or 6 hours) |
PUBLIC_PLAYLIST |
Determines whether to create a public playlist. Accepts boolean values (True /False ). |
True |
KEEP_ALIVE |
Whether to keep the Flask server running to prevent the program from sleeping on Replit. Accepts boolean values (True /False ). |
False |
APPRISE_ALERTS |
List of services and URLs for notifications. For more information, visit the Apprise Wiki. | Not set |
TZ |
The desired time zone, formatted according to the IANA Time Zone Database. | America/New_York |
AUTH_CACHE |
A cached JSON string retrieved during initial setup, useful for hosting 24/7 on platforms like Render or other free hosting providers. | Not set |
GSPREAD_KEYS |
Google Service Account JSON obtained via OAuth 2.0 Client ID from the Google Cloud API Credentials. | Not set |
-
Visit the Spotify Developer Dashboard and log in with your Spotify credentials.
-
Create a new application. Choose a name, provide a description (optional), and accept the Terms of Service.
-
In the 'Edit Settings' section, add the redirect URL from your
.env
file, then save. Example: -
Click 'Show Client Secret'.
-
Copy the Client ID and paste it into the
CLIENT_ID
field in your.env
file. Similarly, copy the Client Secret and paste it into theSECRET_CLIENT_ID
field.
- Log in to the Google Cloud Console, create a new project, and enable the Google Sheets and Google Drive APIs.
- Navigate to API & Services > Credentials, then click Create Credentials > Service Account. Follow the prompts and download the resulting JSON file.
- In Google Sheets, create a new file named 'Wrapped365'. Add the following tabs:
short_term
,medium_term
,long_term
,short_term Artists
,medium_term Artists
,long_term Artists
. - Share the Google Sheet with the service account’s email (found in the downloaded JSON file or under the Google Cloud Console Credentials section). Grant it Editor permissions. The email will look like:
wrapped-test@wrapped-test943892.iam.gserviceaccount.com
.
This script can be used locally or using Docker.
Clone the repository & Install dependencies
git clone https://github.com/Prem-ium/Spotify-Wrapped-365.git
cd Spotify-Wrapped-365
pip install -r requirements.txt
Finally, you're ready to run the script!
python main.py
-
Run script locally with Python & generate cache file.
-
Download and install Docker on your system
-
Configure your
.env
file (See below and example for options) -
To build the image, cd into the repository and run:
docker build -t spotify-wrapped .
Then start the bot with:
docker run -it --env-file ./.env --restart unless-stopped --name spotify-wrapped spotify-wrapped
-
Let the bot log in and begin working. DO NOT PRESS
CTRL-c
. This will kill the container and the bot. To exit the logs view, pressCTRL-p
thenCTRL-q
. This will exit the logs view but let the bot keep running.
This repository is using the MIT license.
I'm not available to respond to issues in this repository. For direct support, please consider sponsoring me below under the Silver
or Gold
tier. Keep in mind that the public version is mostly "as built" and is rarely updated, while the private Gold Sponsor version receives regular updates and support.
I've been working on this project for a few months now, and I'm really happy with how it's turned out. It's also been a helpful tool for users to view their music data. If you appreciate my work and would like to show your support, there are two convenient ways to make a donation:
-
GitHub Sponsors
- Donate via GitHub Sponsors
- This is the preferred donation method as it incurs no transaction fees & different tiers offer perks.
-
Buy Me A Coffee
-
Referral Links
- If you're unable to make a monetary donation, you can still support my work by using my curated Referral Links. Earn bonuses and rewards while contributing to my projects at the same time.
- Explore Referral Links
Your generous donations will go a long way in helping me cover the expenses associated with developing new features and promoting the project to a wider audience. I extend my heartfelt gratitude to all those who have already contributed. Thank you for your support!