A simple python command line script that either converts your Spotify Playlists of songs to YouTube Playlist of videos or takes your liked videos on Youtube, and generates a Spotify playlist based on the song in your liked videos.
Check out the youtube video for a step by step walk through Youtube Video
-
Install All Dependencies
pip3 install -r requirements.txt
-
Collect You Spotify User ID and Oauth Token From Spotify and add it to secrets.py file
- To Collect your User ID, Log into Spotify then go here: Account Overview and its your Username
- To Collect your Oauth Token, Visit this url here: Get Oauth and click the Get Token button
-
Enable Oauth For Youtube and download the client_secrets.json
- Ok this part is tricky but its worth it! Just follow the guide here Set Up Youtube Oauth ! If you are having issues check this out Oauth Setup 2 and this one too Oauth Setup 3
- Note: Choose desktop client when selecting the application type.
-
Run the File
python3 create_playlist.py
- You'll immediately see your browser opened and asking you to sign in into your google account. Select the appropriate account.
- It will automatically collect your
authorization code
- You get to choose your option from the menu
- Choose a playlist and it will create a YouTube playlist for you
- Trying to play songs from Spotify Playlists on Discord server using Rhythm Bot manually? Convert your spotify playlist to Youtube playlist and just play the playlist
- Want to watch your favorite music playlists music videos on screen, convert your playlist using SpotifyYouTubeGeneratePlaylist
- And many more......
- Google's API quota limit for a day is 10,000 counts. One search request costs 100 units and one playlist insert query costs 50 units. So I had to limit adding 50 videos per day.
- You have to manually update the Spotify authorization token after it expires every time.
- Tests
- Add Error Handling
- Pagination Handling (Spotify)
- Workaround for Youtube Data API v3 daily quota limits for searching
- Spotify Oauth token expires very quickly, If you come across a
KeyError
this could be caused by an expired token. So just refer back to step 3 in local setup, and generate a new token! - Google's API quota limit for a day is 10,000 counts. One search request costs 100 units and one playlist insert query costs 50 units. So I had to limit adding 50 videos per day.