Python scripts to convert and sync Spotify Playlist to Deezer Playlist using their respective APIs, and a discord bot implementing them. Deezer playlist is limited to 2000 songs, the bot does not convert or sync playlist over due to this. It is understood that the search method and sync method are in no way the best, and was only created for adequate functionality.
- Python
- Python Request
- Spotify API
- Deezer API
- Pycord
- PostgreSQL
- Heroku
To set up, download the files and then install the packages in requirement.txt.
Afterwards, create a .env file in the directory for the CLI or Discord Bot, and complete the env with information for one of the two:
APP_ID = "deezer_app_id"
SECRET = "deezer_secret_id"
REDIRECT_URL = "deezer_redirect_url"
SPOTIPY_CLIENT_ID = "spotify_client_id"
SPOTIPY_CLIENT_SECRET = "spotify_client_secret"
SPOTIPY_REDIRECT_URI = "spotify_redirect_url"TOKEN = "discord_token"
KEY = "key_fernet"
DATABASE_URL= "postgres_url"
APP_ID = "deezer_app_id"
SECRET = "deezer_secret_id"
REDIRECT_URL = "deezer_redirect_url"
SPOTIPY_CLIENT_ID = "spotify_client_id"
SPOTIPY_CLIENT_SECRET = "spotify_client_secret"
SPOTIPY_REDIRECT_URI = "spotify_redirect_url"To create the user database, use the following commands:
CREATE TABLE userInfo (
userid VARCHAR ( 50 ) UNIQUE NOT NULL,
token VARCHAR ( 255 ) UNIQUE,
sync TEXT[][]);
ALTER TABLE userinfo ALTER COLUMN sync SET DEFAULT '{}';
To create the fernet key, use the following commands:
from cryptography.fernet import Fernet
key = Fernet.generate_key()
key_str = key.decode('utf-8')
print(key_str)pip install py-cord==2.0.0b1; pip install -r requirements.txt; python main.pyGet Deezer API Info by creating app on Deezer for developers
Get Spotify API Info by creating app on Spotify for developers
Finally, run the main.py file.
