Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/davidchalifoux/spotify-charts-ripper
- Owner: davidchalifoux
- License: mit
- Created: 2022-04-30T18:06:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-05T15:36:00.000Z (almost 2 years ago)
- Last Synced: 2025-01-23T01:33:26.288Z (20 days ago)
- Topics: python, scrapping, selenium, spotify
- Language: Python
- Homepage:
- Size: 30 MB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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/