Convert Spotify Playlist to YouTube Playlist
Python script to convert Spotify playlist to YouTube playlist.
pip install -r requirements.txt
client_secret.json
.env
fileCLIENT_ID="xxxxxxxxxxxxxxxxxx"
CLIENT_SECRET="xxxxxxxxxxxxxxxx"
python main.py create [OPTIONS] SPOTIFY_PLAYLIST_ID
Browser will open for authorization. Sign into google account.
Options:
--public Create a public playlist
--private Create a public playlist
-n, --name TEXT Name of the YouTube playlist to be created
-d, --description TEXT Description of the playlist
-l, --only-link just only link of playlist, logs not appear
-s, --save-to-sync Save to list of playlist to sync
--help Show this message and exit. Refer sync-multiple-playlist section in ReadMe
Create YouTube Playlist from Spotify Playlist
python main.py create SPOTIFY_PLAYLIST_ID
python main.py create --public -n "My Playlist" -d "A collection of my favorite songs" SPOTIFY_PLAYLIST_ID
python main.py create --private -s SPOTIFY_PLAYLIST_ID
main.py sync [OPTIONS]
Options:
-s, --spotify_playlist_id TEXT Spotify playlist ID
-y, --youtube_playlist_id TEXT YouTube playlist ID
-l, --only-link just only link of playlist, logs not appear
--help Show this message and exit.
python main.py sync -s <spotify_playlist_id> -y <youtube_playlist_id>
-s
, --spotify_playlist_id
: Specifies the Spotify playlist ID to sync.-y
, --youtube_playlist_id
: Specifies the YouTube playlist ID to sync.-l
, --only-link
: Retrieves only the link of the playlist without displaying logs.It also open browser for authorization. Sign into google account to sync playlist.
Sync Spotify playlist with YouTube playlist and retrieve only the link:
python main.py sync -s SPOTIFY_PLAYLIST_ID -y YOUTUBE_PLAYLIST_ID --only-link
When creating a playlist, just add --save-to-sync
or -s
flag to it. It save the Spotify and YouTube playlist id in playlists.json file.
Sync all playlists in that file -
python main.py sync
Clear file -
python main.py clear
Refer this blog post for more info
If you need more info or any support please feel free to contact me
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.