•  


GitHub - Prem-ium/Spotify-Wrapped-365: ?? Generate Top Tracks Playlist of your Top Spotify Listening Habits ??
Skip to content

Prem-ium/Spotify-Wrapped-365

Repository files navigation

?? Spotify Wrapped 365 ??

Github Sponsor

View your Spotify Top Tracks in a Playlist, Top Played Artists, & More !

image

Features

  • Generate Top Tracks Playlist that auto-updates!
  • Generate List of Top Played Artists
  • Generate Reccomended Tracks Playlists (Optional)
  • Optional Apprise Alerts/Notifications
  • Docker Support
  • Google Sheets Compatiable.
  • Keep_Alive Flask Server

Environment Variables

To run this project, you will need to add the following environment variables to your .env file (see .env.example for a reference):

Required .env:
Environment Variable Description Default Value
CLIENT_ID Found on Spotify Developer Dashboard. More Info -
SECRET_CLIENT_ID Found on Spotify Developer Dashboard. More Info -
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.) -
Optional .env:
Environment Variable Description Default Value
MINUTES Number of minutes the program should wait before updating Top Tracks playlist. 360 minutes (or 6 hours)
PUBLIC_PLAYLIST Boolean value indicating whether to create a public playlist. True
RECOMMENDATIONS Boolean value indicating whether to generate recommendations (tracks playlist and artists recommendations). False
KEEP_ALIVE Whether to run the flask server or not to keep the program from sleeping on replit. False
APPRISE_ALERTS Full list of services and their URLs available here: Apprise Wiki -
TZ Your desired Time-Zone. Should be formatted from the IANA TZ Database. America/New York
AUTH_CACHE Cache JSON String retrieved from initial setup, for hosting 24/7 on Render or other platforms for free. -
GSPREAD_KEYS Your Google Service Account JSON contents obtained via OAuth 2.0 Client ID in Credentials of Google Cloud API. -

Setup

Spotify Developer Credentials (Required)

  1. Go to Spotify Developer's Dashboard . Log in using your Spotify credentials.

  2. Create a new Application. Name it as desired, add any description, and agree to the Terms of Service.

  3. Click on 'Edit Settings' and add the redirect URL you've set in your .env file, then save. Examples:

    Redirect URL Example

  4. Click 'Show Client Secret'.

  5. Copy/paste the Client ID into CLIENT_ID and the Secret Client ID into SECRET_CLIENT_ID within your .env file.

    Client ID Example

Google Sheets/GSpread (Optional)

  1. Sign into the Google Cloud Console , create your APP, and enable Google Sheets and Google Drive APIs.
  2. Go to API & Services -> Credentials -> Create Credentials -> Service Account. Follow the prompts and download the JSON file afterward.
  3. Open Google Sheets and create a new file named 'Wrapped365'. Add tabs named 'short_term', 'medium_term', 'long_term', 'short_term Artists', 'medium_term Artists', and 'long_term Artists'.
  4. Share the Google Sheet Document with the email of your service account, giving editor permissions. The email can be found in Google's Cloud Console Credentials or within the downloaded JSON file, resembling something like: wrapped-test@wrapped-test943892.iam.gserviceaccount.com .

Installation

This script can be used locally or using Docker.

Python

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

Docker

  1. Run script locally with Python & generate cache file.

  2. Download and install Docker on your system

  3. Configure your .env file (See below and example for options)

  4. 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
    
  5. 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, press CTRL-p then CTRL-q . This will exit the logs view but let the bot keep running.

License

This repository is using the MIT license.

Issues

  • GitHub Actions Support (Currently Not Working-> ISSUE: Spotipy Access token is able to be refreshed, but cannot be updated to GitHub Secrets for next run)

Donations

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:

  1. GitHub Sponsors

    • Donate via GitHub Sponsors
    • This is the preferred donation method as you can place donations with no transaction fees & possibily receive perks for your donation.
    • GitHub Sponsor
  2. Buy Me A Coffee

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!

?? What I've been listening to

- "漢字路" 한글한자자동변환 서비스는 교육부 고전문헌국역지원사업의 지원으로 구축되었습니다.
- "漢字路" 한글한자자동변환 서비스는 전통문화연구회 "울산대학교한국어처리연구실 옥철영(IT융합전공)교수팀"에서 개발한 한글한자자동변환기를 바탕하여 지속적으로 공동 연구 개발하고 있는 서비스입니다.
- 현재 고유명사(인명, 지명등)을 비롯한 여러 변환오류가 있으며 이를 해결하고자 많은 연구 개발을 진행하고자 하고 있습니다. 이를 인지하시고 다른 곳에서 인용시 한자 변환 결과를 한번 더 검토하시고 사용해 주시기 바랍니다.
- 변환오류 및 건의,문의사항은 juntong@juntong.or.kr로 메일로 보내주시면 감사하겠습니다. .
Copyright ⓒ 2020 By '전통문화연구회(傳統文化硏究會)' All Rights reserved.
 한국   대만   중국   일본