Skip to content

This project aims to scrape all the music data from Hardwax and create genre-based playlists on Spotify.

Notifications You must be signed in to change notification settings

niels-demeyer/hardwax-spotify

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hardwax-spotify

This project aims to scrape all the music data from Hardwax and create genre-based playlists on Spotify.

results

The results can be found using the following link Listen on Spotify

Configuration Setup

1. Database Configuration

Create a .env file in your project root directory and configure the database connection parameters:

# Database configuration
DB_HOST = 'your_postgresql_host'
DB_PORT = 'your_postgresql_port'
DB_NAME = 'your_database_name'
DB_USER = 'your_database_user'
DB_PASSWORD = 'your_database_password'

2. Spotify Configuration

In the same .env file, set up the Spotify configuration parameters:

# Spotify configuration
SPOTIFY_REDIRECT_URI = 'https://localhost:300'  # or your preferred redirect URI
SPOTIFY_USERNAME = 'your_spotify_user_id'
CLIENT_ID = 'your_spotify_client_id'  # obtain this from the Spotify Developer Dashboard
CLIENT_SECRET = 'your_spotify_client_secret'  # obtain this from the Spotify Developer Dashboard
REFRESH_TOKEN = 'your_spotify_refresh_token'  # obtain this by running refresh_token.py

scrapy

In the hardwax folder you can find a scrapy project that will scrape all the data for you. Simply run all the run_all_spiders.

spotify api

The last thing to do is to run the files in the spotify folder.

file result
search_albums.py Takes the scraping data and searches for the artist-album combination and returns the spotify id.
search_songs Gets all the tracks from the album and returns the spotify id.
make_playlist_tables.py Splits the tracks into different tables based on how big the playlist can be on spotify
playlist.py Makes the playlist tables into spotify playlists.

About

This project aims to scrape all the music data from Hardwax and create genre-based playlists on Spotify.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages