Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davidchalifoux/spotify-charts-ripper

Python script for automatically downloading Spotify Charts data.
https://github.com/davidchalifoux/spotify-charts-ripper

python scrapping selenium spotify

Last synced: 16 days ago
JSON representation

Python script for automatically downloading Spotify Charts data.

Awesome Lists containing this project

README

        

![Demo of the script running](screencast.gif)

# Spotify Charts Data Ripper

This script downloads the Spotify daily top songs in the USA from Jan 1st 2017 to today. It uses [Selenium](https://www.selenium.dev/) and the [Spotify Charts](https://charts.spotify.com/) website. Each day's data is placed in your downloads folder in CSV format.

_You must have Google Chrome installed. However, you can modify the code to use any major browser you prefer._

# How to use

- Clone the repository
- Install dependencies using PIP
- `pip install -U selenium`
- `pip install webdriver-manager`
- `pip install pandas`
- `pip install python-dotenv`
- Create a `.env` file with the following variables:
- `SPOTIFY_USERNAME` (Your Spotify username or email)
- `SPOTIFY_PASSWORD` (Your Spotify password)
- Run `python main.py`

# Troubleshooting

Errors can happen if the script tries to click the download button before the page finishes loading. If you run into issues with it, either modify the starting date or increase the `time.sleep()` time.

# Visualization

You can use this data to make some pretty interesting visualizations. Here is an example of a bar race chart showing the most streamed tracks per day: https://public.flourish.studio/story/1429985/